Closed jvican closed 2 years ago
I fixed this, will make a PR, but the diagnostics issue is still happening. @rwols Do you know what might be going on? I think the LSP server is sending the diagnostics and Sublime is not showing them because the file is not open. Is that possible?
Thanks for for the fix @jvican.
As for the other issue, from my understanding it is a limitation of the LSP package on which this package rely. @rwols Is there an existing issue on the LSP repo ?
Thanks for the answer. Now that you say it, it makes sense it's a problem on the LSP package. I think this is quite a severe limitation because it gives the impression that the changes the user is doing in the editor are OK when they are really not. Delaying or hiding diagnostics for other messages ends up getting in the way of my workflow. @rwols Would it be possible to get a fix for that in the plugin? How much would it take?
Exactly what’s the problem?
Oh the diagnostics. Yeah, we only show diags for open files. I don’t have any plans to change this, but we’re always open to pull requests.
If I remember correctly the difficulty on the LSP package side is about keeping track of diagnostics for files that aren't open. @jvican I recommend you create an issue on the LSP package so that we can discuss this issue and possible solutions there.
As for the didFocusTextDocument
notification just ping me for a review.
I will do that, will elaborate on why this is important for languages such as Scala.
The underlying pain described in this issue has been fixed in https://github.com/sublimelsp/LSP/issues/1868#event-5514967250 and it will be released soon.
I'm using the latest Metals Sublime release with the latest Sublime Text release (Build 4116) and I'm getting the following errors in the Metals server log panel:
This suggests that we're not sending the
didFocusTextDocument
well to the Metals server and it's potentially causing misbehaviors on the server. Looks like we might need to change the ST4 implementation herehttps://github.com/scalameta/metals-sublime/blob/b95de4f46262d1576cf36b65a79f7e87f577d7a1/st4/LspMetalsFocus.py#L9-L33
@ayoub-benali You're the last person that made the change, do you know what might be going on? Also, I've experienced cases where Metals is not publishing compilation errors for files that are not open. Every time it's happened has been annoying and unpredictable. I'm not sure if this is connected to that issue, but you might want to know about it. Let me know if you have any ideas here because I'd be willing to invest some time fixing the issue with missing diagnostics.