-
-
Notifications
You must be signed in to change notification settings - Fork 182
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
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
Get LanguageClient of LSP running in WebExtension #750
Comments
In addition, I execute custom commands with: monacoEditorRef.current?.executeCommand(...) ...which throw intial error messages because the |
@P422L is this web extension created by you? You need to communicate with that extension somehow, because it runs isolated from your editor code above. A |
@kaisalmen Thank you for your quick reply. Yes it is my extension and I have tried both the I lack a bit of understanding of how to connect my React component with my Monaco Editor (running in a worker) to the LanguageClient (running in a worker in a WebExtension). The approach with the MessageChannel sounds good, but as far as I understand it I have to pass it, otherwise I can't communicate on the same channel. Do you have a short example? |
@kaisalmen I would still appreciate a small code snippet that shows me how to set up the communication to an extension in a webworker. 😅 |
@P422L sorry, I don't have a ready example for your problem. I am working on PR #734 where the languageclient / server communication and the file exchange is routed via message channels. This is still WIP. This is not exactly what you need, but may help. You need to pass the message port via a transferables to a worker. You can pass the two ports of a channel to different workers and then use that channel for inter-worker communication. |
@kaisalmen unfortunately, that doesn't really help me. My problem is that I don't understand how I can continuously pass something to a worker in a web extension. |
@pbrostean / @P422L I have to see if I can find an example. |
As this is not an issue but rather a question for help i think this can be closed and reopened for discussion if needed. |
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
Description
I have created a
MonacoEditorReactComp
with the followinguserConfig
:The LSP functionalities work as expected, meaning my Monaco editor is definitely connected to the
LanguageClient
from the.vsix
file, and thisLanguageClient
is also connected to theLanguageServer
running in the extension.Use Case
I need to react to a custom state of the
LanguageClient
, meaning I need a way to communicate between theLanguageClient
and my editor. Currently, I only see options to access theLanguageClient
and the connection when I create it in the config, but not when I want to access aLanguageClient
in an extension.Question
How can I obtain the connection details for a
LanguageClient
that is running in an extension, so I can communicate with it from my editor? Is there no way I can access it via the id?The text was updated successfully, but these errors were encountered: