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
When adding an attribute to a variable (in this case System.Diagnostics.CodeAnalysis.SuppressMessageAttribute, but the outcome is the same for other attributes such as ValidateSetAttribute), the variable will no longer appear the the 'Outline' panel.
Take this script for example:
$MyVariable='foobar'
The variable MyVariable appears in the 'Outline' panel. Now, add an attribute to it. In this case, I added the System.Diagnostics.CodeAnalysis.SuppressMessageAttribute attribute to disable the PSUserDeclaredVarsMoreThanAssignments warning from not using the variable in the current script.
Prerequisites
Summary
When adding an attribute to a variable (in this case
System.Diagnostics.CodeAnalysis.SuppressMessageAttribute
, but the outcome is the same for other attributes such asValidateSetAttribute
), the variable will no longer appear the the 'Outline' panel.Take this script for example:
The variable
MyVariable
appears in the 'Outline' panel. Now, add an attribute to it. In this case, I added theSystem.Diagnostics.CodeAnalysis.SuppressMessageAttribute
attribute to disable thePSUserDeclaredVarsMoreThanAssignments
warning from not using the variable in the current script.The script works correctly, and the attribute correctly disables the warning, but the variable no longer appears in the 'Outline' panel.
PowerShell Version
Visual Studio Code Version
Extension Version
[email protected]
Steps to Reproduce
Visuals
No response
Logs
No response
The text was updated successfully, but these errors were encountered: