OmniSharp / OmniSharp/csharp-language-server-protocol

Enabling/disabling handler based on client configuration

Open
#627 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C#
Stars
638
Forks
109
Avg merge
1m
Merged PRs (30d)
2

Description

Is there a way to enable and disable handlers dynamically based on client configuration?

For example, VS Code recommends that a formatter provide a client setting to enable or disable it.

If this is possible to do, I'm guessing it's probably something like this:

  1. Enable synchronization of the relevant configuration section (.WithConfigurationSection, I think)
  2. Either pass configuration at startup (for clients that don't support dynamic configuration), or delay enabling the handler until after Initialize has completed and then retrieve configuration and add the handler if enabled. (Per the spec, the server isn't allowed to use the configuration request message before initialization has completed).
  3. Listen to configuration changes, and remove and add the handler as appropriate.

Questions:
Are there APIs to add or remove handlers after the server has completed initialization?
What's the best approach to listen for a change to a specific configuration setting?

Thanks,

David

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 with the handler-registration APIs and .WithConfigurationSection mentioned in the issue, then trace initialization and configuration-change handling in the repository. Determine whether handlers can be added or removed after initialization and how a specific setting can be observed; done means the supported approach and any required API changes are clear.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
api, tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.