From 910edd422cc339b1c18d9525bb791777b3b1f587 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Mangeonjean?= Date: Fri, 19 Apr 2024 10:41:10 +0200 Subject: [PATCH] fix: do not write to readonly filesystem --- src/services.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/services.ts b/src/services.ts index 2e71600..c9ccba0 100644 --- a/src/services.ts +++ b/src/services.ts @@ -19,7 +19,7 @@ import getWorkingCopyServiceOverride from '@codingame/monaco-vscode-working-copy import getEmmetServiceOverride from '@codingame/monaco-vscode-emmet-service-override' import { initialize as initializeServices } from 'vscode/services' import * as monaco from 'monaco-editor' -import { RegisteredFile, RegisteredFileSystemProvider, initFile, registerCustomProvider, OverlayFileSystemProvider, EmptyFileSystemProvider } from '@codingame/monaco-vscode-files-service-override' +import { RegisteredFile, RegisteredFileSystemProvider, registerCustomProvider, OverlayFileSystemProvider, EmptyFileSystemProvider, RegisteredMemoryFile } from '@codingame/monaco-vscode-files-service-override' import { IWorkbenchConstructionOptions, IWorkspaceProvider } from 'vscode/vscode/vs/workbench/browser/web.api' import EditorOpenHandlerRegistry from './tools/EditorOpenHandlerRegistry' import { whenReady as whenExtensionsReady } from './extensions' @@ -97,11 +97,11 @@ export function registerServices (newServices: monaco.editor.IEditorOverrideServ } export async function generateAndInitializeWorkspace (workspaceFile = monaco.Uri.file('/workspace.code-workspace'), label?: string): Promise { - await initFile(workspaceFile, JSON.stringify({ + registerFile(new RegisteredMemoryFile(workspaceFile, JSON.stringify({ folders: [{ path: '/tmp/project' }] - })) + }))) return { open: async () => false, workspace: {