Skip to content

Commit

Permalink
update monaco (#5071)
Browse files Browse the repository at this point in the history
* update monaco

* update monaco
  • Loading branch information
rubenfiszel authored Jan 15, 2025
1 parent 09dda48 commit b455f5b
Show file tree
Hide file tree
Showing 10 changed files with 19,464 additions and 39,267 deletions.
3,471 changes: 1,024 additions & 2,447 deletions frontend/package-lock.json

Large diffs are not rendered by default.

24 changes: 10 additions & 14 deletions frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -86,15 +86,11 @@
"dependencies": {
"@anthropic-ai/sdk": "^0.32.1",
"@aws-crypto/sha256-js": "^4.0.0",
"@codingame/monaco-vscode-configuration-service-override": "~8.0.2",
"@codingame/monaco-vscode-files-service-override": "~8.0.2",
"@codingame/monaco-vscode-keybindings-service-override": "~8.0.2",
"@codingame/monaco-vscode-lifecycle-service-override": "~8.0.2",
"@codingame/monaco-vscode-localization-service-override": "~8.0.2",
"@codingame/monaco-vscode-standalone-css-language-features": "~8.0.2",
"@codingame/monaco-vscode-standalone-json-language-features": "~8.0.2",
"@codingame/monaco-vscode-standalone-languages": "~8.0.2",
"@codingame/monaco-vscode-standalone-typescript-language-features": "~8.0.2",
"@codingame/monaco-vscode-configuration-service-override": "~11.1.2",
"@codingame/monaco-vscode-standalone-css-language-features": "~11.1.2",
"@codingame/monaco-vscode-standalone-json-language-features": "~11.1.2",
"@codingame/monaco-vscode-standalone-languages": "~11.1.2",
"@codingame/monaco-vscode-standalone-typescript-language-features": "~11.1.2",
"@json2csv/plainjs": "^7.0.6",
"@leeoniya/ufuzzy": "^1.0.8",
"@mistralai/mistralai": "^1.3.0",
Expand Down Expand Up @@ -122,10 +118,10 @@
"highlight.js": "^11.8.0",
"lucide-svelte": "^0.399.0",
"minimatch": "^10.0.1",
"monaco-editor": "npm:@codingame/monaco-vscode-editor-api@~8.0.2",
"monaco-editor-wrapper": "^5.5.2",
"monaco-editor": "npm:@codingame/monaco-vscode-editor-api@~11.1.2",
"monaco-editor-wrapper": "^6.1.0",
"monaco-graphql": "^1.6.0",
"monaco-languageclient": "~8.8.2",
"monaco-languageclient": "~9.1.0",
"monaco-vim": "^0.4.1",
"ol": "^7.4.0",
"openai": "^4.57.2",
Expand All @@ -142,10 +138,10 @@
"svelte-infinite-loading": "^1.4.0",
"svelte-tiny-virtual-list": "^2.0.5",
"tailwind-merge": "^1.13.2",
"vscode": "npm:@codingame/monaco-vscode-api@~8.0.2",
"vscode": "npm:@codingame/monaco-vscode-api@~11.1.2",
"vscode-languageclient": "~9.0.1",
"vscode-uri": "~3.0.8",
"vscode-ws-jsonrpc": "~3.3.2",
"vscode-ws-jsonrpc": "~3.4.0",
"windmill-parser-wasm-csharp": "^1.437.1",
"windmill-parser-wasm-go": "^1.429.0",
"windmill-parser-wasm-php": "^1.429.0",
Expand Down
6 changes: 1 addition & 5 deletions frontend/src/lib/components/Editor.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -702,6 +702,7 @@
) {
const client = new MonacoLanguageClient({
name: name,
messageTransports: transports,
clientOptions: {
outputChannel,
documentSelector: [lang],
Expand Down Expand Up @@ -732,11 +733,6 @@
})
}
}
},
connectionProvider: {
get: () => {
return Promise.resolve(transports)
}
}
})
return client
Expand Down
6 changes: 0 additions & 6 deletions frontend/src/lib/components/SimpleEditor.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,6 @@
type IDisposable
} from 'monaco-editor'
import '@codingame/monaco-vscode-standalone-languages'
import '@codingame/monaco-vscode-standalone-json-language-features'
import '@codingame/monaco-vscode-standalone-css-language-features'
import '@codingame/monaco-vscode-standalone-typescript-language-features'
import { allClasses } from './apps/editor/componentsPanel/cssUtils'
import { createEventDispatcher, onDestroy, onMount } from 'svelte'
Expand Down Expand Up @@ -436,7 +431,6 @@
</script>

