microsoft / AL

Home of the Dynamics 365 Business Central AL Language extension for Visual Studio Code. Used to track issues regarding the latest version of the AL compiler and developer tools available in the Visual Studio Code Marketplace or as part of the AL Developer Preview builds for Dynamics 365 Business Central.
MIT License
728 stars 241 forks source link

.vscode\temp-al-proxy.al(5,10): error AL0107: Syntax error, identifier expected #6324

Closed dzzzb closed 3 years ago

dzzzb commented 3 years ago

I keep getting this error when trying to compile, at random/spurious times, and have to restart VS Code 9008 times until it randomly decides to work for a brief while longer. Sorry, I can't provide a minimal example, as it's so sporadic. I just hope it can get onto the radar for fixing.

If there's anything I can run to try to get more info on this, please let me know. Clicking on the link to said proxy file does nothing because it's already been deleted by the time the error is reported.

atoader commented 3 years ago

Do you have any other extension installed that would generate that file? That is not something we generate as far as I know.

dzzzb commented 3 years ago

I have other extensions installed, but I don't know which could be generating that, and googling for it only finds copies of this issue!

I'll have to wait and see if it comes up again, then try to disable/enable extensions until I can isolate what causes it. That might be a few days as I'm doing a migration just now, not really actively building any new code, and I haven't seen it crop up in the few builds I've done. But I'll try to pinpoint it next time I get it... assuming it's consistent enough for that!

fvet commented 3 years ago

We're facing similar issues (have not been able to look into the details yet) ...

image

That is not something we generate as far as I know.

mboon75 commented 3 years ago

I am having the same issue here. It seems it has to do with rad.json. My trick to work around this is, to remove rad.json and recompile.

atoader commented 3 years ago

Should we try to find which extension is generating the temp-al-proxy.al file? Could you list the extensions that you have installed? Let's see if there is anything in common.

dzzzb commented 3 years ago

This is what I have installed. If the error was less sporadic, I'd try to disable and retest to narrow this down, but lately it has only occurred occasionally and usually goes away the next time I try to build.

image

fvet commented 3 years ago

Extensions Added: al v6.1.381323 al-code-outline v2.0.21 al-codeactions v0.2.24 al-extension-pack v1.0.10 al-test-runner v0.4.5 al-var-helper v2.4.0 alrunner v3.3.1 azure-account v0.9.4 bracket-pair-colorizer-2 v0.2.0 code-settings-sync v3.4.3 createGUID v0.0.2 crs-al-language-extension v1.3.5 git-extensions-for-vs-code v1.1.3 githd v2.2.4 githistory v0.6.14 gitlens v11.1.3 graphviz-interactive-preview v0.0.9 jbockle-format-files v3.0.0 markdown-all-in-one v3.4.0 path-intellisense v2.3.0 powershell v2020.6.0 rest-client v0.24.4 todo-tree v0.0.193 vs-keybindings v0.2.0 vscode-azureappservice v0.20.0 vscode-azurefunctions v1.1.0 vscode-guid v1.4.20 vscode-logicapps v1.0.1 xliff-sync v0.6.0 xml v2.5.1

atoader commented 3 years ago

That's a very long list. Maybe we should go another way. If you disable all the extensions except the AL one, does it still reproduce?

dzzzb commented 3 years ago

I can't disable all extensions (I need Vim keybindings to live), but I haven't been using any of the AL-related ones, so given that the file implicated has al in the name, I'll presume it's one of those and disable them and see if it recurs.

Given that mboon said this:

I am having the same issue here. It seems it has to do with rad.json. My trick to work around this is, to remove rad.json and recompile.

...does that suggest anywhere more specific to look? Is rad.json AL-specific or more general to VS Code? Maybe the al in the filename is just taken from the loaded language.

atoader commented 3 years ago

I agree that giving up on the Vim keybindings would severely degrade the experience :) . I suspect that another extension is generating that AL file and it is interacting badly with the RAD functionality. The other extensions might be generating the file even if you are not using them, but it is just a guess. Let me know what you find

BrianThorChristensen commented 3 years ago

I also get the same error very often. It seems that it mostly occurs if I build just after a reload. Reloading again and waiting a minute usually helps. When I compare my list of extensions in VSCode to those listed by dtkb and fvet we have these in common: al v6.1.381323 al-code-outline v2.0.21 alrunner v3.3.1 crs-al-language-extension v1.3.5 gitlens v11.1.3 todo-tree v0.0.193

