mirror of
https://github.com/microsoft/monaco-editor.git
synced 2025-12-22 19:42:56 +01:00
Adopt new editor, bump TypeScript
This commit is contained in:
parent
e054e6cb4c
commit
27f5823a7e
8 changed files with 238774 additions and 232347 deletions
|
|
@ -93,26 +93,10 @@ export class WorkerManager {
|
|||
|
||||
getLanguageServiceWorker(...resources: Uri[]): Promise<TypeScriptWorker> {
|
||||
let _client: TypeScriptWorker;
|
||||
return toShallowCancelPromise(
|
||||
this._getClient().then((client) => {
|
||||
_client = client
|
||||
}).then(_ => {
|
||||
return this._worker.withSyncedResources(resources)
|
||||
}).then(_ => _client)
|
||||
);
|
||||
return this._getClient().then((client) => {
|
||||
_client = client
|
||||
}).then(_ => {
|
||||
return this._worker.withSyncedResources(resources)
|
||||
}).then(_ => _client);
|
||||
}
|
||||
}
|
||||
|
||||
function toShallowCancelPromise<T>(p: Promise<T>): Promise<T> {
|
||||
let completeCallback: (value: T) => void;
|
||||
let errorCallback: (err: any) => void;
|
||||
|
||||
let r = new Promise<T>((c, e) => {
|
||||
completeCallback = c;
|
||||
errorCallback = e;
|
||||
}, () => { });
|
||||
|
||||
p.then(completeCallback, errorCallback);
|
||||
|
||||
return r;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue