Skip to content

Add here-string autoClosingPairs to PowerShell language configuration#5545

Draft
Copilot wants to merge 2 commits into
mainfrom
copilot/here-string-intellisense-fix
Draft

Add here-string autoClosingPairs to PowerShell language configuration#5545
Copilot wants to merge 2 commits into
mainfrom
copilot/here-string-intellisense-fix

Conversation

Copilot AI commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

PowerShell here-strings (@'...'@, @"..."@) were not auto-closed by the editor — typing @" would not insert the closing "@ on a new line.

This was fixed upstream in VS Code core via microsoft/vscode#95245, which added here-string entries to the built-in PowerShell language-configuration.json. This PR mirrors that fix explicitly in the extension's setLanguageConfiguration call so the behavior is self-documenting and not silently dependent on the VS Code version.

Changes

  • src/extension.ts: Adds autoClosingPairs to the setLanguageConfiguration call, including:
    • @'\n'@ and @"\n"@ with notIn: ["string", "comment"] — matches the VS Code core fix exactly; \n is required because PowerShell's here-string terminator must be at the start of a line
    • All pre-existing auto-closing pairs ({}, [], (), "", '', <##>) carried forward explicitly, since specifying autoClosingPairs replaces rather than merges with the built-in configuration

Closes #1517

VS Code PR microsoft/vscode#95245 added autoclosing pairs for PowerShell
here-strings to VS Code's built-in language configuration. This change
explicitly adds the same pairs to the extension's setLanguageConfiguration
call so the behavior is self-documenting and works correctly regardless of
the VS Code version.
Copilot AI changed the title [WIP] Fix here string intellisense completion and indentation Add here-string autoClosingPairs to PowerShell language configuration Jun 29, 2026
Copilot AI requested a review from andyleejordan June 29, 2026 17:39
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.

2 participants