-
Notifications
You must be signed in to change notification settings - Fork 245
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
'Specified argument was out of the range of valid values. (Parameter 'position')' #7861
Comments
Can you try the latest pre-release and verify that it happens there too? |
I've did some more testing and it seems to be an issue on my workstation 😳 I have the same result on my workstation on the latest pre-release, but also on previous releases, like the 13.0.964488 of the AL Language. So I've created an VM from scratch, where I try'ed to create a repo, unfortunately without success so far. I've try'ed
Any idea what I can try to possible create a repo on this? |
Maybe you have some hidden characters or something in your original workstation? |
Try copying over your vscode user config. Make sure workspace/folder settings are also in sync. |
Thank you, @BazookaMusic and @dannoe, for the suggestions! I'm getting closer but still not fully there. Here's what I've tried so far, although the issue persists: Steps Taken
However, the error still remains, but I’ve found some new details:
I discovered step 3 can be skipped, which led me to focus on the "Launch and Attach" part. When both VS Code windows are open and the AL Language extension is done initializing, attaching from one VS Code instance to the AL project works without any issues. However, when I try to open the AL project and attach to it almost simultaneously, the error occurs. Unfortunately, I haven’t been able to reproduce this issue on another workstation, which makes me think there’s still something I’m missing. Any further thoughts on what else to investigate? |
We don't support attaching via the C# debugger on the language server. It's some kind of race condition during the initialization of the project. The error says that the lines of the file in memory are less than it expected. Does this occur when you are not using the C# debugger? |
I suspect the issue could be related to the timing of the AL Language extension's initialization. When attaching after the extension has fully initialized, the error does not occur.
Yes, the error only occurs when using the C# debugger. Without the debugger, everything functions as expected, and no errors are encountered.
I wasn’t aware of that, thank you for the clarification! 😳 I’ll go ahead and close this issue since this is an unsupported scenario. However, I’d love to discuss this further if the opportunity arises, as we rely on the C# debugger for building custom code analyzers. |
@Arthurvdv While the code analyzers that partners have developed are very cool, this is also a scenario that Microsoft does not officially support. The AL language server is compiled in release mode and we don't provide official tooling to create the code analyzers, eg. publically documented interfaces. What I would suggest is that you wait until the projects have been loaded before attaching, as that will reduce the chance of something breaking during the initial load. |
@BazookaMusic Thank you for taking the time to provide feedback, especially considering this isn't officially supported. When you mentioned attaching the C# debugger to the language server, I thought that in general, it wouldn't work. However, waiting until the project is fully loaded before attaching is a feasible workaround to prevent this error from happening.
Thank you! |
1. Describe the bug
I've encounter an
ArgumentOutOfRangeException
when compiling an extensions with a procedure which has aIntegrationEvent
decorator, combined with attaching on theMicrosoft.Dynamics.Nav.EditorServices.Host.exe
process from another VS Code window.2. To Reproduce
al.codeAnalyzers
in thesettings.json
fileMicrosoft.Dynamics.Nav.EditorServices.Host.exe
processNote: Because the developers need to copy and paste the code snippet, including a code snippet as a media file (i.e. .gif) is not sufficient.
3. Expected behavior
While I'm doubting if this is an supported scenario, it would be great if this would be accepted to look into. On development of a custom code analyzer, this makes it a bit more challenging to determine possible errors.
4. Actual behavior
Catching the error to prevent raising an ArgumentOutOfRangeException.
5. Versions:
Final Checklist
Please remember to do the following:
The text was updated successfully, but these errors were encountered: