Version v2021.2.2 doesn't highlight the #Requires statements
See original GitHub issueEnvironment
- Editor and Version (VS Code, Atom, Sublime): VSCode 1.53.2
- Your primary theme: Dark+ (default dark)
Issue Description
I just opened some PowerShell scripts and the extension got updated. Right in front of my eyes, I had some #requires statements and they got their highlight stripped off.
Screenshots
Expected Behavior
The only Theme which still highlights those statements that I found is Night Owl. I have like 10 themes installed and went through all of them and the Night Owl is the only one.
Code Samples
# Az modules
#Requires -Module @{ ModuleName = 'Az.Accounts'; RequiredVersion = '1.9.5' }
#Requires -Module @{ ModuleName = 'Az.ApplicationInsights'; RequiredVersion = '1.1.0' }
#Requires -Module @{ ModuleName = 'Az.Compute'; RequiredVersion = '4.5.0' }
#Requires -Module @{ ModuleName = 'Az.Network'; RequiredVersion = '3.5.0' }
#Requires -Module @{ ModuleName = 'Az.Resources'; RequiredVersion = '2.5.1' }
#Requires -Module @{ ModuleName = 'Az.ServiceBus'; RequiredVersion = '1.4.1' }
#Requires -Module @{ ModuleName = 'Az.Storage'; RequiredVersion = '2.7.0' }
#Requires -Module @{ ModuleName = 'Az.Websites'; RequiredVersion = '1.11.0' }
Issue Analytics
- State:
- Created 3 years ago
- Reactions:4
- Comments:8 (2 by maintainers)
Top Results From Across the Web
How to Highlight Text in PDF Documents - YouTube
Learn how to highlight a PDF on your iPhone and iPad with PDF Expert. You can easily highlight, underline, and strike out the...
Read more >dafi36-2406.pdf - Air Force
By Order of the Secretary of the Air Force, this Guidance Memorandum immediately implements changes to Air Force Instruction (AFI) 36-2406, ...
Read more >Supervisory Highlights: Issue 25, Fall 2021
The findings included in this report cover examinations completed between January 2021 and. June 2021 in the areas of credit card account management,...
Read more >ANSI Essential Requirements 2022
The ANSI Essential Requirements govern the processes by which standards developers are accredited by ANSI and American National Standards are developed.
Read more >IATA Dangerous Goods Regulations 62nd Edition (English ...
Users of the IATA Dangerous Goods Regulations are asked to note the following amendments and corrections to the 62nd Edition, effective from ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Thanks everyone, we agree that we should mark comments so that they are not semantically highlighted, and fall back to the TextMate grammar
Incorrect. Unless your theme is marked as supporting semantic highlighting, you will 100% use the EditorSyntax grammar highlighting. (this is what the OP is running in to) Secondly, anything the symantic highlighting doesn’t handle directly, falls back to the EditorSyntax grammar highlighting.
Third, semantic highlighting was not intended to be a replacement for TextMate grammar’s, but instead a supplement. TextMate is still going to handle things better and be more flexible. In the case of PowerShell, the symantic highlighter is almost useless, as everything can be determined by the TextMate grammar. I am not implying that the current EditorSyntax grammar handles everything, but that a TextMate grammar CAN handle everything PowerShell has to syntax, which so implemented.
My suggestion, STOP semantically highlighting comments, and let that fall back on the TextMate grammar.
Include in that Text Strings, as the semantic highlighting prevents the TextMate grammar from highlighting character escapes. (actually the sematic highlighting will fail on a text string (doublequote) if an intepolated variable appears, so it should just give up trying text strings in general.)