Skip to content

feat(language-server): add shared workspace/configuration utilities#66734

Closed
kbrilla wants to merge 1 commit intoangular:mainfrom
kbrilla:feat/workspace-configuration
Closed

feat(language-server): add shared workspace/configuration utilities#66734
kbrilla wants to merge 1 commit intoangular:mainfrom
kbrilla:feat/workspace-configuration

Conversation

@kbrilla
Copy link
Contributor

@kbrilla kbrilla commented Jan 24, 2026

Description

Adds shared infrastructure for features to request configuration from the VS Code client using the LSP workspace/configuration protocol. This is the preferred approach over CLI arguments because:

  1. Configuration changes take effect immediately without restarting the extension
  2. Supports per-workspace and per-folder configuration via VS Code's settings hierarchy
  3. VS Code automatically merges settings from different scopes:
    • Default settings
    • User settings (global)
    • Workspace settings
    • Workspace folder settings
    • Language-specific settings

New Utilities

Utility Purpose
getWorkspaceConfiguration Request multiple config sections at once
getConfigurationSection Convenience wrapper for single sections
flattenConfiguration Flatten nested config to dot-notation keys

Usage Example

// Request multiple sections
const [tsConfig, angularConfig] = await getWorkspaceConfiguration(
  session.connection,
  [
    { section: 'typescript.inlayHints', scopeUri: documentUri },
    { section: 'angular.inlayHints', scopeUri: documentUri },
  ]
);

// Flatten for easier mapping
const flat = flattenConfiguration(tsConfig, 'typescript.inlayHints');
// { 'typescript.inlayHints.parameterNames.enabled': 'all', ... }

LSP Reference

See workspace/configuration in the LSP 3.17 specification.

Dependents

This infrastructure will be used by:

Breaking Changes

None

🤖 AI Disclosure

This PR was developed using Claude Opus 4.5 AI assistant under human orchestration and review by @kbrilla.

This commit adds infrastructure for features to request configuration from
the VS Code client using the LSP workspace/configuration protocol. This is
the preferred approach over CLI arguments because:

1. Configuration changes take effect immediately without restarting
2. Supports per-workspace and per-folder configuration
3. VS Code automatically merges settings from different scopes:
   - Default settings
   - User settings (global)
   - Workspace settings
   - Workspace folder settings
   - Language-specific settings

The new utilities include:
- getWorkspaceConfiguration: Request multiple config sections at once
- getConfigurationSection: Convenience wrapper for single sections
- flattenConfiguration: Flatten nested config to dot-notation keys

This infrastructure will be used by:
- Inlay hints feature (PR angular#66731)
- Document symbols feature (PR angular#66690)
@atscott
Copy link
Contributor

atscott commented Jan 26, 2026

I'm going to close this one. Let's just couple it to one of the other PRs that uses it. It's a bit awkward to submit this on its own when it's not used anywhere.

@atscott atscott closed this Jan 26, 2026
@kbrilla
Copy link
Contributor Author

kbrilla commented Jan 26, 2026

I'm going to close this one. Let's just couple it to one of the other PRs that uses it. It's a bit awkward to submit this on its own when it's not used anywhere.

Oh ok! I actually though that's how Angular team does it - one PR per small features for easier code review and better git history.
@atscott I have two question though:

  1. Ok will add it to one of the PR that uses it !
  2. Should it be still one commit per PR or separate 2 commits if it's multiple commits?

@atscott
Copy link
Contributor

atscott commented Jan 26, 2026

I actually though that's how Angular team does it - one PR per small features for easier code review and better git history.

Yes, though this PR doesn't really appear to be a feature (it should be marked as a refactor in the other PRs too). The separate commit is good and will make the other PRs easier to review.

Should it be still one commit per PR or separate 2 commits if it's multiple commits?

You can separate it into 2 commits in the PRs

@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Feb 26, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

detected: feature PR contains a feature commit

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants