Skip to content

Commit 7e4a73c

Browse files
committed
Fix schema matching against vscode-remote
Fixes #1104.
1 parent 2f0878d commit 7e4a73c

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

scripts/vscode.patch

+28
Original file line numberDiff line numberDiff line change
@@ -619,6 +619,34 @@ index 84c46faa36..957e8412e1 100644
619619

620620
if (!this.configuration.userDataProvider) {
621621
const remoteUserDataUri = this.getRemoteUserDataUri();
622+
diff --git a/src/vs/workbench/common/resources.ts b/src/vs/workbench/common/resources.ts
623+
index 53de865d8f..df234821a9 100644
624+
--- a/src/vs/workbench/common/resources.ts
625+
+++ b/src/vs/workbench/common/resources.ts
626+
@@ -15,6 +15,7 @@ import { ParsedExpression, IExpression, parse } from 'vs/base/common/glob';
627+
import { IWorkspaceContextService } from 'vs/platform/workspace/common/workspace';
628+
import { IConfigurationService, IConfigurationChangeEvent } from 'vs/platform/configuration/common/configuration';
629+
import { withNullAsUndefined } from 'vs/base/common/types';
630+
+import { Schemas } from 'vs/base/common/network';
631+
632+
export class ResourceContextKey extends Disposable implements IContextKey<URI> {
633+
634+
@@ -63,7 +64,7 @@ export class ResourceContextKey extends Disposable implements IContextKey<URI> {
635+
set(value: URI | null) {
636+
if (!ResourceContextKey._uriEquals(this._resourceKey.get(), value)) {
637+
this._resourceKey.set(value);
638+
- this._schemeKey.set(value ? value.scheme : null);
639+
+ this._schemeKey.set(value ? (value.scheme === Schemas.vscodeRemote ? Schemas.file : value.scheme) : null);
640+
this._filenameKey.set(value ? basename(value) : null);
641+
this._langIdKey.set(value ? this._modeService.getModeIdByFilepathOrFirstLine(value) : null);
642+
this._extensionKey.set(value ? extname(value) : null);
643+
@@ -200,4 +201,4 @@ export class ResourceGlobMatcher extends Disposable {
644+
645+
return !!expressionForRoot(resourcePathToMatch);
646+
}
647+
-}
648+
\ No newline at end of file
649+
+}
622650
diff --git a/src/vs/workbench/contrib/files/browser/files.contribution.ts b/src/vs/workbench/contrib/files/browser/files.contribution.ts
623651
index 1f4cd95f65..061931cbde 100644
624652
--- a/src/vs/workbench/contrib/files/browser/files.contribution.ts

0 commit comments

Comments
 (0)