-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
[plugin][languages]Add Plugin API for language server contribution #3805
Conversation
registerLanguageClientContribution(clientContribution: LanguageClientContribution): Disposable { | ||
const id = clientContribution.id; | ||
if (this.isRegistered(id)) { | ||
console.warn(`Language contribution with type '${id}' already registered.`); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hello, use of Logger ?
} | ||
|
||
private isRegistered(languageId: string): boolean { | ||
for (const id of this.languageClientContributors.keys()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(maybe then we don't need a method for that)
Adding review of @akosyakov as |
@svor here are some questions
|
also you may discuss with @evidolob but AFAIK it should go on the "proposed" scope as the API might change after ppl start to play with it |
With the plugin system in place, I don't really see a point of exposing in Theia plugin API something what should be deprecated eventually. //cc @svenefftinge |
I've made some changes, now the export namespace languageServer {
/**
* Registers new language server.
*
* @param languageServerInfo information about the language server
*/
export function registerLanguageServerProvider(languageServerInfo: LanguageServerInfo): void;
/**
* Stops the language server.
*
* @param id language server's id
*/
export function stop(id: string): void;
} and this
I didn't think how the new Language Server should be stopped or unregistered, so for now I've added one more method into API to make it possible.
I have another field to describe parameters or arguments for the command: /**
* Command's arguments.
*/
args: string[]; or i misunderstood your question?
PluginLanguageClientContribution extends BaseLanguageClientContribution which has To check this API I've created a plugin which is based on XML language server and I'm going to provide a PR into theia-samples with this plugin when current PR will be resolved. |
should return a Disposable object ? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm fine for plug-in/ext changes as it goes on a proposed.d.ts, need approval of @akosyakov for languages changes
The comment from @akosyakov really should be addressed before merge. Please ask if it is unclear. |
@akosyakov the extension point this PR introduces is for contributing language servers. The fact that it is implemented using MonacoLanguageClient is not not exposed in the API and therefore not relevant to the discussion I'll let @benoitf take over this discussion, though, since I'll be on vacation starting tonight. |
I'm on vacation starting today as well.
Agreed, such strategic decisions should be discussed/decided by Theia community.
For Theia project, ability to run VS Code extensions in Theia, and even vice versa, to run Theia plugins in VS Code, is important. It makes easier for (VS Code extension) developers to use Theia API namespace without fear to be locked-in and invest time in the platform that does not have yet big user base in comparison to VS Code. Having interchangeable vscode and theia APIs next to each other would attract such devs. I don't understand why we would create artificial barriers for devs.
We don't have any control over Monaco, LSP and DAP as well. In order to contribute to LSP, one should provide the implementation for one of the clients. Even with one implementation, one should still wait when VS Code team align proposed features with vscode APIs. By allowing and aligning Theia and VS Code APIs, we make it easier for VS Code team and it would be less work for us to align with them.
We should not have several ways of doing the same thing in the framework. If using and collaborating on |
We're not creating artificial barrier. Also the initial plan was described 6 month ago there #1482 so no surprise here.
It would limit the innovation. Also some usecase may be valid only for "online" IDE vs a Desktop IDE. So better to have compliance but still permit other ways required by other behaviors.
Disagreeing. Framework is open and should leverage innovation, not being blocked-up on waiting VSCode decide to do something. And wait again before being able to use it. Compliance doesn't imply to be default. AFAIK Theia is a framework, not a product. Based on the previous feedback, let see how to modify only plug-in extension and not languages package. As it's a proposal API, it can be tested, changed, updated and even removed if it goes really wrong. |
@benoitf now all changes are located in |
@svor FYI branch has some conflicts |
Signed-off-by: Valeriy Svydenko <vsvydenk@redhat.com>
LGTM now, all stuff is only related to plug-ins |
Signed-off-by: Valeriy Svydenko vsvydenk@redhat.com
This PR provides simple Plugin API as proposed which allows to register new Language Server from the plug-in. For this was added new namespace:
To register new Language Server a plugin has to call
registerLanguageServerContribution(languageContribution: PluginLanguageContribution)
where
languageContribution
provides an information about LS contribution:To stop the language server need to call
languageServer.stop(languageServerId)