-
-
Notifications
You must be signed in to change notification settings - Fork 178
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Using monaco workers for language support #633
Comments
Hi,
You can't really separate monaco from VScode, that's the same things, VSCode is built around monaco
I would be surprised there is a language supported by monaco but not VSCode, do you have an example?
It's bundled with the monaco-editor package directly, but with monaco-vscode-api/monaco-languageclient, they are separate packages (
The monaco-editor api is still exposed via the The only exception is libraries importing internal monaco-editor modules directly, those modules should be whitelisted in monaco-vscode-api (which seems to be the case for monaco-graphql, I'll whitelist them)
Since a few weeks ago, you can chose to use monaco/monarch languages (If you don't enable theme/textmate services). The default ones are packaged in |
Hi @rubenfiszel the following example let's you start the same Langium Grammar DSL example with monarch and textmate grammars: https://github.com/TypeFox/monaco-languageclient/blob/main/packages/examples/src/langium/langium-dsl/wrapperLangium.ts
Check the Configuration section it details which services are loaded in which configuration. |
Also, the multi-editor example makes use of the standalone packages @CGNonofr mentioned above. |
With CodinGame/monaco-vscode-api#391, I've managed to make monaco-graphql work |
Thanks for the super quick responses. I will give it a try this weekend with all this new information! |
Ok I've played with it for a few hours and I've hit a few roadblocks. I am using vite and have different issues between Some issues I now suspect would be solved by using https://github.com/CodinGame/monaco-vscode-api#if-you-use-vite
When using
which doesn't exist in the dist folders (this is using npm run preview, after npm run build) |
Also it seems graphql doesn't exist as a standalone vscode-api feature package |
@rubenfiszel With |
How is it imported in your codebase?
What do you mean? You can either use the graphql VSCode extension or the monaco library now |
I didn't find a package
Like this:
Those packages are custom to us (but public) and build by ourselves using wasm-pack: https://rustwasm.github.io/docs/wasm-pack/ |
Any clue about why the workers are imported from:
when doing a static build ? I would have expected vite to export those into an assets folder in the dist/build folder and refer to those directly |
Graphql is not a VSCode
Maybe init(new URL('windmill-parser-wasm/windmill_parser_wasm_bg.wasm', import.meta.url).href) |
What I'm trying to import is: so if I understand right it's part of default monaco but not default vscode?
Will try, thanks! |
Oh my bad, you're just talking about the syntax highlighting, not the intellisense, then the package you're looking for is |
@rubenfiszel it tries to load the bundled workers that are part of the npm package from a relative location. That is why you can override the The other possibility is to override all required instructions. |
Hi @rubenfiszel any news regarding this? |
I did another attempt 2 weeks ago but was unsuccessful but also didn't have enough time to investigate why. Our current setup work perfectly which is why it's not urgent to upgrade. All of our code is open-source: https://github.com/windmill-labs/windmill I was wondering if you provided any consulting services since our WebIDE is a very important part of our product, and monaco-languageclient is the core of it. As soon as I have some more cycles, I will come back to it. Thanks a lot for the support and detailed answers so far! |
Hi @rubenfiszel TypeFox offers consulting if you want more direct or timely support. Independently of that I hope that we now reached a state where future updates will not be as disruptive as they were in the past. We will add more examples/verification examples that ensure directly the stack is working. |
Hi,
I'm trying to upgrade from a previous version of the monaco-languageclient.
I'm only interested in the language client and otherwise prefer to load monaco than vscode, especially for languages that we are not supported by vscode at the moment.
To load workers for client-side languages, I previously used:
and an extension such as: https://www.npmjs.com/package/monaco-graphql which assume some monaco contribs are there.
With the new version of monaco-languageclient this seems to not be possible anymore because my understanding is that it doesn't use monaco but vscode instead.
How can I support those languages as I did previously ? I see there are vscode language default extensions that could support most of the languages except graphql, but it seems to me that it requires textmate and that it's heavier than the usual monaco language support.
Our use-case is for windmill (https://github.com/windmill-labs/windmill) and users close and start editors a lot, as soon as they change nodes in the app or flow editor. Hence, I would prefer a more lightweight situation.
I'm currently stuck unable to upgrade.
The text was updated successfully, but these errors were encountered: