How can I disable verb highlighting in Visual Studio Code?

0
0
Asked By SillyGiraffe27 On

I'm facing an issue in Visual Studio Code where my functions are getting syntax highlighted based on approved verbs, and I'd like to know how to turn that off. When I use an approved verb, my function names show in yellow, but they turn white when I use verbs that aren't in the approved list. It's quite annoying! I'm currently using the PowerShell extension by Microsoft.

2 Answers

Answered By CleverCoder88 On

Another option is to use the SuppressMessageAttribute. You can add this attribute to your functions: `[Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSUseApprovedVerbs", "", Justification="sue me")]`. This will stop the highlighting for that specific function.

Answered By CasualDev42 On

Honestly, if it’s not a cmdlet you're creating for shell binding, I wouldn’t stress about using approved verbs. Just name your functions whatever you like in PascalCase. It’s way more flexible for everyday coding!

SillyGiraffe27 -

Exactly! Sometimes it just feels good to break the rules a bit.

Related Questions

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.