Skip to content

Derive LSP distribution id from package.json name#388

Open
holodorum wants to merge 1 commit into
kson-org:mainfrom
holodorum:derive-distribution-id-from-package-name
Open

Derive LSP distribution id from package.json name#388
holodorum wants to merge 1 commit into
kson-org:mainfrom
holodorum:derive-distribution-id-from-package-name

Conversation

@holodorum
Copy link
Copy Markdown
Collaborator

The VSCode extension hard-coded "kson" as the prefix for its command ids, configuration section, and diagnostic source — duplicating name, which the manifest already has to declare and which VSCode guarantees unique per publisher. Read it from packageJSON.name and thread it as distributionId through the LSP init options, so the manifest's contribution keys and the runtime namespace can't drift apart. KsonSettings is unwrapped in the same pass—the server now strips the outer namespace key, so the type is { formatOptions, codeLensEnabled } instead of { kson: {...} }.

The VSCode extension hard-coded "kson" as the prefix for its command ids, configuration section, and diagnostic source — duplicating `name`, which the manifest already has to declare and which VSCode guarantees unique per publisher. Read it from `packageJSON.name` and thread it as `distributionId` through the LSP init options, so the manifest's contribution keys and the runtime namespace can't drift apart. `KsonSettings` is unwrapped in the same pass — the server now strips the outer namespace key, so the type is `{ formatOptions, codeLensEnabled }` instead of `{ kson: {...} }`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant