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

Allow LSP server to be stopped #5964

Merged
merged 10 commits into from
Mar 8, 2023
Merged

Conversation

davxy
Copy link
Contributor

@davxy davxy commented Feb 13, 2023

Sometimes you don't require the lsp to run, especially if you want to quickly have a look at a file part of a large project.

This PR allows to stop lsp when required via :lsp-stop command.

If required, lsp can be restarted via lst-restart.

Without having separate commands I was also thinking about having subcommands part a generic :lsp command.
That is, remove lsp-restart, :lsp-stop in favour of a more generic and extensible lsp.

The usage would be :lsp start, :lsp stop, :lsp restart. (restart and start may be probably merged in a single start command)

(Docs will be eventually updated if the PR is accepted...)

@the-mikedavis the-mikedavis added A-language-server Area: Language server client S-waiting-on-review Status: Awaiting review from a maintainer. labels Feb 13, 2023
@goyalyashpal
Copy link
Contributor

having subcommands part a generic :lsp command.

+1

@sudormrfbin
Copy link
Member

An advantage of having separate commands instead of a top level command with subcommands is discoverability -- every action possible is spelled out in the completion popup when you type :lsp.

@davxy davxy requested a review from archseer February 15, 2023 14:36
@davxy davxy requested review from LeoniePhiline and removed request for archseer February 15, 2023 16:11
@LeoniePhiline LeoniePhiline mentioned this pull request Feb 16, 2023
@davxy davxy requested review from archseer and LeoniePhiline and removed request for LeoniePhiline and archseer February 20, 2023 22:04
@helmesjo
Copy link

helmesjo commented Feb 23, 2023

An advantage of having separate commands instead of a top level command with subcommands is discoverability -- every action possible is spelled out in the completion popup when you type :lsp.

Yeah I've noticed this at times, but isn't this rather a separate issue (bug) that should be solved? I mean, the subcommands are known so there is no reason helix can't list them. Top level command + subcommands almost always pays for itself in the long run.

@davxy davxy requested review from the-mikedavis and LeoniePhiline and removed request for archseer, the-mikedavis and LeoniePhiline March 2, 2023 09:55
@davxy davxy requested a review from the-mikedavis March 2, 2023 09:55
@the-mikedavis
Copy link
Member

Looks like the CI is failing because of some trailing whitespace - you can fix it with cargo fmt

Copy link
Member

@the-mikedavis the-mikedavis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a small clippy lint but otherwise this looks good 👍

helix-term/src/commands/typed.rs Outdated Show resolved Hide resolved
@the-mikedavis the-mikedavis merged commit f976c00 into helix-editor:master Mar 8, 2023
sagnibak pushed a commit to sagnibak/helix that referenced this pull request Mar 21, 2023
wes-adams pushed a commit to wes-adams/helix that referenced this pull request Jul 4, 2023
@davxy davxy deleted the lsp-stop branch September 18, 2023 09:50
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 S-waiting-on-review Status: Awaiting review from a maintainer.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants