Skip to content

Commit 59f5d55

Browse files
authored
debt: review implicit public fields that are actually protected (microsoft#166603) (microsoft#167052)
1 parent 914ec50 commit 59f5d55

File tree

22 files changed

+208
-226
lines changed

22 files changed

+208
-226
lines changed

src/vs/editor/contrib/quickAccess/browser/editorNavigationQuickAccess.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ export abstract class AbstractEditorNavigationQuickAccessProvider implements IQu
176176

177177
private rangeHighlightDecorationId: IEditorLineDecoration | undefined = undefined;
178178

179-
protected addDecorations(editor: IEditor, range: IRange): void {
179+
addDecorations(editor: IEditor, range: IRange): void {
180180
editor.changeDecorations(changeAccessor => {
181181

182182
// Reset old decorations if any
@@ -220,7 +220,7 @@ export abstract class AbstractEditorNavigationQuickAccessProvider implements IQu
220220
});
221221
}
222222

223-
protected clearDecorations(editor: IEditor): void {
223+
clearDecorations(editor: IEditor): void {
224224
const rangeHighlightDecorationId = this.rangeHighlightDecorationId;
225225
if (rangeHighlightDecorationId) {
226226
editor.changeDecorations(changeAccessor => {

src/vs/platform/backup/test/electron-main/backupMainService.test.ts

Lines changed: 64 additions & 64 deletions
Large diffs are not rendered by default.

src/vs/platform/files/test/node/parcelWatcher.integrationTest.ts

Lines changed: 25 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import { isLinux, isMacintosh, isWindows } from 'vs/base/common/platform';
1212
import { Promises, RimRafMode } from 'vs/base/node/pfs';
1313
import { flakySuite, getPathFromAmdModule, getRandomTestPath } from 'vs/base/test/node/testUtils';
1414
import { FileChangeType } from 'vs/platform/files/common/files';
15-
import { IParcelWatcherInstance, ParcelWatcher } from 'vs/platform/files/node/watcher/parcel/parcelWatcher';
15+
import { ParcelWatcher } from 'vs/platform/files/node/watcher/parcel/parcelWatcher';
1616
import { IRecursiveWatchRequest } from 'vs/platform/files/common/watcher';
1717
import { getDriveLetter } from 'vs/base/common/extpath';
1818
import { ltrim } from 'vs/base/common/strings';
@@ -47,13 +47,9 @@ import { ltrim } from 'vs/base/common/strings';
4747
}
4848
}
4949

50-
override toExcludePaths(path: string, excludes: string[] | undefined): string[] | undefined {
50+
testToExcludePaths(path: string, excludes: string[] | undefined): string[] | undefined {
5151
return super.toExcludePaths(path, excludes);
5252
}
53-
54-
override restartWatching(watcher: IParcelWatcherInstance, delay = 10): void {
55-
return super.restartWatching(watcher, delay);
56-
}
5753
}
5854

5955
let testDir: string;
@@ -573,39 +569,39 @@ import { ltrim } from 'vs/base/common/strings';
573569

574570
// undefined / empty
575571

576-
assert.strictEqual(watcher.toExcludePaths(testDir, undefined), undefined);
577-
assert.strictEqual(watcher.toExcludePaths(testDir, []), undefined);
572+
assert.strictEqual(watcher.testToExcludePaths(testDir, undefined), undefined);
573+
assert.strictEqual(watcher.testToExcludePaths(testDir, []), undefined);
578574

579575
// absolute paths
580576

581-
let excludes = watcher.toExcludePaths(testDir, [testDir]);
577+
let excludes = watcher.testToExcludePaths(testDir, [testDir]);
582578
assert.strictEqual(excludes?.length, 1);
583579
assert.strictEqual(excludes[0], testDir);
584580

585-
excludes = watcher.toExcludePaths(testDir, [`${testDir}${sep}`, join(testDir, 'foo', 'bar'), `${join(testDir, 'other', 'deep')}${sep}`]);
581+
excludes = watcher.testToExcludePaths(testDir, [`${testDir}${sep}`, join(testDir, 'foo', 'bar'), `${join(testDir, 'other', 'deep')}${sep}`]);
586582
assert.strictEqual(excludes?.length, 3);
587583
assert.strictEqual(excludes[0], testDir);
588584
assert.strictEqual(excludes[1], join(testDir, 'foo', 'bar'));
589585
assert.strictEqual(excludes[2], join(testDir, 'other', 'deep'));
590586

591587
// wrong casing is normalized for root
592588
if (!isLinux) {
593-
excludes = watcher.toExcludePaths(testDir, [join(testDir.toUpperCase(), 'node_modules', '**')]);
589+
excludes = watcher.testToExcludePaths(testDir, [join(testDir.toUpperCase(), 'node_modules', '**')]);
594590
assert.strictEqual(excludes?.length, 1);
595591
assert.strictEqual(excludes[0], join(testDir, 'node_modules'));
596592
}
597593

598594
// exclude ignored if not parent of watched dir
599-
excludes = watcher.toExcludePaths(testDir, [join(dirname(testDir), 'node_modules', '**')]);
595+
excludes = watcher.testToExcludePaths(testDir, [join(dirname(testDir), 'node_modules', '**')]);
600596
assert.strictEqual(excludes, undefined);
601597

602598
// relative paths
603599

604-
excludes = watcher.toExcludePaths(testDir, ['.']);
600+
excludes = watcher.testToExcludePaths(testDir, ['.']);
605601
assert.strictEqual(excludes?.length, 1);
606602
assert.strictEqual(excludes[0], testDir);
607603

608-
excludes = watcher.toExcludePaths(testDir, ['foo', `bar${sep}`, join('foo', 'bar'), `${join('other', 'deep')}${sep}`]);
604+
excludes = watcher.testToExcludePaths(testDir, ['foo', `bar${sep}`, join('foo', 'bar'), `${join('other', 'deep')}${sep}`]);
609605
assert.strictEqual(excludes?.length, 4);
610606
assert.strictEqual(excludes[0], join(testDir, 'foo'));
611607
assert.strictEqual(excludes[1], join(testDir, 'bar'));
@@ -614,69 +610,69 @@ import { ltrim } from 'vs/base/common/strings';
614610

615611
// simple globs (relative)
616612

617-
excludes = watcher.toExcludePaths(testDir, ['**']);
613+
excludes = watcher.testToExcludePaths(testDir, ['**']);
618614
assert.strictEqual(excludes?.length, 1);
619615
assert.strictEqual(excludes[0], testDir);
620616

621-
excludes = watcher.toExcludePaths(testDir, ['**/**']);
617+
excludes = watcher.testToExcludePaths(testDir, ['**/**']);
622618
assert.strictEqual(excludes?.length, 1);
623619
assert.strictEqual(excludes[0], testDir);
624620

625-
excludes = watcher.toExcludePaths(testDir, ['**\\**']);
621+
excludes = watcher.testToExcludePaths(testDir, ['**\\**']);
626622
assert.strictEqual(excludes?.length, 1);
627623
assert.strictEqual(excludes[0], testDir);
628624

629-
excludes = watcher.toExcludePaths(testDir, ['**/node_modules/**']);
625+
excludes = watcher.testToExcludePaths(testDir, ['**/node_modules/**']);
630626
assert.strictEqual(excludes?.length, 1);
631627
assert.strictEqual(excludes[0], join(testDir, 'node_modules'));
632628

633-
excludes = watcher.toExcludePaths(testDir, ['**/.git/objects/**']);
629+
excludes = watcher.testToExcludePaths(testDir, ['**/.git/objects/**']);
634630
assert.strictEqual(excludes?.length, 1);
635631
assert.strictEqual(excludes[0], join(testDir, '.git', 'objects'));
636632

637-
excludes = watcher.toExcludePaths(testDir, ['**/node_modules']);
633+
excludes = watcher.testToExcludePaths(testDir, ['**/node_modules']);
638634
assert.strictEqual(excludes?.length, 1);
639635
assert.strictEqual(excludes[0], join(testDir, 'node_modules'));
640636

641-
excludes = watcher.toExcludePaths(testDir, ['**/.git/objects']);
637+
excludes = watcher.testToExcludePaths(testDir, ['**/.git/objects']);
642638
assert.strictEqual(excludes?.length, 1);
643639
assert.strictEqual(excludes[0], join(testDir, '.git', 'objects'));
644640

645-
excludes = watcher.toExcludePaths(testDir, ['node_modules/**']);
641+
excludes = watcher.testToExcludePaths(testDir, ['node_modules/**']);
646642
assert.strictEqual(excludes?.length, 1);
647643
assert.strictEqual(excludes[0], join(testDir, 'node_modules'));
648644

649-
excludes = watcher.toExcludePaths(testDir, ['.git/objects/**']);
645+
excludes = watcher.testToExcludePaths(testDir, ['.git/objects/**']);
650646
assert.strictEqual(excludes?.length, 1);
651647
assert.strictEqual(excludes[0], join(testDir, '.git', 'objects'));
652648

653649
// simple globs (absolute)
654650

655-
excludes = watcher.toExcludePaths(testDir, [join(testDir, 'node_modules', '**')]);
651+
excludes = watcher.testToExcludePaths(testDir, [join(testDir, 'node_modules', '**')]);
656652
assert.strictEqual(excludes?.length, 1);
657653
assert.strictEqual(excludes[0], join(testDir, 'node_modules'));
658654

659655
// Linux: more restrictive glob treatment
660656
if (isLinux) {
661-
excludes = watcher.toExcludePaths(testDir, ['**/node_modules/*/**']);
657+
excludes = watcher.testToExcludePaths(testDir, ['**/node_modules/*/**']);
662658
assert.strictEqual(excludes?.length, 1);
663659
assert.strictEqual(excludes[0], join(testDir, 'node_modules'));
664660
}
665661

666662
// unsupported globs
667663

668664
else {
669-
excludes = watcher.toExcludePaths(testDir, ['**/node_modules/*/**']);
665+
excludes = watcher.testToExcludePaths(testDir, ['**/node_modules/*/**']);
670666
assert.strictEqual(excludes, undefined);
671667
}
672668

673-
excludes = watcher.toExcludePaths(testDir, ['**/*.js']);
669+
excludes = watcher.testToExcludePaths(testDir, ['**/*.js']);
674670
assert.strictEqual(excludes, undefined);
675671

676-
excludes = watcher.toExcludePaths(testDir, ['*.js']);
672+
excludes = watcher.testToExcludePaths(testDir, ['*.js']);
677673
assert.strictEqual(excludes, undefined);
678674

679-
excludes = watcher.toExcludePaths(testDir, ['*']);
675+
excludes = watcher.testToExcludePaths(testDir, ['*']);
680676
assert.strictEqual(excludes, undefined);
681677
});
682678
});

src/vs/workbench/contrib/codeEditor/browser/quickaccess/gotoSymbolQuickAccess.ts

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55

66
import { localize } from 'vs/nls';
77
import { IKeyMods, IQuickPickSeparator, IQuickInputService, IQuickPick } from 'vs/platform/quickinput/common/quickInput';
8-
import { IEditor } from 'vs/editor/common/editorCommon';
98
import { IEditorService } from 'vs/workbench/services/editor/common/editorService';
109
import { IRange } from 'vs/editor/common/core/range';
1110
import { Registry } from 'vs/platform/registry/common/platform';
@@ -119,14 +118,6 @@ export class GotoSymbolQuickAccessProvider extends AbstractGotoSymbolQuickAccess
119118
return this.doGetSymbolPicks(this.getDocumentSymbols(model, token), prepareQuery(filter), options, token);
120119
}
121120

