al-code-outline icon indicating copy to clipboard operation
al-code-outline copied to clipboard

removeProtectedGlobalVariables default value?

Open fvet opened this issue 7 months ago • 1 comments

When executing the 'Removed unused variables' action on below code, the protected global is removed, which is a breaking change.

Image

In the app's settings.json file, I've however stated to remove globals / locals only, but not the protected globals. (not explicitly set)

"alOutline.defaultRemoveUnusedVariablesSettings": {
        "removeGlobalVariables": true,
        "removeLocalMethodParameters": true,
        "removeLocalVariables": true
    },

I would expect removeProtectedGlobalVariables to be defaulted to false if not included in the list of defaultRemoveUnusedVariablesSettings.

Updating the settings fixes the issue, but I was wondering if this is a bug / can be solved, to avoid having to run through all my projects / app's and update the settings...

"alOutline.defaultRemoveUnusedVariablesSettings": {
        "removeGlobalVariables": true,
        "removeLocalMethodParameters": true,
        "removeLocalVariables": true,
        "removeProtectedGlobalVariables": false // Explicit set to false fixes the issue
    },

fvet avatar May 22 '25 06:05 fvet