mirror of
https://github.com/microsoft/monaco-editor.git
synced 2025-12-22 22:02:55 +01:00
Strict checks for json
This commit is contained in:
parent
6054aa23fc
commit
45ae1272ea
6 changed files with 85 additions and 47 deletions
|
|
@ -15,12 +15,13 @@ export class WorkerManager {
|
|||
private _lastUsedTime: number;
|
||||
private _configChangeListener: IDisposable;
|
||||
|
||||
private _worker: editor.MonacoWebWorker<JSONWorker>;
|
||||
private _client: Promise<JSONWorker>;
|
||||
private _worker: editor.MonacoWebWorker<JSONWorker> | null;
|
||||
private _client: Promise<JSONWorker> | null;
|
||||
|
||||
constructor(defaults: LanguageServiceDefaults) {
|
||||
this._defaults = defaults;
|
||||
this._worker = null;
|
||||
this._client = null;
|
||||
this._idleCheckInterval = window.setInterval(() => this._checkIfIdle(), 30 * 1000);
|
||||
this._lastUsedTime = 0;
|
||||
this._configChangeListener = this._defaults.onDidChange(() => this._stopWorker());
|
||||
|
|
@ -81,7 +82,9 @@ export class WorkerManager {
|
|||
_client = client;
|
||||
})
|
||||
.then((_) => {
|
||||
return this._worker.withSyncedResources(resources);
|
||||
if (this._worker) {
|
||||
return this._worker.withSyncedResources(resources);
|
||||
}
|
||||
})
|
||||
.then((_) => _client);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue