Skip to content

Commit 9382e63

Browse files
author
Eric Amodio
committed
Fixes microsoft#107802 - renames resourceFolder to resourceDirname
Also fixes issue with reset not clearing some of the keys
1 parent 9d4ebd4 commit 9382e63

1 file changed

Lines changed: 8 additions & 6 deletions

File tree

src/vs/workbench/common/resources.ts

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ export class ResourceContextKey extends Disposable implements IContextKey<URI> {
2424

2525
static readonly Scheme = new RawContextKey<string>('resourceScheme', undefined);
2626
static readonly Filename = new RawContextKey<string>('resourceFilename', undefined);
27-
static readonly Folder = new RawContextKey<string>('resourceFolder', undefined);
27+
static readonly Dirname = new RawContextKey<string>('resourceDirname', undefined);
2828
static readonly Path = new RawContextKey<string>('resourcePath', undefined);
2929
static readonly LangId = new RawContextKey<string>('resourceLangId', undefined);
3030
static readonly Resource = new RawContextKey<URI>('resource', undefined);
@@ -35,7 +35,7 @@ export class ResourceContextKey extends Disposable implements IContextKey<URI> {
3535
private readonly _resourceKey: IContextKey<URI | null>;
3636
private readonly _schemeKey: IContextKey<string | null>;
3737
private readonly _filenameKey: IContextKey<string | null>;
38-
private readonly _folderKey: IContextKey<string | null>;
38+
private readonly _dirnameKey: IContextKey<string | null>;
3939
private readonly _pathKey: IContextKey<string | null>;
4040
private readonly _langIdKey: IContextKey<string | null>;
4141
private readonly _extensionKey: IContextKey<string | null>;
@@ -51,7 +51,7 @@ export class ResourceContextKey extends Disposable implements IContextKey<URI> {
5151

5252
this._schemeKey = ResourceContextKey.Scheme.bindTo(this._contextKeyService);
5353
this._filenameKey = ResourceContextKey.Filename.bindTo(this._contextKeyService);
54-
this._folderKey = ResourceContextKey.Folder.bindTo(this._contextKeyService);
54+
this._dirnameKey = ResourceContextKey.Dirname.bindTo(this._contextKeyService);
5555
this._pathKey = ResourceContextKey.Path.bindTo(this._contextKeyService);
5656
this._langIdKey = ResourceContextKey.LangId.bindTo(this._contextKeyService);
5757
this._resourceKey = ResourceContextKey.Resource.bindTo(this._contextKeyService);
@@ -76,7 +76,7 @@ export class ResourceContextKey extends Disposable implements IContextKey<URI> {
7676
this._resourceKey.set(value);
7777
this._schemeKey.set(value ? value.scheme : null);
7878
this._filenameKey.set(value ? basename(value) : null);
79-
this._folderKey.set(value ? dirname(value).fsPath : null);
79+
this._dirnameKey.set(value ? dirname(value).fsPath : null);
8080
this._pathKey.set(value ? value.fsPath : null);
8181
this._langIdKey.set(value ? this._modeService.getModeIdByFilepathOrFirstLine(value) : null);
8282
this._extensionKey.set(value ? extname(value) : null);
@@ -88,9 +88,11 @@ export class ResourceContextKey extends Disposable implements IContextKey<URI> {
8888

8989
reset(): void {
9090
this._contextKeyService.bufferChangeEvents(() => {
91-
this._schemeKey.reset();
92-
this._langIdKey.reset();
9391
this._resourceKey.reset();
92+
this._schemeKey.reset();
93+
this._filenameKey.reset();
94+
this._dirnameKey.reset();
95+
this._pathKey.reset();
9496
this._langIdKey.reset();
9597
this._extensionKey.reset();
9698
this._hasResource.reset();

0 commit comments

Comments
 (0)