al-codeactions icon indicating copy to clipboard operation
al-codeactions copied to clipboard

Remove unused Variables Error

Open MikeHigi opened this issue 1 year ago • 2 comments

Hey,

one of my most needed Cleanup is not working atm:

Method not found: 'Microsoft.Dynamics.Nav.CodeAnalysis.Compilation Microsoft.Dynamics.Nav.CodeAnalysis.Compilation.Create(System.String, System.String, System.Version, System.Nullable1<System.Guid>, System.Collections.Generic.IEnumerable1<Microsoft.Dynamics.Nav.CodeAnalysis.SymbolReferenceSpecification>, System.Collections.Generic.IEnumerable`1<Microsoft.Dynamics.Nav.CodeAnalysis.Syntax.SyntaxTree>, Microsoft.Dynamics.Nav.CodeAnalysis.CompilationOptions, Microsoft.Dynamics.Nav.CodeAnalysis.IFileSystem, Microsoft.Dynamics.Nav.CodeAnalysis.DotNet.IDotNetResolverFactory, Microsoft.Dynamics.Nav.CodeAnalysis.IReferenceManager, Boolean)'.

Is there anything I missed to setup or change?

MikeHigi avatar Mar 19 '24 08:03 MikeHigi

Yesterday the new al language version was released, and with it some breaking changes.

As a workaround you can switch back to the previous AL language version, which might fix the error atm: image

christianbraeunlich avatar Mar 20 '24 02:03 christianbraeunlich

Thanks for the analysis @christianbraeunlich 🙂 Regarding the cleanup tasks, Andrzej (author of the AZ AL Dev Tools) implemented as well a cleanup task after I've implemented it, which is better then my one, so I'm considering to remove it in the future. Check out his "Remove Unused Variables from the Active Project" as well

DavidFeldhoff avatar Mar 20 '24 05:03 DavidFeldhoff