You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Hashtable BareWord key highlighting changes with presence of inline comment #219
The syntax highlighting of a BareWord key that is followed by an inline comment in a Hashtable is different in a new unsaved editor vs when it is saved.
Before the file is saved:
After the file is saved:
Removing the inline comment (re-adding the inline comment goes back to how it is above):
I would expect the keys to be consistently highlighted, regardless of a following inline comment or not.
I'm using the Default Dark Modern theme - in case that's relevant.
Edit: I noticed while filling in this issue template, that GitHub's syntax highlighting also does the same thing!
The two key's are subtly different colours
PowerShell Version
Name Value---- -----PSVersion 7.4.12PSEdition CoreGitCommitId 7.4.12OS Microsoft Windows 10.0.22631Platform Win32NTPSCompatibleVersions {1.0, 2.0, 3.0, 4.0}PSRemotingProtocolVersion 2.3SerializationVersion 1.1.0.1WSManStackVersion 3.0Name : Visual Studio Code HostVersion : 2025.2.0InstanceId : 703b8fce-f163-4396-8543-54cfa0a5ba7cUI : System.Management.Automation.Internal.Host.InternalHostUserInterfaceCurrentCulture : en-GBCurrentUICulture : en-GBPrivateData : Microsoft.PowerShell.ConsoleHost+ConsoleColorProxyDebuggerEnabled : TrueIsRunspacePushed : FalseRunspace : System.Management.Automation.Runspaces.LocalRunspace
Activity
andyleejordan commentedon Oct 7, 2025
This tells me that it's an issue with the TextMate grammar in the EditorSyntax repo, hence transferred.
RedCMD commentedon Oct 8, 2025
regex currently doesn't support comments
EditorSyntax/PowerShellSyntax.tmLanguage
Line 1536 in a08b55b