Skip to content

Suffix server command ids on the client and add the Marketplace icon - #192

Merged
satyakigh merged 1 commit into
mainfrom
commands-version
Oct 8, 2026
Merged

satyakigh merged 1 commit into
mainfrom
commands-version

Conversation

@satyakigh

@satyakigh satyakigh commented Oct 8, 2026 •

Copy link
Copy Markdown
Collaborator

Two extensions hosting the CloudFormation language server in the same VS Code window currently break each other. The server lists its workspace/executeCommand ids (/command/template/clear-diagnostic, /command/region/update) in its initialize result, vscode-languageclient registers each id as a VS Code command, and VS Code rejects the second registration of an id that already exists. The rejection happens inside client initialization, so the second extension to activate loses all CloudFormation features with command '/command/template/clear-diagnostic' already exists. This client already sends aws.commandSuffix, but server releases up to 1.12.0 do not honour it and advertise the bare ids.

Server command ids are registered under the client suffix

SuffixedExecuteCommandFeature replaces the library's built-in execute-command feature. Every id the server advertises is registered with VS Code as <id>.iac-vscode, and invocations are forwarded to the server under the id it advertised, so the server sees no difference. A provideCodeActions middleware in CfnLanguageClient points the commands attached to server-provided code actions at the same suffixed ids and leaves commands the server did not advertise alone. CfnLanguageClient extends LanguageClient, swaps the feature in through registerFeature, and is what the extension now constructs.

Ids that already carry the suffix are kept as they are, so a server release that honours aws.commandSuffix turns this code into a no-op rather than double-suffixing. It can be removed once such a release is the oldest supported server.

Marketplace icon

package.json sets icon to resources/marketplace/aws-cloudformation-icon.png, the AWS CloudFormation service icon copied unmodified from the public AWS Architecture Icons package (Q3 2026 release, Arch_AWS-CloudFormation_64@5x.png, 400x400).

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@satyakigh
satyakigh requested a review from a team as a code owner October 8, 2026 20:49
@github-code-quality

Copy link
Copy Markdown

Code Coverage Overview

Languages: TypeScript

TypeScript / code-coverage/vitest

The overall line coverage in commit 718a8c8 in the commands-version branch remains at 78%, unchanged from commit dfc611c in the main branch.

Show a line coverage summary of the most impacted files.
File main dfc611c commands-version 718a8c8 +/-
src/lsp-server/...nguageClient.ts 0% 0% 0%
src/lsp-server/LspCommands.ts 100% 100% 0%
src/lsp-server/...mmandFeature.ts 0% 100% +100%

@satyakigh
satyakigh merged commit fab58cf into main Oct 8, 2026
8 checks passed
@satyakigh
satyakigh deleted the commands-version branch October 8, 2026 23:12
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