0xEE00 commented 3 years ago

Similar error here when we try to build project after sync branch. "c:\OneDrive\VSCode\Business Central Localization\.al-lang-proxy\tempalfile.al(1,10): error AL0297: The application object identifier '0' is not valid. It must be within the allowed ranges' [xxxxxxx..xxxxxxx] '. "

If we create this file (tempalfile.al) and then delete it, the build will be successful :)

0xEE00 commented 3 years ago

After we create tempalfile.al, sometimes the following error occurs:

[Error - 11:51:57] Please report this issue to https://github.com/microsoft/al/issues including information on how to reproduce it, if possible. Processing of message 'textDocument/codeAction' failed with error: 'Specified argument was out of the range of valid values. (Parameter 'span')' Details: System.ArgumentOutOfRangeException: Specified argument was out of the range of valid values. (Parameter 'span') at Microsoft.Dynamics.Nav.CodeAnalysis.SyntaxNode.FindNode(TextSpan span, Boolean findInsideTrivia, Boolean getInnermostNodeForTie) in D:\a\1\s\source\Prod\Microsoft.Dynamics.Nav.CodeAnalysis\Syntax\SyntaxNode.cs:line 1401 at Microsoft.Dynamics.Nav.CodeAnalysis.ConvertIfToCase.ConvertIfToCaseCodeRefactoringProvider.ComputeRefactoringsAsync(CodeRefactoringContext context) in D:\a\1\s\source\Prod\Microsoft.Dynamics.Nav.CodeAnalysis.Workspaces\CodeRefactoring\Providers\ConvertIfToCase\ConvertIfToCaseCodeRefactoringProvider.cs:line 34 at Microsoft.Dynamics.Nav.CodeAnalysis.CodeRefactoring.CodeRefactoringService.GetRefactoringFromProviderAsync(Document document, TextSpan state, ICodeRefactoringProvider provider, CancellationToken cancellationToken) in D:\a\1\s\source\Prod\Microsoft.Dynamics.Nav.CodeAnalysis.Workspaces\CodeRefactoring\CodeRefactoringService.cs:line 71 at Microsoft.Dynamics.Nav.CodeAnalysis.CodeRefactoring.CodeRefactoringService.GetRefactoringsAsync(Document document, TextSpan state, CancellationToken cancellationToken) in D:\a\1\s\source\Prod\Microsoft.Dynamics.Nav.CodeAnalysis.Workspaces\CodeRefactoring\CodeRefactoringService.cs:line 44 at Microsoft.Dynamics.Nav.CodeAnalysis.CodeActions.ALCodeActionService.GetCodeActionsAsync(Document document, TextSpan textSpan, CancellationToken cancellationToken) in D:\a\1\s\source\Prod\Microsoft.Dynamics.Nav.CodeAnalysis.Workspaces\CodeActions\ALCodeActionService.cs:line 60 at Microsoft.Dynamics.Nav.EditorServices.Protocol.LanguageServer.CodeActionRequestHandler.HandleAsync(ProtocolCodeActionRequest request, Int32 requestId, CancellationToken cancellationToken) in D:\a\1\s\source\Prod\Microsoft.Dynamics.Nav.EditorServices.Protocol\LanguageServer\CodeActionRequestHandler.cs:line 59 at Microsoft.Dynamics.Nav.EditorServices.Protocol.MessageProtocol.RequestHandlerBase`1.HandleAsync(JToken requestContents, Int32 requestId, CancellationToken cancellationToken) in D:\a\1\s\source\Prod\Microsoft.Dynamics.Nav.EditorServices.Protocol\MessageProtocol\RequestHandlerBase.cs:line 65 at Microsoft.Dynamics.Nav.EditorServices.Protocol.RequestRegistry.Process(Message message) in D:\a\1\s\source\Prod\Microsoft.Dynamics.Nav.EditorServices.Protocol\Endpoints\RequestRegistry.cs:line 80

dannoe commented 3 years ago

Maybe this helps, but the file is mentioned in this extension: https://github.com/anzwdev/al-code-outline/blob/028ca1c9aeaa98632c04f176d8082346d429277a/src/allanguage/alLangServerProxy.ts#L183

atoader commented 3 years ago

I'll close this as external. I suggest you open an issue with the owner of the 3rd party extension.