StefanMaron / vsc-lintercop

MIT License
6 stars 6 forks source link

Lintercop stopped working all of a sudden #16

Closed rknabben closed 6 months ago

rknabben commented 6 months ago

Lintercop suddenly started to give this message on my workspace:

Analyzer 'BusinessCentral.LinterCop.Design.Rule0044AnalyzeTransferFields' threw an exception of type 'System.InvalidCastException' with message 'System.InvalidCastException: Unable to cast object of type 'Microsoft.Dynamics.Nav.CodeAnalysis.Syntax.CodeunitSyntax' to type 'Microsoft.Dynamics.Nav.CodeAnalysis.Syntax.TableExtensionSyntax'. at BusinessCentral.LinterCop.Design.Rule0044AnalyzeTransferFields.AnalyzeTableExtension(SyntaxNodeAnalysisContext ctx) at Microsoft.Dynamics.Nav.CodeAnalysis.Diagnostics.AnalyzerExecutor.ExecuteAndCatchIfThrows_NoLock(DiagnosticAnalyzer analyzer, Action analyze, Nullable`1 info) in X:\Prod\Microsoft.Dynamics.Nav.CodeAnalysis\DiagnosticAnalyzer\AnalyzerExecutor.cs:line 1088'

This message is an error on the APP.JSON, which is neither a Codeunit nor an TableExtension. This seems to completely confuse the Codecop as it is rejecting all kinds of code that previously was working perfectly.

rknabben commented 6 months ago

Update: switching back from the pre-release AL to the Release AL extension solved the problem, so most likely the error is caused by changes (or a bug!) in the pre-release AL extension.