<EditorTheme />

{#if editor && suggestion && code.length === 0}
<div
class="absolute top-[0.05rem] left-[2.05rem] z-10 text-sm text-[#0007] italic font-mono dark:text-[#ffffff56] text-ellipsis overflow-hidden whitespace-nowrap"
Expand Down
20 changes: 12 additions & 8 deletions frontend/src/lib/components/vscode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { initServices } from 'monaco-languageclient/vscode/services'
import getMonarchServiceOverride from '@codingame/monaco-vscode-monarch-service-override'
import '@codingame/monaco-vscode-standalone-typescript-language-features'
import { editor as meditor } from 'monaco-editor/esm/vs/editor/editor.api'
import getConfigurationServiceOverride from '@codingame/monaco-vscode-configuration-service-override'

export let isInitialized = false
export let isInitializing = false
Expand All @@ -16,14 +17,17 @@ export async function initializeVscode(caller?: string) {
try {
// init vscode-api
await initServices({
serviceConfig: {
userServices: {
// ...getThemeServiceOverride(),
// ...getTextmateServiceOverride()
...getMonarchServiceOverride()
},
debugLogging: true,
enableExtHostWorker: false
serviceOverrides: {
// ...getThemeServiceOverride(),
// ...getTextmateServiceOverride()
...getConfigurationServiceOverride(),
...getMonarchServiceOverride()
},
enableExtHostWorker: false,
userConfiguration: {
json: JSON.stringify({
'editor.experimental.asyncTokenization': true
})
}
})
isInitialized = true
Expand Down
79 changes: 42 additions & 37 deletions frontend/src/lib/monaco_workers/build_workers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,43 +7,48 @@ import { useWorkerFactory } from 'monaco-editor-wrapper/workerFactory'

export function buildWorkerDefinition() {
useWorkerFactory({
ignoreMapping: true,
workerLoaders: {
editorWorkerService: () => {
return new Worker(new URL('monaco-editor-wrapper/workers/module/editor', import.meta.url), {
type: 'module'
})
},
javascript: () => {
return new Worker(new URL('monaco-editor-wrapper/workers/module/ts', import.meta.url), {
type: 'module'
})
},
typescript: () => {
return new Worker(new URL('monaco-editor-wrapper/workers/module/ts', import.meta.url), {
type: 'module'
})
},
json: () => {
return new Worker(new URL('monaco-editor-wrapper/workers/module/json', import.meta.url), {
type: 'module'
})
},
html: () => {
return new Worker(new URL('monaco-editor-wrapper/workers/module/html', import.meta.url), {
type: 'module'
})
},
css: () => {
return new Worker(new URL('monaco-editor-wrapper/workers/module/css', import.meta.url), {
type: 'module'
})
},
graphql: () => {
console.log('Creating graphql worker')
return new Worker(new URL(`./graphql.worker.bundle.js`, import.meta.url), {
name: 'graphql'
})
workerOverrides: {
ignoreMapping: true,
workerLoaders: {
editorWorkerService: () => {
return new Worker(
new URL('monaco-editor-wrapper/workers/module/editor', import.meta.url),
{
type: 'module'
}
)
},
javascript: () => {
return new Worker(new URL('monaco-editor-wrapper/workers/module/ts', import.meta.url), {
type: 'module'
})
},
typescript: () => {
return new Worker(new URL('monaco-editor-wrapper/workers/module/ts', import.meta.url), {
type: 'module'
})
},
json: () => {
return new Worker(new URL('monaco-editor-wrapper/workers/module/json', import.meta.url), {
type: 'module'
})
},
html: () => {
return new Worker(new URL('monaco-editor-wrapper/workers/module/html', import.meta.url), {
type: 'module'
})
},
css: () => {
return new Worker(new URL('monaco-editor-wrapper/workers/module/css', import.meta.url), {
type: 'module'
})
},
graphql: () => {
console.log('Creating graphql worker')
return new Worker(new URL(`./graphql.worker.bundle.js`, import.meta.url), {
name: 'graphql'
})
}
}
}
})
Expand Down
Loading

0 comments on commit b455f5b

Please sign in to comment.