microsoft / microsoft/pyright

Report serverInfo (name and version) in the initialize result

Open Beginner friendly
#11,723 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
15.6k
Forks
1.8k
Avg merge
12h 13m
Merged PRs (30d)
52

Description

**Is your feature request related to a problem? Please describe.**

A client, or a proxy in front of the server, cannot tell from the LSP handshake which server it is talking to or which version: pyright's `InitializeResult` has no `serverInfo`. The name and version appear only in the startup `window/logMessage` ("Pyright language server 1.1.412 starting"), which a client has to parse. `serverInfo` has been a standard field since LSP 3.15, and basedpyright already returns it.

**Describe the solution you'd like**

`InitializeResult.serverInfo = { name: productName, version }` in `LanguageServerBase.initialize` (`packages/pyright-internal/src/languageServerBase.ts`). It is a four-line change; I have it ready and can open a PR if this is acceptable.

**Additional context**

I use it in lsp-det (https://github.com/tagawa0525/lsp-det), a proxy that selects a per-server readiness mapping by the server's name and version. Today it has to read pyright's startup log for that.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in packages/pyright-internal/src/languageServerBase.ts at LanguageServerBase.initialize and inspect how the LSP InitializeResult is assembled. Verify the server name comes from productName and the version from the existing server version value, then confirm the initialize response exposes both fields without changing the startup log behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
tooling
Issue type
Feature
Difficulty
1/5
Estimated time
Under an hour
Activity status
Active
Clarity
Clearly specified
Newbie friendliness
88/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.