Closed svor closed 5 years ago
Why plugins should use LanguageClient
from Theia frontend? Can they create own instances of LanguageClient
from pure vscode-languageclient-node
package as VS Code extensions do it? Such instances contribute language features via vscode
extension API, implemented by theia
plugin API.
@akosyakov no, the vscode-languageclient-node uses api from the vscode namespace, which is explicitly not available to theia plugins. @benoitf
I think we should change the architecture on the backend so, that there is an inversify scope per frontend (we could bind it to the lifecycle of websocket connection for now). Anything injected in within that scope would be using that connection, so we would no longer need to broadcast messaged to all clients if we don't want to. Still the outer global scope can be used to have shared functionality and state, like e.g. the optimized file watcher.
This would also mean that we would start a plug-in per frontend connection, but I think that's just right. @akosyakov has prototyped this approach very locally for having a command service within the debug adapter. I think this should be changed across Theia.
@svenefftinge How is your comment related to this work? I don't understand.
@tsmaeder MonacoLanguageClient
on the frontend is implemented by shimming relevant vscode apis, which is not quite trivial to maintain. With plugin system, I've hoped just use vscode-languageclient-node
in theia plugins and forget of maintenance effort of MonacoLanguageClient
. Would not it be easy to allow explicitly to use vscode
api from theia plugins?
@akosyakov Should we have a separate extension/plugin alongside for broadcast? I am working on PoC, I can push changes if you guys are interested.
Need to implement a way to communicate between the plugin and Theia via
IConnection
. It should be a general solution for different implementations of Language Server and Debug Adpater to make it possible to send and receive json-rpc messages.For example when the plugin wants to start Language Server it has to have an ability to register IConnection to make it possible to communicate with the client of Language Server which was created on Theia.
Also we need to have some registry of IConnection because at the same time can be created many connections between plugins and Theia.
cc @evidolob @tolusha @tsmaeder @benoitf