Repository navigation
feat: Implement automated installation for user-defined language servers - #1047
Conversation
|
@rcjsuen could you test this PR (please note that it is not finished) by installing the zip https://github.com/redhat-developer/lsp4ij?tab=readme-ov-file#testing-the-ci-builds and give me a lot of feedbacks:
Thanks! |
eb047c6 to
ec0eb2d
Compare
rcjsuen
left a comment
There was a problem hiding this comment.
@rcjsuen could you test this PR (please note that it is not finished) by installing the zip https://github.com/redhat-developer/lsp4ij?tab=readme-ov-file#testing-the-ci-builds and give me a lot of feedbacks
Hi @angelozerr, I have installed the plugin from this build.
- I tried the Docker Language Server first. It has no installation option but the link is still there. Clicking on the link does nothing and did not produce an error message. Is the expectation that all language servers have an installation option or should we disable this page if the JSON file is empty and/or malformed?
- I can click the install button in the "New Language Server" dialog and then errors start appearing behind everything. This seems counterintuitive.
- After installing the TypeScript Language Server the toast notification stays up for a while. I would have expected it to disappear immediately/faster after clicking on the "Globally" hyperlink button.
- Horizontal scrolling is terrible. Could we add a "Copy" button somewhere so that I can copy and paste the terminal output somewhere for me to read more easily? Or maybe a way to "open the message as a file"? Consider taking the terminal output and then a) putting the content into a temporary file and then b) opening it as a read-only buffer/file in JetBrains? Or maybe JetBrains can just let you open a
byte[]orString? I don't know.
- As
openUrlis not implemented yet I did not test that. - As for the JSON schema, I don't really have a strong opinion either way. Instead of
{ "exec": { "command": ... } }you could consider doing{ "type": "exec", "args": { ... } }and then you can do the same for{ "type": "openUrl", "args": { ... } }and have everything havetypeandargs. It's not the end of the world which way you end up taking. We should just make sure it is reasonably extensible I think.
| public boolean run(@NotNull InstallerContext context) { | ||
| Ref<StepAction> selectedAction = new Ref<>(); | ||
| Notification notification = new Notification(ServerMessageHandler.LSP_WINDOW_SHOW_MESSAGE_GROUP_ID, | ||
| "Install error", |
There was a problem hiding this comment.
We might want to make this message title configurable. I clicked "Launch installation" and I get an "Install error" message telling me it's not installed. It doesn't make sense in this case for it to be an error because I purposely clicked on "Launch installation". I know it is not installed and that is why I am trying to install it.
| context.printError("✗ " + output.getStderr()); | ||
| return false; | ||
| } | ||
|
|
||
| context.print("✓ " + output.getStdout()); |
There was a problem hiding this comment.
How is JetBrains support for emojis in terminals? Maybe we could consider using ✅ and ❌ to make it clearer at a glance? Alternatively, adding the words like "Success" or "Failure" might help. I find these unicode checkmarks and X marks a little small myself.
|
@rcjsuen thanks for your feedback. All your feedbacks show that the current PR is very bad, but it is normal because it is not finished. I would like just to have feedback from the general idea. Do you like the idea? I have changed the JSON descriptor and now we have a check and run section. It will help when I will integrate this JSON installer when language server will start. Please be patient and let me provide a more stable PR. |
Yes sure we should disable it, but it is not the hard part :) For Docker Language Serve, I expect that you do a contribution when PR will be merged.
Indeed I should take care about that.
Indeed, it is not implemented. For now I am working on download support.
I don't know, I have implemented very quickly this console. I wanted to have traces.
Indeed
I had started with type idea, but it is more verbose and for JSON Schema I think it is impossible to manage that. |
Yes, sorry, I guess I did not answer that question itself now that I look back at what I wrote. :P I think the idea is good and should be easy for people to implement. In the worst/hard cases language server developers can at least just use I wonder about the UX if a separate modal dialog could be used so users can slowly advance/proceed through the process like a regular installer (like wizards in Eclipse). |
I think it is a bad idea to block the UI (vscode for instance avoid doing that). More this installer will be used when language server will be started (ex: when user will open a file which is associated to a language server). Perhaps we could manage modal UI in the future, but for now I would like to try to cover installer for all existing templates. Let's go step by step. |
Okay, yeah, if you're thinking of initializing the process when the user opens a file then I agree that a blocking UI would not be good. Makes sense to me. |
7529f83 to
c4c988d
Compare
3cabb4b to
80b0226
Compare
5fba311 to
77bd85c
Compare
493a7df to
5eeb6e7
Compare
0e6183d to
ec88e56
Compare
Fixes redhat-developer#999 Signed-off-by: azerr <[email protected]>
ec88e56 to
91b0abe
Compare
|
@rcjsuen even if it is not perfect, I decided to merge the PR. Once https://github.com/redhat-developer/lsp4ij/actions/runs/15211836313 will be finished you will able to install nighty. I suggest that you see https://github.com/redhat-developer/lsp4ij/blob/main/src/main/resources/templates/typescript-language-server/installer.json to contribuet with your installer. You will see that it is very simple and there is no dialog message. It is possible to have a showMessage dialog but there were too many problems (like you have seen with task which doesn't stop). My main goal was to provide an installer which is working. It should work with rust, clangd, typescript. I will implement installer.json for other language server later. Please not that this installer is working with also with DAP server. For instance of you want to debuh JS with https://github.com/redhat-developer/lsp4ij/blob/main/docs/dap/user-defined-dap/vscode-js-debug.md, now you will not need to download yourself the vscode-js-debug zip and not to update the DAP server command. It would work out of the box. If you have time, please test rust and clangd since installer depends on OS. For the moment there is no doc, you can read smart-data-lake/sdl-lsp#19 (comment) I know that it is not perfect, don't hesitate to create any issues to improve this declarative installer. |




feat: Implement automated installation for user-defined language servers
Fixes #999
This PR starts working but it requires a lot of improvement. The PR adds now an Installer tab:
The main idea is to declare with JSON the steps to check installation and install the server (but I repeat me it is a draft for the moment). step can be:
exec: to execute a command (ex :where nodefor windows andwhich nodefor other OS)showMessageto show message with some buttons which execute an another step.openUrito open a website uri (not already implemented)downloadto download some language server (not already implemented)refto reference an another step (not already implemented)onFailto execute an another step when step fails.Here the sample with typescript-language-server:
When you click on Launch Installation, it execute steps:. You can see that in the right console and for this installer it show a message to install Globally the ls:
When you click on Globally it execute the npm install: