Skip to content

Commit 2c5e08a

Browse files
authored
Fix extension in Code-Server environments (#150)
1 parent 99ade44 commit 2c5e08a

7 files changed

Lines changed: 20 additions & 6 deletions

File tree

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/open-collaboration-vscode/CHANGELOG.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,17 @@
11
# Change Log of `open-collaboration-tools`
22

3+
## v0.3.4 (Jul. 2025)
4+
5+
- Fixed the extension to work in Code-Server applications
6+
7+
## v0.3.3 (Jun. 2025)
8+
9+
- Updated our extension logo again
10+
11+
## v0.3.2 (Jun. 2025)
12+
13+
- Updated our extension logo to match the new OCT design
14+
315
## v0.3.1 (Apr. 2025)
416

517
- Shared documents are now using normalized line endings (`\n`) to prevent cross-platform issues ([#127](https://github.com/eclipse-oct/open-collaboration-tools/pull/127)).

packages/open-collaboration-vscode/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "open-collaboration-tools",
33
"displayName": "Open Collaboration Tools",
4-
"version": "0.3.3",
4+
"version": "0.3.4",
55
"license": "MIT",
66
"description": "Connect with others and live-share your code in real-time collaboration sessions",
77
"publisher": "typefox",

packages/open-collaboration-vscode/src/collaboration-room-service.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ export class CollaborationRoomService {
169169
}
170170
return false;
171171
});
172-
if (success && isWeb) {
172+
if (success && isWeb()) {
173173
// It seems like the web extension mode doesn't restart the extension host upon changing workspace folders
174174
// However, force restarting the extension host by reloading the window removes the current workspace folders
175175
// Therefore, we simply attempt to connect after a short delay after receiving the success signal

packages/open-collaboration-vscode/src/collaboration-status-service.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ export class CollaborationStatusService {
6262
this.statusBarItem.command = commandId;
6363
this.statusBarItem.tooltip = vscode.l10n.t('Start a collaboration session');
6464
this.statusBarItem.show();
65-
if (isWeb) {
65+
if (isWeb()) {
6666
// For some reason, VS Code simply "swallows" our status bar item when running in web mode.
6767
// This will attempt to show it again every 200ms. After 30s, we disable that again.
6868
const interval = setInterval(() => this.statusBarItem.show(), 200);

packages/open-collaboration-vscode/src/utils/system.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,6 @@
66

77
import * as vscode from 'vscode';
88

9-
export const isWeb = vscode.env.appRoot === '';
9+
export function isWeb(): boolean {
10+
return !(typeof process === 'object' && Boolean(process.versions.node)) && vscode.env.uiKind === vscode.UIKind.Web;
11+
}

packages/open-collaboration-vscode/src/utils/workspace.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ export interface CodeWorkspaceFolder {
4040

4141
export async function storeWorkspace(folders: Folder[], storageUri: vscode.Uri): Promise<vscode.Uri | undefined> {
4242
const canWrite = vscode.workspace.fs.isWritableFileSystem(storageUri.scheme);
43-
if (!canWrite || isWeb) {
43+
if (!canWrite || isWeb()) {
4444
return undefined;
4545
}
4646
try {

0 commit comments

Comments
 (0)