Skip to content

Commit

Permalink
fix: do not write to readonly filesystem
Browse files Browse the repository at this point in the history
  • Loading branch information
Loïc Mangeonjean committed Apr 19, 2024
1 parent 609e6d1 commit 910edd4
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/services.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -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<IWorkspaceProvider> {
await initFile(workspaceFile, JSON.stringify(<IStoredWorkspace>{
registerFile(new RegisteredMemoryFile(workspaceFile, JSON.stringify(<IStoredWorkspace>{
folders: [{
path: '/tmp/project'
}]
}))
})))
return {
open: async () => false,
workspace: {
Expand Down

0 comments on commit 910edd4

Please sign in to comment.