Skip to content

Allow LSP server to be stopped - #5964

Merged
the-mikedavis merged 10 commits into
helix-editor:masterfrom
davxy:lsp-stop
Mar 8, 2023
Merged

Allow LSP server to be stopped#5964
the-mikedavis merged 10 commits into
helix-editor:masterfrom
davxy:lsp-stop

Conversation

@davxy

@davxy davxy commented Feb 13, 2023

Copy link
Copy Markdown
Contributor

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
Copy Markdown
Contributor

having subcommands part a generic :lsp command.

+1

@sudormrfbin

Copy link
Copy Markdown
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.

Comment thread helix-term/src/commands/typed.rs
@davxy
davxy requested a review from archseer February 15, 2023 14:36
Comment thread helix-term/src/commands/typed.rs Outdated
@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 LeoniePhiline and archseer and removed request for LeoniePhiline and archseer February 20, 2023 22:04
Comment thread helix-term/src/commands/typed.rs Outdated
@helmesjo

helmesjo commented Feb 23, 2023

Copy link
Copy Markdown

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 LeoniePhiline and the-mikedavis and removed request for LeoniePhiline, archseer and the-mikedavis March 2, 2023 09:55
@davxy
davxy requested a review from the-mikedavis March 2, 2023 09:55
@the-mikedavis

Copy link
Copy Markdown
Member

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

@the-mikedavis the-mikedavis left a comment

Copy link
Copy Markdown
Member

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 👍

Comment thread helix-term/src/commands/typed.rs Outdated
davxy and others added 2 commits March 5, 2023 17:39
Co-authored-by: Michael Davis <mcarsondavis@gmail.com>
@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