Skip to content

fix(cloudformation): do not register plaintext or txt in document selector - #8868

Open
reginaldalfret wants to merge 1 commit into
aws:masterfrom
reginaldalfret:fix/issue-8867-cfn-document-selector
Open

reginaldalfret wants to merge 1 commit into
aws:masterfrom
reginaldalfret:fix/issue-8867-cfn-document-selector

Conversation

@reginaldalfret

Copy link
Copy Markdown

Problem

The CloudFormation language server previously registered { language: 'plaintext' } and { pattern: '**/*.txt' } in CfnDocumentSelector. As a result, the CloudFormation language server attached to ordinary notes, log files, and text documents in VS Code. When pressing Enter in any .txt or Plain Text document, the completion widget opened with AWSTemplateFormatVersion: "2010-09-09" preselected, causing subsequent Enter presses to auto-insert CloudFormation template syntax into non-template text files.

Solution

Remove { language: 'plaintext' } and { pattern: '**/*.txt' } from CfnDocumentSelector. The language server continues to attach to genuine template files and extensions (.template, .cfn, .json, .yaml, .yml, and cloudformation/template/json/yaml language modes). Also update the unit tests in lspClientConfig.test.ts to reflect the template extensions and verify that plaintext and .txt files are not registered.

Fixes #8867

…ector

Signed-off-by: reginaldalfret <reginaldalfret@gmail.com>
@reginaldalfret
reginaldalfret requested a review from a team October 9, 2026 13:03
@amazon-inspector-ohio

Copy link
Copy Markdown

⏳ I'm reviewing this pull request for security vulnerabilities and code quality issues. I'll provide an update when I'm done

@amazon-inspector-ohio

Copy link
Copy Markdown

✅ I finished the code review, and didn't find any security or code quality issues.

@github-actions

github-actions Bot commented Oct 9, 2026

Copy link
Copy Markdown
  • This pull request implements a feat or fix, so it must include a changelog entry (unless the fix is for an unreleased feature). Review the changelog guidelines.
    • Note: beta or "experiment" features that have active users should announce fixes in the changelog.
    • If this is not a feature or fix, use an appropriate type from the title guidelines. For example, telemetry-only changes should use the telemetry type.

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.

CloudFormation language server attaches to every .txt and plaintext file, so Enter inserts AWSTemplateFormatVersion

1 participant