From 3bf72456356165747dca5be8694d99f4c53e89bd Mon Sep 17 00:00:00 2001 From: Akos Kitta Date: Fri, 5 Jun 2020 11:55:02 +0200 Subject: [PATCH 1/2] GH-3985: Support for css/tml via VS Code extension Closes #3985 Signed-off-by: Akos Kitta --- .../src/generator/webpack-generator.ts | 12 +----------- package.json | 2 ++ packages/monaco/src/browser/monaco-loader.ts | 4 +--- 3 files changed, 4 insertions(+), 14 deletions(-) diff --git a/dev-packages/application-manager/src/generator/webpack-generator.ts b/dev-packages/application-manager/src/generator/webpack-generator.ts index 9629a8ad49636..bb9df1525e84a 100644 --- a/dev-packages/application-manager/src/generator/webpack-generator.ts +++ b/dev-packages/application-manager/src/generator/webpack-generator.ts @@ -72,22 +72,12 @@ const { mode, staticCompression } = yargs.option('mode', { }).argv; const development = mode === 'development';${this.ifMonaco(() => ` -const monacoEditorCorePath = development ? '${this.resolve('@theia/monaco-editor-core', 'dev/vs')}' : '${this.resolve('@theia/monaco-editor-core', 'min/vs')}'; -const monacoCssLanguagePath = '${this.resolve('monaco-css', 'release/min')}'; -const monacoHtmlLanguagePath = '${this.resolve('monaco-html', 'release/min')}';`)} +const monacoEditorCorePath = development ? '${this.resolve('@theia/monaco-editor-core', 'dev/vs')}' : '${this.resolve('@theia/monaco-editor-core', 'min/vs')}';`)} const plugins = [new CopyWebpackPlugin([${this.ifMonaco(() => ` { from: monacoEditorCorePath, to: 'vs' - }, - { - from: monacoCssLanguagePath, - to: 'vs/language/css' - }, - { - from: monacoHtmlLanguagePath, - to: 'vs/language/html' }`)} ])]; // it should go after copy-plugin in order to compress monaco as well diff --git a/package.json b/package.json index 660ae466676b8..c458908e7b04e 100644 --- a/package.json +++ b/package.json @@ -87,6 +87,7 @@ "vscode-builtin-cpp": "https://open-vsx.org/api/vscode/cpp/1.44.2/file/vscode.cpp-1.44.2.vsix", "vscode-builtin-csharp": "https://open-vsx.org/api/vscode/csharp/1.44.2/file/vscode.csharp-1.44.2.vsix", "vscode-builtin-css": "https://open-vsx.org/api/vscode/css/1.44.2/file/vscode.css-1.44.2.vsix", + "vscode-builtin-css-language-features": "https://open-vsx.org/api/vscode/css-language-features/1.45.1/file/vscode.css-language-features-1.45.1.vsix", "vscode-builtin-debug-auto-launch": "https://open-vsx.org/api/vscode/debug-auto-launch/1.44.2/file/vscode.debug-auto-launch-1.44.2.vsix", "vscode-builtin-docker": "https://open-vsx.org/api/vscode/docker/1.44.2/file/vscode.docker-1.44.2.vsix", "vscode-builtin-emmet": "https://open-vsx.org/api/vscode/emmet/1.44.2/file/vscode.emmet-1.44.2.vsix", @@ -98,6 +99,7 @@ "vscode-builtin-handlebars": "https://open-vsx.org/api/vscode/handlebars/1.44.2/file/vscode.handlebars-1.44.2.vsix", "vscode-builtin-hlsl": "https://open-vsx.org/api/vscode/hlsl/1.44.2/file/vscode.hlsl-1.44.2.vsix", "vscode-builtin-html": "https://open-vsx.org/api/vscode/html/1.44.2/file/vscode.html-1.44.2.vsix", + "vscode-builtin-html-language-features": "https://open-vsx.org/api/vscode/html-language-features/1.45.1/file/vscode.html-language-features-1.45.1.vsix", "vscode-builtin-ini": "https://open-vsx.org/api/vscode/ini/1.44.2/file/vscode.ini-1.44.2.vsix", "vscode-builtin-jake": "https://open-vsx.org/api/vscode/jake/1.44.2/file/vscode.jake-1.44.2.vsix", "vscode-builtin-java": "https://open-vsx.org/api/vscode/java/1.44.2/file/vscode.java-1.44.2.vsix", diff --git a/packages/monaco/src/browser/monaco-loader.ts b/packages/monaco/src/browser/monaco-loader.ts index 6f1c304e2d374..84c88c8cb0317 100644 --- a/packages/monaco/src/browser/monaco-loader.ts +++ b/packages/monaco/src/browser/monaco-loader.ts @@ -44,8 +44,6 @@ export function loadMonaco(vsRequire: any): Promise { return new Promise(resolve => { vsRequire(['vs/editor/editor.main'], () => { vsRequire([ - 'vs/language/css/monaco.contribution', - 'vs/language/html/monaco.contribution', 'vs/platform/commands/common/commands', 'vs/platform/actions/common/actions', 'vs/platform/keybinding/common/keybindingsRegistry', @@ -78,7 +76,7 @@ export function loadMonaco(vsRequire: any): Promise { 'vs/platform/contextkey/common/contextkey', 'vs/platform/contextkey/browser/contextKeyService', 'vs/base/common/errors' - ], (css: any, html: any, commands: any, actions: any, + ], (commands: any, actions: any, keybindingsRegistry: any, keybindingResolver: any, resolvedKeybinding: any, keybindingLabels: any, keyCodes: any, mime: any, editorExtensions: any, simpleServices: any, standaloneServices: any, standaloneLanguages: any, quickOpenWidget: any, quickOpenModel: any, From 3debc5d84508fe96bae2712e2875ea66103ba8b4 Mon Sep 17 00:00:00 2001 From: Akos Kitta Date: Fri, 5 Jun 2020 11:55:22 +0200 Subject: [PATCH 2/2] Removed a leftover `await`. Signed-off-by: Akos Kitta --- packages/monaco/src/browser/monaco-editor-service.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/monaco/src/browser/monaco-editor-service.ts b/packages/monaco/src/browser/monaco-editor-service.ts index 12c7b5c351f58..347dca0fffefa 100644 --- a/packages/monaco/src/browser/monaco-editor-service.ts +++ b/packages/monaco/src/browser/monaco-editor-service.ts @@ -78,7 +78,7 @@ export class MonacoEditorService extends monaco.services.CodeEditorServiceImpl { return undefined; } if (ApplicationShell.TrackableWidgetProvider.is(widget)) { - for (const childWidget of await widget.getTrackableWidgets()) { + for (const childWidget of widget.getTrackableWidgets()) { const editorWidget = await this.findEditorWidgetByUri(childWidget, uriAsString); if (editorWidget) { return editorWidget;