microsoft / microsoft/language-server-protocol

Should all server capabilities allow the corresponding dynamic registration options?

Open
#1,908 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

feature-request
Dominant language
TypeScript
Stars
13k
Forks
1k
Avg merge
6d 1h
Merged PRs (30d)
10

Description

Some, but not all, of the server capability fields in the initialize response allow providing the corresponding registration options. It's helpful to be able to do so, since the registration options type usually includes additional fields, such as the documentSelector.

Examples:

  • completionProvider has type CompletionOptions and doesn't allow CompletionRegistrationOptions
  • typeDefinitionProvider has type TypeDefinitionOptions | TypeDefinitionRegistrationOptions

Is this just for backwards compatibility? Is there a way we could migrate the protocol to be more consistent here? It would make things simpler. For example, if you want to make use of the documentSelector capability, you can have many cases:

  • Client supports dynamic registration: dynamically register
  • Client does not support dynamic registration:
    • Options field supports dynamic registration options: statically register
    • Options field does not support dynamic registration options: give up

It's quite fiddly.

Contributor guide

No contributing guide indexed for this repository

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 by comparing the server capability types in the initialize response, especially completionProvider and typeDefinitionProvider, with their corresponding registration option types. Determine the backwards-compatibility constraints and whether a consistent migration is possible; done means the protocol has a decided, documented approach rather than an unresolved set of cases.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
api
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.