Skip to content

Commit 17b8cf1

Browse files
committed
remo unused code
#38414
1 parent 67cd925 commit 17b8cf1

File tree

5 files changed

+1
-144
lines changed

5 files changed

+1
-144
lines changed

src/vs/base/common/actions.ts

-27
Original file line numberDiff line numberDiff line change
@@ -41,33 +41,6 @@ export interface IActionItem {
4141
dispose(): void;
4242
}
4343

44-
/**
45-
* Checks if the provided object is compatible
46-
* with the IAction interface.
47-
* @param thing an object
48-
*/
49-
export function isAction(thing: any): thing is IAction {
50-
if (!thing) {
51-
return false;
52-
} else if (thing instanceof Action) {
53-
return true;
54-
} else if (typeof thing.id !== 'string') {
55-
return false;
56-
} else if (typeof thing.label !== 'string') {
57-
return false;
58-
} else if (typeof thing.class !== 'string') {
59-
return false;
60-
} else if (typeof thing.enabled !== 'boolean') {
61-
return false;
62-
} else if (typeof thing.checked !== 'boolean') {
63-
return false;
64-
} else if (typeof thing.run !== 'function') {
65-
return false;
66-
} else {
67-
return true;
68-
}
69-
}
70-
7144
export interface IActionChangeEvent {
7245
label?: string;
7346
tooltip?: string;

src/vs/base/test/common/actions.test.ts

-78
This file was deleted.

src/vs/workbench/parts/debug/electron-browser/debugCommands.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ export function registerCommands(): void {
2525
KeybindingsRegistry.registerCommandAndKeybindingRule({
2626
id: 'debug.logToDebugConsole',
2727
weight: KeybindingsRegistry.WEIGHT.workbenchContrib(),
28-
handler(accessor: ServicesAccessor, value: string) {
28+
handler: (accessor: ServicesAccessor, value: string) => {
2929
if (typeof value === 'string') {
3030
const debugService = accessor.get(IDebugService);
3131
// Use warning as severity to get the orange color for messages coming from the debug extension

src/vs/workbench/parts/files/common/explorerModel.ts

-31
Original file line numberDiff line numberDiff line change
@@ -225,33 +225,6 @@ export class FileStat implements IFileStat {
225225
this.hasChildren = this.children.length > 0;
226226
}
227227

228-
/**
229-
* Returns true if this stat is a directory that contains a child with the given name.
230-
*
231-
* @param ignoreCase if true, will check for the name ignoring case.
232-
* @param type the type of stat to check for.
233-
*/
234-
public hasChild(name: string, ignoreCase?: boolean, type: StatType = StatType.ANY): boolean {
235-
for (let i = 0; i < this.children.length; i++) {
236-
const child = this.children[i];
237-
if ((type === StatType.FILE && child.isDirectory) || (type === StatType.FOLDER && !child.isDirectory)) {
238-
continue;
239-
}
240-
241-
// Check for Identity
242-
if (child.name === name) {
243-
return true;
244-
}
245-
246-
// Also consider comparing without case
247-
if (ignoreCase && child.name.toLowerCase() === name.toLowerCase()) {
248-
return true;
249-
}
250-
}
251-
252-
return false;
253-
}
254-
255228
/**
256229
* Removes a child element from this folder.
257230
*/
@@ -383,10 +356,6 @@ export class NewStatPlaceholder extends FileStat {
383356
throw new Error('Can\'t perform operations in NewStatPlaceholder.');
384357
}
385358

386-
public hasChild(name: string, ignoreCase?: boolean): boolean {
387-
return false;
388-
}
389-
390359
public removeChild(child: NewStatPlaceholder): void {
391360
throw new Error('Can\'t perform operations in NewStatPlaceholder.');
392361
}

src/vs/workbench/parts/files/test/browser/explorerModel.test.ts

-7
Original file line numberDiff line numberDiff line change
@@ -44,16 +44,9 @@ suite('Files - View Model', () => {
4444
const s = createStat('/path/to/stat', 'sName', true, false, 8096, d);
4545

4646
const child1 = createStat('/path/to/stat/foo', 'foo', true, false, 8096, d);
47-
const child2 = createStat('/path/to/stat/bar.html', 'bar', false, false, 8096, d);
4847
const child4 = createStat('/otherpath/to/other/otherbar.html', 'otherbar.html', false, false, 8096, d);
4948

50-
assert(!s.hasChild(child1.name));
51-
assert(!s.hasChild(child2.name));
52-
5349
s.addChild(child1);
54-
assert(s.hasChild(child1.name));
55-
assert(!s.hasChild(child1.name.toUpperCase()));
56-
assert(s.hasChild(child1.name.toUpperCase(), true));
5750

5851
assert(s.children.length === 1);
5952
assert(s.hasChildren);

0 commit comments

Comments
 (0)