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

Constraint_Error in ALS from vscode when reading Ada code #1194

Open
stcarrez opened this issue May 1, 2024 · 5 comments
Open

Constraint_Error in ALS from vscode when reading Ada code #1194

stcarrez opened this issue May 1, 2024 · 5 comments
Assignees
Labels

Comments

@stcarrez
Copy link

stcarrez commented May 1, 2024

With version 24.0.5, I'm seeing CONSTRAINT_ERROR from vscode when looking at some Ada file that compiles.
It occurs for one file but not for others. The file is correct and compiles. The issue occurs when moving the caret at some position in the buffer by using the mouse (ie, click to position the caret).

2024-05-01 14:29:25.728 [error] Exception: CONSTRAINT_ERROR (LSP.Text_Documents.Line_Marker_Vectors.Constant_Reference: Index is out of range): Error: Exception: CONSTRAINT_ERROR (LSP.Text_Documents.Line_Marker_Vectors.Constant_Reference: Index is out of range)
	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:6127)
	at process.processImmediate (node:internal/timers:476:21)

Each time there is such exception, vscode displays the popup with message Request textDocument/foldingRange failed..

The log file /home/ciceron/.config/Code/logs/20240428T113411/window1/exthost/exthost.log indicates the above exception (several times) but there is no other information.

@AnthonyLeonardoGracio
Copy link
Collaborator

Hello @stcarrez ,

As said on the other issue, having the logs produced by the Ada Language Server itself in the ~/.als folder would help a lot, if you could attach them.

Regards,

@stcarrez
Copy link
Author

stcarrez commented May 2, 2024

See exthost.log

@AnthonyLeonardoGracio
Copy link
Collaborator

Hello @stcarrez,

This is the log coming from VS Code itself, which does not help much here: we really need the logs present in the ~/.als folder, which are emitted by the Ada Language Server executable itself.

Regards,

@stcarrez
Copy link
Author

Again, there is no ~/.als folder on Linux. If I create manually that directory, it is populated by empty files like:

ls -la ~/.als/
total 8
drwxrwxr-x  2 ciceron ciceron 4096 juin  15 10:31 .
drwxr-xr-x 78 ciceron ciceron 4096 juin  15 09:53 ..
-rw-rw-r--  1 ciceron ciceron    0 juin  14 23:09 als.2024-06-14T230920.2911985.log
-rw-rw-r--  1 ciceron ciceron    0 juin  14 23:09 als.2024-06-14T230920.2911986.log
-rw-rw-r--  1 ciceron ciceron    0 juin  15 10:06 als.2024-06-15T100612.2935280.log
-rw-rw-r--  1 ciceron ciceron    0 juin  15 10:06 als.2024-06-15T100612.2935282.log
-rw-rw-r--  1 ciceron ciceron    0 juin  15 10:24 als.2024-06-15T102424.2937842.log
-rw-rw-r--  1 ciceron ciceron    0 juin  15 10:24 als.2024-06-15T102424.2937844.log
-rw-rw-r--  1 ciceron ciceron    0 juin  15 10:28 als.2024-06-15T102833.2939281.log
-rw-rw-r--  1 ciceron ciceron    0 juin  15 10:28 als.2024-06-15T102833.2939283.log
-rw-rw-r--  1 ciceron ciceron    0 juin  15 10:30 als.2024-06-15T103052.2940267.log
-rw-rw-r--  1 ciceron ciceron    0 juin  15 10:30 als.2024-06-15T103052.2940269.log
-rw-rw-r--  1 ciceron ciceron    0 juin  15 10:31 als.2024-06-15T103118.2940687.log
-rw-rw-r--  1 ciceron ciceron    0 juin  15 10:31 als.2024-06-15T103118.2940689.log

Either this is not supported by the binary shipped with the VScode plugin, or, there is some option that I'm not aware of to enable that.

@AnthonyLeonardoGracio
Copy link
Collaborator

Hmm really strange, normally the directory is created by default. In any case, just add a traces.cfg file in this ~/.als folder, with the following contents:

>als.$T.txt:buffer_size=0:buffer_size=0
ALS.MAIN=yes
## uncomment the following 2 lines to activate full traces
ALS.IN=yes
ALS.OUT=yes

With this file you will get non-empty log files, normally.

We will investigate on why this folder does not get created by default.

Regards,

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