mirror of
https://github.com/microsoft/monaco-editor.git
synced 2025-12-22 23:13:02 +01:00
Revert the lib files coming through as monaco models
This commit is contained in:
parent
86f6d762df
commit
ca76528ce1
2 changed files with 2 additions and 8 deletions
|
|
@ -69,6 +69,8 @@ export class TypeScriptWorker implements ts.LanguageServiceHost, monaco.language
|
||||||
if (model) {
|
if (model) {
|
||||||
// a true editor model
|
// a true editor model
|
||||||
text = model.getValue();
|
text = model.getValue();
|
||||||
|
} else if (fileName in libFileMap) {
|
||||||
|
text = libFileMap[fileName];
|
||||||
|
|
||||||
} else if (fileName in this._extraLibs) {
|
} else if (fileName in this._extraLibs) {
|
||||||
// extra lib
|
// extra lib
|
||||||
|
|
|
||||||
|
|
@ -61,19 +61,11 @@ export class WorkerManager {
|
||||||
|
|
||||||
private _getClient(): Promise<TypeScriptWorker> {
|
private _getClient(): Promise<TypeScriptWorker> {
|
||||||
if (!this._client) {
|
if (!this._client) {
|
||||||
// Adds all of the .d.ts lib files into Monaco as editor models,
|
|
||||||
// this allows themm to show up in peek (and allow editing if desired).
|
|
||||||
for (const key in libFileMap) {
|
|
||||||
monaco.editor.createModel(libFileMap[key], "javascript", monaco.Uri.file(key))
|
|
||||||
}
|
|
||||||
|
|
||||||
this._worker = monaco.editor.createWebWorker<TypeScriptWorker>({
|
this._worker = monaco.editor.createWebWorker<TypeScriptWorker>({
|
||||||
|
|
||||||
// module that exports the create() method and returns a `TypeScriptWorker` instance
|
// module that exports the create() method and returns a `TypeScriptWorker` instance
|
||||||
moduleId: 'vs/language/typescript/tsWorker',
|
moduleId: 'vs/language/typescript/tsWorker',
|
||||||
|
|
||||||
label: this._modeId,
|
label: this._modeId,
|
||||||
|
|
||||||
keepIdleModels: true,
|
keepIdleModels: true,
|
||||||
|
|
||||||
// passed in to the create() method
|
// passed in to the create() method
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue