-
Notifications
You must be signed in to change notification settings - Fork 184
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
Multi-server views do not send requests to (all) capable servers for hover, actions etc. #562
Comments
I didn't have eslint-server installed for months now and typescript checking was sometimes working and sometimes not so it can't be the exact reason for the failure (maybe contributes to some timing issue?). |
It's absolutely possible that an un-startable config causes unexpected issues finding the "right" working language server session. So if you have eslint-server enabled but not installed you have sporadic ts-ls functionality? |
To be fair I don't think eslint failure to start is relevant. Maybe only in terms of changing timing a bit. I've now installed that server and still having same issue occasionally. I'll have to look into that issue more at one point but I don't have time for it right now. |
I digged deeper and found the problem that is the cause of this. Seems to be due to fundamental limitation in this package, that makes it only consider one language server per file. Or at least for some of the actions like So if I have two servers registered for a file, for example eslint and typescript, and I hover some symbol in a file, if eslint is the one that hover action picks, nothing will show up as eslint doesn't provide Probably the right way to fix it would be to let all servers handle request like |
Great find! |
Another issue here is the debug logging doesn't tell you which server is receiving certain requests, perhaps we should replace the LSP prefix with the server's name there! |
Yes, that was annoying during debugging this problem. Had to add extra prints for that. |
Also I was thinking that it would make sense to create separate console for LSP related (debug) messages. Then LSP prefix would definitively not be needed. |
Yes, but some users may not want that (one shared console means easier to correlate LSP messages with other debug logging) |
I wonder how high is this issue on your (hypothetical) roadmap? It's quite important for me as I would like to use eslint and typescript servers at the same time and currently it doesn't make sense as I will loose hover diagnostics for one of them. I wonder if I should start investigating this myself, but you probably wouldn't want someone with not-so-great understanding of the code suddenly rewriting big portions of it ;). |
It's not the highest on the roadmap :) When you say "hover diagnostics" I am a bit confused, LSP should be showing diagnostics from both servers in the popup already. But the symbol hover requested from the server could absolutely suffer from the issue you described - and a first step would be for LSP to only request from the server that supports hover requests. |
I did some work on this (will link a PR if it matures), but also got the eslint plugin to the typescript server working, which removes one language server from your equation. Check the discussion on gitter of the last month about https://github.com/Quramy/typescript-eslint-language-service |
I honestly can't make this plugin work. Also I wonder if it would work with plain JS files as that is what I'm using typescript lang server for mostly. |
LSP (in master) should now pick the right language server based on cursor position and capability. Would appreciate if you could test and feedback! As discussed earlier, requesting things like completions from multiple servers and concatenating is a lot of complexity when the majority LSP users are likely served by a single process per language. In your case, I suspect the codeAction feature will not work as expected if both the typescript and eslint servers have the capability. I didn't try this, but removing scopes from the eslint client config might have solved your issue as well. |
I will try later. I've tried to quickly check now but can't make eslint server report anything. Need to re-figure that out.
Which scopes are you thinking of? In case of vue files, it needs to run on whole file, same as LSP-vue. |
The scopes like “source.js” assigned to the eslint server in your LSP
settings. But try the latest changes instead!
…On Tue, Sep 10, 2019 at 12:55 PM Rafał Chłodnicki ***@***.***> wrote:
I didn't try this, but removing scopes from the eslint client config might
have solved your issue as well.
Which scopes are thinking of? In case of vue files, it needs to run on
whole file, same as LSP-vue.
—
You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHub
<#562>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABBRGOFKB5UTFH25WXFF2LTQI54K5ANCNFSM4HFFXCZQ>
.
|
@tomv564 I've tested now. Apparently I had to hack eslint server by hardcoding response to But now that's done, the hover works for both servers running simultaneously but the squiggly lines added by eslint server over the errors are removed by lsp-vue server second later. So it's not very usable still. |
I've created this LSP-eslint package that includes hacked server for easy testing. This is the hacking I had to do: https://github.com/rchl/LSP-eslint/commit/976532f8968c282a24f075a98e7d2f51d80dbb60 |
Thanks, the regions disappearing for diagnostics in views is a bug - I started a fix but I'll take a bit of extra time to clean up some ugliness in that logic. |
The DiagnosticUpdate had a misleading "diagnostics" member that is incomplete, this was removed. For issue #562
@rchl servers should not be fighting to get their squigglies to stay anymore, can you verify? |
I can confirm that it's fixed. Thank you. :) |
@tomv564 Getting this error though:
On commit 3b8686e |
@tomv564 Hmm, maybe I wasn't on latest master at the time of the error. I think maybe package control override my linked LSP with latest release. I can't reproduce the error now. |
@tomv564 Me again. Sorry, that error actually does trigger with eslint server. Repro: In an empty file, type one character. It seems to be something to do with offsets being out of range. Logs:
|
Yes, that error showed up in your logs earlier and I think it's the server not following the spec with that diagnostic: Both character and line can only be integers in |
I've created issue and PR in vscode-eslint project. |
Saw your fix got merged, nice one! To get back to this issue, are code actions from eslint and your js server working correctly? |
Yes, all works fine as far as this issue. :) |
I don't have any concrete bug repro yet but often, after starting Sublime, LSP will just not work for certain files.
I've quickly enabled logging and these were the first messages that I've gotten:
In that state, SublimeLSP doesn't provide any typescript checking on typing or hovering variables.
Could it be that failure to start eslint server makes typescript checking not work either??
(I've redacted some sensitive information).
The text was updated successfully, but these errors were encountered: