mirror of
https://github.com/microsoft/monaco-editor.git
synced 2025-12-22 19:42:56 +01:00
update dependencies, fix promise typing issue
This commit is contained in:
parent
c4f9df0f80
commit
ff043657bd
2 changed files with 9 additions and 10 deletions
|
|
@ -25,12 +25,12 @@
|
|||
"gulp-tsb": "^2.0.0",
|
||||
"gulp-uglify": "^1.5.3",
|
||||
"merge-stream": "^1.0.0",
|
||||
"monaco-editor-core": "^0.10.0",
|
||||
"monaco-editor-core": "^0.10.1",
|
||||
"monaco-languages": "^0.9.0",
|
||||
"object-assign": "^4.1.0",
|
||||
"rimraf": "^2.5.2",
|
||||
"typescript": "2.3.4",
|
||||
"vscode-json-languageservice": "^2.0.11",
|
||||
"vscode-languageserver-types": "^3.3.0-alpha.1"
|
||||
"typescript": "^2.7.1",
|
||||
"vscode-languageserver-types": "^3.5.0",
|
||||
"vscode-json-languageservice": "^3.0.5"
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -11,7 +11,6 @@ import IWorkerContext = monaco.worker.IWorkerContext;
|
|||
import * as jsonService from 'vscode-json-languageservice';
|
||||
import * as ls from 'vscode-languageserver-types';
|
||||
|
||||
|
||||
class PromiseAdapter<T> implements jsonService.Thenable<T> {
|
||||
private wrapped: monaco.Promise<T>;
|
||||
|
||||
|
|
@ -19,17 +18,17 @@ class PromiseAdapter<T> implements jsonService.Thenable<T> {
|
|||
this.wrapped = new monaco.Promise<T>(executor);
|
||||
}
|
||||
public then<TResult>(onfulfilled?: (value: T) => TResult | jsonService.Thenable<TResult>, onrejected?: (reason: any) => void): jsonService.Thenable<TResult> {
|
||||
return this.wrapped.then(onfulfilled, onrejected);
|
||||
let thenable : monaco.Thenable<T> = this.wrapped;
|
||||
return thenable.then(onfulfilled, onrejected);
|
||||
}
|
||||
public getWrapped(): monaco.Promise<T> {
|
||||
public getWrapped(): monaco.Thenable<T> {
|
||||
return this.wrapped;
|
||||
}
|
||||
public cancel(): void {
|
||||
this.wrapped.cancel();
|
||||
}
|
||||
|
||||
public static resolve<T>(v: T): jsonService.Thenable<T> {
|
||||
return monaco.Promise.as(v);
|
||||
public static resolve<T>(v: T | Thenable<T>): jsonService.Thenable<T> {
|
||||
return <monaco.Thenable<T>> monaco.Promise.as(v);
|
||||
}
|
||||
public static reject<T>(v: T): jsonService.Thenable<T> {
|
||||
return monaco.Promise.wrapError(v);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue