mirror of
https://github.com/microsoft/monaco-editor.git
synced 2025-12-22 22:02:55 +01:00
Adds a vfs project
This commit is contained in:
parent
89fdcf5424
commit
166e63b991
5 changed files with 117 additions and 30 deletions
|
|
@ -10,6 +10,7 @@ import { IExtraLibs } from './monaco.contribution';
|
|||
|
||||
import IWorkerContext = monaco.worker.IWorkerContext;
|
||||
|
||||
|
||||
export class TypeScriptWorker implements ts.LanguageServiceHost, monaco.languages.typescript.TypeScriptWorker {
|
||||
|
||||
// --- model sync -----------------------
|
||||
|
|
@ -36,7 +37,7 @@ export class TypeScriptWorker implements ts.LanguageServiceHost, monaco.language
|
|||
return models.concat(Object.keys(this._extraLibs));
|
||||
}
|
||||
|
||||
private _getModel(fileName: string): monaco.worker.IMirrorModel | null {
|
||||
_getModel(fileName: string): monaco.worker.IMirrorModel | null {
|
||||
let models = this._ctx.getMirrorModels();
|
||||
for (let i = 0; i < models.length; i++) {
|
||||
if (models[i].uri.toString() === fileName) {
|
||||
|
|
@ -271,7 +272,7 @@ export function create(ctx: IWorkerContext, createData: ICreateData): TypeScript
|
|||
throw new Error(`The script at ${createData.customWorkerPath} does not add customTSWorkerFactory to self`)
|
||||
}
|
||||
// @ts-ignore - The throw validates this
|
||||
TSWorkerClass = self.customTSWorkerFactory(TypeScriptWorker)
|
||||
TSWorkerClass = self.customTSWorkerFactory(TypeScriptWorker, ts, libFileMap)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue