anzwdev / al-code-outline

AL Code Outline for Visual Studio Code
MIT License
51 stars 13 forks source link

Delete unused variables with obsolete tag #590

Closed ThorstenEngelsGOB closed 1 month ago

ThorstenEngelsGOB commented 2 months ago

Unused variables are deleted when the CodeCleanUp is performed. This is fine as long as they are not protected vars. However, if they are protected vars, they must not be deleted automatically. Even if these variables are marked as obsolete. No automatic deletion may be carried out here, as the handling of the obsolete tag must remain under the control of the developer. Only the developer can decide when they may be deleted.

image

anzwdev commented 1 month ago

Than you for reporting your issue. I've extended "Remove unused variables" commands and code cleanup functionality and split "remove global variables" option into 2 - "remove global variables" and "remove protected global variables". For code cleanup version of this functionality, you can use "alOutline.defaultRemoveUnusedVariablesSettings" setting to decide what should be removed.

"alOutline.defaultRemoveUnusedVariablesSettings": {
    "removeGlobalVariables": true,
    "removeProtectedGlobalVariables": false,
    "removeLocalVariables": true,
    "removeLocalMethodParameters": true
}
ThorstenEngelsGOB commented 1 month ago

[like] Engels, Thorsten reacted to your message:


From: Andrzej Zwierzchowski @.> Sent: Tuesday, July 2, 2024 9:21:00 PM To: anzwdev/al-code-outline @.> Cc: Engels, Thorsten @.>; Author @.> Subject: Re: [anzwdev/al-code-outline] Delete unused variables with obsolete tag (Issue #590)

Than you for reporting your issue. I've extended "Remove unused variables" commands and code cleanup functionality and split "remove global variables" option into 2 - "remove global variables" and "remove protected global variables". For code cleanup version of this functionality, you can use "alOutline.defaultRemoveUnusedVariablesSettings" setting to decide what should be removed.

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

— Reply to this email directly, view it on GitHubhttps://github.com/anzwdev/al-code-outline/issues/590#issuecomment-2204460318, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AGURUCS32XFPEOPPECAZNADZKMKTZAVCNFSM6AAAAABJOLJL7WVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEMBUGQ3DAMZRHA. You are receiving this because you authored the thread.Message ID: @.***>

GOB Software & Systeme GmbH & Co. KG | Europark Fichtenhain A 5 | 47807 Krefeld | Germany | Sitz der Gesellschaft: Krefeld | Registergericht: Amtsgericht Krefeld | Registernummer: HRA 3944 Geschäftsführer: Tim Bellen, Robert Küpper