mirror of
https://github.com/Microsoft/vscode
synced 2024-08-25 03:56:03 +00:00
some of #76442
This commit is contained in:
parent
8508bb8b77
commit
ab5b94db34
|
@ -14,11 +14,11 @@ export function deepClone<T>(obj: T): T {
|
||||||
return obj as any;
|
return obj as any;
|
||||||
}
|
}
|
||||||
const result: any = Array.isArray(obj) ? [] : {};
|
const result: any = Array.isArray(obj) ? [] : {};
|
||||||
Object.keys(obj as any).forEach((key: string) => {
|
Object.keys(<any>obj).forEach((key: string) => {
|
||||||
if (obj[key] && typeof obj[key] === 'object') {
|
if ((<any>obj)[key] && typeof (<any>obj)[key] === 'object') {
|
||||||
result[key] = deepClone(obj[key]);
|
result[key] = deepClone((<any>obj)[key]);
|
||||||
} else {
|
} else {
|
||||||
result[key] = obj[key];
|
result[key] = (<any>obj)[key];
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
return result;
|
return result;
|
||||||
|
|
|
@ -14,7 +14,7 @@ import { IClipboardService } from 'vs/platform/clipboard/common/clipboardService
|
||||||
import { IWorkspaceContextService } from 'vs/platform/workspace/common/workspace';
|
import { IWorkspaceContextService } from 'vs/platform/workspace/common/workspace';
|
||||||
import { isSingleFolderWorkspaceIdentifier, toWorkspaceIdentifier, WORKSPACE_EXTENSION } from 'vs/platform/workspaces/common/workspaces';
|
import { isSingleFolderWorkspaceIdentifier, toWorkspaceIdentifier, WORKSPACE_EXTENSION } from 'vs/platform/workspaces/common/workspaces';
|
||||||
|
|
||||||
export const KnownSnippetVariableNames = Object.freeze({
|
export const KnownSnippetVariableNames: { [key: string]: true } = Object.freeze({
|
||||||
'CURRENT_YEAR': true,
|
'CURRENT_YEAR': true,
|
||||||
'CURRENT_YEAR_SHORT': true,
|
'CURRENT_YEAR_SHORT': true,
|
||||||
'CURRENT_MONTH': true,
|
'CURRENT_MONTH': true,
|
||||||
|
@ -275,4 +275,4 @@ export class WorkspaceBasedVariableResolver implements VariableResolver {
|
||||||
}
|
}
|
||||||
return filename;
|
return filename;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue