From 13b7ad2da99e6bfdee55f4d4c9f851644934692a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Mangeonjean?= Date: Thu, 11 Jul 2024 17:09:49 +0200 Subject: [PATCH] feat: split working copy service --- README.md | 4 ++-- package.json | 7 +++++++ rollup.config.ts | 3 ++- src/features/workingCopy.ts | 6 ++++++ src/services.ts | 2 -- 5 files changed, 17 insertions(+), 5 deletions(-) create mode 100644 src/features/workingCopy.ts diff --git a/README.md b/README.md index 6f841e7..7c29b38 100644 --- a/README.md +++ b/README.md @@ -40,14 +40,14 @@ There are some optional features that can be enabled by importing a specific exp - `@codingame/monaco-editor-wrapper/features/extensionHostWorker` enables the worker extension host which allows to run VSCode extensions - `@codingame/monaco-editor-wrapper/features/notifications` enables the VSCode notifications instead of logging into the console - `@codingame/monaco-editor-wrapper/features/workbench` allows to use the full VSCode workbench +- `@codingame/monaco-editor-wrapper/features/typescriptStandalone` enables the monaco standalone typescript language feature worker -Those feature can be used in the workbench feature is enabled: +Those feature can be used if the workbench feature is enabled: - `@codingame/monaco-editor-wrapper/features/viewPanels` enables a few panels (timeline, outline, output, markers, explorer) - `@codingame/monaco-editor-wrapper/features/search` enables the search panel - `@codingame/monaco-editor-wrapper/features/extensionGallery` enables the extension gallery panel and the possibility to install extensions from the marketplace - `@codingame/monaco-editor-wrapper/features/terminal` enables the terminal panel - `@codingame/monaco-editor-wrapper/features/testing` enables the testing panels -- `@codingame/monaco-editor-wrapper/features/typescriptStandalone` enables the monaco standalone typescript language feature worker ### Embed language IntelliSense diff --git a/package.json b/package.json index 3dc873d..a37c527 100644 --- a/package.json +++ b/package.json @@ -71,6 +71,10 @@ "./features/typescriptStandalone": { "types": "./dist/features/typescriptStandalone.d.ts", "default": "./dist/features/typescriptStandalone.js" + }, + "./features/workingCopy": { + "types": "./dist/features/workingCopy.d.ts", + "default": "./dist/features/workingCopy.js" } }, "typesVersions": { @@ -107,6 +111,9 @@ ], "features/typescriptStandalone": [ "./dist/features/typescriptStandalone.d.ts" + ], + "features/workingCopy": [ + "./dist/features/workingCopy.d.ts" ] } }, diff --git a/rollup.config.ts b/rollup.config.ts index 991d23b..1a3bd1e 100644 --- a/rollup.config.ts +++ b/rollup.config.ts @@ -31,7 +31,8 @@ export default rollup.defineConfig({ 'features/extensionGallery': 'src/features/extensionGallery.ts', 'features/workbench': 'src/features/workbench.ts', 'features/profile': 'src/features/profile.ts', - 'features/typescriptStandalone': 'src/features/typescriptStandalone.ts' + 'features/typescriptStandalone': 'src/features/typescriptStandalone.ts', + 'features/workingCopy': 'src/features/workingCopy.ts' }, output: [{ dir: 'dist', diff --git a/src/features/workingCopy.ts b/src/features/workingCopy.ts new file mode 100644 index 0000000..bd8dc3e --- /dev/null +++ b/src/features/workingCopy.ts @@ -0,0 +1,6 @@ +import getWorkingCopyServiceOverride from '@codingame/monaco-vscode-working-copy-service-override' +import { registerServices } from '../services' + +registerServices({ + ...getWorkingCopyServiceOverride() +}) diff --git a/src/services.ts b/src/services.ts index f6addb9..75dc828 100644 --- a/src/services.ts +++ b/src/services.ts @@ -15,7 +15,6 @@ import getStorageServiceOverride from '@codingame/monaco-vscode-storage-service- import getLifecycleServiceOverride from '@codingame/monaco-vscode-lifecycle-service-override' import getQuickAccessServiceOverride from '@codingame/monaco-vscode-quickaccess-service-override' import getLogServiceOverride from '@codingame/monaco-vscode-log-service-override' -import getWorkingCopyServiceOverride from '@codingame/monaco-vscode-working-copy-service-override' import getEmmetServiceOverride from '@codingame/monaco-vscode-emmet-service-override' import { initialize as initializeServices } from 'vscode/services' import * as monaco from 'monaco-editor' @@ -85,7 +84,6 @@ let services: monaco.editor.IEditorOverrideServices = { return useGlobalPicker() } }), - ...getWorkingCopyServiceOverride(), ...getEmmetServiceOverride() }