提交 fadbc9c6 编写于 作者: M Matt Bierner

Move reset logic out of Promise

上级 89b68c6d
......@@ -337,22 +337,22 @@ export default class TypeScriptServiceClient implements ITypeScriptServiceClient
private startService(resendModels: boolean = false): Promise<ForkedTsServerProcess> {
let currentVersion = this.versionPicker.currentVersion;
return this.servicePromise = new Promise<ForkedTsServerProcess>(async (resolve, reject) => {
this.info(`Using tsserver from: ${currentVersion.path}`);
if (!fs.existsSync(currentVersion.tsServerPath)) {
window.showWarningMessage(localize('noServerFound', 'The path {0} doesn\'t point to a valid tsserver install. Falling back to bundled TypeScript version.', currentVersion.path));
this.info(`Using tsserver from: ${currentVersion.path}`);
if (!fs.existsSync(currentVersion.tsServerPath)) {
window.showWarningMessage(localize('noServerFound', 'The path {0} doesn\'t point to a valid tsserver install. Falling back to bundled TypeScript version.', currentVersion.path));
this.versionPicker.useBundledVersion();
currentVersion = this.versionPicker.currentVersion;
}
this.versionPicker.useBundledVersion();
currentVersion = this.versionPicker.currentVersion;
}
this._apiVersion = this.versionPicker.currentVersion.version || API.defaultVersion;
this.onDidChangeTypeScriptVersion(currentVersion);
this._apiVersion = this.versionPicker.currentVersion.version || API.defaultVersion;
this.onDidChangeTypeScriptVersion(currentVersion);
this.requestQueue = new RequestQueue();
this.callbacks = new CallbackMap();
this.lastError = null;
this.requestQueue = new RequestQueue();
this.callbacks = new CallbackMap();
this.lastError = null;
return this.servicePromise = new Promise<ForkedTsServerProcess>(async (resolve, reject) => {
try {
const tsServerForkArgs = await this.getTsServerArgs(currentVersion);
const tsServerForkOptions: electron.IForkOptions = {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册