-
Notifications
You must be signed in to change notification settings - Fork 58
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
Add Language Servers View #519
Conversation
8bd3cfb
to
76b8026
Compare
@ahmedneilhussain since you are doing a lot of refactoring lately maybe you have some ideas regarding the open issues? |
I'm looking at the LS lifecycle code at the moment in an attempt to tidy it up and make the started/stopped/error states a little bit more explicit and atomic. I'll see what can be done. |
b9c1e78
to
cc99fff
Compare
Hi @sebthom I've been busy wading through the LS lifecycle code (in I think it would be relatively straightforward to have LSW instances call a method on Start and stop are obviously explicitly called methods that are easy to hook into. I think we could also add a 'whenComplete' hook onto I think we could also expose some of the server info on |
The fields on |
Just for your informartion, I have ported LSP4E classes (LanguageServerWrapper, etc) in IJ and I provide a LSP consoles which show both the started language server and the console. IMHO I think it is better to have processes and console in the same view. Here a screenshot: I have managed too lifecycle (starting, stopping, started, stopped) of language server to update UI according the sate: |
e8da82f
to
50cbf53
Compare
@angelozerr that looks really nice... unfortunately you implemented it for the "wrong" IDE :-) I don't have the resources to match this in Eclipse atm. I still believe that the language server view offered by this PR is a worthwhile addition and can be extended later if required. |
Indeed I'm an Eclipse user, but I love discovering anything like vscode and IJ. I wanted just to share with you my feature that I think it could be very nice on LSP4E.
yes sure! |
@sebthom , I have not followed this PR, but it would be great if we could merge before the new release is done. Is it in an state where could merge it? |
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'd like to release LSP4E today or tomorrow, and I'm not comfortable with the idea of merging it big chunks of lowly-tested code into the codebase just before a release.
I also have concerns with the code that is relatively intrusive (introducing interfaces that core APIs must implement rather than using adapters) while the view itself would rather be totally standalone, and maybe even worth being part of a seperate bundle.
I will try to give a more precise review after the release.
Additionally to those technical concerns, I have a "strategical" one: if we give possibility to workaround possible issues with LS by giving control over the process, doesn't it bring a risk that people just rely more and more on workarounds rather than actually fixing the causes?...
org.eclipse.lsp4e/src/org/eclipse/lsp4e/LanguageServerWrapper.java
Outdated
Show resolved
Hide resolved
org.eclipse.lsp4e/src/org/eclipse/lsp4e/ui/LanguageServerProcessesView.java
Outdated
Show resolved
Hide resolved
|
||
private void updateViewerInput() { | ||
final var currentElements = (Object[]) viewer.getInput(); | ||
final var newElements = LanguageServiceAccessor.startedServers.stream().filter(LanguageServerWrapper::isActive) |
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.
Could something like LanguageServers.anyMatching().collectAll((w, t) -> w)
work?
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 don't see how. Each LanguageServers
instance is for a specific document or project and obtained via LanguageServers#forDocument
or LanguageServers#forProject
. I need a list of all running LS no matter for which project or document.
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.
Additionally to the inlined comments, here are some suggestions:
- Use ProcessHandle that does everything well
- Use some adapterFactories to adapt the StreamProvider and LanguageServerWrapper to ProcessHandle; and consumers just call
Adapters.adapt(wrapper, ProcessHandle.class)
. This prevents API from extra interface hierarchy - I don't think such view is useful for the average user. I would rather see it part of a new dedicated bundle (eg org.eclipse.lsp4e.sdk) that is dedicated to LS management, monitoring, debugging... in the IDE.
org.eclipse.lsp4e/src/org/eclipse/lsp4e/server/ProcessInfo.java
Outdated
Show resolved
Hide resolved
org.eclipse.lsp4e/src/org/eclipse/lsp4e/server/ProcessStreamConnectionProvider.java
Outdated
Show resolved
Hide resolved
org.eclipse.lsp4e/src/org/eclipse/lsp4e/LanguageServerWrapper.java
Outdated
Show resolved
Hide resolved
org.eclipse.lsp4e/src/org/eclipse/lsp4e/LanguageServerWrapper.java
Outdated
Show resolved
Hide resolved
Thanks! |
Thanks a lot, I am looking forward for this feature. |
This PR addresses #518 and introduces a new "Language Server Processes" view, looking like this: