Add here-string autoClosingPairs to PowerShell language configuration - #5545
Add here-string autoClosingPairs to PowerShell language configuration#5545Andy Jordan (andyleejordan) with Copilot wants to merge 3 commits into
Conversation
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 does this actually need to be added to our extension or can we just close as resolved since users will always pick up the changes from upstream? |
…Code core The fix from microsoft/vscode#95245 (merged April 2020) is already present in every VS Code version ≥1.45. The extension's minimum required version is ^1.114.0, so all users already pick up the here-string autoclosing behavior from VS Code's built-in PowerShell language-configuration.json. Additionally, setLanguageConfiguration() only replaces keys explicitly provided; since `autoClosingPairs` was never specified in the extension's call, VS Code's built-in pairs (including the here-string entries) were never overridden. The explicit addition was therefore redundant. Closes #1517 Co-authored-by: andyleejordan <2226434+andyleejordan@users.noreply.github.com>
Yes, closing as resolved is the right call. Two reasons:
I've reverted the |
|
Good question! Since The main argument for keeping this explicit in the extension was self-documentation and not being silently dependent on VS Code internals — but that's a style preference rather than a correctness need. I'd lean toward closing this as "no longer needed" to avoid maintaining duplicated configuration that could drift from VS Code core in the future. If you close it, I'd suggest leaving a note on the original tracking issue (if any) pointing to
Add this agentic workflows to your repoTo install this agentic workflow, run |
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'ssetLanguageConfigurationcall so the behavior is self-documenting and not silently dependent on the VS Code version.Changes
src/extension.ts: AddsautoClosingPairsto thesetLanguageConfigurationcall, including:@'→\n'@and@"→\n"@withnotIn: ["string", "comment"]— matches the VS Code core fix exactly;\nis required because PowerShell's here-string terminator must be at the start of a line{},[],(),"",'',<##>) carried forward explicitly, since specifyingautoClosingPairsreplaces rather than merges with the built-in configuration