Closed MikeGlue closed 2 years ago
Hi, @MikeGlue could you please share your AL settings from the settings.json file?
Here you go:
{
"al.codeAnalyzers": [
"${CodeCop}"
],
"al.enableCodeAnalysis": true,
"al.backgroundCodeAnalysis": true,
"al.enableCodeActions": true
}
@MikeGlue, we are unable to reproduce the issue, please check again on the latest version of our VSCode extension and make sure you don't have any other extensions installed.
This is definitely still happening with the latest AL extension (v9.0.605172) and the sample project I provided to you. I confirmed that all extensions have been removed except for AL Language. I also confirmed that another developer on my team is seeing the same issue.
I've attached a fresh copy of the "child" project that just needs the base BC symbols added. Everything in this project was compiled and validated using the latest AL extension and using the official release of v20.
Same error happens:
Analyzer 'Microsoft.Dynamics.Nav.CodeCop.Design.Rule131StringParamsMustMatchPlaceholders' threw an exception of type 'System.InvalidCastException' with message 'System.InvalidCastException: Unable to cast object of type 'Microsoft.Dynamics.Nav.CodeAnalysis.Symbols.SimpleNavTypeSymbol' to type 'Microsoft.Dynamics.Nav.CodeAnalysis.ILabelTypeSymbol'.
at Microsoft.Dynamics.Nav.CodeCop.Design.Rule131StringParamsMustMatchPlaceholders.GetExpressionParamValue(IOperation expression) in D:\a\1\s\source\Prod\Microsoft.Dynamics.Nav.CodeCop\Design\Rule131StringParamsMustMatchPlaceholders.cs:line 103
at Microsoft.Dynamics.Nav.CodeCop.Design.Rule131StringParamsMustMatchPlaceholders.AnalyzeInvocation(OperationAnalysisContext ctx) in D:\a\1\s\source\Prod\Microsoft.Dynamics.Nav.CodeCop\Design\Rule131StringParamsMustMatchPlaceholders.cs:line 71
at Microsoft.Dynamics.Nav.CodeAnalysis.Diagnostics.AnalyzerExecutor.<>c__DisplayClass53_1.<ExecuteOperationAction>b__1() in D:\a\1\s\source\Prod\Microsoft.Dynamics.Nav.CodeAnalysis\DiagnosticAnalyzer\AnalyzerExecutor.cs:line 764
at Microsoft.Dynamics.Nav.CodeAnalysis.Diagnostics.AnalyzerExecutor.ExecuteAndCatchIfThrows_NoLock(DiagnosticAnalyzer analyzer, Action analyze, Nullable`1 info) in D:\a\1\s\source\Prod\Microsoft.Dynamics.Nav.CodeAnalysis\DiagnosticAnalyzer\AnalyzerExecutor.cs:line 1078'
The fix for this issue has been checked in to the master branch. It will be available in the bcinsider.azurecr.io/bcsandbox-master Docker image starting from platform build number 39052 and VS Code Extension Version
If you don’t have access to these images you need to become part of the Ready2Go program: aka.ms/readytogo
For more details on code branches and docker images please read: https://blogs.msdn.microsoft.com/nav/2018/05/03/al-developer-previews-multiple-releases-and-github/ https://freddysblog.com/2020/06/25/working-with-artifacts/
The fix for this issue has been checked in to the master branch. It will be available in the bcinsider.azurecr.io/bcsandbox-master Docker image starting from platform build number 39197 and VS Code Extension Version 10.0.611940.
If you don’t have access to these images you need to become part of the Ready2Go program: aka.ms/readytogo
For more details on code branches and docker images please read: https://blogs.msdn.microsoft.com/nav/2018/05/03/al-developer-previews-multiple-releases-and-github/ https://freddysblog.com/2020/06/25/working-with-artifacts/
1. Describe the bug The following CodeCop error appears when you StrSubstNo with a protected variable that has a placeholder in it.
2. To Reproduce I replicated this with a report extension, not sure if it can happen with other extension objects. I've attached the example projects that I used to replicate the issue.
I have attached a zip of both the parent and child projects that replicate the issue: CodeAnalyserError.zip
3. Expected behavior No code analysis error.
4. Actual behavior The following error shows (it repeats if you have multiple instances of StrSubstNo being used:
5. Versions:
Final Checklist
Please remember to do the following:
[x] Search the issue repository to ensure you are reporting a new issue
[x] Reproduce the issue after disabling all extensions except the AL Language extension
[x] Simplify your code around the issue to better isolate the problem