-
-
Notifications
You must be signed in to change notification settings - Fork 661
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
Upgrade Diagnostics to JSON-RPC #9134
Comments
What method names should we use here? |
Hm... Do these two even need separate methods? It could be as simple as I also wonder if it would make sense to be able to specify a list of files in a single request for future-proofing (we might want diagnostics for all files that are currently opened in the editor, for instance). Or would that not really be much more efficient than N separate requests anyhow? |
We could support multiple files, though I don't know in which case this would actually be useful. The problem with omitting file is that we have some logic related to |
Hm, that reminds me, we talked about being able to provide the contents for multiple files, not just the display file (since there can be multiple files with unsaved changes in an editor). The current approach of only updating diagnostics of the currently focused file has some drawbacks. Sometimes it leads to errors from other open files sticking around when they've already been fixed. That's why we might want to update diagnostics for all open editors at once someday - at least if it's not much more expensive to do so. |
Alright, I'll work towards supporting multiple files then. And yes, having |
I guess we would have to keep Any thoughts on the performance of requesting diagnostics for 1 file vs N files (where N is maybe 10 or so) - is that something that has gotten a lot cheaper with that recent texpr refactor? I guess we would have to measure to be sure if that's viable. |
We would still support 1 diagnostics with N files is definitely faster than N diagnostics with 1 file due to the way diagnostics is implemented. Though this is likely something we should look into as a separate issue. |
@kLabz I've assigned you to this because you're currently working in a very related area. Would be good to finally get this done. Ideally, I'd like to entirely remove all the old |
This shouldn't be hard to implement, but I'm not sure how the choice to run for current file or all open files should be made.
With a note that both this new behavior and that potential new command would only be available if |
To me this is a typical "What do other languages do?"-situation. |
This currently leads me to first solution (especially since diagnostics on N files is almost as fast as diagnostics on 1 file) Will take a look at other languages, though I'm not sure what languages work in a similar way |
With how interconnected compilation is in general there's not much of a difference in performance if we add more sources. Most files cannot be diagnosed independently anyway, so all this really comes down to is a glorified filter mechanism. This makes me lean towards the first solution as well. |
As discussed.
The text was updated successfully, but these errors were encountered: