Skip to content
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

Restart language server when changing document language #5300

Closed
the-mikedavis opened this issue Dec 26, 2022 · 2 comments
Closed

Restart language server when changing document language #5300

the-mikedavis opened this issue Dec 26, 2022 · 2 comments
Labels
A-language-server Area: Language server client C-enhancement Category: Improvements

Comments

@the-mikedavis
Copy link
Member

Document::set_language currently only changes the syntax and highlighting parts of a document. If the language server configuration or binary changed, the language server is not terminated or restarted. For example, :set-language text on a rust file running rust-analyzer will not close the rust-analyzer session - you will still see completion and diagnostics.

Unless the language server configuration is the same before and after, Document::set_language should close the open language server (if any) and start the new language server for the new configuration.

(In the long-run, we may also want to look into using didChangeConfiguration for language servers that support it. ref)

@the-mikedavis the-mikedavis added C-enhancement Category: Improvements A-language-server Area: Language server client labels Dec 26, 2022
@the-mikedavis
Copy link
Member Author

Document::set_language should also probably call Document::detect_indent_and_line_ending since those values can change when the Document.language field changes

@pascalkuthe
Copy link
Member

pascalkuthe commented Apr 7, 2024

I think this can be closed, see #8949 (comment)

In these sense that all callsites habdle this so thisndoesnt lead to any issues observaböe by users

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-language-server Area: Language server client C-enhancement Category: Improvements
Projects
None yet
Development

No branches or pull requests

2 participants