122-
override addDecorations(editor: IEditor, range: IRange): void {
123-
super.addDecorations(editor, range);
124-
}
125-
126-
override clearDecorations(editor: IEditor): void {
127-
super.clearDecorations(editor);
128-
}
129-
130121
//#endregion
131122

132123
protected override provideWithoutTextEditor(picker: IQuickPick<IGotoSymbolQuickPickItem>): IDisposable {

src/vs/workbench/services/editor/test/browser/editorGroupsService.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ suite('EditorGroupsService', () => {
229229

230230
assert.strictEqual(part.groups.length, 3);
231231

232-
part.saveState();
232+
part.testSaveState();
233233
part.dispose();
234234

235235
const [restoredPart] = await createPart(instantiationService);

src/vs/workbench/services/editor/test/browser/editorsObserver.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -375,7 +375,7 @@ suite('EditorsObserver', function () {
375375
assert.strictEqual(observer.hasEditor({ resource: input2.resource, typeId: input2.typeId, editorId: input2.editorId }), true);
376376
assert.strictEqual(observer.hasEditor({ resource: input3.resource, typeId: input3.typeId, editorId: input3.editorId }), true);
377377

378-
storage.emitWillSaveState(WillSaveStateReason.SHUTDOWN);
378+
storage.testEmitWillSaveState(WillSaveStateReason.SHUTDOWN);
379379

380380
const restoredObserver = disposables.add(new EditorsObserver(part, storage));
381381
await part.whenReady;
@@ -424,7 +424,7 @@ suite('EditorsObserver', function () {
424424
assert.strictEqual(observer.hasEditor({ resource: input2.resource, typeId: input2.typeId, editorId: input2.editorId }), true);
425425
assert.strictEqual(observer.hasEditor({ resource: input3.resource, typeId: input3.typeId, editorId: input3.editorId }), true);
426426

427-
storage.emitWillSaveState(WillSaveStateReason.SHUTDOWN);
427+
storage.testEmitWillSaveState(WillSaveStateReason.SHUTDOWN);
428428

429429
const restoredObserver = disposables.add(new EditorsObserver(part, storage));
430430
await part.whenReady;
@@ -461,7 +461,7 @@ suite('EditorsObserver', function () {
461461
assert.strictEqual(currentEditorsMRU[0].editor, input1);
462462
assert.strictEqual(observer.hasEditor({ resource: input1.resource, typeId: input1.typeId, editorId: input1.editorId }), true);
463463

464-
storage.emitWillSaveState(WillSaveStateReason.SHUTDOWN);
464+
storage.testEmitWillSaveState(WillSaveStateReason.SHUTDOWN);
465465

466466
const restoredObserver = disposables.add(new EditorsObserver(part, storage));
467467
await part.whenReady;

src/vs/workbench/services/lifecycle/test/electron-browser/lifecycleService.test.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@ suite('Lifecycleservice', function () {
1616

1717
class TestLifecycleService extends NativeLifecycleService {
1818

19-
override handleBeforeShutdown(reason: ShutdownReason): Promise<boolean> {
19+
testHandleBeforeShutdown(reason: ShutdownReason): Promise<boolean> {
2020
return super.handleBeforeShutdown(reason);
2121
}
2222

23-
override handleWillShutdown(reason: ShutdownReason): Promise<void> {
23+
testHandleWillShutdown(reason: ShutdownReason): Promise<void> {
2424
return super.handleWillShutdown(reason);
2525
}
2626
}
@@ -62,7 +62,7 @@ suite('Lifecycleservice', function () {
6262
}, 'test');
6363
});
6464

65-
const veto = await lifecycleService.handleBeforeShutdown(ShutdownReason.QUIT);
65+
const veto = await lifecycleService.testHandleBeforeShutdown(ShutdownReason.QUIT);
6666

6767
assert.strictEqual(veto, true);
6868
assert.strictEqual(vetoCalled, true);
@@ -93,7 +93,7 @@ suite('Lifecycleservice', function () {
9393
}, 'test');
9494
});
9595

96-
const veto = await lifecycleService.handleBeforeShutdown(ShutdownReason.QUIT);
96+
const veto = await lifecycleService.testHandleBeforeShutdown(ShutdownReason.QUIT);
9797

9898
assert.strictEqual(veto, true);
9999
assert.strictEqual(vetoCalled, true);
@@ -107,7 +107,7 @@ suite('Lifecycleservice', function () {
107107
}), 'test');
108108
});
109109

110-
const veto = await lifecycleService.handleBeforeShutdown(ShutdownReason.QUIT);
110+
const veto = await lifecycleService.testHandleBeforeShutdown(ShutdownReason.QUIT);
111111

112112
assert.strictEqual(veto, true);
113113
});
@@ -119,7 +119,7 @@ suite('Lifecycleservice', function () {
119119
}), 'test');
120120
});
121121

122-
const veto = await lifecycleService.handleBeforeShutdown(ShutdownReason.QUIT);
122+
const veto = await lifecycleService.testHandleBeforeShutdown(ShutdownReason.QUIT);
123123

124124
assert.strictEqual(veto, true);
125125
});
@@ -135,7 +135,7 @@ suite('Lifecycleservice', function () {
135135
}), { id: 'test', label: 'test' });
136136
});
137137

138-
await lifecycleService.handleWillShutdown(ShutdownReason.QUIT);
138+
await lifecycleService.testHandleWillShutdown(ShutdownReason.QUIT);
139139

140140
assert.strictEqual(joinCalled, true);
141141
});
@@ -151,7 +151,7 @@ suite('Lifecycleservice', function () {
151151
}), { id: 'test', label: 'test' });
152152
});
153153

154-
await lifecycleService.handleWillShutdown(ShutdownReason.QUIT);
154+
await lifecycleService.testHandleWillShutdown(ShutdownReason.QUIT);
155155

156156
assert.strictEqual(joinCalled, true);
157157
});

src/vs/workbench/services/progress/test/browser/progressIndicator.test.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,8 @@ suite('Progress Indicator', () => {
6767
const testProgressBar = new TestProgressBar();
6868
const progressScope = new class extends AbstractProgressScope {
6969
constructor() { super('test.scopeId', true); }
70-
override onScopeOpened(scopeId: string) { super.onScopeOpened(scopeId); }
71-
override onScopeClosed(scopeId: string): void { super.onScopeClosed(scopeId); }
70+
testOnScopeOpened(scopeId: string) { super.onScopeOpened(scopeId); }
71+
testOnScopeClosed(scopeId: string): void { super.onScopeClosed(scopeId); }
7272
}();
7373
const testObject = new ScopedProgressIndicator((<any>testProgressBar), progressScope);
7474

@@ -90,31 +90,31 @@ suite('Progress Indicator', () => {
9090
assert.strictEqual(true, testProgressBar.fDone);
9191

9292
// Inactive: Show (Infinite)
93-
progressScope.onScopeClosed('test.scopeId');
93+
progressScope.testOnScopeClosed('test.scopeId');
9494
testObject.show(true);
9595
assert.strictEqual(false, !!testProgressBar.fInfinite);
96-
progressScope.onScopeOpened('test.scopeId');
96+
progressScope.testOnScopeOpened('test.scopeId');
9797
assert.strictEqual(true, testProgressBar.fInfinite);
9898

9999
// Inactive: Show (Total / Worked)
100-
progressScope.onScopeClosed('test.scopeId');
100+
progressScope.testOnScopeClosed('test.scopeId');
101101
fn = testObject.show(100);
102102
fn.total(80);
103103
fn.worked(20);
104104
assert.strictEqual(false, !!testProgressBar.fTotal);
105-
progressScope.onScopeOpened('test.scopeId');
105+
progressScope.testOnScopeOpened('test.scopeId');
106106
assert.strictEqual(20, testProgressBar.fWorked);
107107
assert.strictEqual(80, testProgressBar.fTotal);
108108

109109
// Acive: Show While
110110
let p = Promise.resolve(null);
111111
await testObject.showWhile(p);
112112
assert.strictEqual(true, testProgressBar.fDone);
113-
progressScope.onScopeClosed('test.scopeId');
113+
progressScope.testOnScopeClosed('test.scopeId');
114114
p = Promise.resolve(null);
115115
await testObject.showWhile(p);
116116
assert.strictEqual(true, testProgressBar.fDone);
117-
progressScope.onScopeOpened('test.scopeId');
117+
progressScope.testOnScopeOpened('test.scopeId');
118118
assert.strictEqual(true, testProgressBar.fDone);
119119
});
120120
});

src/vs/workbench/services/textfile/common/textFileEditorModelManager.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -493,7 +493,7 @@ export class TextFileEditorModelManager extends Disposable implements ITextFileE
493493
this.mapResourceToModelListeners.set(model.resource, modelListeners);
494494
}
495495

496-
protected add(resource: URI, model: TextFileEditorModel): void {
496+
add(resource: URI, model: TextFileEditorModel): void {
497497
const knownModel = this.mapResourceToModel.get(resource);
498498
if (knownModel === model) {
499499
return; // already cached
@@ -508,7 +508,7 @@ export class TextFileEditorModelManager extends Disposable implements ITextFileE
508508
this.mapResourceToDisposeListener.set(resource, model.onWillDispose(() => this.remove(resource)));
509509
}
510510

511-
protected remove(resource: URI): void {
511+
remove(resource: URI): void {
512512
const removed = this.mapResourceToModel.delete(resource);
513513

514514
const disposeListener = this.mapResourceToDisposeListener.get(resource);

0 commit comments

Comments
 (0)