Skip to content
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

Pre-condition failure in ALS from vscode when writing Ada code #1186

Open
stcarrez opened this issue Mar 10, 2024 · 6 comments
Open

Pre-condition failure in ALS from vscode when writing Ada code #1186

stcarrez opened this issue Mar 10, 2024 · 6 comments
Assignees
Labels

Comments

@stcarrez
Copy link

It happens regularly that ALS reports a failure while typing some Ada code. I report the issue here since the vscode plugin seems provided by this project. This creates (multiple) popup on the IDE about the failure.

I guess it occurs probably on some completion action while writing new procedure/function, hence at a stage where the Ada program is of course not valid because being written.

2024-03-10 14:51:49.655 [error] Exception: LANGKIT_SUPPORT.ERRORS.PRECONDITION_FAILURE (null node argument): Error: Exception: LANGKIT_SUPPORT.ERRORS.PRECONDITION_FAILURE (null node argument)
	at lr (/home/ciceron/.vscode/extensions/adacore.ada-24.0.4/out/src/extension.js:36:228)

Let me know if you need more information or if I can enable something to log more information for you.
This is the last version available at this date (24.0.4).

@AnthonyLeonardoGracio
Copy link
Collaborator

Hello,

We have fixed similar issues recently, mostly due to LSP codeActions that sometimes fail on invalid code.

We plan to release a new VS Code extension version in the coming weeks, would be worth to try again once it's released. If you still face the issue, you can give us the corresponding log: you can find them under your ~/.als directory.

Regards,

@stcarrez
Copy link
Author

stcarrez commented May 1, 2024

The issue seems to be present with 24.0.5 but the occurrence seems to have been reduced.

2024-05-01 09:41:11.860 [error] [AdaCore.ada] provider FAILED
2024-05-01 09:41:11.860 [error] Error: Exception: LANGKIT_SUPPORT.ERRORS.PRECONDITION_FAILURE (null node argumen$
        at dr (/home/ciceron/.vscode/extensions/adacore.ada-24.0.5/out/src/extension.js:36:228)
        at xr (/home/ciceron/.vscode/extensions/adacore.ada-24.0.5/out/src/extension.js:35:6240)
        at lr (/home/ciceron/.vscode/extensions/adacore.ada-24.0.5/out/src/extension.js:35:6363)
        at Immediate.<anonymous> (/home/ciceron/.vscode/extensions/adacore.ada-24.0.5/out/src/extension.js:35:61$
        at process.processImmediate (node:internal/timers:476:21)
2024-05-01 09:41:12.556 [error] [AdaCore.ada] provider FAILED
2024-05-01 09:41:12.557 [error] Error: Exception: LANGKIT_SUPPORT.ERRORS.PRECONDITION_FAILURE (null node argumen$
        at dr (/home/ciceron/.vscode/extensions/adacore.ada-24.0.5/out/src/extension.js:36:228)
        at xr (/home/ciceron/.vscode/extensions/adacore.ada-24.0.5/out/src/extension.js:35:6240)
        at lr (/home/ciceron/.vscode/extensions/adacore.ada-24.0.5/out/src/extension.js:35:6363)
        at Immediate.<anonymous> (/home/ciceron/.vscode/extensions/adacore.ada-24.0.5/out/src/extension.js:35:61$
        at process.processImmediate (node:internal/timers:476:21)
2024-05-01 09:41:21.999 [error] [AdaCore.ada] provider FAILED
2024-05-01 09:41:21.999 [error] Error: Exception: LANGKIT_SUPPORT.ERRORS.PRECONDITION_FAILURE (null node argumen$
        at dr (/home/ciceron/.vscode/extensions/adacore.ada-24.0.5/out/src/extension.js:36:228)
        at xr (/home/ciceron/.vscode/extensions/adacore.ada-24.0.5/out/src/extension.js:35:6240)
        at lr (/home/ciceron/.vscode/extensions/adacore.ada-24.0.5/out/src/extension.js:35:6363)
        at Immediate.<anonymous> (/home/ciceron/.vscode/extensions/adacore.ada-24.0.5/out/src/extension.js:35:61$
        at process.processImmediate (node:internal/timers:476:21)

@AnthonyLeonardoGracio
Copy link
Collaborator

Hello @stcarrez,

We would need the logs present in your ~/.als folder: these should contain the exception's SLOC, which would help us a lot ir order to fix it.

Regards,

@stcarrez
Copy link
Author

stcarrez commented May 2, 2024

There is no ~/.als folder but I've found logs for the ada_language_server daemon in /home/ciceron/.config/Code/logs/20240428T113411/window1/exthost/exthost.log

exthost.log

@AnthonyLeonardoGracio
Copy link
Collaborator

Hello @stcarrez,

This is not expected: the Ada Language Server itself should produce logs under the$HOME/.als/ folder (see here for more info).

The logs you have attached are the logs produced by the Ada TypeScript extension, the layer on top of the Ada Language Server that interfaces with VS Code. While these logs can be useful for bugs coming form the TypeScript layer, they aren't that useful for bugs coming from the ALS itself (which is the case here).

Can you double-check to see if some log are present in the folder mentioned above? Otherwise you can create a ~/.als/traces.cfg file manually, as described in the link.

Another option would be to provide a small reproducer if doable.

Regards,

@AnthonyLeonardoGracio
Copy link
Collaborator

Normally you should also have access to the logs produced by the ALS by running the Ada: Show Ada Language Server output from the VS Code command palette (ctrl + P key shortcut).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants