From d9630fc0f5fe0dd7c23c274ad9627588ba50c18c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20M=C3=A4der?= Date: Wed, 2 Oct 2024 14:10:17 +0200 Subject: [PATCH 1/8] Update monaco-editor-core to 1.96.3 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes #14726 Contributed on behalf of STMicroelectronics Signed-off-by: Thomas Mäder --- .vscode/launch.json | 17 +- .../src/generator/webpack-generator.ts | 21 +- .../@theia+monaco-editor-core+1.83.101.patch | 32 -- .../src/monaco-webpack-plugins.ts | 28 ++ examples/api-samples/package.json | 2 +- examples/browser/package.json | 3 +- examples/browser/tsconfig.json | 5 +- examples/browser/webpack.config.js | 10 + examples/electron/webpack.config.js | 9 +- package-lock.json | 51 +-- packages/ai-chat-ui/package.json | 2 +- packages/ai-code-completion/package.json | 2 +- packages/ai-core/package.json | 2 +- packages/bulk-edit/package.json | 2 +- packages/collaboration/package.json | 2 +- packages/console/package.json | 2 +- .../default-secondary-window-service.ts | 8 +- .../window/secondary-window-service.ts | 3 + packages/debug/package.json | 2 +- .../disassembly-view-widget.ts | 6 +- .../editor/src/browser/editor-contribution.ts | 14 +- .../editor-generated-preference-schema.ts | 373 +++++++++++++++--- packages/editor/src/browser/editor-manager.ts | 14 +- .../src/browser/quick-file-open.ts | 7 +- packages/git/package.json | 2 +- packages/keymaps/package.json | 2 +- packages/monaco/README.md | 4 +- packages/monaco/package.json | 2 +- .../monaco-markdown-renderer.ts | 2 +- .../monaco/src/browser/monaco-diff-editor.ts | 2 +- packages/monaco/src/browser/monaco-editor.ts | 21 +- ...onaco-frontend-application-contribution.ts | 25 +- .../src/browser/monaco-frontend-module.ts | 13 +- packages/monaco/src/browser/monaco-init.ts | 25 +- .../src/browser/monaco-quick-input-service.ts | 78 ++-- .../src/browser/simple-monaco-editor.ts | 5 +- packages/notebook/package.json | 2 +- .../src/browser/service/notebook-options.ts | 4 +- packages/output/package.json | 2 +- packages/plugin-ext-vscode/package.json | 2 +- packages/plugin-ext/package.json | 2 +- .../src/main/browser/languages-main.ts | 29 +- .../src/plugin/preference-registry.ts | 43 +- packages/plugin-metrics/package.json | 2 +- packages/preferences/package.json | 2 +- packages/scm/package.json | 2 +- packages/task/package.json | 2 +- packages/toolbar/package.json | 2 +- 48 files changed, 635 insertions(+), 257 deletions(-) delete mode 100644 dev-packages/cli/patches/@theia+monaco-editor-core+1.83.101.patch create mode 100644 dev-packages/native-webpack-plugin/src/monaco-webpack-plugins.ts diff --git a/.vscode/launch.json b/.vscode/launch.json index 3539be4173f25..5d3c67f81db99 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -4,6 +4,20 @@ // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 "version": "0.2.0", "configurations": [ + { + "name": "download plugins", + "program": "${workspaceFolder}/dev-packages/cli/lib/theia.js", + "request": "launch", + "args": [ + "build", + "--mode development" + ], + "skipFiles": [ + "/**" + ], + "type": "node", + "cwd": "${workspaceFolder}/examples/browser" + }, { "type": "node", "request": "attach", @@ -28,6 +42,7 @@ "protocol": "inspector", "args": [ ".", + "c:\\users\\thomas", "--log-level=debug", "--hostname=localhost", "--no-cluster", @@ -177,4 +192,4 @@ "stopAll": true } ] -} +} \ No newline at end of file diff --git a/dev-packages/application-manager/src/generator/webpack-generator.ts b/dev-packages/application-manager/src/generator/webpack-generator.ts index 3f32adda88f71..dfd123b175682 100644 --- a/dev-packages/application-manager/src/generator/webpack-generator.ts +++ b/dev-packages/application-manager/src/generator/webpack-generator.ts @@ -61,8 +61,9 @@ const webpack = require('webpack'); const yargs = require('yargs'); const resolvePackagePath = require('resolve-package-path'); const CopyWebpackPlugin = require('copy-webpack-plugin'); -const CompressionPlugin = require('compression-webpack-plugin') -const MiniCssExtractPlugin = require('mini-css-extract-plugin') +const CompressionPlugin = require('compression-webpack-plugin'); +const MiniCssExtractPlugin = require('mini-css-extract-plugin'); +const { MonacoWebpackPlugin } = require('@theia/native-webpack-plugin/lib/monaco-webpack-plugins.js'); const outputPath = path.resolve(__dirname, 'lib', 'frontend'); const { mode, staticCompression } = yargs.option('mode', { @@ -99,7 +100,8 @@ const plugins = [ new webpack.ProvidePlugin({ // the Buffer class doesn't exist in the browser but some dependencies rely on it Buffer: ['buffer', 'Buffer'] - }) + }), + new MonacoWebpackPlugin() ]; // it should go after copy-plugin in order to compress monaco as well if (staticCompression) { @@ -171,6 +173,10 @@ module.exports = [{ test: /source-map-support/, loader: 'ignore-loader' }, + { + test: /\\.d\\.ts$/, + loader: 'ignore-loader' + }, { test: /\\.js$/, enforce: 'pre', @@ -240,6 +246,7 @@ module.exports = [{ filename: "[name].css", chunkFilename: "[id].css", }), + new MonacoWebpackPlugin(), ], devtool: 'source-map', entry: { @@ -345,6 +352,7 @@ const yargs = require('yargs'); const webpack = require('webpack'); const TerserPlugin = require('terser-webpack-plugin'); const NativeWebpackPlugin = require('@theia/native-webpack-plugin'); +const { MonacoWebpackPlugin } = require('@theia/native-webpack-plugin/lib/monaco-webpack-plugins.js'); const { mode } = yargs.option('mode', { description: "Mode to use", @@ -432,6 +440,10 @@ const config = { name: 'native/[name].[ext]' } }, + { + test: /\\.d\\.ts$/, + loader: 'ignore-loader' + }, { test: /\\.js$/, enforce: 'pre', @@ -451,7 +463,8 @@ const config = { // Optional node dependencies can be safely ignored new webpack.IgnorePlugin({ checkResource: resource => ignoredResources.has(resource) - }) + }), + new MonacoWebpackPlugin() ], optimization: { // Split and reuse code across the various entry points diff --git a/dev-packages/cli/patches/@theia+monaco-editor-core+1.83.101.patch b/dev-packages/cli/patches/@theia+monaco-editor-core+1.83.101.patch deleted file mode 100644 index da1e72d06ac90..0000000000000 --- a/dev-packages/cli/patches/@theia+monaco-editor-core+1.83.101.patch +++ /dev/null @@ -1,32 +0,0 @@ -diff --git a/node_modules/@theia/monaco-editor-core/esm/vs/base/browser/ui/sash/sash.js b/node_modules/@theia/monaco-editor-core/esm/vs/base/browser/ui/sash/sash.js -index 111dec4..b196066 100644 ---- a/node_modules/@theia/monaco-editor-core/esm/vs/base/browser/ui/sash/sash.js -+++ b/node_modules/@theia/monaco-editor-core/esm/vs/base/browser/ui/sash/sash.js -@@ -47,14 +47,15 @@ function setGlobalHoverDelay(size) { - } - exports.setGlobalHoverDelay = setGlobalHoverDelay; - class MouseEventFactory { -- constructor() { -+ constructor(el) { -+ this.el = el; - this.disposables = new lifecycle_1.DisposableStore(); - } - get onPointerMove() { -- return this.disposables.add(new event_1.DomEmitter(window, 'mousemove')).event; -+ return this.disposables.add(new event_1.DomEmitter(this.el.ownerDocument.defaultView, 'mousemove')).event; - } - get onPointerUp() { -- return this.disposables.add(new event_1.DomEmitter(window, 'mouseup')).event; -+ return this.disposables.add(new event_1.DomEmitter(this.el.ownerDocument.defaultView, 'mouseup')).event; - } - dispose() { - this.disposables.dispose(); -@@ -243,7 +244,7 @@ class Sash extends lifecycle_1.Disposable { - this.el.classList.add('mac'); - } - const onMouseDown = this._register(new event_1.DomEmitter(this.el, 'mousedown')).event; -- this._register(onMouseDown(e => this.onPointerStart(e, new MouseEventFactory()), this)); -+ this._register(onMouseDown(e => this.onPointerStart(e, new MouseEventFactory(this.el)), this)); - const onMouseDoubleClick = this._register(new event_1.DomEmitter(this.el, 'dblclick')).event; - this._register(onMouseDoubleClick(this.onPointerDoublePress, this)); - const onMouseEnter = this._register(new event_1.DomEmitter(this.el, 'mouseenter')).event; diff --git a/dev-packages/native-webpack-plugin/src/monaco-webpack-plugins.ts b/dev-packages/native-webpack-plugin/src/monaco-webpack-plugins.ts new file mode 100644 index 0000000000000..1add7025dbdd5 --- /dev/null +++ b/dev-packages/native-webpack-plugin/src/monaco-webpack-plugins.ts @@ -0,0 +1,28 @@ +// ***************************************************************************** +// Copyright (C) 2023 TypeFox and others. +// +// This program and the accompanying materials are made available under the +// terms of the Eclipse Public License v. 2.0 which is available at +// http://www.eclipse.org/legal/epl-2.0. +// +// This Source Code may also be made available under the following Secondary +// Licenses when the conditions for such availability set forth in the Eclipse +// Public License v. 2.0 are satisfied: GNU General Public License, version 2 +// with the GNU Classpath Exception which is available at +// https://www.gnu.org/software/classpath/license.html. +// +// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0 +// ***************************************************************************** + +import * as webpack from 'webpack'; + +export class MonacoWebpackPlugin { + apply(compiler: webpack.Compiler) { + compiler.hooks.contextModuleFactory.tap('MonacoBuildPlugin', cmf => { + cmf.hooks.contextModuleFiles.tap('MonacoBuildPlugin', files => files.filter(file => { + return !file.endsWith('.d.ts'); + })); + + }); + } +} diff --git a/examples/api-samples/package.json b/examples/api-samples/package.json index c9ad12d8950b7..05665f621eae0 100644 --- a/examples/api-samples/package.json +++ b/examples/api-samples/package.json @@ -11,7 +11,7 @@ "@theia/file-search": "1.57.0", "@theia/filesystem": "1.57.0", "@theia/monaco": "1.57.0", - "@theia/monaco-editor-core": "1.83.101", + "@theia/monaco-editor-core": "1.96.3", "@theia/output": "1.57.0", "@theia/ovsx-client": "1.57.0", "@theia/search-in-workspace": "1.57.0", diff --git a/examples/browser/package.json b/examples/browser/package.json index a0398e6aa3d04..1190a17aaee64 100644 --- a/examples/browser/package.json +++ b/examples/browser/package.json @@ -108,6 +108,7 @@ "watch:compile": "tsc -b -w" }, "devDependencies": { - "@theia/cli": "1.57.0" + "@theia/cli": "1.57.0", + "@theia/native-webpack-plugin": "1.57.0" } } diff --git a/examples/browser/tsconfig.json b/examples/browser/tsconfig.json index 5c292172236e8..b999627752e3f 100644 --- a/examples/browser/tsconfig.json +++ b/examples/browser/tsconfig.json @@ -1,6 +1,6 @@ { "extends": "../../configs/base.tsconfig", - "include": [], + "include": [ ], "compilerOptions": { "composite": true }, @@ -8,6 +8,9 @@ { "path": "../../dev-packages/cli" }, + { + "path": "../../dev-packages/native-webpack-plugin" + }, { "path": "../../packages/ai-anthropic" }, diff --git a/examples/browser/webpack.config.js b/examples/browser/webpack.config.js index 69246fc75b5cd..9d9ba148e8096 100644 --- a/examples/browser/webpack.config.js +++ b/examples/browser/webpack.config.js @@ -3,8 +3,11 @@ * To reset delete this file and rerun theia build again. */ // @ts-check +const webpack = require('webpack'); const configs = require('./gen-webpack.config.js'); const nodeConfig = require('./gen-webpack.node.config.js'); +const { fileURLToPath } = require('url'); +const { MonacoWebpackPlugin } = require('@theia/native-webpack-plugin/lib/monaco-webpack-plugins.js'); /** * Expose bundled modules on window.theia.moduleName namespace, e.g. @@ -16,6 +19,13 @@ configs[0].module.rules.push({ loader: require.resolve('@theia/application-manager/lib/expose-loader') }); +const plugin2 = new MonacoWebpackPlugin(); + +// @ts-ignore +configs[0].plugins.push(plugin2); +// @ts-ignore +configs[1].plugins.push(plugin2); + module.exports = [ ...configs, nodeConfig.config diff --git a/examples/electron/webpack.config.js b/examples/electron/webpack.config.js index 8c8bfd55c3b64..0d5184aaaa019 100644 --- a/examples/electron/webpack.config.js +++ b/examples/electron/webpack.config.js @@ -3,17 +3,22 @@ * To reset delete this file and rerun theia build again. */ // @ts-check +const webpack = require('webpack'); const configs = require('./gen-webpack.config.js'); const nodeConfig = require('./gen-webpack.node.config.js'); +const { MonacoWebpackPlugin } = require('@theia/native-webpack-plugin/lib/monaco-webpack-plugins.js'); + /** * Expose bundled modules on window.theia.moduleName namespace, e.g. * window['theia']['@theia/core/lib/common/uri']. * Such syntax can be used by external code, for instance, for testing. -config.module.rules.push({ + */ +configs[0].module.rules.push({ test: /\.js$/, loader: require.resolve('@theia/application-manager/lib/expose-loader') -}); */ +}); + module.exports = [ ...configs, diff --git a/package-lock.json b/package-lock.json index 45c0ad2a529a8..cc889b9aa6bcf 100644 --- a/package-lock.json +++ b/package-lock.json @@ -402,7 +402,7 @@ "@theia/file-search": "1.57.0", "@theia/filesystem": "1.57.0", "@theia/monaco": "1.57.0", - "@theia/monaco-editor-core": "1.83.101", + "@theia/monaco-editor-core": "1.96.3", "@theia/output": "1.57.0", "@theia/ovsx-client": "1.57.0", "@theia/search-in-workspace": "1.57.0", @@ -494,7 +494,8 @@ "@theia/workspace": "1.57.0" }, "devDependencies": { - "@theia/cli": "1.57.0" + "@theia/cli": "1.57.0", + "@theia/native-webpack-plugin": "1.57.0" } }, "examples/browser-only": { @@ -6088,10 +6089,10 @@ "link": true }, "node_modules/@theia/monaco-editor-core": { - "version": "1.83.101", - "resolved": "https://registry.npmjs.org/@theia/monaco-editor-core/-/monaco-editor-core-1.83.101.tgz", - "integrity": "sha512-UaAi6CEvain/qbGD3o6Ufe8plLyzAVQ53p9Ke+MoBYDhb391+r+MuK++JtITqIrXqoa8OCjbt8wQxEFSNNO0Mw==", - "license": "MIT and (Apache-2.0 or MPL-2.0)" + "version": "1.96.3", + "resolved": "https://registry.npmjs.org/@theia/monaco-editor-core/-/monaco-editor-core-1.96.3.tgz", + "integrity": "sha512-8YjySDxUTM1N9nmeymBsH4liP07DIG4TCt8mIscq2vQL1oE0ir9GBjHxybF8XUgJx7uSaZtUwK2OALX22CngWA==", + "license": "MIT" }, "node_modules/@theia/native-webpack-plugin": { "resolved": "dev-packages/native-webpack-plugin", @@ -29825,7 +29826,7 @@ "@theia/editor-preview": "1.57.0", "@theia/filesystem": "1.57.0", "@theia/monaco": "1.57.0", - "@theia/monaco-editor-core": "1.83.101", + "@theia/monaco-editor-core": "1.96.3", "@theia/workspace": "1.57.0", "minimatch": "^5.1.0", "tslib": "^2.6.2", @@ -29843,7 +29844,7 @@ "@theia/ai-core": "1.57.0", "@theia/core": "1.57.0", "@theia/filesystem": "1.57.0", - "@theia/monaco-editor-core": "1.83.101", + "@theia/monaco-editor-core": "1.96.3", "@theia/output": "1.57.0", "@theia/workspace": "1.57.0", "minimatch": "^5.1.0", @@ -29862,7 +29863,7 @@ "@theia/editor": "1.57.0", "@theia/filesystem": "1.57.0", "@theia/monaco": "1.57.0", - "@theia/monaco-editor-core": "1.83.101", + "@theia/monaco-editor-core": "1.96.3", "@theia/output": "1.57.0", "@theia/variable-resolver": "1.57.0", "@theia/workspace": "1.57.0", @@ -30076,7 +30077,7 @@ "@theia/editor": "1.57.0", "@theia/filesystem": "1.57.0", "@theia/monaco": "1.57.0", - "@theia/monaco-editor-core": "1.83.101", + "@theia/monaco-editor-core": "1.96.3", "@theia/workspace": "1.57.0", "tslib": "^2.6.2" }, @@ -30107,7 +30108,7 @@ "@theia/editor": "1.57.0", "@theia/filesystem": "1.57.0", "@theia/monaco": "1.57.0", - "@theia/monaco-editor-core": "1.83.101", + "@theia/monaco-editor-core": "1.96.3", "@theia/workspace": "1.57.0", "lib0": "^0.2.52", "open-collaboration-protocol": "0.2.0", @@ -30127,7 +30128,7 @@ "dependencies": { "@theia/core": "1.57.0", "@theia/monaco": "1.57.0", - "@theia/monaco-editor-core": "1.83.101", + "@theia/monaco-editor-core": "1.96.3", "anser": "^2.0.1", "tslib": "^2.6.2" }, @@ -30402,7 +30403,7 @@ "@theia/filesystem": "1.57.0", "@theia/markers": "1.57.0", "@theia/monaco": "1.57.0", - "@theia/monaco-editor-core": "1.83.101", + "@theia/monaco-editor-core": "1.96.3", "@theia/output": "1.57.0", "@theia/process": "1.57.0", "@theia/task": "1.57.0", @@ -30581,7 +30582,7 @@ "@theia/core": "1.57.0", "@theia/editor": "1.57.0", "@theia/filesystem": "1.57.0", - "@theia/monaco-editor-core": "1.83.101", + "@theia/monaco-editor-core": "1.96.3", "@theia/navigator": "1.57.0", "@theia/scm": "1.57.0", "@theia/scm-extra": "1.57.0", @@ -30656,7 +30657,7 @@ "dependencies": { "@theia/core": "1.57.0", "@theia/monaco": "1.57.0", - "@theia/monaco-editor-core": "1.83.101", + "@theia/monaco-editor-core": "1.96.3", "@theia/preferences": "1.57.0", "@theia/userstorage": "1.57.0", "jsonc-parser": "^2.2.0", @@ -30748,7 +30749,7 @@ "@theia/editor": "1.57.0", "@theia/filesystem": "1.57.0", "@theia/markers": "1.57.0", - "@theia/monaco-editor-core": "1.83.101", + "@theia/monaco-editor-core": "1.96.3", "@theia/outline-view": "1.57.0", "@theia/workspace": "1.57.0", "fast-plist": "^0.1.2", @@ -30786,7 +30787,7 @@ "@theia/editor": "1.57.0", "@theia/filesystem": "1.57.0", "@theia/monaco": "1.57.0", - "@theia/monaco-editor-core": "1.83.101", + "@theia/monaco-editor-core": "1.96.3", "@theia/outline-view": "1.57.0", "advanced-mark.js": "^2.6.0", "react-perfect-scrollbar": "^1.5.8", @@ -30829,7 +30830,7 @@ "@theia/core": "1.57.0", "@theia/editor": "1.57.0", "@theia/monaco": "1.57.0", - "@theia/monaco-editor-core": "1.83.101", + "@theia/monaco-editor-core": "1.96.3", "p-queue": "^8.0.1", "tslib": "^2.6.2" }, @@ -30914,7 +30915,7 @@ "@theia/markers": "1.57.0", "@theia/messages": "1.57.0", "@theia/monaco": "1.57.0", - "@theia/monaco-editor-core": "1.83.101", + "@theia/monaco-editor-core": "1.96.3", "@theia/navigator": "1.57.0", "@theia/notebook": "1.57.0", "@theia/output": "1.57.0", @@ -30983,7 +30984,7 @@ "@theia/editor": "1.57.0", "@theia/filesystem": "1.57.0", "@theia/monaco": "1.57.0", - "@theia/monaco-editor-core": "1.83.101", + "@theia/monaco-editor-core": "1.96.3", "@theia/navigator": "1.57.0", "@theia/outline-view": "1.57.0", "@theia/plugin": "1.57.0", @@ -31013,7 +31014,7 @@ "dependencies": { "@theia/core": "1.57.0", "@theia/metrics": "1.57.0", - "@theia/monaco-editor-core": "1.83.101", + "@theia/monaco-editor-core": "1.96.3", "@theia/plugin": "1.57.0", "@theia/plugin-ext": "1.57.0", "tslib": "^2.6.2" @@ -31031,7 +31032,7 @@ "@theia/editor": "1.57.0", "@theia/filesystem": "1.57.0", "@theia/monaco": "1.57.0", - "@theia/monaco-editor-core": "1.83.101", + "@theia/monaco-editor-core": "1.96.3", "@theia/userstorage": "1.57.0", "@theia/workspace": "1.57.0", "async-mutex": "^0.3.1", @@ -31245,7 +31246,7 @@ "@theia/editor": "1.57.0", "@theia/filesystem": "1.57.0", "@theia/monaco": "1.57.0", - "@theia/monaco-editor-core": "1.83.101", + "@theia/monaco-editor-core": "1.96.3", "@types/diff": "^5.2.1", "diff": "^5.2.0", "p-debounce": "^2.1.0", @@ -31315,7 +31316,7 @@ "@theia/filesystem": "1.57.0", "@theia/markers": "1.57.0", "@theia/monaco": "1.57.0", - "@theia/monaco-editor-core": "1.83.101", + "@theia/monaco-editor-core": "1.96.3", "@theia/process": "1.57.0", "@theia/terminal": "1.57.0", "@theia/userstorage": "1.57.0", @@ -31417,7 +31418,7 @@ "@theia/file-search": "1.57.0", "@theia/filesystem": "1.57.0", "@theia/monaco": "1.57.0", - "@theia/monaco-editor-core": "1.83.101", + "@theia/monaco-editor-core": "1.96.3", "@theia/search-in-workspace": "1.57.0", "@theia/userstorage": "1.57.0", "@theia/workspace": "1.57.0", diff --git a/packages/ai-chat-ui/package.json b/packages/ai-chat-ui/package.json index d07e6acd74cf4..9f4645622fb39 100644 --- a/packages/ai-chat-ui/package.json +++ b/packages/ai-chat-ui/package.json @@ -9,7 +9,7 @@ "@theia/editor": "1.57.0", "@theia/filesystem": "1.57.0", "@theia/monaco": "1.57.0", - "@theia/monaco-editor-core": "1.83.101", + "@theia/monaco-editor-core": "1.96.3", "@theia/editor-preview": "1.57.0", "@theia/workspace": "1.57.0", "minimatch": "^5.1.0", diff --git a/packages/ai-code-completion/package.json b/packages/ai-code-completion/package.json index 6202f5e05c10a..96c95da0ae42f 100644 --- a/packages/ai-code-completion/package.json +++ b/packages/ai-code-completion/package.json @@ -6,7 +6,7 @@ "@theia/ai-core": "1.57.0", "@theia/core": "1.57.0", "@theia/filesystem": "1.57.0", - "@theia/monaco-editor-core": "1.83.101", + "@theia/monaco-editor-core": "1.96.3", "@theia/output": "1.57.0", "@theia/workspace": "1.57.0", "minimatch": "^5.1.0", diff --git a/packages/ai-core/package.json b/packages/ai-core/package.json index cbb8bcb64f4bb..d1a75c5a4cc7b 100644 --- a/packages/ai-core/package.json +++ b/packages/ai-core/package.json @@ -7,7 +7,7 @@ "@theia/editor": "1.57.0", "@theia/filesystem": "1.57.0", "@theia/monaco": "1.57.0", - "@theia/monaco-editor-core": "1.83.101", + "@theia/monaco-editor-core": "1.96.3", "@theia/output": "1.57.0", "@theia/variable-resolver": "1.57.0", "@theia/workspace": "1.57.0", diff --git a/packages/bulk-edit/package.json b/packages/bulk-edit/package.json index 94bb8c6a230f0..dcfb0da7c6cfd 100644 --- a/packages/bulk-edit/package.json +++ b/packages/bulk-edit/package.json @@ -7,7 +7,7 @@ "@theia/editor": "1.57.0", "@theia/filesystem": "1.57.0", "@theia/monaco": "1.57.0", - "@theia/monaco-editor-core": "1.83.101", + "@theia/monaco-editor-core": "1.96.3", "@theia/workspace": "1.57.0", "tslib": "^2.6.2" }, diff --git a/packages/collaboration/package.json b/packages/collaboration/package.json index 442449446beaf..4280eadd84382 100644 --- a/packages/collaboration/package.json +++ b/packages/collaboration/package.json @@ -7,7 +7,7 @@ "@theia/editor": "1.57.0", "@theia/filesystem": "1.57.0", "@theia/monaco": "1.57.0", - "@theia/monaco-editor-core": "1.83.101", + "@theia/monaco-editor-core": "1.96.3", "@theia/workspace": "1.57.0", "open-collaboration-protocol": "0.2.0", "open-collaboration-yjs": "0.2.0", diff --git a/packages/console/package.json b/packages/console/package.json index 30301f5420b46..5e41e5faecfa2 100644 --- a/packages/console/package.json +++ b/packages/console/package.json @@ -5,7 +5,7 @@ "dependencies": { "@theia/core": "1.57.0", "@theia/monaco": "1.57.0", - "@theia/monaco-editor-core": "1.83.101", + "@theia/monaco-editor-core": "1.96.3", "anser": "^2.0.1", "tslib": "^2.6.2" }, diff --git a/packages/core/src/browser/window/default-secondary-window-service.ts b/packages/core/src/browser/window/default-secondary-window-service.ts index 4e415476f5887..40997df1076da 100644 --- a/packages/core/src/browser/window/default-secondary-window-service.ts +++ b/packages/core/src/browser/window/default-secondary-window-service.ts @@ -20,11 +20,15 @@ import { ExtractableWidget } from '../widgets'; import { ApplicationShell } from '../shell'; import { Saveable } from '../saveable'; import { PreferenceService } from '../preferences'; -import { environment } from '../../common'; +import { Emitter, environment, Event } from '../../common'; import { SaveableService } from '../saveable-service'; @injectable() export class DefaultSecondaryWindowService implements SecondaryWindowService { + protected readonly onWindowOpenedEmitter = new Emitter; + readonly onWindowOpened: Event = this.onWindowOpenedEmitter.event; + protected readonly onWindowClosedEmitter = new Emitter; + readonly onWindowClosed: Event = this.onWindowClosedEmitter.event; // secondary-window.html is part of Theia's generated code. It is generated by dev-packages/application-manager/src/generator/frontend-generator.ts protected static SECONDARY_WINDOW_URL = 'secondary-window.html'; @@ -94,6 +98,7 @@ export class DefaultSecondaryWindowService implements SecondaryWindowService { const newWindow = window.open(DefaultSecondaryWindowService.SECONDARY_WINDOW_URL, this.nextWindowId(), options) ?? undefined; if (newWindow) { this.secondaryWindows.push(newWindow); + this.onWindowOpenedEmitter.fire(newWindow); newWindow.addEventListener('DOMContentLoaded', () => { newWindow.addEventListener('beforeunload', evt => { const saveable = Saveable.get(widget); @@ -113,6 +118,7 @@ export class DefaultSecondaryWindowService implements SecondaryWindowService { const extIndex = this.secondaryWindows.indexOf(newWindow); if (extIndex > -1) { + this.onWindowClosedEmitter.fire(newWindow) this.secondaryWindows.splice(extIndex, 1); }; }); diff --git a/packages/core/src/browser/window/secondary-window-service.ts b/packages/core/src/browser/window/secondary-window-service.ts index 84e45cc9cfae8..b73840b9381f0 100644 --- a/packages/core/src/browser/window/secondary-window-service.ts +++ b/packages/core/src/browser/window/secondary-window-service.ts @@ -14,6 +14,7 @@ // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0 // ***************************************************************************** +import { Event } from '../../common'; import { ApplicationShell } from '../shell'; import { ExtractableWidget } from '../widgets'; @@ -33,6 +34,8 @@ export interface SecondaryWindowService { * @returns the created window or `undefined` if it could not be created */ createSecondaryWindow(widget: ExtractableWidget, shell: ApplicationShell): Window | undefined; + readonly onWindowOpened: Event; + readonly onWindowClosed: Event; /** Handles focussing the given secondary window in the browser and on Electron. */ focus(win: Window): void; diff --git a/packages/debug/package.json b/packages/debug/package.json index afbfb9435e917..4c7c42f2c7f67 100644 --- a/packages/debug/package.json +++ b/packages/debug/package.json @@ -9,7 +9,7 @@ "@theia/filesystem": "1.57.0", "@theia/markers": "1.57.0", "@theia/monaco": "1.57.0", - "@theia/monaco-editor-core": "1.83.101", + "@theia/monaco-editor-core": "1.96.3", "@theia/output": "1.57.0", "@theia/process": "1.57.0", "@theia/task": "1.57.0", diff --git a/packages/debug/src/browser/disassembly-view/disassembly-view-widget.ts b/packages/debug/src/browser/disassembly-view/disassembly-view-widget.ts index 52268785d1ace..3e6ae76437d3e 100644 --- a/packages/debug/src/browser/disassembly-view/disassembly-view-widget.ts +++ b/packages/debug/src/browser/disassembly-view/disassembly-view-widget.ts @@ -27,7 +27,7 @@ import { BareFontInfo } from '@theia/monaco-editor-core/esm/vs/editor/common/con import { WorkbenchTable } from '@theia/monaco-editor-core/esm/vs/platform/list/browser/listService'; import { DebugState, DebugSession } from '../debug-session'; import { EditorPreferences } from '@theia/editor/lib/browser'; -import { PixelRatio } from '@theia/monaco-editor-core/esm/vs/base/browser/browser'; +import { PixelRatio } from '@theia/monaco-editor-core/esm/vs/base/browser/pixelRatio'; import { DebugPreferences } from '../debug-preferences'; import { DebugThread } from '../model/debug-thread'; import { Event } from '@theia/monaco-editor-core/esm/vs/base/common/event'; @@ -89,8 +89,8 @@ export class DisassemblyViewWidget extends BaseWidget { this.node.tabIndex = -1; this.node.style.outline = 'none'; this._previousDebuggingState = this.debugSessionManager.currentSession?.state ?? DebugState.Inactive; - this._fontInfo = BareFontInfo.createFromRawSettings(this.toFontInfo(), PixelRatio.value); - this.editorPreferences.onPreferenceChanged(() => this._fontInfo = BareFontInfo.createFromRawSettings(this.toFontInfo(), PixelRatio.value)); + this._fontInfo = BareFontInfo.createFromRawSettings(this.toFontInfo(), PixelRatio.getInstance(window).value); + this.editorPreferences.onPreferenceChanged(() => this._fontInfo = BareFontInfo.createFromRawSettings(this.toFontInfo(), PixelRatio.getInstance(window).value)); this.debugPreferences.onPreferenceChanged(e => { if (e.preferenceName === 'debug.disassemblyView.showSourceCode' && e.newValue !== this._enableSourceCodeRender) { this._enableSourceCodeRender = e.newValue; diff --git a/packages/editor/src/browser/editor-contribution.ts b/packages/editor/src/browser/editor-contribution.ts index 00dca84019da8..03c852f99229b 100644 --- a/packages/editor/src/browser/editor-contribution.ts +++ b/packages/editor/src/browser/editor-contribution.ts @@ -22,7 +22,8 @@ import { FrontendApplicationContribution, DiffUris, DockLayout, QuickInputService, KeybindingRegistry, KeybindingContribution, SHELL_TABBAR_CONTEXT_SPLIT, ApplicationShell, WidgetStatusBarContribution, - Widget + Widget, + OpenWithService } from '@theia/core/lib/browser'; import { ContextKeyService } from '@theia/core/lib/browser/context-key-service'; import { CommandHandler, DisposableCollection, MenuContribution, MenuModelRegistry } from '@theia/core'; @@ -39,6 +40,7 @@ export class EditorContribution implements FrontendApplicationContribution, CommandContribution, KeybindingContribution, MenuContribution, WidgetStatusBarContribution { @inject(EditorManager) protected readonly editorManager: EditorManager; + @inject(OpenWithService) protected readonly openWithService: OpenWithService; @inject(EditorLanguageStatusService) protected readonly languageStatusService: EditorLanguageStatusService; @inject(ApplicationShell) protected readonly shell: ApplicationShell; @@ -50,6 +52,16 @@ export class EditorContribution implements FrontendApplicationContribution, onStart(): void { this.initEditorContextKeys(); + this.openWithService.registerHandler({ + id: 'default', + label: this.editorManager.label, + providerName: nls.localizeByDefault('Built-in'), + canHandle: () => 100, + // Higher priority than any other handler + // so that the text editor always appears first in the quick pick + getOrder: () => 10000, + open: uri => this.editorManager.open(uri) + }); } protected initEditorContextKeys(): void { diff --git a/packages/editor/src/browser/editor-generated-preference-schema.ts b/packages/editor/src/browser/editor-generated-preference-schema.ts index 63b69a675c424..79d89d8a26af8 100644 --- a/packages/editor/src/browser/editor-generated-preference-schema.ts +++ b/packages/editor/src/browser/editor-generated-preference-schema.ts @@ -81,25 +81,20 @@ export const editorGeneratedPreferenceProperties: PreferenceSchema['properties'] "restricted": false }, "editor.wordBasedSuggestions": { - "type": "boolean", - "default": true, - "description": nls.localize("theia/editor/editor.wordBasedSuggestions", "Controls whether completions should be computed based on words in the document."), - "scope": "language-overridable", - "restricted": false - }, - "editor.wordBasedSuggestionsMode": { "enum": [ + "off", "currentDocument", "matchingDocuments", "allDocuments" ], "default": "matchingDocuments", "enumDescriptions": [ + nls.localizeByDefault("Turn off Word Based Suggestions."), nls.localizeByDefault("Only suggest words from the active document."), nls.localizeByDefault("Suggest words from all open documents of the same language."), nls.localizeByDefault("Suggest words from all open documents.") ], - "description": nls.localize("theia/editor/editor.wordBasedSuggestionsMode", "Controls from which documents word based completions are computed."), + "description": nls.localizeByDefault("Controls whether completions should be computed based on words in the document and from which documents they are computed."), "scope": "language-overridable", "restricted": false }, @@ -135,7 +130,7 @@ export const editorGeneratedPreferenceProperties: PreferenceSchema['properties'] }, "editor.experimental.asyncTokenization": { "type": "boolean", - "default": false, + "default": true, "description": nls.localizeByDefault("Controls whether the tokenization should happen asynchronously on a web worker."), "tags": [ "experimental" @@ -160,6 +155,33 @@ export const editorGeneratedPreferenceProperties: PreferenceSchema['properties'] "scope": "language-overridable", "restricted": false }, + "editor.experimental.treeSitterTelemetry": { + "type": "boolean", + "default": false, + "markdownDescription": nls.localize("theia/editor/editor.experimental.treeSitterTelemetry", "Controls whether tree sitter parsing should be turned on and telemetry collected. Setting `editor.experimental.preferTreeSitter` for specific languages will take precedence."), + "tags": [ + "experimental", + "onExP" + ], + "scope": "language-overridable", + "restricted": false + }, + "editor.experimental.preferTreeSitter": { + "type": "array", + "items": { + "type": "string", + "enum": [ + "typescript" + ] + }, + "default": [], + "markdownDescription": nls.localize("theia/editor/editor.experimental.preferTreeSitter", "Controls whether tree sitter parsing should be turned on for specific languages. This will take precedence over `editor.experimental.treeSitterTelemetry` for the specified languages."), + "tags": [ + "experimental" + ], + "scope": "language-overridable", + "restricted": false + }, "editor.language.brackets": { "type": [ "array", @@ -248,6 +270,13 @@ export const editorGeneratedPreferenceProperties: PreferenceSchema['properties'] "scope": "language-overridable", "restricted": false }, + "diffEditor.renderGutterMenu": { + "type": "boolean", + "default": true, + "description": nls.localizeByDefault("When enabled, the diff editor shows a special gutter for revert and stage actions."), + "scope": "language-overridable", + "restricted": false + }, "diffEditor.ignoreTrimWhitespace": { "type": "boolean", "default": true, @@ -296,9 +325,6 @@ export const editorGeneratedPreferenceProperties: PreferenceSchema['properties'] nls.localizeByDefault("Uses the legacy diffing algorithm."), nls.localizeByDefault("Uses the advanced diffing algorithm.") ], - "tags": [ - "experimental" - ], "scope": "language-overridable", "restricted": false }, @@ -347,6 +373,13 @@ export const editorGeneratedPreferenceProperties: PreferenceSchema['properties'] "scope": "language-overridable", "restricted": false }, + "diffEditor.experimental.useTrueInlineView": { + "type": "boolean", + "default": false, + "description": nls.localize("theia/editor/diffEditor.experimental.useTrueInlineView", "If enabled and the editor uses the inline view, word changes are rendered inline."), + "scope": "language-overridable", + "restricted": false + }, "editor.acceptSuggestionOnCommitCharacter": { "markdownDescription": nls.localizeByDefault("Controls whether suggestions should be accepted on commit characters. For example, in JavaScript, the semi-colon (`;`) can be a commit character that accepts a suggestion and types that character."), "type": "boolean", @@ -379,9 +412,9 @@ export const editorGeneratedPreferenceProperties: PreferenceSchema['properties'] "off" ], "enumDescriptions": [ - nls.localize("theia/editor/editor.accessibilitySupport0", "Use platform APIs to detect when a Screen Reader is attached"), - nls.localize("theia/editor/editor.accessibilitySupport1", "Optimize for usage with a Screen Reader"), - nls.localize("theia/editor/editor.accessibilitySupport2", "Assume a screen reader is not attached") + nls.localizeByDefault("Use platform APIs to detect when a Screen Reader is attached."), + nls.localizeByDefault("Optimize for usage with a Screen Reader."), + nls.localizeByDefault("Assume a screen reader is not attached.") ], "default": "auto", "tags": [ @@ -731,7 +764,7 @@ export const editorGeneratedPreferenceProperties: PreferenceSchema['properties'] "restricted": false }, "editor.cursorStyle": { - "description": nls.localizeByDefault("Controls the cursor style."), + "description": nls.localize("theia/editor/editor.cursorStyle", "Controls the cursor style in insert input mode."), "type": "string", "enum": [ "line", @@ -788,7 +821,7 @@ export const editorGeneratedPreferenceProperties: PreferenceSchema['properties'] "editor.dropIntoEditor.enabled": { "type": "boolean", "default": true, - "markdownDescription": nls.localize("theia/editor/editor.dropIntoEditor.enabled", "Controls whether you can drag and drop a file into a text editor by holding down `shift` (instead of opening the file in an editor)."), + "markdownDescription": nls.localizeByDefault("Controls whether you can drag and drop a file into a text editor by holding down the `Shift` key (instead of opening the file in an editor)."), "scope": "language-overridable", "restricted": false }, @@ -807,6 +840,14 @@ export const editorGeneratedPreferenceProperties: PreferenceSchema['properties'] "scope": "language-overridable", "restricted": false }, + "editor.experimentalEditContextEnabled": { + "description": nls.localize("theia/editor/editor.experimentalEditContextEnabled", "Sets whether the new experimental edit context should be used instead of the text area."), + "included": true, + "type": "boolean", + "default": false, + "scope": "language-overridable", + "restricted": false + }, "editor.emptySelectionClipboard": { "description": nls.localizeByDefault("Controls whether copying without a selection copies the current line."), "type": "boolean", @@ -893,6 +934,21 @@ export const editorGeneratedPreferenceProperties: PreferenceSchema['properties'] "scope": "language-overridable", "restricted": false }, + "editor.find.history": { + "type": "string", + "enum": [ + "never", + "workspace" + ], + "default": "workspace", + "enumDescriptions": [ + nls.localize("theia/editor/editor.find.history0", "Do not store search history from the find widget."), + nls.localize("theia/editor/editor.find.history1", "Store search history across the active workspace") + ], + "description": nls.localize("theia/editor/editor.find.history", "Controls how the find widget history should be stored"), + "scope": "language-overridable", + "restricted": false + }, "editor.folding": { "description": nls.localizeByDefault("Controls whether the editor has code folding enabled."), "type": "boolean", @@ -1049,6 +1105,10 @@ export const editorGeneratedPreferenceProperties: PreferenceSchema['properties'] }, "editor.gotoLocation.multiple": { "deprecationMessage": "This setting is deprecated, please use separate settings like 'editor.editor.gotoLocation.multipleDefinitions' or 'editor.editor.gotoLocation.multipleImplementations' instead.", + "type": [ + "string", + "null" + ], "default": null, "scope": "language-overridable", "restricted": false @@ -1277,7 +1337,7 @@ export const editorGeneratedPreferenceProperties: PreferenceSchema['properties'] "type": "integer", "minimum": 0, "default": 300, - "description": nls.localize("theia/editor/editor.hover.hidingDelay", "Controls the delay in milliseconds after thich the hover is hidden. Requires `editor.hover.sticky` to be enabled."), + "description": nls.localizeByDefault("Controls the delay in milliseconds after which the hover is hidden. Requires `editor.hover.sticky` to be enabled."), "scope": "language-overridable", "restricted": false }, @@ -1300,16 +1360,25 @@ export const editorGeneratedPreferenceProperties: PreferenceSchema['properties'] "default": "onHover", "enum": [ "always", - "onHover" + "onHover", + "never" ], "enumDescriptions": [ nls.localizeByDefault("Show the inline suggestion toolbar whenever an inline suggestion is shown."), - nls.localizeByDefault("Show the inline suggestion toolbar when hovering over an inline suggestion.") + nls.localizeByDefault("Show the inline suggestion toolbar when hovering over an inline suggestion."), + nls.localizeByDefault("Never show the inline suggestion toolbar.") ], "description": nls.localizeByDefault("Controls when to show the inline suggestion toolbar."), "scope": "language-overridable", "restricted": false }, + "editor.inlineSuggest.syntaxHighlightingEnabled": { + "type": "boolean", + "default": false, + "description": nls.localize("theia/editor/editor.inlineSuggest.syntaxHighlightingEnabled", "Controls whether to show syntax highlighting for inline suggestions in the editor."), + "scope": "language-overridable", + "restricted": false + }, "editor.inlineSuggest.suppressSuggestions": { "type": "boolean", "default": false, @@ -1317,6 +1386,50 @@ export const editorGeneratedPreferenceProperties: PreferenceSchema['properties'] "scope": "language-overridable", "restricted": false }, + "editor.inlineSuggest.fontFamily": { + "type": "string", + "default": "default", + "description": nls.localizeByDefault("Controls the font family of the inline suggestions."), + "scope": "language-overridable", + "restricted": false + }, + "editor.inlineSuggest.edits.experimental.enabled": { + "type": "boolean", + "default": true, + "description": nls.localize("theia/editor/editor.inlineSuggest.edits.experimental.enabled", "Controls whether to enable experimental edits in inline suggestions."), + "scope": "language-overridable", + "restricted": false + }, + "editor.inlineSuggest.edits.experimental.useMixedLinesDiff": { + "type": "string", + "default": "never", + "description": nls.localize("theia/editor/editor.inlineSuggest.edits.experimental.useMixedLinesDiff", "Controls whether to enable experimental edits in inline suggestions."), + "enum": [ + "never", + "whenPossible" + ], + "scope": "language-overridable", + "restricted": false + }, + "editor.inlineSuggest.edits.experimental.useInterleavedLinesDiff": { + "type": "string", + "default": "never", + "description": nls.localize("theia/editor/editor.inlineSuggest.edits.experimental.useInterleavedLinesDiff", "Controls whether to enable experimental interleaved lines diff in inline suggestions."), + "enum": [ + "never", + "always", + "afterJump" + ], + "scope": "language-overridable", + "restricted": false + }, + "editor.inlineSuggest.edits.experimental.onlyShowWhenCloseToCursor": { + "type": "boolean", + "default": true, + "description": nls.localize("theia/editor/editor.inlineSuggest.edits.experimental.onlyShowWhenCloseToCursor", "Controls whether to only show inline suggestions when the cursor is close to the suggestion."), + "scope": "language-overridable", + "restricted": false + }, "editor.letterSpacing": { "description": nls.localizeByDefault("Controls the letter spacing in pixels."), "type": "number", @@ -1325,8 +1438,18 @@ export const editorGeneratedPreferenceProperties: PreferenceSchema['properties'] "restricted": false }, "editor.lightbulb.enabled": { - "type": "boolean", - "default": true, + "type": "string", + "enum": [ + "off", + "onCode", + "on" + ], + "default": "onCode", + "enumDescriptions": [ + nls.localizeByDefault("Disable the code action menu."), + nls.localizeByDefault("Show the code action menu when the cursor is on lines with code."), + nls.localizeByDefault("Show the code action menu when the cursor is on lines with code or on empty lines.") + ], "description": nls.localizeByDefault("Enables the Code Action lightbulb in the editor."), "scope": "language-overridable", "restricted": false @@ -1464,6 +1587,34 @@ export const editorGeneratedPreferenceProperties: PreferenceSchema['properties'] "scope": "language-overridable", "restricted": false }, + "editor.minimap.showRegionSectionHeaders": { + "type": "boolean", + "default": true, + "description": nls.localizeByDefault("Controls whether named regions are shown as section headers in the minimap."), + "scope": "language-overridable", + "restricted": false + }, + "editor.minimap.showMarkSectionHeaders": { + "type": "boolean", + "default": true, + "description": nls.localizeByDefault("Controls whether MARK: comments are shown as section headers in the minimap."), + "scope": "language-overridable", + "restricted": false + }, + "editor.minimap.sectionHeaderFontSize": { + "type": "number", + "default": 9, + "description": nls.localizeByDefault("Controls the font size of section headers in the minimap."), + "scope": "language-overridable", + "restricted": false + }, + "editor.minimap.sectionHeaderLetterSpacing": { + "type": "number", + "default": 1, + "description": nls.localize("theia/editor/editor.minimap.sectionHeaderLetterSpacing", "Controls the amount of space (in pixels) between characters of section header. This helps the readability of the header in small font sizes."), + "scope": "language-overridable", + "restricted": false + }, "editor.mouseWheelScrollSensitivity": { "markdownDescription": nls.localizeByDefault("A multiplier to be used on the `deltaX` and `deltaY` of mouse wheel scroll events."), "type": "number", @@ -1525,7 +1676,51 @@ export const editorGeneratedPreferenceProperties: PreferenceSchema['properties'] "restricted": false }, "editor.occurrencesHighlight": { - "description": nls.localize("theia/editor/editor.occurrencesHighlight", "Controls whether the editor should highlight semantic symbol occurrences."), + "markdownEnumDescriptions": [ + nls.localizeByDefault("Does not highlight occurrences."), + nls.localizeByDefault("Highlights occurrences only in the current file."), + nls.localizeByDefault("Experimental: Highlights occurrences across all valid open files.") + ], + "markdownDescription": nls.localizeByDefault("Controls whether occurrences should be highlighted across open files."), + "type": "string", + "enum": [ + "off", + "singleFile", + "multiFile" + ], + "default": "singleFile", + "scope": "language-overridable", + "restricted": false + }, + "editor.occurrencesHighlightDelay": { + "description": nls.localize("theia/editor/editor.occurrencesHighlightDelay", "Controls the delay in milliseconds after which occurrences are highlighted."), + "tags": [ + "preview" + ], + "type": "integer", + "default": 250, + "minimum": 0, + "maximum": 2000, + "scope": "language-overridable", + "restricted": false + }, + "editor.overtypeCursorStyle": { + "description": nls.localize("theia/editor/editor.overtypeCursorStyle", "Controls the cursor style in overtype input mode."), + "type": "string", + "enum": [ + "line", + "block", + "underline", + "line-thin", + "block-outline", + "underline-thin" + ], + "default": "block", + "scope": "language-overridable", + "restricted": false + }, + "editor.overtypeOnPaste": { + "description": nls.localize("theia/editor/editor.overtypeOnPaste", "Controls whether pasting should overtype."), "type": "boolean", "default": true, "scope": "language-overridable", @@ -1690,7 +1885,7 @@ export const editorGeneratedPreferenceProperties: PreferenceSchema['properties'] "comments": "off", "strings": "off" }, - "markdownDescription": nls.localize("theia/editor/editor.quickSuggestions", "Controls whether suggestions should automatically show up while typing. This can be controlled for typing in comments, strings, and other code. Quick suggestion can be configured to show as ghost text or with the suggest widget. Also be aware of the '#editor.suggestOnTriggerCharacters#'-setting which controls if suggestions are triggered by special characters."), + "markdownDescription": nls.localize("theia/editor/editor.quickSuggestions", "Controls whether suggestions should automatically show up while typing. This can be controlled for typing in comments, strings, and other code. Quick suggestion can be configured to show as ghost text or with the suggest widget. Also be aware of the `#editor.suggestOnTriggerCharacters#`-setting which controls if suggestions are triggered by special characters."), "scope": "language-overridable", "restricted": false }, @@ -1871,6 +2066,13 @@ export const editorGeneratedPreferenceProperties: PreferenceSchema['properties'] "scope": "language-overridable", "restricted": false }, + "editor.scrollbar.ignoreHorizontalScrollbarInContentHeight": { + "type": "boolean", + "default": false, + "description": nls.localizeByDefault("When set, the horizontal scrollbar will not increase the size of the editor's content."), + "scope": "language-overridable", + "restricted": false + }, "editor.scrollBeyondLastColumn": { "description": nls.localizeByDefault("Controls the number of extra characters beyond which the editor will scroll horizontally."), "type": "integer", @@ -1967,7 +2169,7 @@ export const editorGeneratedPreferenceProperties: PreferenceSchema['properties'] }, "editor.stickyScroll.enabled": { "type": "boolean", - "default": false, + "default": true, "description": nls.localizeByDefault("Shows the nested current scopes during the scroll at the top of the editor."), "scope": "language-overridable", "restricted": false @@ -1976,7 +2178,7 @@ export const editorGeneratedPreferenceProperties: PreferenceSchema['properties'] "type": "number", "default": 5, "minimum": 1, - "maximum": 10, + "maximum": 20, "description": nls.localizeByDefault("Defines the maximum number of sticky lines to show."), "scope": "language-overridable", "restricted": false @@ -1996,7 +2198,7 @@ export const editorGeneratedPreferenceProperties: PreferenceSchema['properties'] "editor.stickyScroll.scrollWithEditor": { "type": "boolean", "default": true, - "description": nls.localize("theia/editor/editor.stickyScroll.scrollWithEditor", "Enable scrolling of the sticky scroll widget with the editor's horizontal scrollbar."), + "description": nls.localizeByDefault("Enable scrolling of Sticky Scroll with the editor's horizontal scrollbar."), "scope": "language-overridable", "restricted": false }, @@ -2480,7 +2682,7 @@ export const editorGeneratedPreferenceProperties: PreferenceSchema['properties'] "restricted": false }, "editor.useTabStops": { - "description": nls.localize("theia/editor/editor.useTabStops", "Inserting and deleting whitespace follows tab stops."), + "description": nls.localizeByDefault("Spaces and tabs are inserted and deleted in alignment with tab stops."), "type": "boolean", "default": true, "scope": "language-overridable", @@ -2501,6 +2703,24 @@ export const editorGeneratedPreferenceProperties: PreferenceSchema['properties'] "scope": "language-overridable", "restricted": false }, + "editor.wordSegmenterLocales": { + "anyOf": [ + { + "description": nls.localizeByDefault("Locales to be used for word segmentation when doing word related navigations or operations. Specify the BCP 47 language tag of the word you wish to recognize (e.g., ja, zh-CN, zh-Hant-TW, etc.)."), + "type": "string" + }, + { + "description": nls.localizeByDefault("Locales to be used for word segmentation when doing word related navigations or operations. Specify the BCP 47 language tag of the word you wish to recognize (e.g., ja, zh-CN, zh-Hant-TW, etc.)."), + "type": "array", + "items": { + "type": "string" + } + } + ], + "default": [], + "scope": "language-overridable", + "restricted": false + }, "editor.wordSeparators": { "description": nls.localizeByDefault("Characters that will be used as word separators when doing word related navigations or operations."), "type": "string", @@ -2617,6 +2837,13 @@ export const editorGeneratedPreferenceProperties: PreferenceSchema['properties'] "scope": "language-overridable", "restricted": false }, + "editor.inlayHints.maximumLength": { + "type": "number", + "default": 43, + "markdownDescription": nls.localize("theia/editor/editor.inlayHints.maximumLength", "Maximum overall length of inlay hints, for a single line, before they get truncated by the editor. Set to `0` to never truncate"), + "scope": "language-overridable", + "restricted": false + }, "editor.tabFocusMode": { "markdownDescription": nls.localizeByDefault("Controls whether the editor receives tabs or defers them to the workbench for navigation."), "type": "boolean", @@ -2625,9 +2852,19 @@ export const editorGeneratedPreferenceProperties: PreferenceSchema['properties'] "restricted": false }, "editor.defaultColorDecorators": { - "markdownDescription": nls.localizeByDefault("Controls whether inline color decorations should be shown using the default document color provider"), - "type": "boolean", - "default": false, + "enumDescriptions": [ + nls.localize("theia/editor/editor.defaultColorDecorators0", "Show default color decorators only when no extension provides colors decorators."), + nls.localize("theia/editor/editor.defaultColorDecorators1", "Always show default color decorators."), + nls.localize("theia/editor/editor.defaultColorDecorators2", "Never show default color decorators.") + ], + "description": nls.localize("theia/editor/editor.defaultColorDecorators", "Controls whether inline color decorations should be shown using the default document color provider."), + "type": "string", + "enum": [ + "auto", + "always", + "never" + ], + "default": "auto", "scope": "language-overridable", "restricted": false }, @@ -2662,21 +2899,18 @@ export const editorGeneratedPreferenceProperties: PreferenceSchema['properties'] "default": true, "restricted": false }, - "editor.codeActionWidget.includeNearbyQuickfixes": { + "editor.codeActionWidget.includeNearbyQuickFixes": { "type": "boolean", "scope": "language-overridable", - "description": nls.localize("theia/editor/editor.codeActionWidget.includeNearbyQuickfixes", "Enable/disable showing nearest quickfix within a line when not currently on a diagnostic."), - "default": false, + "description": nls.localizeByDefault("Enable/disable showing nearest Quick Fix within a line when not currently on a diagnostic."), + "default": true, "restricted": false }, - "editor.experimental.dropIntoEditor.defaultProvider": { - "type": "object", + "editor.codeActions.triggerOnFocusChange": { + "type": "boolean", "scope": "language-overridable", - "description": nls.localizeByDefault("Configures the default drop provider to use for content of a given mime type."), - "default": {}, - "additionalProperties": { - "type": "string" - }, + "markdownDescription": nls.localize("theia/editor/editor.codeActions.triggerOnFocusChange", "Enable triggering `#editor.codeActionsOnSave#` when `#files.autoSave#` is set to `afterDelay`. Code Actions must be set to `always` to be triggered for window and focus changes."), + "default": false, "restricted": false }, "editor.rename.enablePreview": { @@ -2700,8 +2934,6 @@ export const editorGeneratedPreferenceProperties: PreferenceSchema['properties'] } }; -type QuickSuggestionValues = boolean | 'on' | 'inline' | 'off'; - export interface GeneratedEditorPreferences { 'editor.tabSize': number; 'editor.indentSize': 'tabSize' | number; @@ -2709,22 +2941,24 @@ export interface GeneratedEditorPreferences { 'editor.detectIndentation': boolean; 'editor.trimAutoWhitespace': boolean; 'editor.largeFileOptimizations': boolean; - 'editor.wordBasedSuggestions': boolean; - 'editor.wordBasedSuggestionsMode': 'currentDocument' | 'matchingDocuments' | 'allDocuments'; + 'editor.wordBasedSuggestions': 'off' | 'currentDocument' | 'matchingDocuments' | 'allDocuments'; 'editor.semanticHighlighting.enabled': true | false | 'configuredByTheme'; 'editor.stablePeek': boolean; 'editor.maxTokenizationLineLength': number; 'editor.experimental.asyncTokenization': boolean; 'editor.experimental.asyncTokenizationLogging': boolean; 'editor.experimental.asyncTokenizationVerification': boolean; - 'editor.language.brackets': Array<[string, string]> | null | 'null'; - 'editor.language.colorizedBracketPairs': Array<[string, string]> | null; + 'editor.experimental.treeSitterTelemetry': boolean; + 'editor.experimental.preferTreeSitter': 'typescript'[]; + 'editor.language.brackets': string[][] | 'null'; + 'editor.language.colorizedBracketPairs': string[][] | 'null'; 'diffEditor.maxComputationTime': number; 'diffEditor.maxFileSize': number; 'diffEditor.renderSideBySide': boolean; 'diffEditor.renderSideBySideInlineBreakpoint': number; 'diffEditor.useInlineViewWhenSpaceIsLimited': boolean; 'diffEditor.renderMarginRevertIcon': boolean; + 'diffEditor.renderGutterMenu': boolean; 'diffEditor.ignoreTrimWhitespace': boolean; 'diffEditor.renderIndicators': boolean; 'diffEditor.codeLens': boolean; @@ -2736,6 +2970,7 @@ export interface GeneratedEditorPreferences { 'diffEditor.hideUnchangedRegions.contextLineCount': number; 'diffEditor.experimental.showMoves': boolean; 'diffEditor.experimental.showEmptyDecorations': boolean; + 'diffEditor.experimental.useTrueInlineView': boolean; 'editor.acceptSuggestionOnCommitCharacter': boolean; 'editor.acceptSuggestionOnEnter': 'on' | 'smart' | 'off'; 'editor.accessibilitySupport': 'auto' | 'on' | 'off'; @@ -2773,6 +3008,7 @@ export interface GeneratedEditorPreferences { 'editor.dragAndDrop': boolean; 'editor.dropIntoEditor.enabled': boolean; 'editor.dropIntoEditor.showDropSelector': 'afterDrop' | 'never'; + 'editor.experimentalEditContextEnabled': boolean; 'editor.emptySelectionClipboard': boolean; 'editor.experimentalWhitespaceRendering': 'svg' | 'font' | 'off'; 'editor.fastScrollSensitivity': number; @@ -2781,6 +3017,7 @@ export interface GeneratedEditorPreferences { 'editor.find.autoFindInSelection': 'never' | 'always' | 'multiline'; 'editor.find.addExtraSpaceOnTop': boolean; 'editor.find.loop': boolean; + 'editor.find.history': 'never' | 'workspace'; 'editor.folding': boolean; 'editor.foldingStrategy': 'auto' | 'indentation'; 'editor.foldingHighlight': boolean; @@ -2790,12 +3027,12 @@ export interface GeneratedEditorPreferences { 'editor.fontFamily': string; 'editor.fontLigatures': boolean | string; 'editor.fontSize': number; - 'editor.fontWeight': number | string | 'normal' | 'bold' | '100' | '200' | '300' | '400' | '500' | '600' | '700' | '800' | '900'; + 'editor.fontWeight': number | string | ('normal' | 'bold' | '100' | '200' | '300' | '400' | '500' | '600' | '700' | '800' | '900'); 'editor.fontVariations': boolean | string; 'editor.formatOnPaste': boolean; 'editor.formatOnType': boolean; 'editor.glyphMargin': boolean; - 'editor.gotoLocation.multiple': null; + 'editor.gotoLocation.multiple': string | null; 'editor.gotoLocation.multipleDefinitions': 'peek' | 'gotoAndPeek' | 'goto'; 'editor.gotoLocation.multipleTypeDefinitions': 'peek' | 'gotoAndPeek' | 'goto'; 'editor.gotoLocation.multipleDeclarations': 'peek' | 'gotoAndPeek' | 'goto'; @@ -2813,10 +3050,16 @@ export interface GeneratedEditorPreferences { 'editor.hover.hidingDelay': number; 'editor.hover.above': boolean; 'editor.inlineSuggest.enabled': boolean; - 'editor.inlineSuggest.showToolbar': 'always' | 'onHover'; + 'editor.inlineSuggest.showToolbar': 'always' | 'onHover' | 'never'; + 'editor.inlineSuggest.syntaxHighlightingEnabled': boolean; 'editor.inlineSuggest.suppressSuggestions': boolean; + 'editor.inlineSuggest.fontFamily': string; + 'editor.inlineSuggest.edits.experimental.enabled': boolean; + 'editor.inlineSuggest.edits.experimental.useMixedLinesDiff': 'never' | 'whenPossible'; + 'editor.inlineSuggest.edits.experimental.useInterleavedLinesDiff': 'never' | 'always' | 'afterJump'; + 'editor.inlineSuggest.edits.experimental.onlyShowWhenCloseToCursor': boolean; 'editor.letterSpacing': number; - 'editor.lightbulb.enabled': boolean; + 'editor.lightbulb.enabled': 'off' | 'onCode' | 'on'; 'editor.lineHeight': number; 'editor.lineNumbers': 'off' | 'on' | 'relative' | 'interval'; 'editor.linkedEditing': boolean; @@ -2830,13 +3073,20 @@ export interface GeneratedEditorPreferences { 'editor.minimap.scale': '1' | '2' | '3'; 'editor.minimap.renderCharacters': boolean; 'editor.minimap.maxColumn': number; + 'editor.minimap.showRegionSectionHeaders': boolean; + 'editor.minimap.showMarkSectionHeaders': boolean; + 'editor.minimap.sectionHeaderFontSize': number; + 'editor.minimap.sectionHeaderLetterSpacing': number; 'editor.mouseWheelScrollSensitivity': number; 'editor.mouseWheelZoom': boolean; 'editor.multiCursorMergeOverlapping': boolean; 'editor.multiCursorModifier': 'ctrlCmd' | 'alt'; 'editor.multiCursorPaste': 'spread' | 'full'; 'editor.multiCursorLimit': number; - 'editor.occurrencesHighlight': boolean; + 'editor.occurrencesHighlight': 'off' | 'singleFile' | 'multiFile'; + 'editor.occurrencesHighlightDelay': number; + 'editor.overtypeCursorStyle': 'line' | 'block' | 'underline' | 'line-thin' | 'block-outline' | 'underline-thin'; + 'editor.overtypeOnPaste': boolean; 'editor.overviewRulerBorder': boolean; 'editor.padding.top': number; 'editor.padding.bottom': number; @@ -2846,7 +3096,11 @@ export interface GeneratedEditorPreferences { 'editor.parameterHints.cycle': boolean; 'editor.peekWidgetDefaultFocus': 'tree' | 'editor'; 'editor.definitionLinkOpensInPeek': boolean; - 'editor.quickSuggestions': boolean | { other?: QuickSuggestionValues; comments?: QuickSuggestionValues; strings?: QuickSuggestionValues }; + 'editor.quickSuggestions': { + strings: 'on' | 'inline' | 'off', + comments: 'on' | 'inline' | 'off' + other: 'on' | 'inline' | 'off' + }; 'editor.quickSuggestionsDelay': number; 'editor.renameOnType': boolean; 'editor.renderControlCharacters': boolean; @@ -2855,12 +3109,13 @@ export interface GeneratedEditorPreferences { 'editor.renderLineHighlightOnlyWhenFocus': boolean; 'editor.renderWhitespace': 'none' | 'boundary' | 'selection' | 'trailing' | 'all'; 'editor.roundedSelection': boolean; - 'editor.rulers': Array; + 'editor.rulers': (number | { column: number, color: string })[]; 'editor.scrollbar.vertical': 'auto' | 'visible' | 'hidden'; 'editor.scrollbar.horizontal': 'auto' | 'visible' | 'hidden'; 'editor.scrollbar.verticalScrollbarSize': number; 'editor.scrollbar.horizontalScrollbarSize': number; 'editor.scrollbar.scrollByPage': boolean; + 'editor.scrollbar.ignoreHorizontalScrollbarInContentHeight': boolean; 'editor.scrollBeyondLastColumn': number; 'editor.scrollBeyondLastLine': boolean; 'editor.scrollPredominantAxis': boolean; @@ -2887,7 +3142,7 @@ export interface GeneratedEditorPreferences { 'editor.suggest.preview': boolean; 'editor.suggest.showInlineDetails': boolean; 'editor.suggest.maxVisibleSuggestions': number; - 'editor.suggest.filteredTypes': Record; + 'editor.suggest.filteredTypes': object; 'editor.suggest.showMethods': boolean; 'editor.suggest.showFunctions': boolean; 'editor.suggest.showConstructors': boolean; @@ -2933,6 +3188,7 @@ export interface GeneratedEditorPreferences { 'editor.unusualLineTerminators': 'auto' | 'off' | 'prompt'; 'editor.useTabStops': boolean; 'editor.wordBreak': 'normal' | 'keepAll'; + 'editor.wordSegmenterLocales': string | string[]; 'editor.wordSeparators': string; 'editor.wordWrap': 'off' | 'on' | 'wordWrapColumn' | 'bounded'; 'editor.wordWrapColumn': number; @@ -2943,13 +3199,14 @@ export interface GeneratedEditorPreferences { 'editor.inlayHints.fontSize': number; 'editor.inlayHints.fontFamily': string; 'editor.inlayHints.padding': boolean; + 'editor.inlayHints.maximumLength': number; 'editor.tabFocusMode': boolean; - 'editor.defaultColorDecorators': boolean; + 'editor.defaultColorDecorators': 'auto' | 'always' | 'never'; 'editor.colorDecoratorsActivatedOn': 'clickAndHover' | 'hover' | 'click'; 'editor.inlineCompletionsAccessibilityVerbose': boolean; 'editor.codeActionWidget.showHeaders': boolean; - 'editor.codeActionWidget.includeNearbyQuickfixes': boolean; - 'editor.experimental.dropIntoEditor.defaultProvider': null; + 'editor.codeActionWidget.includeNearbyQuickFixes': boolean; + 'editor.codeActions.triggerOnFocusChange': boolean; 'editor.rename.enablePreview': boolean; 'editor.find.globalFindClipboard': boolean; 'editor.selectionClipboard': boolean; diff --git a/packages/editor/src/browser/editor-manager.ts b/packages/editor/src/browser/editor-manager.ts index f8767a5b4a1cb..be949e7b210f8 100644 --- a/packages/editor/src/browser/editor-manager.ts +++ b/packages/editor/src/browser/editor-manager.ts @@ -18,7 +18,7 @@ import { injectable, postConstruct, inject } from '@theia/core/shared/inversify' import URI from '@theia/core/lib/common/uri'; import { RecursivePartial, Emitter, Event, MaybePromise, CommandService, nls } from '@theia/core/lib/common'; import { - WidgetOpenerOptions, NavigatableWidgetOpenHandler, NavigatableWidgetOptions, Widget, PreferenceService, CommonCommands, OpenWithService, getDefaultHandler, + WidgetOpenerOptions, NavigatableWidgetOpenHandler, NavigatableWidgetOptions, Widget, PreferenceService, CommonCommands, getDefaultHandler, defaultHandlerPriority } from '@theia/core/lib/browser'; import { EditorWidget } from './editor-widget'; @@ -59,7 +59,6 @@ export class EditorManager extends NavigatableWidgetOpenHandler { @inject(CommandService) protected readonly commands: CommandService; @inject(PreferenceService) protected readonly preferenceService: PreferenceService; - @inject(OpenWithService) protected readonly openWithService: OpenWithService; @postConstruct() protected override init(): void { @@ -88,16 +87,7 @@ export class EditorManager extends NavigatableWidgetOpenHandler { this.addRecentlyVisible(widget); } } - this.openWithService.registerHandler({ - id: 'default', - label: this.label, - providerName: nls.localizeByDefault('Built-in'), - canHandle: () => 100, - // Higher priority than any other handler - // so that the text editor always appears first in the quick pick - getOrder: () => 10000, - open: uri => this.open(uri) - }); + this.updateCurrentEditor(); } diff --git a/packages/file-search/src/browser/quick-file-open.ts b/packages/file-search/src/browser/quick-file-open.ts index beab936b56e04..da6a8d4b51050 100644 --- a/packages/file-search/src/browser/quick-file-open.ts +++ b/packages/file-search/src/browser/quick-file-open.ts @@ -318,8 +318,11 @@ export class QuickFileOpenService implements QuickAccessProvider { } private getItemIconClasses(uri: URI): string[] | undefined { - const icon = this.labelProvider.getIcon(uri); - return icon !== '' ? [icon + ' file-icon'] : []; + const icon = this.labelProvider.getIcon(uri).split(' '); + if (icon.length > 0) { + icon.push('file-icon') + } + return icon; } private getItemDescription(uri: URI): string { diff --git a/packages/git/package.json b/packages/git/package.json index 0e4bd0e2258ac..b4acd4983f8d7 100644 --- a/packages/git/package.json +++ b/packages/git/package.json @@ -6,7 +6,7 @@ "@theia/core": "1.57.0", "@theia/editor": "1.57.0", "@theia/filesystem": "1.57.0", - "@theia/monaco-editor-core": "1.83.101", + "@theia/monaco-editor-core": "1.96.3", "@theia/navigator": "1.57.0", "@theia/scm": "1.57.0", "@theia/scm-extra": "1.57.0", diff --git a/packages/keymaps/package.json b/packages/keymaps/package.json index 302779ca8372b..d5940e6e6b9b0 100644 --- a/packages/keymaps/package.json +++ b/packages/keymaps/package.json @@ -5,7 +5,7 @@ "dependencies": { "@theia/core": "1.57.0", "@theia/monaco": "1.57.0", - "@theia/monaco-editor-core": "1.83.101", + "@theia/monaco-editor-core": "1.96.3", "@theia/preferences": "1.57.0", "@theia/userstorage": "1.57.0", "jsonc-parser": "^2.2.0", diff --git a/packages/monaco/README.md b/packages/monaco/README.md index c3d46088be70f..d310baad1ea2b 100644 --- a/packages/monaco/README.md +++ b/packages/monaco/README.md @@ -35,13 +35,13 @@ process, the steps for undertaking a Monaco uplift are outlined here. 2. Find the latest release tag in the official VSCode repo, and the most recent uplift branch in the Theia fork. - > At the time of this writing the latest release tag is `1.67.2`, and the uplift branch is `monaco-uplift-2022-6` + > At the time of this writing the latest release tag is `1.96.3`, and the uplift branch is `monaco-uplift-1.96.3` 3. Check out the release tag, cherry pick the tip of the uplift branch, and resolve any conflicts. > As you resolve conflicts and make changes to the VSCode repo, make sure you end up with a single commit on the uplift branch to make it easier for the next person to rebase. -4. Try to build. At the moment, this means running `yarn` and `yarn run gulp editor-distro`. +4. Try to build. At the moment, this means running `npm install` and `npm run gulp editor-distro`. 5. Fix any build errors that arise. 6. Change the version in `build/monaco/package.json` diff --git a/packages/monaco/package.json b/packages/monaco/package.json index af1af5c0f3d72..44103f07566ea 100644 --- a/packages/monaco/package.json +++ b/packages/monaco/package.json @@ -7,7 +7,7 @@ "@theia/editor": "1.57.0", "@theia/filesystem": "1.57.0", "@theia/markers": "1.57.0", - "@theia/monaco-editor-core": "1.83.101", + "@theia/monaco-editor-core": "1.96.3", "@theia/outline-view": "1.57.0", "@theia/workspace": "1.57.0", "fast-plist": "^0.1.2", diff --git a/packages/monaco/src/browser/markdown-renderer/monaco-markdown-renderer.ts b/packages/monaco/src/browser/markdown-renderer/monaco-markdown-renderer.ts index dd46b027c06d8..5114df844e45a 100644 --- a/packages/monaco/src/browser/markdown-renderer/monaco-markdown-renderer.ts +++ b/packages/monaco/src/browser/markdown-renderer/monaco-markdown-renderer.ts @@ -16,7 +16,7 @@ import { inject, injectable, postConstruct } from '@theia/core/shared/inversify'; import { ILanguageService } from '@theia/monaco-editor-core/esm/vs/editor/common/languages/language'; -import { MarkdownRenderer as CodeMarkdownRenderer, IMarkdownRendererOptions } from '@theia/monaco-editor-core/esm/vs/editor/contrib/markdownRenderer/browser/markdownRenderer'; +import { MarkdownRenderer as CodeMarkdownRenderer, IMarkdownRendererOptions } from '@theia/monaco-editor-core/esm/vs/editor/browser/widget/markdownRenderer/browser/markdownRenderer'; import { StandaloneServices } from '@theia/monaco-editor-core/esm/vs/editor/standalone/browser/standaloneServices'; import * as monaco from '@theia/monaco-editor-core'; import { OpenerService, PreferenceService, WidgetOpenerOptions, open } from '@theia/core/lib/browser'; diff --git a/packages/monaco/src/browser/monaco-diff-editor.ts b/packages/monaco/src/browser/monaco-diff-editor.ts index 22f6722e36230..929231e632cc1 100644 --- a/packages/monaco/src/browser/monaco-diff-editor.ts +++ b/packages/monaco/src/browser/monaco-diff-editor.ts @@ -26,7 +26,7 @@ import { ICodeEditor, IDiffEditorConstructionOptions } from '@theia/monaco-edito import { IActionDescriptor, IStandaloneCodeEditor, IStandaloneDiffEditor, StandaloneCodeEditor, StandaloneDiffEditor2 } from '@theia/monaco-editor-core/esm/vs/editor/standalone/browser/standaloneCodeEditor'; import { IEditorConstructionOptions } from '@theia/monaco-editor-core/esm/vs/editor/browser/config/editorConfiguration'; -import { EmbeddedDiffEditorWidget } from '@theia/monaco-editor-core/esm/vs/editor/browser/widget/embeddedCodeEditorWidget'; +import { EmbeddedDiffEditorWidget } from '@theia/monaco-editor-core/esm/vs/editor/browser/widget/diffEditor/embeddedDiffEditorWidget'; import { IInstantiationService } from '@theia/monaco-editor-core/esm/vs/platform/instantiation/common/instantiation'; import { ContextKeyValue, IContextKey } from '@theia/monaco-editor-core/esm/vs/platform/contextkey/common/contextkey'; import { IDisposable } from '@theia/monaco-editor-core/esm/vs/base/common/lifecycle'; diff --git a/packages/monaco/src/browser/monaco-editor.ts b/packages/monaco/src/browser/monaco-editor.ts index 069e5ae66b4cf..8cb073b8812e8 100644 --- a/packages/monaco/src/browser/monaco-editor.ts +++ b/packages/monaco/src/browser/monaco-editor.ts @@ -51,7 +51,7 @@ import { ICodeEditor, IMouseTargetMargin } from '@theia/monaco-editor-core/esm/v import { IStandaloneEditorConstructionOptions, StandaloneCodeEditor, StandaloneEditor } from '@theia/monaco-editor-core/esm/vs/editor/standalone/browser/standaloneCodeEditor'; import { ServiceCollection } from '@theia/monaco-editor-core/esm/vs/platform/instantiation/common/serviceCollection'; import { MarkdownString } from '@theia/core/lib/common/markdown-rendering'; -import { ConfigurationChangedEvent, IEditorOptions } from '@theia/monaco-editor-core/esm/vs/editor/common/config/editorOptions'; +import { ConfigurationChangedEvent, IEditorOptions, ShowLightbulbIconMode } from '@theia/monaco-editor-core/esm/vs/editor/common/config/editorOptions'; import { ICodeEditorService } from '@theia/monaco-editor-core/esm/vs/editor/browser/services/codeEditorService'; import { ICommandService } from '@theia/monaco-editor-core/esm/vs/platform/commands/common/commands'; import { IContextKeyService } from '@theia/monaco-editor-core/esm/vs/platform/contextkey/common/contextkey'; @@ -63,6 +63,7 @@ import { ILanguageConfigurationService } from '@theia/monaco-editor-core/esm/vs/ import { ILanguageFeaturesService } from '@theia/monaco-editor-core/esm/vs/editor/common/services/languageFeatures'; import * as objects from '@theia/monaco-editor-core/esm/vs/base/common/objects'; import { Selection } from '@theia/editor/lib/browser/editor'; +import { IHoverService } from '@theia/monaco-editor-core/esm/vs/platform/hover/browser/hover'; export type ServicePair = [ServiceIdentifier, T]; @@ -150,7 +151,7 @@ export class MonacoEditor extends MonacoEditorServices implements TextEditor { protected create(options?: monaco.editor.IStandaloneEditorConstructionOptions | IStandaloneEditorConstructionOptions, override?: EditorServiceOverrides): Disposable { const combinedOptions = { ...options, - lightbulb: { enabled: true }, + lightbulb: { enabled: ShowLightbulbIconMode.On }, fixedOverflowWidgets: true, scrollbar: { useShadows: false, @@ -704,9 +705,21 @@ class EmbeddedCodeEditor extends StandaloneCodeEditor { @IAccessibilityService accessibilityService: IAccessibilityService, @ILanguageConfigurationService languageConfigurationService: ILanguageConfigurationService, @ILanguageFeaturesService languageFeaturesService: ILanguageFeaturesService, + @IHoverService hoverService: IHoverService ) { - super(domElement, { ...parentEditor.getRawOptions(), overflowWidgetsDomNode: parentEditor.getOverflowWidgetsDomNode() }, instantiationService, codeEditorService, - commandService, contextKeyService, keybindingService, themeService, notificationService, accessibilityService, languageConfigurationService, languageFeaturesService); + super(domElement, + { ...parentEditor.getRawOptions(), overflowWidgetsDomNode: parentEditor.getOverflowWidgetsDomNode() }, + instantiationService, + codeEditorService, + commandService, + contextKeyService, + hoverService, + keybindingService, + themeService, + notificationService, + accessibilityService, + languageConfigurationService, + languageFeaturesService); this._parentEditor = parentEditor; this._overwriteOptions = options; diff --git a/packages/monaco/src/browser/monaco-frontend-application-contribution.ts b/packages/monaco/src/browser/monaco-frontend-application-contribution.ts index e93e9700b8295..b5b788f74a495 100644 --- a/packages/monaco/src/browser/monaco-frontend-application-contribution.ts +++ b/packages/monaco/src/browser/monaco-frontend-application-contribution.ts @@ -33,9 +33,17 @@ import { MonacoEditor } from './monaco-editor'; import { StandaloneServices } from '@theia/monaco-editor-core/esm/vs/editor/standalone/browser/standaloneServices'; import { StandaloneThemeService } from '@theia/monaco-editor-core/esm/vs/editor/standalone/browser/standaloneThemeService'; import { IStandaloneThemeService } from '@theia/monaco-editor-core/esm/vs/editor/standalone/common/standaloneTheme'; +import { SecondaryWindowService } from '@theia/core/lib/browser/window/secondary-window-service'; +import { registerWindow } from '@theia/monaco-editor-core/esm/vs/base/browser/dom'; + +type CodeWindow = Window & typeof globalThis & { + vscodeWindowId: number; +}; @injectable() export class MonacoFrontendApplicationContribution implements FrontendApplicationContribution, StylingParticipant { + protected readonly windowsById = new Map(); + protected nextWindowId = 2; // the main window has the id "1" @inject(MonacoTextModelService) protected readonly textModelService: MonacoTextModelService; @@ -56,6 +64,9 @@ export class MonacoFrontendApplicationContribution implements FrontendApplicatio @inject(SecondaryWindowHandler) protected readonly secondaryWindowHandler: SecondaryWindowHandler; + @inject(SecondaryWindowService) + protected readonly secondaryWindowService: SecondaryWindowService; + @postConstruct() protected init(): void { this.addAdditionalPreferenceValidations(); @@ -98,6 +109,17 @@ export class MonacoFrontendApplicationContribution implements FrontendApplicatio themeService.registerEditorContainer(widget.node); } }); + this.secondaryWindowService.onWindowOpened(window => { + const codeWindow: CodeWindow = window as CodeWindow; + codeWindow.vscodeWindowId = this.nextWindowId++; + + this.windowsById.set(codeWindow.vscodeWindowId, registerWindow(codeWindow)); + }); + + this.secondaryWindowService.onWindowClosed(window => { + const codeWindow: CodeWindow = window as CodeWindow; + this.windowsById.get(codeWindow.vscodeWindowId)?.dispose(); + }); } registerThemeStyle(theme: ColorTheme, collector: CssStyleCollector): void { @@ -172,8 +194,7 @@ export class MonacoFrontendApplicationContribution implements FrontendApplicatio new editorBoolConstructor(id++, 'detectIndentation', true, editorGeneratedPreferenceProperties['editor.detectIndentation']), new editorBoolConstructor(id++, 'trimAutoWhitespace', true, editorGeneratedPreferenceProperties['editor.trimAutoWhitespace']), new editorBoolConstructor(id++, 'largeFileOptimizations', true, editorGeneratedPreferenceProperties['editor.largeFileOptimizations']), - new editorBoolConstructor(id++, 'wordBasedSuggestions', true, editorGeneratedPreferenceProperties['editor.wordBasedSuggestions']), - new editorStringEnumConstructor(id++, 'wordBasedSuggestionsMode', 'matchingDocuments', editorGeneratedPreferenceProperties['editor.wordBasedSuggestionsMode'].enum, editorGeneratedPreferenceProperties['editor.wordBasedSuggestionsMode']), + new editorStringEnumConstructor(id++, 'wordBasedSuggestions', 'matchingDocuments', editorGeneratedPreferenceProperties['editor.wordBasedSuggestions'].enum, editorGeneratedPreferenceProperties['editor.wordBasedSuggestions']), new editorBoolConstructor(id++, 'stablePeek', false, editorGeneratedPreferenceProperties['editor.stablePeek']), new editorIntConstructor(id++, 'maxTokenizationLineLength', 20000, 1, MAX_SAFE_INTEGER, editorGeneratedPreferenceProperties['editor.maxTokenizationLineLength']), ); diff --git a/packages/monaco/src/browser/monaco-frontend-module.ts b/packages/monaco/src/browser/monaco-frontend-module.ts index e7d727453bb07..2bfb2daf5b3f3 100644 --- a/packages/monaco/src/browser/monaco-frontend-module.ts +++ b/packages/monaco/src/browser/monaco-frontend-module.ts @@ -66,16 +66,17 @@ import { GotoLineQuickAccessContribution } from './monaco-gotoline-quick-access' import { GotoSymbolQuickAccessContribution } from './monaco-gotosymbol-quick-access'; import { QuickAccessContribution, QuickAccessRegistry } from '@theia/core/lib/browser/quick-input/quick-access'; import { MonacoQuickAccessRegistry } from './monaco-quick-access-registry'; -import { ConfigurationTarget, IConfigurationChangeEvent, IConfigurationService } from '@theia/monaco-editor-core/esm/vs/platform/configuration/common/configuration'; -import { StandaloneConfigurationService } from '@theia/monaco-editor-core/esm/vs/editor/standalone/browser/standaloneServices'; -import { Configuration } from '@theia/monaco-editor-core/esm/vs/platform/configuration/common/configurationModels'; +import { ConfigurationTarget, IConfigurationChangeEvent, IConfigurationService } from '@theia/monaco-editor-core/esm/vs/platform/configuration/common/configuration.js'; +import { StandaloneConfigurationService, StandaloneServices } from '@theia/monaco-editor-core/esm/vs/editor/standalone/browser/standaloneServices'; +import { Configuration } from '@theia/monaco-editor-core/esm/vs/platform/configuration/common/configurationModels.js'; import { MarkdownRenderer } from '@theia/core/lib/browser/markdown-rendering/markdown-renderer'; import { MonacoMarkdownRenderer } from './markdown-renderer/monaco-markdown-renderer'; import { ThemeService } from '@theia/core/lib/browser/theming'; import { ThemeServiceWithDB } from './monaco-indexed-db'; -import { IContextKeyService } from '@theia/monaco-editor-core/esm/vs/platform/contextkey/common/contextkey'; -import { IThemeService } from '@theia/monaco-editor-core/esm/vs/platform/theme/common/themeService'; +import { IContextKeyService } from '@theia/monaco-editor-core/esm/vs/platform/contextkey/common/contextkey.js'; +import { IThemeService } from '@theia/monaco-editor-core/esm/vs/platform/theme/common/themeService.js'; import { ActiveMonacoUndoRedoHandler, FocusedMonacoUndoRedoHandler } from './monaco-undo-redo-handler'; +import { ILogService } from '@theia/monaco-editor-core/esm/vs/platform/log/common/log'; export default new ContainerModule((bind, unbind, isBound, rebind) => { bind(MonacoThemingService).toSelf().inSingletonScope(); @@ -189,7 +190,7 @@ export const MonacoConfigurationService = Symbol('MonacoConfigurationService'); export function createMonacoConfigurationService(container: interfaces.Container): IConfigurationService { const preferences = container.get(PreferenceService); const preferenceSchemaProvider = container.get(PreferenceSchemaProvider); - const service = new StandaloneConfigurationService(); + const service = new StandaloneConfigurationService(StandaloneServices.get(ILogService)); const _configuration: Configuration = service['_configuration']; _configuration.getValue = (section, overrides) => { diff --git a/packages/monaco/src/browser/monaco-init.ts b/packages/monaco/src/browser/monaco-init.ts index d622e596c3df5..8906e681b2c3b 100644 --- a/packages/monaco/src/browser/monaco-init.ts +++ b/packages/monaco/src/browser/monaco-init.ts @@ -23,26 +23,11 @@ * might call `initialize()` while being constructed. * The service descriptors require a constructor function, so we declare dummy class for each Monaco service we override. But instead of returning an instance of the dummy class, * we fetch the implementation of the monaco service from the inversify container. - * The inversify-constructed services must not call StandaloneServices.get() or StandaloneServices.initialize() from their constructors. Calling `get`()` in postConstruct mehtods + * The inversify-constructed services must not call StandaloneServices.get() or StandaloneServices.initialize() from their constructors. Calling `get`()` in postConstruct methods * is allowed. */ // Before importing anything from monaco we need to override its localization function -import * as MonacoNls from '@theia/monaco-editor-core/esm/vs/nls'; -import { nls } from '@theia/core/lib/common/nls'; -import { FormatType, Localization } from '@theia/core/lib/common/i18n/localization'; - -Object.assign(MonacoNls, { - localize(_key: string, label: string, ...args: FormatType[]): string { - if (nls.locale) { - const defaultKey = nls.getDefaultKey(label); - if (defaultKey) { - return nls.localize(defaultKey, label, ...args); - } - } - return Localization.format(label, args); - } -}); import { Container } from '@theia/core/shared/inversify'; import { ICodeEditorService } from '@theia/monaco-editor-core/esm/vs/editor/browser/services/codeEditorService'; @@ -118,6 +103,12 @@ class MonacoQuickInputImplementationConstructor { } } +class MonacoStandaloneThemeServiceConstructor { + constructor(container: Container) { + return new MonacoStandaloneThemeService(); + } +} + export namespace MonacoInit { export function init(container: Container): void { StandaloneServices.initialize({ @@ -128,7 +119,7 @@ export namespace MonacoInit { [IBulkEditService.toString()]: new SyncDescriptor(MonacoBulkEditServiceConstructor, [container]), [ICommandService.toString()]: new SyncDescriptor(MonacoCommandServiceConstructor, [container]), [IQuickInputService.toString()]: new SyncDescriptor(MonacoQuickInputImplementationConstructor, [container]), - [IStandaloneThemeService.toString()]: new MonacoStandaloneThemeService() + [IStandaloneThemeService.toString()]: new SyncDescriptor(MonacoStandaloneThemeServiceConstructor, []) }); } } diff --git a/packages/monaco/src/browser/monaco-quick-input-service.ts b/packages/monaco/src/browser/monaco-quick-input-service.ts index a611b6fe33e21..a10d4138ce02f 100644 --- a/packages/monaco/src/browser/monaco-quick-input-service.ts +++ b/packages/monaco/src/browser/monaco-quick-input-service.ts @@ -31,17 +31,18 @@ import { MonacoResolvedKeybinding } from './monaco-resolved-keybinding'; import { IQuickAccessController } from '@theia/monaco-editor-core/esm/vs/platform/quickinput/common/quickAccess'; import { QuickAccessController } from '@theia/monaco-editor-core/esm/vs/platform/quickinput/browser/quickAccess'; import { IContextKey, IContextKeyService } from '@theia/monaco-editor-core/esm/vs/platform/contextkey/common/contextkey'; -import { IListOptions, List } from '@theia/monaco-editor-core/esm/vs/base/browser/ui/list/listWidget'; import * as monaco from '@theia/monaco-editor-core'; import { ResolvedKeybinding } from '@theia/monaco-editor-core/esm/vs/base/common/keybindings'; import { IInstantiationService } from '@theia/monaco-editor-core/esm/vs/platform/instantiation/common/instantiation'; import { StandaloneServices } from '@theia/monaco-editor-core/esm/vs/editor/standalone/browser/standaloneServices'; import { IMatch } from '@theia/monaco-editor-core/esm/vs/base/common/filters'; -import { IListRenderer, IListVirtualDelegate } from '@theia/monaco-editor-core/esm/vs/base/browser/ui/list/list'; import { CancellationToken, Event } from '@theia/core'; import { MonacoColorRegistry } from './monaco-color-registry'; import { ThemeService } from '@theia/core/lib/browser/theming'; import { IStandaloneThemeService } from '@theia/monaco-editor-core/esm/vs/editor/standalone/common/standaloneTheme'; +import { ILayoutService } from '@theia/monaco-editor-core/esm/vs/platform/layout/browser/layoutService'; +import { IHoverDelegate, IHoverDelegateOptions } from '@theia/monaco-editor-core/esm/vs/base/browser/ui/hover/hoverDelegate'; +import { IHoverWidget } from '@theia/monaco-editor-core/esm/vs/base/browser/ui/hover/hover'; // Copied from @vscode/src/vs/base/parts/quickInput/browser/quickInputList.ts export interface IListElement { @@ -59,8 +60,21 @@ export interface IListElement { readonly fireButtonTriggered: (event: IQuickPickItemButtonEvent) => void; } +class HoverDelegate implements IHoverDelegate { + showHover(options: IHoverDelegateOptions, focus?: boolean | undefined): IHoverWidget | undefined { + return undefined; + } + onDidHideHover?: (() => void) | undefined; + delay: number; + placement?: 'mouse' | 'element' | undefined; + showNativeHover?: boolean | undefined; + +} @injectable() export class MonacoQuickInputImplementation implements IQuickInputService { + get currentQuickInput(): IQuickInput | undefined { + return this.controller.currentQuickInput; + } declare readonly _serviceBrand: undefined; @@ -77,7 +91,6 @@ export class MonacoQuickInputImplementation implements IQuickInputService { protected readonly themeService: ThemeService; protected container: HTMLElement; - private quickInputList: List; protected inQuickOpen: IContextKey; @@ -113,19 +126,19 @@ export class MonacoQuickInputImplementation implements IQuickInputService { return this.controller.createQuickWidget(); } - createQuickPick(): IQuickPick { - return this.controller.createQuickPick(); + createQuickPick(options: { useSeparators: true; }): IQuickPick; + createQuickPick(options: { useSeparators: false; }): IQuickPick; + createQuickPick(options: { useSeparators: boolean }): IQuickPick | IQuickPick { + return this.controller.createQuickPick({ + useSeparators: options.useSeparators + }); } - createInputBox(): IInputBox { return this.controller.createInputBox(); } open(filter: string): void { this.quickAccess.show(filter); - setTimeout(() => { - this.quickInputList.focusNth(0); - }, 300); } input(options?: IInputOptions, token?: monaco.CancellationToken): Promise { @@ -185,21 +198,10 @@ export class MonacoQuickInputImplementation implements IQuickInputService { } private initController(): void { - this.controller = new QuickInputController(this.getOptions(), StandaloneServices.get(IStandaloneThemeService)); - this.updateLayout(); - } - - private updateLayout(): void { - // Initialize the layout using screen dimensions as monaco computes the actual sizing. - // https://github.com/microsoft/vscode/blob/6261075646f055b99068d3688932416f2346dd3b/src/vs/base/parts/quickinput/browser/quickInput.ts#L1799 - this.controller.layout(this.getClientDimension(), 0); - } - - private getClientDimension(): monaco.editor.IDimension { - return { width: window.innerWidth, height: window.innerHeight }; - } + const contextKeyService = StandaloneServices.get(IContextKeyService); + const instantiationService = StandaloneServices.get(IInstantiationService); + const layoutService = StandaloneServices.get(ILayoutService); - private getOptions(): IQuickInputOptions { const options: IQuickInputOptions = { idPrefix: 'quickInput_', container: this.container, @@ -208,14 +210,23 @@ export class MonacoQuickInputImplementation implements IQuickInputService { backKeybindingLabel: () => undefined, setContextKey: (id?: string) => this.setContextKey(id), returnFocus: () => this.container.focus(), - createList: ( - user: string, container: HTMLElement, delegate: IListVirtualDelegate, renderers: IListRenderer[], listOptions: IListOptions - ): List => this.quickInputList = new List(user, container, delegate, renderers, listOptions), + hoverDelegate: new HoverDelegate(), linkOpenerDelegate: () => { // @monaco-uplift: not sure what to do here } }; - return options; + this.controller = new QuickInputController(options, layoutService, instantiationService, contextKeyService); + this.updateLayout(); + } + + private updateLayout(): void { + // Initialize the layout using screen dimensions as monaco computes the actual sizing. + // https://github.com/microsoft/vscode/blob/6261075646f055b99068d3688932416f2346dd3b/src/vs/base/parts/quickinput/browser/quickInput.ts#L1799 + this.controller.layout(this.getClientDimension(), 0); + } + + private getClientDimension(): monaco.editor.IDimension { + return { width: window.innerWidth, height: window.innerHeight }; } // @monaco-uplift @@ -258,13 +269,18 @@ export class MonacoQuickInputImplementation implements IQuickInputService { listInactiveSelectionForeground: this.colorRegistry.toCssVariableName('list.InactiveSelectionForeground'), listHoverBackground: this.colorRegistry.toCssVariableName('list.HoverBackground'), listHoverForeground: this.colorRegistry.toCssVariableName('list.HoverForeground'), - listDropBackground: this.colorRegistry.toCssVariableName('list.DropBackground'), + listDropOverBackground: this.colorRegistry.toCssVariableName('list.DropOverBackground'), + listDropBetweenBackground: this.colorRegistry.toCssVariableName('list.DropBetweenBackground'), listSelectionOutline: this.colorRegistry.toCssVariableName('activeContrastBorder'), listHoverOutline: this.colorRegistry.toCssVariableName('activeContrastBorder'), treeIndentGuidesStroke: this.colorRegistry.toCssVariableName('tree.indentGuidesStroke'), treeInactiveIndentGuidesStroke: this.colorRegistry.toCssVariableName('tree.inactiveIndentGuidesStroke'), + treeStickyScrollBackground: this.colorRegistry.toCssVariableName('tree.StickyScrollBackground'), + treeStickyScrollBorder: this.colorRegistry.toCssVariableName('tree.tickyScrollBorde'), + treeStickyScrollShadow: this.colorRegistry.toCssVariableName('tree.StickyScrollShadow'), tableColumnsBorder: this.colorRegistry.toCssVariableName('tree.tableColumnsBorder'), tableOddRowsBackgroundColor: this.colorRegistry.toCssVariableName('tree.tableOddRowsBackground'), + }, inputBox: { inputForeground: this.colorRegistry.toCssVariableName('inputForeground'), @@ -434,11 +450,11 @@ export class MonacoQuickInputService implements QuickInputService { } createQuickPick(): QuickPick { - const quickPick = this.monacoService.createQuickPick>(); + const quickPick = this.monacoService.createQuickPick>({ useSeparators: true }); return this.wrapQuickPick(quickPick); } - wrapQuickPick(wrapped: IQuickPick>): QuickPick { + wrapQuickPick(wrapped: IQuickPick, { useSeparators: true }>): QuickPick { return new MonacoQuickPick(wrapped, this.keybindingRegistry); } @@ -532,7 +548,7 @@ class MonacoQuickInput { } class MonacoQuickPick extends MonacoQuickInput implements QuickPick { - constructor(protected override readonly wrapped: IQuickPick>, protected readonly keybindingRegistry: KeybindingRegistry) { + constructor(protected override readonly wrapped: IQuickPick, { useSeparators: true }>, protected readonly keybindingRegistry: KeybindingRegistry) { super(wrapped); } diff --git a/packages/monaco/src/browser/simple-monaco-editor.ts b/packages/monaco/src/browser/simple-monaco-editor.ts index 5c862b81fba94..ed634d9de532a 100644 --- a/packages/monaco/src/browser/simple-monaco-editor.ts +++ b/packages/monaco/src/browser/simple-monaco-editor.ts @@ -16,7 +16,7 @@ import { EditorServiceOverrides, MonacoEditor, MonacoEditorServices } from './monaco-editor'; -import { CodeEditorWidget, ICodeEditorWidgetOptions } from '@theia/monaco-editor-core/esm/vs/editor/browser/widget/codeEditorWidget'; +import { CodeEditorWidget, ICodeEditorWidgetOptions } from '@theia/monaco-editor-core/esm/vs/editor/browser/widget/codeEditor/codeEditorWidget'; import { IInstantiationService } from '@theia/monaco-editor-core/esm/vs/platform/instantiation/common/instantiation'; import { StandaloneServices } from '@theia/monaco-editor-core/esm/vs/editor/standalone/browser/standaloneServices'; import { ServiceCollection } from '@theia/monaco-editor-core/esm/vs/platform/instantiation/common/serviceCollection'; @@ -27,6 +27,7 @@ import * as monaco from '@theia/monaco-editor-core'; import { ElementExt } from '@theia/core/shared/@phosphor/domutils'; import { Selection } from '@theia/editor/lib/browser/editor'; import { SelectionDirection } from '@theia/monaco-editor-core/esm/vs/editor/common/core/selection'; +import { ShowLightbulbIconMode } from '@theia/monaco-editor-core/esm/vs/editor/common/config/editorOptions'; export class SimpleMonacoEditor extends MonacoEditorServices implements Disposable { @@ -87,7 +88,7 @@ export class SimpleMonacoEditor extends MonacoEditorServices implements Disposab protected create(options?: MonacoEditor.IOptions, override?: EditorServiceOverrides, widgetOptions?: ICodeEditorWidgetOptions): Disposable { const combinedOptions = { ...options, - lightbulb: { enabled: true }, + lightbulb: { enabled: ShowLightbulbIconMode.On }, fixedOverflowWidgets: true, automaticLayout: true, scrollbar: { diff --git a/packages/notebook/package.json b/packages/notebook/package.json index 3124e7ebb887e..9beb04b996e31 100644 --- a/packages/notebook/package.json +++ b/packages/notebook/package.json @@ -7,7 +7,7 @@ "@theia/editor": "1.57.0", "@theia/filesystem": "1.57.0", "@theia/monaco": "1.57.0", - "@theia/monaco-editor-core": "1.83.101", + "@theia/monaco-editor-core": "1.96.3", "@theia/outline-view": "1.57.0", "advanced-mark.js": "^2.6.0", "react-perfect-scrollbar": "^1.5.8", diff --git a/packages/notebook/src/browser/service/notebook-options.ts b/packages/notebook/src/browser/service/notebook-options.ts index 2ecf59f02f31f..854973b0b014f 100644 --- a/packages/notebook/src/browser/service/notebook-options.ts +++ b/packages/notebook/src/browser/service/notebook-options.ts @@ -21,7 +21,7 @@ import { Emitter } from '@theia/core'; import { NotebookPreferences, notebookPreferenceSchema } from '../contributions/notebook-preferences'; import { EditorPreferences } from '@theia/editor/lib/browser'; import { BareFontInfo } from '@theia/monaco-editor-core/esm/vs/editor/common/config/fontInfo'; -import { PixelRatio } from '@theia/monaco-editor-core/esm/vs/base/browser/browser'; +import { PixelRatio } from '@theia/monaco-editor-core/esm/vs/base/browser/pixelRatio'; const notebookOutputOptionsRelevantPreferences = [ 'editor.fontSize', @@ -149,7 +149,7 @@ export class NotebookOptionsService { fontLigatures: this.editorPreferences['editor.fontLigatures'], lineHeight: this.editorPreferences['editor.lineHeight'], letterSpacing: this.editorPreferences['editor.letterSpacing'], - }, PixelRatio.value); + }, PixelRatio.getInstance(window).value); } } diff --git a/packages/output/package.json b/packages/output/package.json index 7ecb262b972c9..e30fa79f9aa5b 100644 --- a/packages/output/package.json +++ b/packages/output/package.json @@ -6,7 +6,7 @@ "@theia/core": "1.57.0", "@theia/editor": "1.57.0", "@theia/monaco": "1.57.0", - "@theia/monaco-editor-core": "1.83.101", + "@theia/monaco-editor-core": "1.96.3", "p-queue": "^8.0.1", "tslib": "^2.6.2" }, diff --git a/packages/plugin-ext-vscode/package.json b/packages/plugin-ext-vscode/package.json index 78f36143e028e..6ffc3491fb4da 100644 --- a/packages/plugin-ext-vscode/package.json +++ b/packages/plugin-ext-vscode/package.json @@ -8,7 +8,7 @@ "@theia/editor": "1.57.0", "@theia/filesystem": "1.57.0", "@theia/monaco": "1.57.0", - "@theia/monaco-editor-core": "1.83.101", + "@theia/monaco-editor-core": "1.96.3", "@theia/navigator": "1.57.0", "@theia/outline-view": "1.57.0", "@theia/plugin": "1.57.0", diff --git a/packages/plugin-ext/package.json b/packages/plugin-ext/package.json index 73a77bf958aa3..614039f9d7ca7 100644 --- a/packages/plugin-ext/package.json +++ b/packages/plugin-ext/package.json @@ -17,7 +17,7 @@ "@theia/markers": "1.57.0", "@theia/messages": "1.57.0", "@theia/monaco": "1.57.0", - "@theia/monaco-editor-core": "1.83.101", + "@theia/monaco-editor-core": "1.96.3", "@theia/navigator": "1.57.0", "@theia/notebook": "1.57.0", "@theia/output": "1.57.0", diff --git a/packages/plugin-ext/src/main/browser/languages-main.ts b/packages/plugin-ext/src/main/browser/languages-main.ts index 4051d8cc9f91e..748b84eb582ac 100644 --- a/packages/plugin-ext/src/main/browser/languages-main.ts +++ b/packages/plugin-ext/src/main/browser/languages-main.ts @@ -73,8 +73,8 @@ import { EditorLanguageStatusService, LanguageStatus as EditorLanguageStatus } f import { LanguageSelector, RelativePattern } from '@theia/editor/lib/common/language-selector'; import { ILanguageFeaturesService } from '@theia/monaco-editor-core/esm/vs/editor/common/services/languageFeatures'; import { - DocumentOnDropEdit, - DocumentOnDropEditProvider, + DocumentDropEditProvider, + DocumentDropEditsSession, EvaluatableExpression, EvaluatableExpressionProvider, InlineValue, @@ -82,8 +82,7 @@ import { InlineValuesProvider } from '@theia/monaco-editor-core/esm/vs/editor/common/languages'; import { ITextModel } from '@theia/monaco-editor-core/esm/vs/editor/common/model'; -import { CodeActionTriggerKind, SnippetString } from '../../plugin/types-impl'; -import { DataTransfer } from './data-transfer/data-transfer-type-converters'; +import { CodeActionTriggerKind } from '../../plugin/types-impl'; import { IReadonlyVSDataTransfer } from '@theia/monaco-editor-core/esm/vs/base/common/dataTransfer'; import { FileUploadService } from '@theia/filesystem/lib/browser/file-upload-service'; @@ -736,36 +735,24 @@ export class LanguagesMainImpl implements LanguagesMain, Disposable { handle, StandaloneServices .get(ILanguageFeaturesService) - .documentOnDropEditProvider + .documentDropEditProvider .register(selector, this.createDocumentDropEditProvider(handle, metadata)) ); } - createDocumentDropEditProvider(handle: number, _metadata?: DocumentDropEditProviderMetadata): DocumentOnDropEditProvider { + createDocumentDropEditProvider(handle: number, _metadata?: DocumentDropEditProviderMetadata): DocumentDropEditProvider { return { // @monaco-uplift id and dropMimeTypes should be supported by the monaco drop editor provider after 1.82.0 // id?: string; // dropMimeTypes: metadata?.dropMimeTypes ?? ['*/*'], - provideDocumentOnDropEdits: async (model, position, dataTransfer, token) => this.provideDocumentDropEdits(handle, model, position, dataTransfer, token) + provideDocumentDropEdits: async (model, position, dataTransfer, token) => this.provideDocumentDropEdits(handle, model, position, dataTransfer, token) }; } protected async provideDocumentDropEdits(handle: number, model: ITextModel, position: monaco.IPosition, - dataTransfer: IReadonlyVSDataTransfer, token: CancellationToken): Promise { + dataTransfer: IReadonlyVSDataTransfer, token: CancellationToken): Promise { await this.fileUploadService.upload(new URI(), { source: dataTransfer, leaveInTemp: true }); - const edit = await this.proxy.$provideDocumentDropEdits(handle, model.uri, position, await DataTransfer.toDataTransferDTO(dataTransfer), token); - if (edit) { - return { - // @monaco-uplift label and yieldTo should be supported by monaco after 1.82.0. The implementation relies on a copy of the plugin data - // label: label: edit.label ?? localize('defaultDropLabel', "Drop using '{0}' extension", this._extension.displayName || this._extension.name),, - // yieldTo: edit.yieldTo?.map(yTo => { - // return 'mimeType' in yTo ? yTo : { providerId: DocumentOnDropEditAdapter.toInternalProviderId(yTo.extensionId, yTo.providerId) }; - // }), - label: 'no label', - insertText: edit.insertText instanceof SnippetString ? { snippet: edit.insertText.value } : edit.insertText, - additionalEdit: toMonacoWorkspaceEdit(edit?.additionalEdit) - }; - } + return undefined; } $registerFoldingRangeProvider(handle: number, pluginInfo: PluginInfo, selector: SerializedDocumentFilter[], eventHandle: number | undefined): void { diff --git a/packages/plugin-ext/src/plugin/preference-registry.ts b/packages/plugin-ext/src/plugin/preference-registry.ts index 6d676309d1889..ce7e4f724fce9 100644 --- a/packages/plugin-ext/src/plugin/preference-registry.ts +++ b/packages/plugin-ext/src/plugin/preference-registry.ts @@ -34,6 +34,7 @@ import { RPCProtocol } from '../common/rpc-protocol'; import { isObject, mixin } from '../common/types'; import { WorkspaceExtImpl } from './workspace'; import cloneDeep = require('lodash.clonedeep'); +import { ILogService, LogLevel } from '@theia/monaco-editor-core/esm/vs/platform/log/common/log'; const injectionRe = /\b__proto__\b|\bconstructor\.prototype\b/; @@ -79,6 +80,30 @@ export class TheiaWorkspace extends Workspace { } } +const logService: ILogService = { + _serviceBrand: undefined, + onDidChangeLogLevel: new Emitter().event, + getLevel: function (): LogLevel { + return LogLevel.Info; + }, + setLevel: function (level: LogLevel): void { + }, + trace: function (message: string, ...args: any[]): void { + }, + debug: function (message: string, ...args: any[]): void { + }, + info: function (message: string, ...args: any[]): void { + }, + warn: function (message: string, ...args: any[]): void { + }, + error: function (message: string | Error, ...args: any[]): void { + }, + flush: function (): void { + }, + dispose: function (): void { + } +}; + @injectable() export class PreferenceRegistryExtImpl implements PreferenceRegistryExt { @inject(RPCProtocol) @@ -251,19 +276,27 @@ export class PreferenceRegistryExtImpl implements PreferenceRegistryExt { Object.keys(data[PreferenceScope.Folder]).forEach(resource => { folderConfigurations.set(URI.parse(resource), this.getConfigurationModel(`Folder: ${resource}`, data[PreferenceScope.Folder][resource])); }); + + function createEmptyModel(): ConfigurationModel { + return new ConfigurationModel({}, [], [], undefined, logService); + } + return new Configuration( defaultConfiguration, - new ConfigurationModel(), /** policy configuration. */ - new ConfigurationModel(), /** application configuration. */ + createEmptyModel(), /** policy configuration. */ + createEmptyModel(), /** application configuration. */ userConfiguration, - new ConfigurationModel(), /** remote configuration. */ + createEmptyModel(), /** remote configuration. */ workspaceConfiguration, - folderConfigurations + folderConfigurations, + ConfigurationModel.createEmptyModel(logService), + new ResourceMap(), + logService ); } private getConfigurationModel(label: string, data: { [key: string]: any }): ConfigurationModel { - const parser = new ConfigurationModelParser(label); + const parser = new ConfigurationModelParser(label, logService); const sanitized = this.sanitize(data); parser.parseRaw(sanitized); return parser.configurationModel; diff --git a/packages/plugin-metrics/package.json b/packages/plugin-metrics/package.json index cbea8201b9836..1858c42cb1fba 100644 --- a/packages/plugin-metrics/package.json +++ b/packages/plugin-metrics/package.json @@ -5,7 +5,7 @@ "dependencies": { "@theia/core": "1.57.0", "@theia/metrics": "1.57.0", - "@theia/monaco-editor-core": "1.83.101", + "@theia/monaco-editor-core": "1.96.3", "@theia/plugin": "1.57.0", "@theia/plugin-ext": "1.57.0", "tslib": "^2.6.2" diff --git a/packages/preferences/package.json b/packages/preferences/package.json index bbc9c030ae2f8..c0dcacd7c92d9 100644 --- a/packages/preferences/package.json +++ b/packages/preferences/package.json @@ -7,7 +7,7 @@ "@theia/editor": "1.57.0", "@theia/filesystem": "1.57.0", "@theia/monaco": "1.57.0", - "@theia/monaco-editor-core": "1.83.101", + "@theia/monaco-editor-core": "1.96.3", "@theia/userstorage": "1.57.0", "@theia/workspace": "1.57.0", "async-mutex": "^0.3.1", diff --git a/packages/scm/package.json b/packages/scm/package.json index a9b7068e6a55a..00398989ecf05 100644 --- a/packages/scm/package.json +++ b/packages/scm/package.json @@ -7,7 +7,7 @@ "@theia/editor": "1.57.0", "@theia/filesystem": "1.57.0", "@theia/monaco": "1.57.0", - "@theia/monaco-editor-core": "1.83.101", + "@theia/monaco-editor-core": "1.96.3", "@types/diff": "^5.2.1", "diff": "^5.2.0", "p-debounce": "^2.1.0", diff --git a/packages/task/package.json b/packages/task/package.json index 22b43b1a53e91..b75a4b2d74824 100644 --- a/packages/task/package.json +++ b/packages/task/package.json @@ -8,7 +8,7 @@ "@theia/filesystem": "1.57.0", "@theia/markers": "1.57.0", "@theia/monaco": "1.57.0", - "@theia/monaco-editor-core": "1.83.101", + "@theia/monaco-editor-core": "1.96.3", "@theia/process": "1.57.0", "@theia/terminal": "1.57.0", "@theia/userstorage": "1.57.0", diff --git a/packages/toolbar/package.json b/packages/toolbar/package.json index 27f20050e57d0..a86de7d076f17 100644 --- a/packages/toolbar/package.json +++ b/packages/toolbar/package.json @@ -32,7 +32,7 @@ "@theia/file-search": "1.57.0", "@theia/filesystem": "1.57.0", "@theia/monaco": "1.57.0", - "@theia/monaco-editor-core": "1.83.101", + "@theia/monaco-editor-core": "1.96.3", "@theia/search-in-workspace": "1.57.0", "@theia/userstorage": "1.57.0", "@theia/workspace": "1.57.0", From 1ef45513bbd65d5b599ac7aa1644a7a2e55b770e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20M=C3=A4der?= Date: Fri, 17 Jan 2025 15:42:19 +0100 Subject: [PATCH 2/8] Linter fixes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Thomas Mäder --- .../native-webpack-plugin/src/monaco-webpack-plugins.ts | 6 ++---- .../src/browser/window/default-secondary-window-service.ts | 2 +- packages/file-search/src/browser/quick-file-open.ts | 2 +- .../browser/markdown-renderer/monaco-markdown-renderer.ts | 3 ++- 4 files changed, 6 insertions(+), 7 deletions(-) diff --git a/dev-packages/native-webpack-plugin/src/monaco-webpack-plugins.ts b/dev-packages/native-webpack-plugin/src/monaco-webpack-plugins.ts index 1add7025dbdd5..7137dda7eed05 100644 --- a/dev-packages/native-webpack-plugin/src/monaco-webpack-plugins.ts +++ b/dev-packages/native-webpack-plugin/src/monaco-webpack-plugins.ts @@ -17,11 +17,9 @@ import * as webpack from 'webpack'; export class MonacoWebpackPlugin { - apply(compiler: webpack.Compiler) { + apply(compiler: webpack.Compiler): void { compiler.hooks.contextModuleFactory.tap('MonacoBuildPlugin', cmf => { - cmf.hooks.contextModuleFiles.tap('MonacoBuildPlugin', files => files.filter(file => { - return !file.endsWith('.d.ts'); - })); + cmf.hooks.contextModuleFiles.tap('MonacoBuildPlugin', files => files.filter(file => !file.endsWith('.d.ts'))); }); } diff --git a/packages/core/src/browser/window/default-secondary-window-service.ts b/packages/core/src/browser/window/default-secondary-window-service.ts index 40997df1076da..4fbe3f6f11e81 100644 --- a/packages/core/src/browser/window/default-secondary-window-service.ts +++ b/packages/core/src/browser/window/default-secondary-window-service.ts @@ -118,7 +118,7 @@ export class DefaultSecondaryWindowService implements SecondaryWindowService { const extIndex = this.secondaryWindows.indexOf(newWindow); if (extIndex > -1) { - this.onWindowClosedEmitter.fire(newWindow) + this.onWindowClosedEmitter.fire(newWindow); this.secondaryWindows.splice(extIndex, 1); }; }); diff --git a/packages/file-search/src/browser/quick-file-open.ts b/packages/file-search/src/browser/quick-file-open.ts index da6a8d4b51050..39b1b3b60d3cb 100644 --- a/packages/file-search/src/browser/quick-file-open.ts +++ b/packages/file-search/src/browser/quick-file-open.ts @@ -320,7 +320,7 @@ export class QuickFileOpenService implements QuickAccessProvider { private getItemIconClasses(uri: URI): string[] | undefined { const icon = this.labelProvider.getIcon(uri).split(' '); if (icon.length > 0) { - icon.push('file-icon') + icon.push('file-icon'); } return icon; } diff --git a/packages/monaco/src/browser/markdown-renderer/monaco-markdown-renderer.ts b/packages/monaco/src/browser/markdown-renderer/monaco-markdown-renderer.ts index 5114df844e45a..736431be1fee3 100644 --- a/packages/monaco/src/browser/markdown-renderer/monaco-markdown-renderer.ts +++ b/packages/monaco/src/browser/markdown-renderer/monaco-markdown-renderer.ts @@ -16,7 +16,8 @@ import { inject, injectable, postConstruct } from '@theia/core/shared/inversify'; import { ILanguageService } from '@theia/monaco-editor-core/esm/vs/editor/common/languages/language'; -import { MarkdownRenderer as CodeMarkdownRenderer, IMarkdownRendererOptions } from '@theia/monaco-editor-core/esm/vs/editor/browser/widget/markdownRenderer/browser/markdownRenderer'; +import { MarkdownRenderer as CodeMarkdownRenderer, IMarkdownRendererOptions } + from '@theia/monaco-editor-core/esm/vs/editor/browser/widget/markdownRenderer/browser/markdownRenderer'; import { StandaloneServices } from '@theia/monaco-editor-core/esm/vs/editor/standalone/browser/standaloneServices'; import * as monaco from '@theia/monaco-editor-core'; import { OpenerService, PreferenceService, WidgetOpenerOptions, open } from '@theia/core/lib/browser'; From 073d4ca63db9b545174fac0138e84926b0c111e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20M=C3=A4der?= Date: Tue, 21 Jan 2025 16:55:23 +0100 Subject: [PATCH 3/8] Update to latest version of monaco-editor-core 1.96.301 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Thomas Mäder --- examples/api-samples/package.json | 2 +- package-lock.json | 46 ++++++++++++------------ packages/ai-chat-ui/package.json | 2 +- packages/ai-code-completion/package.json | 2 +- packages/ai-core/package.json | 2 +- packages/bulk-edit/package.json | 2 +- packages/collaboration/package.json | 2 +- packages/console/package.json | 2 +- packages/debug/package.json | 2 +- packages/git/package.json | 2 +- packages/keymaps/package.json | 2 +- packages/monaco/package.json | 2 +- packages/notebook/package.json | 2 +- packages/output/package.json | 2 +- packages/plugin-ext-vscode/package.json | 2 +- packages/plugin-ext/package.json | 2 +- packages/plugin-metrics/package.json | 2 +- packages/preferences/package.json | 2 +- packages/scm/package.json | 2 +- packages/task/package.json | 2 +- packages/toolbar/package.json | 2 +- 21 files changed, 43 insertions(+), 43 deletions(-) diff --git a/examples/api-samples/package.json b/examples/api-samples/package.json index 05665f621eae0..c54536bcf3e64 100644 --- a/examples/api-samples/package.json +++ b/examples/api-samples/package.json @@ -11,7 +11,7 @@ "@theia/file-search": "1.57.0", "@theia/filesystem": "1.57.0", "@theia/monaco": "1.57.0", - "@theia/monaco-editor-core": "1.96.3", + "@theia/monaco-editor-core": "1.96.301", "@theia/output": "1.57.0", "@theia/ovsx-client": "1.57.0", "@theia/search-in-workspace": "1.57.0", diff --git a/package-lock.json b/package-lock.json index cc889b9aa6bcf..d4ae9a42a9b1f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -402,7 +402,7 @@ "@theia/file-search": "1.57.0", "@theia/filesystem": "1.57.0", "@theia/monaco": "1.57.0", - "@theia/monaco-editor-core": "1.96.3", + "@theia/monaco-editor-core": "1.96.301", "@theia/output": "1.57.0", "@theia/ovsx-client": "1.57.0", "@theia/search-in-workspace": "1.57.0", @@ -6089,9 +6089,9 @@ "link": true }, "node_modules/@theia/monaco-editor-core": { - "version": "1.96.3", - "resolved": "https://registry.npmjs.org/@theia/monaco-editor-core/-/monaco-editor-core-1.96.3.tgz", - "integrity": "sha512-8YjySDxUTM1N9nmeymBsH4liP07DIG4TCt8mIscq2vQL1oE0ir9GBjHxybF8XUgJx7uSaZtUwK2OALX22CngWA==", + "version": "1.96.301", + "resolved": "https://registry.npmjs.org/@theia/monaco-editor-core/-/monaco-editor-core-1.96.301.tgz", + "integrity": "sha512-rcBgPrbEX5hA+JTwT6QBvvQRdcgizofvwVz/0zyXdDlyTcEEMCJPTJWk8nP5lP/JbBZyf8d9Z9/Enj4R3gqTzA==", "license": "MIT" }, "node_modules/@theia/native-webpack-plugin": { @@ -29826,7 +29826,7 @@ "@theia/editor-preview": "1.57.0", "@theia/filesystem": "1.57.0", "@theia/monaco": "1.57.0", - "@theia/monaco-editor-core": "1.96.3", + "@theia/monaco-editor-core": "1.96.301", "@theia/workspace": "1.57.0", "minimatch": "^5.1.0", "tslib": "^2.6.2", @@ -29844,7 +29844,7 @@ "@theia/ai-core": "1.57.0", "@theia/core": "1.57.0", "@theia/filesystem": "1.57.0", - "@theia/monaco-editor-core": "1.96.3", + "@theia/monaco-editor-core": "1.96.301", "@theia/output": "1.57.0", "@theia/workspace": "1.57.0", "minimatch": "^5.1.0", @@ -29863,7 +29863,7 @@ "@theia/editor": "1.57.0", "@theia/filesystem": "1.57.0", "@theia/monaco": "1.57.0", - "@theia/monaco-editor-core": "1.96.3", + "@theia/monaco-editor-core": "1.96.301", "@theia/output": "1.57.0", "@theia/variable-resolver": "1.57.0", "@theia/workspace": "1.57.0", @@ -30077,7 +30077,7 @@ "@theia/editor": "1.57.0", "@theia/filesystem": "1.57.0", "@theia/monaco": "1.57.0", - "@theia/monaco-editor-core": "1.96.3", + "@theia/monaco-editor-core": "1.96.301", "@theia/workspace": "1.57.0", "tslib": "^2.6.2" }, @@ -30108,7 +30108,7 @@ "@theia/editor": "1.57.0", "@theia/filesystem": "1.57.0", "@theia/monaco": "1.57.0", - "@theia/monaco-editor-core": "1.96.3", + "@theia/monaco-editor-core": "1.96.301", "@theia/workspace": "1.57.0", "lib0": "^0.2.52", "open-collaboration-protocol": "0.2.0", @@ -30128,7 +30128,7 @@ "dependencies": { "@theia/core": "1.57.0", "@theia/monaco": "1.57.0", - "@theia/monaco-editor-core": "1.96.3", + "@theia/monaco-editor-core": "1.96.301", "anser": "^2.0.1", "tslib": "^2.6.2" }, @@ -30403,7 +30403,7 @@ "@theia/filesystem": "1.57.0", "@theia/markers": "1.57.0", "@theia/monaco": "1.57.0", - "@theia/monaco-editor-core": "1.96.3", + "@theia/monaco-editor-core": "1.96.301", "@theia/output": "1.57.0", "@theia/process": "1.57.0", "@theia/task": "1.57.0", @@ -30582,7 +30582,7 @@ "@theia/core": "1.57.0", "@theia/editor": "1.57.0", "@theia/filesystem": "1.57.0", - "@theia/monaco-editor-core": "1.96.3", + "@theia/monaco-editor-core": "1.96.301", "@theia/navigator": "1.57.0", "@theia/scm": "1.57.0", "@theia/scm-extra": "1.57.0", @@ -30657,7 +30657,7 @@ "dependencies": { "@theia/core": "1.57.0", "@theia/monaco": "1.57.0", - "@theia/monaco-editor-core": "1.96.3", + "@theia/monaco-editor-core": "1.96.301", "@theia/preferences": "1.57.0", "@theia/userstorage": "1.57.0", "jsonc-parser": "^2.2.0", @@ -30749,7 +30749,7 @@ "@theia/editor": "1.57.0", "@theia/filesystem": "1.57.0", "@theia/markers": "1.57.0", - "@theia/monaco-editor-core": "1.96.3", + "@theia/monaco-editor-core": "1.96.301", "@theia/outline-view": "1.57.0", "@theia/workspace": "1.57.0", "fast-plist": "^0.1.2", @@ -30787,7 +30787,7 @@ "@theia/editor": "1.57.0", "@theia/filesystem": "1.57.0", "@theia/monaco": "1.57.0", - "@theia/monaco-editor-core": "1.96.3", + "@theia/monaco-editor-core": "1.96.301", "@theia/outline-view": "1.57.0", "advanced-mark.js": "^2.6.0", "react-perfect-scrollbar": "^1.5.8", @@ -30830,7 +30830,7 @@ "@theia/core": "1.57.0", "@theia/editor": "1.57.0", "@theia/monaco": "1.57.0", - "@theia/monaco-editor-core": "1.96.3", + "@theia/monaco-editor-core": "1.96.301", "p-queue": "^8.0.1", "tslib": "^2.6.2" }, @@ -30915,7 +30915,7 @@ "@theia/markers": "1.57.0", "@theia/messages": "1.57.0", "@theia/monaco": "1.57.0", - "@theia/monaco-editor-core": "1.96.3", + "@theia/monaco-editor-core": "1.96.301", "@theia/navigator": "1.57.0", "@theia/notebook": "1.57.0", "@theia/output": "1.57.0", @@ -30984,7 +30984,7 @@ "@theia/editor": "1.57.0", "@theia/filesystem": "1.57.0", "@theia/monaco": "1.57.0", - "@theia/monaco-editor-core": "1.96.3", + "@theia/monaco-editor-core": "1.96.301", "@theia/navigator": "1.57.0", "@theia/outline-view": "1.57.0", "@theia/plugin": "1.57.0", @@ -31014,7 +31014,7 @@ "dependencies": { "@theia/core": "1.57.0", "@theia/metrics": "1.57.0", - "@theia/monaco-editor-core": "1.96.3", + "@theia/monaco-editor-core": "1.96.301", "@theia/plugin": "1.57.0", "@theia/plugin-ext": "1.57.0", "tslib": "^2.6.2" @@ -31032,7 +31032,7 @@ "@theia/editor": "1.57.0", "@theia/filesystem": "1.57.0", "@theia/monaco": "1.57.0", - "@theia/monaco-editor-core": "1.96.3", + "@theia/monaco-editor-core": "1.96.301", "@theia/userstorage": "1.57.0", "@theia/workspace": "1.57.0", "async-mutex": "^0.3.1", @@ -31246,7 +31246,7 @@ "@theia/editor": "1.57.0", "@theia/filesystem": "1.57.0", "@theia/monaco": "1.57.0", - "@theia/monaco-editor-core": "1.96.3", + "@theia/monaco-editor-core": "1.96.301", "@types/diff": "^5.2.1", "diff": "^5.2.0", "p-debounce": "^2.1.0", @@ -31316,7 +31316,7 @@ "@theia/filesystem": "1.57.0", "@theia/markers": "1.57.0", "@theia/monaco": "1.57.0", - "@theia/monaco-editor-core": "1.96.3", + "@theia/monaco-editor-core": "1.96.301", "@theia/process": "1.57.0", "@theia/terminal": "1.57.0", "@theia/userstorage": "1.57.0", @@ -31418,7 +31418,7 @@ "@theia/file-search": "1.57.0", "@theia/filesystem": "1.57.0", "@theia/monaco": "1.57.0", - "@theia/monaco-editor-core": "1.96.3", + "@theia/monaco-editor-core": "1.96.301", "@theia/search-in-workspace": "1.57.0", "@theia/userstorage": "1.57.0", "@theia/workspace": "1.57.0", diff --git a/packages/ai-chat-ui/package.json b/packages/ai-chat-ui/package.json index 9f4645622fb39..64592bd88749a 100644 --- a/packages/ai-chat-ui/package.json +++ b/packages/ai-chat-ui/package.json @@ -9,7 +9,7 @@ "@theia/editor": "1.57.0", "@theia/filesystem": "1.57.0", "@theia/monaco": "1.57.0", - "@theia/monaco-editor-core": "1.96.3", + "@theia/monaco-editor-core": "1.96.301", "@theia/editor-preview": "1.57.0", "@theia/workspace": "1.57.0", "minimatch": "^5.1.0", diff --git a/packages/ai-code-completion/package.json b/packages/ai-code-completion/package.json index 96c95da0ae42f..80fa438273489 100644 --- a/packages/ai-code-completion/package.json +++ b/packages/ai-code-completion/package.json @@ -6,7 +6,7 @@ "@theia/ai-core": "1.57.0", "@theia/core": "1.57.0", "@theia/filesystem": "1.57.0", - "@theia/monaco-editor-core": "1.96.3", + "@theia/monaco-editor-core": "1.96.301", "@theia/output": "1.57.0", "@theia/workspace": "1.57.0", "minimatch": "^5.1.0", diff --git a/packages/ai-core/package.json b/packages/ai-core/package.json index d1a75c5a4cc7b..221ba9f3b0954 100644 --- a/packages/ai-core/package.json +++ b/packages/ai-core/package.json @@ -7,7 +7,7 @@ "@theia/editor": "1.57.0", "@theia/filesystem": "1.57.0", "@theia/monaco": "1.57.0", - "@theia/monaco-editor-core": "1.96.3", + "@theia/monaco-editor-core": "1.96.301", "@theia/output": "1.57.0", "@theia/variable-resolver": "1.57.0", "@theia/workspace": "1.57.0", diff --git a/packages/bulk-edit/package.json b/packages/bulk-edit/package.json index dcfb0da7c6cfd..dcf0aecacfd13 100644 --- a/packages/bulk-edit/package.json +++ b/packages/bulk-edit/package.json @@ -7,7 +7,7 @@ "@theia/editor": "1.57.0", "@theia/filesystem": "1.57.0", "@theia/monaco": "1.57.0", - "@theia/monaco-editor-core": "1.96.3", + "@theia/monaco-editor-core": "1.96.301", "@theia/workspace": "1.57.0", "tslib": "^2.6.2" }, diff --git a/packages/collaboration/package.json b/packages/collaboration/package.json index 4280eadd84382..1ce7fc5033eee 100644 --- a/packages/collaboration/package.json +++ b/packages/collaboration/package.json @@ -7,7 +7,7 @@ "@theia/editor": "1.57.0", "@theia/filesystem": "1.57.0", "@theia/monaco": "1.57.0", - "@theia/monaco-editor-core": "1.96.3", + "@theia/monaco-editor-core": "1.96.301", "@theia/workspace": "1.57.0", "open-collaboration-protocol": "0.2.0", "open-collaboration-yjs": "0.2.0", diff --git a/packages/console/package.json b/packages/console/package.json index 5e41e5faecfa2..f99ca0d8ae1a8 100644 --- a/packages/console/package.json +++ b/packages/console/package.json @@ -5,7 +5,7 @@ "dependencies": { "@theia/core": "1.57.0", "@theia/monaco": "1.57.0", - "@theia/monaco-editor-core": "1.96.3", + "@theia/monaco-editor-core": "1.96.301", "anser": "^2.0.1", "tslib": "^2.6.2" }, diff --git a/packages/debug/package.json b/packages/debug/package.json index 4c7c42f2c7f67..d49633679e2dc 100644 --- a/packages/debug/package.json +++ b/packages/debug/package.json @@ -9,7 +9,7 @@ "@theia/filesystem": "1.57.0", "@theia/markers": "1.57.0", "@theia/monaco": "1.57.0", - "@theia/monaco-editor-core": "1.96.3", + "@theia/monaco-editor-core": "1.96.301", "@theia/output": "1.57.0", "@theia/process": "1.57.0", "@theia/task": "1.57.0", diff --git a/packages/git/package.json b/packages/git/package.json index b4acd4983f8d7..fcd81925de0fa 100644 --- a/packages/git/package.json +++ b/packages/git/package.json @@ -6,7 +6,7 @@ "@theia/core": "1.57.0", "@theia/editor": "1.57.0", "@theia/filesystem": "1.57.0", - "@theia/monaco-editor-core": "1.96.3", + "@theia/monaco-editor-core": "1.96.301", "@theia/navigator": "1.57.0", "@theia/scm": "1.57.0", "@theia/scm-extra": "1.57.0", diff --git a/packages/keymaps/package.json b/packages/keymaps/package.json index d5940e6e6b9b0..2f2bb31bbb737 100644 --- a/packages/keymaps/package.json +++ b/packages/keymaps/package.json @@ -5,7 +5,7 @@ "dependencies": { "@theia/core": "1.57.0", "@theia/monaco": "1.57.0", - "@theia/monaco-editor-core": "1.96.3", + "@theia/monaco-editor-core": "1.96.301", "@theia/preferences": "1.57.0", "@theia/userstorage": "1.57.0", "jsonc-parser": "^2.2.0", diff --git a/packages/monaco/package.json b/packages/monaco/package.json index 44103f07566ea..073f167eff3ca 100644 --- a/packages/monaco/package.json +++ b/packages/monaco/package.json @@ -7,7 +7,7 @@ "@theia/editor": "1.57.0", "@theia/filesystem": "1.57.0", "@theia/markers": "1.57.0", - "@theia/monaco-editor-core": "1.96.3", + "@theia/monaco-editor-core": "1.96.301", "@theia/outline-view": "1.57.0", "@theia/workspace": "1.57.0", "fast-plist": "^0.1.2", diff --git a/packages/notebook/package.json b/packages/notebook/package.json index 9beb04b996e31..2f97440e99ab6 100644 --- a/packages/notebook/package.json +++ b/packages/notebook/package.json @@ -7,7 +7,7 @@ "@theia/editor": "1.57.0", "@theia/filesystem": "1.57.0", "@theia/monaco": "1.57.0", - "@theia/monaco-editor-core": "1.96.3", + "@theia/monaco-editor-core": "1.96.301", "@theia/outline-view": "1.57.0", "advanced-mark.js": "^2.6.0", "react-perfect-scrollbar": "^1.5.8", diff --git a/packages/output/package.json b/packages/output/package.json index e30fa79f9aa5b..647a31a3bb3ad 100644 --- a/packages/output/package.json +++ b/packages/output/package.json @@ -6,7 +6,7 @@ "@theia/core": "1.57.0", "@theia/editor": "1.57.0", "@theia/monaco": "1.57.0", - "@theia/monaco-editor-core": "1.96.3", + "@theia/monaco-editor-core": "1.96.301", "p-queue": "^8.0.1", "tslib": "^2.6.2" }, diff --git a/packages/plugin-ext-vscode/package.json b/packages/plugin-ext-vscode/package.json index 6ffc3491fb4da..204682ddb9242 100644 --- a/packages/plugin-ext-vscode/package.json +++ b/packages/plugin-ext-vscode/package.json @@ -8,7 +8,7 @@ "@theia/editor": "1.57.0", "@theia/filesystem": "1.57.0", "@theia/monaco": "1.57.0", - "@theia/monaco-editor-core": "1.96.3", + "@theia/monaco-editor-core": "1.96.301", "@theia/navigator": "1.57.0", "@theia/outline-view": "1.57.0", "@theia/plugin": "1.57.0", diff --git a/packages/plugin-ext/package.json b/packages/plugin-ext/package.json index 614039f9d7ca7..ea4d112560979 100644 --- a/packages/plugin-ext/package.json +++ b/packages/plugin-ext/package.json @@ -17,7 +17,7 @@ "@theia/markers": "1.57.0", "@theia/messages": "1.57.0", "@theia/monaco": "1.57.0", - "@theia/monaco-editor-core": "1.96.3", + "@theia/monaco-editor-core": "1.96.301", "@theia/navigator": "1.57.0", "@theia/notebook": "1.57.0", "@theia/output": "1.57.0", diff --git a/packages/plugin-metrics/package.json b/packages/plugin-metrics/package.json index 1858c42cb1fba..bdcfb9f8cce75 100644 --- a/packages/plugin-metrics/package.json +++ b/packages/plugin-metrics/package.json @@ -5,7 +5,7 @@ "dependencies": { "@theia/core": "1.57.0", "@theia/metrics": "1.57.0", - "@theia/monaco-editor-core": "1.96.3", + "@theia/monaco-editor-core": "1.96.301", "@theia/plugin": "1.57.0", "@theia/plugin-ext": "1.57.0", "tslib": "^2.6.2" diff --git a/packages/preferences/package.json b/packages/preferences/package.json index c0dcacd7c92d9..9c65392bb0a4c 100644 --- a/packages/preferences/package.json +++ b/packages/preferences/package.json @@ -7,7 +7,7 @@ "@theia/editor": "1.57.0", "@theia/filesystem": "1.57.0", "@theia/monaco": "1.57.0", - "@theia/monaco-editor-core": "1.96.3", + "@theia/monaco-editor-core": "1.96.301", "@theia/userstorage": "1.57.0", "@theia/workspace": "1.57.0", "async-mutex": "^0.3.1", diff --git a/packages/scm/package.json b/packages/scm/package.json index 00398989ecf05..78427bda87de5 100644 --- a/packages/scm/package.json +++ b/packages/scm/package.json @@ -7,7 +7,7 @@ "@theia/editor": "1.57.0", "@theia/filesystem": "1.57.0", "@theia/monaco": "1.57.0", - "@theia/monaco-editor-core": "1.96.3", + "@theia/monaco-editor-core": "1.96.301", "@types/diff": "^5.2.1", "diff": "^5.2.0", "p-debounce": "^2.1.0", diff --git a/packages/task/package.json b/packages/task/package.json index b75a4b2d74824..561d8843a99e7 100644 --- a/packages/task/package.json +++ b/packages/task/package.json @@ -8,7 +8,7 @@ "@theia/filesystem": "1.57.0", "@theia/markers": "1.57.0", "@theia/monaco": "1.57.0", - "@theia/monaco-editor-core": "1.96.3", + "@theia/monaco-editor-core": "1.96.301", "@theia/process": "1.57.0", "@theia/terminal": "1.57.0", "@theia/userstorage": "1.57.0", diff --git a/packages/toolbar/package.json b/packages/toolbar/package.json index a86de7d076f17..d7ee3607841ea 100644 --- a/packages/toolbar/package.json +++ b/packages/toolbar/package.json @@ -32,7 +32,7 @@ "@theia/file-search": "1.57.0", "@theia/filesystem": "1.57.0", "@theia/monaco": "1.57.0", - "@theia/monaco-editor-core": "1.96.3", + "@theia/monaco-editor-core": "1.96.301", "@theia/search-in-workspace": "1.57.0", "@theia/userstorage": "1.57.0", "@theia/workspace": "1.57.0", From 3c3bd976db5427be633606fac7bb772d07698db9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20M=C3=A4der?= Date: Wed, 22 Jan 2025 11:33:53 +0100 Subject: [PATCH 4/8] Some changes to make tests pass MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Thomas Mäder --- examples/api-tests/src/monaco-api.spec.js | 10 +++------- .../src/main/browser/languages-main.ts | 17 +++++++++++------ 2 files changed, 14 insertions(+), 13 deletions(-) diff --git a/examples/api-tests/src/monaco-api.spec.js b/examples/api-tests/src/monaco-api.spec.js index 438d10ea53bf5..ed016e4d0178f 100644 --- a/examples/api-tests/src/monaco-api.spec.js +++ b/examples/api-tests/src/monaco-api.spec.js @@ -14,6 +14,8 @@ // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0 // ***************************************************************************** +const { IOpenerService } = require('@theia/monaco-editor-core/esm/vs/platform/opener/common/opener'); + // @ts-check describe('Monaco API', async function () { this.timeout(5000); @@ -149,14 +151,8 @@ describe('Monaco API', async function () { }); it('OpenerService.open', async () => { - const hoverContribution = monacoEditor.getControl().getContribution('editor.contrib.hover'); - assert.isDefined(hoverContribution); - if (!('_openerService' in hoverContribution)) { - assert.fail('hoverContribution does not have OpenerService'); - return; - } /** @type {import('@theia/monaco-editor-core/esm/vs/editor/browser/services/openerService').OpenerService} */ - const openerService = hoverContribution['_openerService']; + const openerService = StandaloneServices.get(IOpenerService); let opened = false; const id = '__test:OpenerService.open'; diff --git a/packages/plugin-ext/src/main/browser/languages-main.ts b/packages/plugin-ext/src/main/browser/languages-main.ts index 748b84eb582ac..a259ad5739f2c 100644 --- a/packages/plugin-ext/src/main/browser/languages-main.ts +++ b/packages/plugin-ext/src/main/browser/languages-main.ts @@ -950,14 +950,19 @@ export class LanguagesMainImpl implements LanguagesMain, Disposable { context: monaco.languages.CodeActionContext, token: monaco.CancellationToken ): Promise { - const actions = await this.proxy.$provideCodeActions(handle, model.uri, rangeOrSelection, this.toModelCodeActionContext(context), token); - if (!actions) { + try { + const actions = await this.proxy.$provideCodeActions(handle, model.uri, rangeOrSelection, this.toModelCodeActionContext(context), token); + if (!actions) { + return undefined; + } + return { + actions: actions.map(a => toMonacoAction(a)), + dispose: () => this.proxy.$releaseCodeActions(handle, actions.map(a => a.cacheId)) + }; + } catch (e) { + console.error(e); return undefined; } - return { - actions: actions.map(a => toMonacoAction(a)), - dispose: () => this.proxy.$releaseCodeActions(handle, actions.map(a => a.cacheId)) - }; } protected toModelCodeActionContext(context: monaco.languages.CodeActionContext): CodeActionContext { From 1cef67acca641581a4723dda7cacbf7d7d0fc3f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20M=C3=A4der?= Date: Wed, 22 Jan 2025 18:57:07 +0100 Subject: [PATCH 5/8] Fix playwright test and update to new monaco build MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Thomas Mäder --- examples/api-samples/package.json | 2 +- package-lock.json | 46 +++++++++---------- packages/ai-chat-ui/package.json | 2 +- packages/ai-code-completion/package.json | 2 +- packages/ai-core/package.json | 2 +- packages/bulk-edit/package.json | 2 +- packages/collaboration/package.json | 2 +- packages/console/package.json | 2 +- packages/debug/package.json | 2 +- .../editor-language-quick-pick-service.ts | 7 ++- packages/git/package.json | 2 +- packages/keymaps/package.json | 2 +- packages/monaco/package.json | 2 +- packages/notebook/package.json | 2 +- packages/output/package.json | 2 +- packages/plugin-ext-vscode/package.json | 2 +- packages/plugin-ext/package.json | 2 +- packages/plugin-metrics/package.json | 2 +- packages/preferences/package.json | 2 +- packages/scm/package.json | 2 +- packages/task/package.json | 2 +- packages/toolbar/package.json | 2 +- 22 files changed, 48 insertions(+), 45 deletions(-) diff --git a/examples/api-samples/package.json b/examples/api-samples/package.json index c54536bcf3e64..7ea4fc5ddb23c 100644 --- a/examples/api-samples/package.json +++ b/examples/api-samples/package.json @@ -11,7 +11,7 @@ "@theia/file-search": "1.57.0", "@theia/filesystem": "1.57.0", "@theia/monaco": "1.57.0", - "@theia/monaco-editor-core": "1.96.301", + "@theia/monaco-editor-core": "1.96.302", "@theia/output": "1.57.0", "@theia/ovsx-client": "1.57.0", "@theia/search-in-workspace": "1.57.0", diff --git a/package-lock.json b/package-lock.json index d4ae9a42a9b1f..b9542c19bef83 100644 --- a/package-lock.json +++ b/package-lock.json @@ -402,7 +402,7 @@ "@theia/file-search": "1.57.0", "@theia/filesystem": "1.57.0", "@theia/monaco": "1.57.0", - "@theia/monaco-editor-core": "1.96.301", + "@theia/monaco-editor-core": "1.96.302", "@theia/output": "1.57.0", "@theia/ovsx-client": "1.57.0", "@theia/search-in-workspace": "1.57.0", @@ -6089,9 +6089,9 @@ "link": true }, "node_modules/@theia/monaco-editor-core": { - "version": "1.96.301", - "resolved": "https://registry.npmjs.org/@theia/monaco-editor-core/-/monaco-editor-core-1.96.301.tgz", - "integrity": "sha512-rcBgPrbEX5hA+JTwT6QBvvQRdcgizofvwVz/0zyXdDlyTcEEMCJPTJWk8nP5lP/JbBZyf8d9Z9/Enj4R3gqTzA==", + "version": "1.96.302", + "resolved": "https://registry.npmjs.org/@theia/monaco-editor-core/-/monaco-editor-core-1.96.302.tgz", + "integrity": "sha512-1np9/dI/cVmAE2KFi/13fK29jQOM9syyK6KaElaQ5nR8DVHsG49WK50Yd4yjwaqH2y4NHDeiZR8GoOJi8L9z4A==", "license": "MIT" }, "node_modules/@theia/native-webpack-plugin": { @@ -29826,7 +29826,7 @@ "@theia/editor-preview": "1.57.0", "@theia/filesystem": "1.57.0", "@theia/monaco": "1.57.0", - "@theia/monaco-editor-core": "1.96.301", + "@theia/monaco-editor-core": "1.96.302", "@theia/workspace": "1.57.0", "minimatch": "^5.1.0", "tslib": "^2.6.2", @@ -29844,7 +29844,7 @@ "@theia/ai-core": "1.57.0", "@theia/core": "1.57.0", "@theia/filesystem": "1.57.0", - "@theia/monaco-editor-core": "1.96.301", + "@theia/monaco-editor-core": "1.96.302", "@theia/output": "1.57.0", "@theia/workspace": "1.57.0", "minimatch": "^5.1.0", @@ -29863,7 +29863,7 @@ "@theia/editor": "1.57.0", "@theia/filesystem": "1.57.0", "@theia/monaco": "1.57.0", - "@theia/monaco-editor-core": "1.96.301", + "@theia/monaco-editor-core": "1.96.302", "@theia/output": "1.57.0", "@theia/variable-resolver": "1.57.0", "@theia/workspace": "1.57.0", @@ -30077,7 +30077,7 @@ "@theia/editor": "1.57.0", "@theia/filesystem": "1.57.0", "@theia/monaco": "1.57.0", - "@theia/monaco-editor-core": "1.96.301", + "@theia/monaco-editor-core": "1.96.302", "@theia/workspace": "1.57.0", "tslib": "^2.6.2" }, @@ -30108,7 +30108,7 @@ "@theia/editor": "1.57.0", "@theia/filesystem": "1.57.0", "@theia/monaco": "1.57.0", - "@theia/monaco-editor-core": "1.96.301", + "@theia/monaco-editor-core": "1.96.302", "@theia/workspace": "1.57.0", "lib0": "^0.2.52", "open-collaboration-protocol": "0.2.0", @@ -30128,7 +30128,7 @@ "dependencies": { "@theia/core": "1.57.0", "@theia/monaco": "1.57.0", - "@theia/monaco-editor-core": "1.96.301", + "@theia/monaco-editor-core": "1.96.302", "anser": "^2.0.1", "tslib": "^2.6.2" }, @@ -30403,7 +30403,7 @@ "@theia/filesystem": "1.57.0", "@theia/markers": "1.57.0", "@theia/monaco": "1.57.0", - "@theia/monaco-editor-core": "1.96.301", + "@theia/monaco-editor-core": "1.96.302", "@theia/output": "1.57.0", "@theia/process": "1.57.0", "@theia/task": "1.57.0", @@ -30582,7 +30582,7 @@ "@theia/core": "1.57.0", "@theia/editor": "1.57.0", "@theia/filesystem": "1.57.0", - "@theia/monaco-editor-core": "1.96.301", + "@theia/monaco-editor-core": "1.96.302", "@theia/navigator": "1.57.0", "@theia/scm": "1.57.0", "@theia/scm-extra": "1.57.0", @@ -30657,7 +30657,7 @@ "dependencies": { "@theia/core": "1.57.0", "@theia/monaco": "1.57.0", - "@theia/monaco-editor-core": "1.96.301", + "@theia/monaco-editor-core": "1.96.302", "@theia/preferences": "1.57.0", "@theia/userstorage": "1.57.0", "jsonc-parser": "^2.2.0", @@ -30749,7 +30749,7 @@ "@theia/editor": "1.57.0", "@theia/filesystem": "1.57.0", "@theia/markers": "1.57.0", - "@theia/monaco-editor-core": "1.96.301", + "@theia/monaco-editor-core": "1.96.302", "@theia/outline-view": "1.57.0", "@theia/workspace": "1.57.0", "fast-plist": "^0.1.2", @@ -30787,7 +30787,7 @@ "@theia/editor": "1.57.0", "@theia/filesystem": "1.57.0", "@theia/monaco": "1.57.0", - "@theia/monaco-editor-core": "1.96.301", + "@theia/monaco-editor-core": "1.96.302", "@theia/outline-view": "1.57.0", "advanced-mark.js": "^2.6.0", "react-perfect-scrollbar": "^1.5.8", @@ -30830,7 +30830,7 @@ "@theia/core": "1.57.0", "@theia/editor": "1.57.0", "@theia/monaco": "1.57.0", - "@theia/monaco-editor-core": "1.96.301", + "@theia/monaco-editor-core": "1.96.302", "p-queue": "^8.0.1", "tslib": "^2.6.2" }, @@ -30915,7 +30915,7 @@ "@theia/markers": "1.57.0", "@theia/messages": "1.57.0", "@theia/monaco": "1.57.0", - "@theia/monaco-editor-core": "1.96.301", + "@theia/monaco-editor-core": "1.96.302", "@theia/navigator": "1.57.0", "@theia/notebook": "1.57.0", "@theia/output": "1.57.0", @@ -30984,7 +30984,7 @@ "@theia/editor": "1.57.0", "@theia/filesystem": "1.57.0", "@theia/monaco": "1.57.0", - "@theia/monaco-editor-core": "1.96.301", + "@theia/monaco-editor-core": "1.96.302", "@theia/navigator": "1.57.0", "@theia/outline-view": "1.57.0", "@theia/plugin": "1.57.0", @@ -31014,7 +31014,7 @@ "dependencies": { "@theia/core": "1.57.0", "@theia/metrics": "1.57.0", - "@theia/monaco-editor-core": "1.96.301", + "@theia/monaco-editor-core": "1.96.302", "@theia/plugin": "1.57.0", "@theia/plugin-ext": "1.57.0", "tslib": "^2.6.2" @@ -31032,7 +31032,7 @@ "@theia/editor": "1.57.0", "@theia/filesystem": "1.57.0", "@theia/monaco": "1.57.0", - "@theia/monaco-editor-core": "1.96.301", + "@theia/monaco-editor-core": "1.96.302", "@theia/userstorage": "1.57.0", "@theia/workspace": "1.57.0", "async-mutex": "^0.3.1", @@ -31246,7 +31246,7 @@ "@theia/editor": "1.57.0", "@theia/filesystem": "1.57.0", "@theia/monaco": "1.57.0", - "@theia/monaco-editor-core": "1.96.301", + "@theia/monaco-editor-core": "1.96.302", "@types/diff": "^5.2.1", "diff": "^5.2.0", "p-debounce": "^2.1.0", @@ -31316,7 +31316,7 @@ "@theia/filesystem": "1.57.0", "@theia/markers": "1.57.0", "@theia/monaco": "1.57.0", - "@theia/monaco-editor-core": "1.96.301", + "@theia/monaco-editor-core": "1.96.302", "@theia/process": "1.57.0", "@theia/terminal": "1.57.0", "@theia/userstorage": "1.57.0", @@ -31418,7 +31418,7 @@ "@theia/file-search": "1.57.0", "@theia/filesystem": "1.57.0", "@theia/monaco": "1.57.0", - "@theia/monaco-editor-core": "1.96.301", + "@theia/monaco-editor-core": "1.96.302", "@theia/search-in-workspace": "1.57.0", "@theia/userstorage": "1.57.0", "@theia/workspace": "1.57.0", diff --git a/packages/ai-chat-ui/package.json b/packages/ai-chat-ui/package.json index 64592bd88749a..4c2cc4b3164c4 100644 --- a/packages/ai-chat-ui/package.json +++ b/packages/ai-chat-ui/package.json @@ -9,7 +9,7 @@ "@theia/editor": "1.57.0", "@theia/filesystem": "1.57.0", "@theia/monaco": "1.57.0", - "@theia/monaco-editor-core": "1.96.301", + "@theia/monaco-editor-core": "1.96.302", "@theia/editor-preview": "1.57.0", "@theia/workspace": "1.57.0", "minimatch": "^5.1.0", diff --git a/packages/ai-code-completion/package.json b/packages/ai-code-completion/package.json index 80fa438273489..80575845fbf92 100644 --- a/packages/ai-code-completion/package.json +++ b/packages/ai-code-completion/package.json @@ -6,7 +6,7 @@ "@theia/ai-core": "1.57.0", "@theia/core": "1.57.0", "@theia/filesystem": "1.57.0", - "@theia/monaco-editor-core": "1.96.301", + "@theia/monaco-editor-core": "1.96.302", "@theia/output": "1.57.0", "@theia/workspace": "1.57.0", "minimatch": "^5.1.0", diff --git a/packages/ai-core/package.json b/packages/ai-core/package.json index 221ba9f3b0954..66228a76f96a7 100644 --- a/packages/ai-core/package.json +++ b/packages/ai-core/package.json @@ -7,7 +7,7 @@ "@theia/editor": "1.57.0", "@theia/filesystem": "1.57.0", "@theia/monaco": "1.57.0", - "@theia/monaco-editor-core": "1.96.301", + "@theia/monaco-editor-core": "1.96.302", "@theia/output": "1.57.0", "@theia/variable-resolver": "1.57.0", "@theia/workspace": "1.57.0", diff --git a/packages/bulk-edit/package.json b/packages/bulk-edit/package.json index dcf0aecacfd13..51f1d3c746be4 100644 --- a/packages/bulk-edit/package.json +++ b/packages/bulk-edit/package.json @@ -7,7 +7,7 @@ "@theia/editor": "1.57.0", "@theia/filesystem": "1.57.0", "@theia/monaco": "1.57.0", - "@theia/monaco-editor-core": "1.96.301", + "@theia/monaco-editor-core": "1.96.302", "@theia/workspace": "1.57.0", "tslib": "^2.6.2" }, diff --git a/packages/collaboration/package.json b/packages/collaboration/package.json index 1ce7fc5033eee..1d34a3d4a1d62 100644 --- a/packages/collaboration/package.json +++ b/packages/collaboration/package.json @@ -7,7 +7,7 @@ "@theia/editor": "1.57.0", "@theia/filesystem": "1.57.0", "@theia/monaco": "1.57.0", - "@theia/monaco-editor-core": "1.96.301", + "@theia/monaco-editor-core": "1.96.302", "@theia/workspace": "1.57.0", "open-collaboration-protocol": "0.2.0", "open-collaboration-yjs": "0.2.0", diff --git a/packages/console/package.json b/packages/console/package.json index f99ca0d8ae1a8..9a6259f0bc8b9 100644 --- a/packages/console/package.json +++ b/packages/console/package.json @@ -5,7 +5,7 @@ "dependencies": { "@theia/core": "1.57.0", "@theia/monaco": "1.57.0", - "@theia/monaco-editor-core": "1.96.301", + "@theia/monaco-editor-core": "1.96.302", "anser": "^2.0.1", "tslib": "^2.6.2" }, diff --git a/packages/debug/package.json b/packages/debug/package.json index d49633679e2dc..e0d2638a1e90d 100644 --- a/packages/debug/package.json +++ b/packages/debug/package.json @@ -9,7 +9,7 @@ "@theia/filesystem": "1.57.0", "@theia/markers": "1.57.0", "@theia/monaco": "1.57.0", - "@theia/monaco-editor-core": "1.96.301", + "@theia/monaco-editor-core": "1.96.302", "@theia/output": "1.57.0", "@theia/process": "1.57.0", "@theia/task": "1.57.0", diff --git a/packages/editor/src/browser/editor-language-quick-pick-service.ts b/packages/editor/src/browser/editor-language-quick-pick-service.ts index 081a75b6d0fed..5fdf3566d0c48 100644 --- a/packages/editor/src/browser/editor-language-quick-pick-service.ts +++ b/packages/editor/src/browser/editor-language-quick-pick-service.ts @@ -42,8 +42,11 @@ export class EditorLanguageQuickPickService { protected toQuickPickLanguage(value: Language, current: string): QuickPickValue { const languageUri = this.toLanguageUri(value); - const icon = this.labelProvider.getIcon(languageUri); - const iconClasses = icon !== '' ? [icon + ' file-icon'] : undefined; + const iconClasses = this.labelProvider.getIcon(languageUri).split(' '); + if (iconClasses.length > 0) { + iconClasses.push('file-icon'); + } + const configured = current === value.id; return { value, diff --git a/packages/git/package.json b/packages/git/package.json index fcd81925de0fa..596a39abfa6de 100644 --- a/packages/git/package.json +++ b/packages/git/package.json @@ -6,7 +6,7 @@ "@theia/core": "1.57.0", "@theia/editor": "1.57.0", "@theia/filesystem": "1.57.0", - "@theia/monaco-editor-core": "1.96.301", + "@theia/monaco-editor-core": "1.96.302", "@theia/navigator": "1.57.0", "@theia/scm": "1.57.0", "@theia/scm-extra": "1.57.0", diff --git a/packages/keymaps/package.json b/packages/keymaps/package.json index 2f2bb31bbb737..8758f4c7b3e47 100644 --- a/packages/keymaps/package.json +++ b/packages/keymaps/package.json @@ -5,7 +5,7 @@ "dependencies": { "@theia/core": "1.57.0", "@theia/monaco": "1.57.0", - "@theia/monaco-editor-core": "1.96.301", + "@theia/monaco-editor-core": "1.96.302", "@theia/preferences": "1.57.0", "@theia/userstorage": "1.57.0", "jsonc-parser": "^2.2.0", diff --git a/packages/monaco/package.json b/packages/monaco/package.json index 073f167eff3ca..7c135453d8540 100644 --- a/packages/monaco/package.json +++ b/packages/monaco/package.json @@ -7,7 +7,7 @@ "@theia/editor": "1.57.0", "@theia/filesystem": "1.57.0", "@theia/markers": "1.57.0", - "@theia/monaco-editor-core": "1.96.301", + "@theia/monaco-editor-core": "1.96.302", "@theia/outline-view": "1.57.0", "@theia/workspace": "1.57.0", "fast-plist": "^0.1.2", diff --git a/packages/notebook/package.json b/packages/notebook/package.json index 2f97440e99ab6..454ba423a679e 100644 --- a/packages/notebook/package.json +++ b/packages/notebook/package.json @@ -7,7 +7,7 @@ "@theia/editor": "1.57.0", "@theia/filesystem": "1.57.0", "@theia/monaco": "1.57.0", - "@theia/monaco-editor-core": "1.96.301", + "@theia/monaco-editor-core": "1.96.302", "@theia/outline-view": "1.57.0", "advanced-mark.js": "^2.6.0", "react-perfect-scrollbar": "^1.5.8", diff --git a/packages/output/package.json b/packages/output/package.json index 647a31a3bb3ad..47371f3fb0cb7 100644 --- a/packages/output/package.json +++ b/packages/output/package.json @@ -6,7 +6,7 @@ "@theia/core": "1.57.0", "@theia/editor": "1.57.0", "@theia/monaco": "1.57.0", - "@theia/monaco-editor-core": "1.96.301", + "@theia/monaco-editor-core": "1.96.302", "p-queue": "^8.0.1", "tslib": "^2.6.2" }, diff --git a/packages/plugin-ext-vscode/package.json b/packages/plugin-ext-vscode/package.json index 204682ddb9242..be0e15b7202ae 100644 --- a/packages/plugin-ext-vscode/package.json +++ b/packages/plugin-ext-vscode/package.json @@ -8,7 +8,7 @@ "@theia/editor": "1.57.0", "@theia/filesystem": "1.57.0", "@theia/monaco": "1.57.0", - "@theia/monaco-editor-core": "1.96.301", + "@theia/monaco-editor-core": "1.96.302", "@theia/navigator": "1.57.0", "@theia/outline-view": "1.57.0", "@theia/plugin": "1.57.0", diff --git a/packages/plugin-ext/package.json b/packages/plugin-ext/package.json index ea4d112560979..8beadb0782dd5 100644 --- a/packages/plugin-ext/package.json +++ b/packages/plugin-ext/package.json @@ -17,7 +17,7 @@ "@theia/markers": "1.57.0", "@theia/messages": "1.57.0", "@theia/monaco": "1.57.0", - "@theia/monaco-editor-core": "1.96.301", + "@theia/monaco-editor-core": "1.96.302", "@theia/navigator": "1.57.0", "@theia/notebook": "1.57.0", "@theia/output": "1.57.0", diff --git a/packages/plugin-metrics/package.json b/packages/plugin-metrics/package.json index bdcfb9f8cce75..d5bb15e55396b 100644 --- a/packages/plugin-metrics/package.json +++ b/packages/plugin-metrics/package.json @@ -5,7 +5,7 @@ "dependencies": { "@theia/core": "1.57.0", "@theia/metrics": "1.57.0", - "@theia/monaco-editor-core": "1.96.301", + "@theia/monaco-editor-core": "1.96.302", "@theia/plugin": "1.57.0", "@theia/plugin-ext": "1.57.0", "tslib": "^2.6.2" diff --git a/packages/preferences/package.json b/packages/preferences/package.json index 9c65392bb0a4c..52e1a7401f6bf 100644 --- a/packages/preferences/package.json +++ b/packages/preferences/package.json @@ -7,7 +7,7 @@ "@theia/editor": "1.57.0", "@theia/filesystem": "1.57.0", "@theia/monaco": "1.57.0", - "@theia/monaco-editor-core": "1.96.301", + "@theia/monaco-editor-core": "1.96.302", "@theia/userstorage": "1.57.0", "@theia/workspace": "1.57.0", "async-mutex": "^0.3.1", diff --git a/packages/scm/package.json b/packages/scm/package.json index 78427bda87de5..1ed7b3e4fcc0d 100644 --- a/packages/scm/package.json +++ b/packages/scm/package.json @@ -7,7 +7,7 @@ "@theia/editor": "1.57.0", "@theia/filesystem": "1.57.0", "@theia/monaco": "1.57.0", - "@theia/monaco-editor-core": "1.96.301", + "@theia/monaco-editor-core": "1.96.302", "@types/diff": "^5.2.1", "diff": "^5.2.0", "p-debounce": "^2.1.0", diff --git a/packages/task/package.json b/packages/task/package.json index 561d8843a99e7..d514cf1aa9961 100644 --- a/packages/task/package.json +++ b/packages/task/package.json @@ -8,7 +8,7 @@ "@theia/filesystem": "1.57.0", "@theia/markers": "1.57.0", "@theia/monaco": "1.57.0", - "@theia/monaco-editor-core": "1.96.301", + "@theia/monaco-editor-core": "1.96.302", "@theia/process": "1.57.0", "@theia/terminal": "1.57.0", "@theia/userstorage": "1.57.0", diff --git a/packages/toolbar/package.json b/packages/toolbar/package.json index d7ee3607841ea..c7bb150b6d4cb 100644 --- a/packages/toolbar/package.json +++ b/packages/toolbar/package.json @@ -32,7 +32,7 @@ "@theia/file-search": "1.57.0", "@theia/filesystem": "1.57.0", "@theia/monaco": "1.57.0", - "@theia/monaco-editor-core": "1.96.301", + "@theia/monaco-editor-core": "1.96.302", "@theia/search-in-workspace": "1.57.0", "@theia/userstorage": "1.57.0", "@theia/workspace": "1.57.0", From 48cfba78747cd409dc6ab03117cdfc4bf8b2bcd1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20M=C3=A4der?= Date: Wed, 29 Jan 2025 13:51:50 +0100 Subject: [PATCH 6/8] Revert some unnecessary changes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Thomas Mäder --- .vscode/launch.json | 17 +---------------- examples/browser/webpack.config.js | 9 --------- examples/electron/webpack.config.js | 3 --- 3 files changed, 1 insertion(+), 28 deletions(-) diff --git a/.vscode/launch.json b/.vscode/launch.json index 5d3c67f81db99..3539be4173f25 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -4,20 +4,6 @@ // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 "version": "0.2.0", "configurations": [ - { - "name": "download plugins", - "program": "${workspaceFolder}/dev-packages/cli/lib/theia.js", - "request": "launch", - "args": [ - "build", - "--mode development" - ], - "skipFiles": [ - "/**" - ], - "type": "node", - "cwd": "${workspaceFolder}/examples/browser" - }, { "type": "node", "request": "attach", @@ -42,7 +28,6 @@ "protocol": "inspector", "args": [ ".", - "c:\\users\\thomas", "--log-level=debug", "--hostname=localhost", "--no-cluster", @@ -192,4 +177,4 @@ "stopAll": true } ] -} \ No newline at end of file +} diff --git a/examples/browser/webpack.config.js b/examples/browser/webpack.config.js index 9d9ba148e8096..fb14cca8c828a 100644 --- a/examples/browser/webpack.config.js +++ b/examples/browser/webpack.config.js @@ -3,11 +3,8 @@ * To reset delete this file and rerun theia build again. */ // @ts-check -const webpack = require('webpack'); const configs = require('./gen-webpack.config.js'); const nodeConfig = require('./gen-webpack.node.config.js'); -const { fileURLToPath } = require('url'); -const { MonacoWebpackPlugin } = require('@theia/native-webpack-plugin/lib/monaco-webpack-plugins.js'); /** * Expose bundled modules on window.theia.moduleName namespace, e.g. @@ -19,12 +16,6 @@ configs[0].module.rules.push({ loader: require.resolve('@theia/application-manager/lib/expose-loader') }); -const plugin2 = new MonacoWebpackPlugin(); - -// @ts-ignore -configs[0].plugins.push(plugin2); -// @ts-ignore -configs[1].plugins.push(plugin2); module.exports = [ ...configs, diff --git a/examples/electron/webpack.config.js b/examples/electron/webpack.config.js index 0d5184aaaa019..fb14cca8c828a 100644 --- a/examples/electron/webpack.config.js +++ b/examples/electron/webpack.config.js @@ -3,12 +3,9 @@ * To reset delete this file and rerun theia build again. */ // @ts-check -const webpack = require('webpack'); const configs = require('./gen-webpack.config.js'); const nodeConfig = require('./gen-webpack.node.config.js'); -const { MonacoWebpackPlugin } = require('@theia/native-webpack-plugin/lib/monaco-webpack-plugins.js'); - /** * Expose bundled modules on window.theia.moduleName namespace, e.g. * window['theia']['@theia/core/lib/common/uri']. From f16256d594a2645a5e110747fc0b999136d058d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20M=C3=A4der?= Date: Wed, 29 Jan 2025 16:47:22 +0100 Subject: [PATCH 7/8] Fix diff editor "Revert" button layout MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Thomas Mäder --- packages/core/src/browser/secondary-window-handler.ts | 1 + packages/core/src/browser/shell/application-shell.ts | 1 + 2 files changed, 2 insertions(+) diff --git a/packages/core/src/browser/secondary-window-handler.ts b/packages/core/src/browser/secondary-window-handler.ts index e967da357b1e5..e899b10da6459 100644 --- a/packages/core/src/browser/secondary-window-handler.ts +++ b/packages/core/src/browser/secondary-window-handler.ts @@ -140,6 +140,7 @@ export class SecondaryWindowHandler { widget.secondaryWindow = newWindow; const rootWidget = new SecondaryWindowRootWidget(); rootWidget.addClass('secondary-widget-root'); + rootWidget.addClass('monaco-workbench'); // needed for compatility with VSCode styles Widget.attach(rootWidget, element); rootWidget.addWidget(widget); widget.show(); diff --git a/packages/core/src/browser/shell/application-shell.ts b/packages/core/src/browser/shell/application-shell.ts index b13081abadb88..02538b4707e99 100644 --- a/packages/core/src/browser/shell/application-shell.ts +++ b/packages/core/src/browser/shell/application-shell.ts @@ -323,6 +323,7 @@ export class ApplicationShell extends Widget { protected initializeShell(): void { this.addClass(APPLICATION_SHELL_CLASS); + this.addClass('monaco-workbench'); // needed for compatility with VSCode styles this.id = 'theia-app-shell'; this.mainPanel = this.createMainPanel(); From d42c7577b9112655d18cf4cc51a8011e562d48b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20M=C3=A4der?= Date: Wed, 29 Jan 2025 20:43:20 +0100 Subject: [PATCH 8/8] Handle empty icon strings MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Thomas Mäder --- .../editor/src/browser/editor-language-quick-pick-service.ts | 2 +- packages/file-search/src/browser/quick-file-open.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/editor/src/browser/editor-language-quick-pick-service.ts b/packages/editor/src/browser/editor-language-quick-pick-service.ts index 5fdf3566d0c48..fb482e26b0b00 100644 --- a/packages/editor/src/browser/editor-language-quick-pick-service.ts +++ b/packages/editor/src/browser/editor-language-quick-pick-service.ts @@ -42,7 +42,7 @@ export class EditorLanguageQuickPickService { protected toQuickPickLanguage(value: Language, current: string): QuickPickValue { const languageUri = this.toLanguageUri(value); - const iconClasses = this.labelProvider.getIcon(languageUri).split(' '); + const iconClasses = this.labelProvider.getIcon(languageUri).split(' ').filter(v => v.length > 0); if (iconClasses.length > 0) { iconClasses.push('file-icon'); } diff --git a/packages/file-search/src/browser/quick-file-open.ts b/packages/file-search/src/browser/quick-file-open.ts index 39b1b3b60d3cb..de1bddd186c7b 100644 --- a/packages/file-search/src/browser/quick-file-open.ts +++ b/packages/file-search/src/browser/quick-file-open.ts @@ -318,7 +318,7 @@ export class QuickFileOpenService implements QuickAccessProvider { } private getItemIconClasses(uri: URI): string[] | undefined { - const icon = this.labelProvider.getIcon(uri).split(' '); + const icon = this.labelProvider.getIcon(uri).split(' ').filter(v => v.length > 0); if (icon.length > 0) { icon.push('file-icon'); }