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

feat(lsp): pass client_info on initialization #4904

Merged
merged 1 commit into from
Dec 9, 2022

Conversation

matoous
Copy link
Contributor

@matoous matoous commented Nov 26, 2022

Pass client name ('helix') and client version (version / git hash) to LSP server on initialization.

@kirawi kirawi added A-language-server Area: Language server client S-waiting-on-review Status: Awaiting review from a maintainer. labels Nov 27, 2022
Comment on lines 7 to 17
let git_hash = Command::new("git")
.args(["rev-parse", "HEAD"])
.output()
.ok()
.filter(|output| output.status.success())
.and_then(|x| String::from_utf8(x.stdout).ok());

let version: Cow<_> = match git_hash {
Some(git_hash) => format!("{} ({})", VERSION, &git_hash[..8]).into(),
None => VERSION.into(),
};
Copy link
Member

Choose a reason for hiding this comment

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

It's a small block to re-use but I wonder if it should be a constant in helix-loader so it can be re-used in helix-lsp and helix-term

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done, also not sure if it maybe would be better to expose GIT_SHA on it's own.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@the-mikedavis I tried it but it makes it very verbose in around the 3 call-sides we have. Until we have a use case for GIT_HASH on it's own I would keep it this way.

Pass client name ('helix') and client version (version / git hash)
to LSP server on initialization.
@the-mikedavis the-mikedavis merged commit 8abed3b into helix-editor:master Dec 9, 2022
herkhinah pushed a commit to herkhinah/helix that referenced this pull request Dec 11, 2022
Pass client name ('helix') and client version (version / git hash)
to LSP server on initialization.
freqmod pushed a commit to freqmod/helix that referenced this pull request Feb 8, 2023
Pass client name ('helix') and client version (version / git hash)
to LSP server on initialization.
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.

3 participants