mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-24 10:38:59 +01:00
Delete vscode-typescript upon close of VS Code (#73801)
* Cleans up vs-typescript temp directoy upon VS code close * Fixed typing errors preventing build from succeeding * Moved deletion to the deactivate method. Added folders per extension host * Removed yarn watch script used in testing
This commit is contained in:
@@ -10,6 +10,8 @@ import { LanguageConfigurationManager } from './features/languageConfiguration';
|
||||
import TypeScriptTaskProviderManager from './features/task';
|
||||
import TypeScriptServiceClientHost from './typeScriptServiceClientHost';
|
||||
import { flatten } from './utils/arrays';
|
||||
import * as electron from './utils/electron';
|
||||
import * as rimraf from 'rimraf';
|
||||
import { CommandManager } from './utils/commandManager';
|
||||
import * as fileSchemes from './utils/fileSchemes';
|
||||
import { standardLanguageDescriptions } from './utils/languageDescription';
|
||||
@@ -128,4 +130,8 @@ function isSupportedDocument(
|
||||
return false;
|
||||
}
|
||||
return fileSchemes.isSupportedScheme(document.uri.scheme);
|
||||
}
|
||||
|
||||
export function deactivate() {
|
||||
rimraf.sync(electron.getInstanceDir());
|
||||
}
|
||||
@@ -5,4 +5,3 @@
|
||||
|
||||
/// <reference path='../../../../src/vs/vscode.d.ts'/>
|
||||
/// <reference path='../../../../src/vs/vscode.proposed.d.ts'/>
|
||||
/// <reference types='@types/node'/>
|
||||
|
||||
@@ -22,8 +22,21 @@ const getRootTempDir = (() => {
|
||||
};
|
||||
})();
|
||||
|
||||
export const getInstanceDir = (() => {
|
||||
let dir: string | undefined;
|
||||
return () => {
|
||||
if (!dir) {
|
||||
dir = path.join(getRootTempDir(), temp.makeRandomHexString(20));
|
||||
}
|
||||
if (!fs.existsSync(dir)) {
|
||||
fs.mkdirSync(dir);
|
||||
}
|
||||
return dir;
|
||||
};
|
||||
})();
|
||||
|
||||
export function getTempFile(prefix: string): string {
|
||||
return path.join(getRootTempDir(), `${prefix}-${temp.makeRandomHexString(20)}.tmp`);
|
||||
return path.join(getInstanceDir(), `${prefix}-${temp.makeRandomHexString(20)}.tmp`);
|
||||
}
|
||||
|
||||
function generatePatchedEnv(env: any, modulePath: string): any {
|
||||
|
||||
Reference in New Issue
Block a user