Closed l0rd closed 5 years ago
I don't really understand what the deliverable is here. Can you explain? Also a LS in the form of a VSCode plugin should be able to run as a VSCode plugin unchanged, no? Nothing to do.
My understanding is that there wouldn't be anything to do if we supported LS in the form of VSCode plugins only (we could use VS Code language client). But we want to support LS in the form of Theia plugin too. So we need a library that handles that second case transparently.
@benoitf am I right? Do you want to add something to that issue description?
@l0rd @benoitf I think there is nothing preventing us from using vscode-language-client in a Theia plugin. After all it's just binding code for hooking up a remote process to the vscode language support plugin api (like "registerReferencesProvider".
@l0rd you're correct. The idea is to map what is required for LSP on top of Theia API. It could reuse some part of vscode langage client but it shouldn't use any of vscode
namespace.
This namespace is not owned by US and may change at any time.
besides the vscode namespace is only provided to VSCode extensions, in a theia plugin you never see any "vscode namespace" so I think description for theia plug-in should be adjusted to
For a LS in the form of a Theia plugin
--> call @theia/language-client
--> call Theia API
Also some stuff might be supported only in a Theia context and not in VS code.
Well, if I understand correctly, we're passing the theia API as the vscode api to VSCode plugins, so if they are not compatibly, we would crash? My approach currently is to create our own 'vscode.ts' module that contains enough vscode API to make the vscode language server lib work.
But I think, the whole thing is much more simple, actually. In Theia, language server back end and front end contributions are already separate, so Theia know how to hook up the messages from a language server to the UI (code completion, etc.). So all we need is a plugin API for running a language server and hooking up the appropriate streams. I guess we'd have to set up some tunneling over the plugin API?
if library is not complex, then yes it can be added to the plugin's API and it will be much more easier then to write LSP for theia.(no external dependency)
BTW I think we really need a LSP example for theia like https://github.com/Microsoft/vscode-extension-samples/tree/master/lsp-sample
To me, the simplest thing to do here is to make the back-end extension point usable as a plugin:
export interface LanguageServerContribution extends LanguageContribution {
start(clientConnection: IConnection): void;
}
For that, we'd have to provide:
registerLanguageServerContribution(LanguageServerContribution)
However, one problem I see is that we have to tunnel the "IConnection" we get from the start method through the plugin API connection. Otherwise, we'd have to be able to open a second connection between the "back end" and the container running the plugin.
Hello, few questions:
registerSomethingProvider
. Is the meaning of contribution and provider are the same ? if so, maybe it should be a Provider as wellextends LanguageContribution
@benoitf my suggestion is a conceptual one, not literal. Changes are left as an exercise to the reader.
I think this task consists of the following tasks:
Related PR https://github.com/theia-ide/theia/pull/3805
Description
This issue is about implementing a wrapper (in the form of a npm library) that allows using VSCode language client to support both Theia and VSCode language servers.
The Theia library will be published on npmjs registry
How it works:
For a LS in the form of a VScode extension --> call
vscode-language-client
--> callvscode API
--> mapping to Theia APIFor a LS in the form of a Theia plugin --> call to
theia-to-vscode-wrapper
--> callvscode-language-client
--> callvscode API
--> mapping to Theia API