CompletionProvider for Monaco #1454
Replies: 2 comments 1 reply
-
Hey @Lemour-sudo, you can always just use the On a performance note: This could easily block the main thread of monaco, since the completion computation (and whole document handling) can be pretty expensive on large documents. So you should attempt to do this in a worker thread.
I'm a bit confused by that. Langium in itself is roughly ~300kb minified. Adding a language on top of that is something in the range of ~200kb + any additional code that you have added to the language implementation. Using Langium in a language server in a separate bundle or in the main bundle for monaco shouldn't have any influence on total build size. You will always need to add the Langium dependency (+ transitive dependencies) and your language code to the bundle. Or is it the monaco-languageclient support that is actually the heavy stuff? |
Beta Was this translation helpful? Give feedback.
-
I will look more into the provider required to register in monaco. I was under the impression that this would be possible without requiring a
Yes. I have been trying to use the Langium lsp through the monaco-languageclient and the size of the bundle increases drastically to about 9mb. I added an issue on their repo to query on this problem: CodinGame/monaco-vscode-api#383. It turns out that it is inevitable to initialize the required vscode services in order to use the client that can be used to communicate with the server. |
Beta Was this translation helpful? Give feedback.
-
Is there a way to get the
CompletionItemProvider
for a language from Langium such that it can be used to register a completion provider for a language in monacoThe lsp is a great solution in most cases, but it easily results in large bundle sizes which can not be deployed on sites running on limited memory environments. Having provider object for functionalities like completion and diagnostics that can be registered onto monaco will be of great help.
Beta Was this translation helpful? Give feedback.
All reactions