Closed timlag1305 closed 3 years ago
hello @timlag1305
Have you tried prebuilt Ada Language Server from the VSCode extension? Does it produce the same result?
Our prebuilt Ada Language Server contains the latest version of libgpr, gnatcoll, libadalang and other dependencies with some errors fixed since GNAT Community 2021 Edition release.
The CONSTRAINT_ERROR
is unexpected. Can you send us symbolic backtrace for it?
On the other side PROPERTY_ERROR
may not mean ALS error. It means that Libadalang is unable to process your code. It could be error in libadalang or else your code is incorrect.
Could you provide the complete reproducer?
Using the prebuilt version from the VSCode extension works correctly. I will work on getting a backtrace of the community release.
I recompiled als and some of its dependencies with debug options. I wasn't able to obtain the complete symbolic backtrace (not sure why) but there is more information.
[ALS.MAIN] Exception (processing notification):
_ALS.MAIN_ SYSTEM.ASSERTIONS.ASSERT_FAILURE
_ALS.MAIN_ [/usr/lib64/libgnat-11.so]
_ALS.MAIN_ 0x7f53a34ebbb2
_ALS.MAIN_ [/usr/lib/gnatcoll.relocatable/libgnatcoll.so.2021]
_ALS.MAIN_ 0x7f53a49c7e10 gnatcoll__json__get__12 at ???
_ALS.MAIN_ 0x556f10e7395b
_ALS.MAIN_ 0x556f108f2ba3
_ALS.MAIN_ 0x556f10df733a
_ALS.MAIN_ 0x556f10df6790
_ALS.MAIN_ [/usr/lib64/libgnarl-11.so]
_ALS.MAIN_ 0x7f53a36e636d
_ALS.MAIN_ [/usr/lib64/libpthread.so.0]
_ALS.MAIN_ 0x7f53a323c257
_ALS.MAIN_ [/usr/lib64/libc.so.6]
_ALS.MAIN_ 0x7f53a2de75e1
_ALS.MAIN_ 0xfffffffffffffffe
[ALS.MAIN] On_DidOpenTextDocument_Notification: file:///home/tim/projects/waterrower/src/api/api.adb
[ALS.MAIN] In Text_Document_Did_Open
I recreated the simplest example I could and still ran into the problem. I am using the built-in language client of neovim 0.5 if it matters.
I created a simple gpr file, empty Makefile, and procedure. See gist: https://gist.github.com/timlag1305/c8ebc4a2eb2b82737f93c18b938dca26
The directory structure is as shown:
.
├── Makefile
├── src
│ └── main.adb
└── test.gpr
1 directory, 3 files
Here is the error:
[ALS.IN] {"method": "workspace/didChangeConfiguration", "jsonrpc": "2.0", "params": {"settings": {"ada": {"renameInComments": "true", "projectFile": "test.gpr", "enableDiagnostics": "true", "defaultCharset": "utf-8"}}}}
[ALS.MAIN] DidChangeConfiguration_Notification: ada=(renameInComments=trueprojectFile=test.gprenableDiagnostics=truedefaultCharset=utf-8)
[ALS.IN] {"method": "textDocument/didOpen", "jsonrpc": "2.0", "params": {"textDocument": {"uri": "file:///home/tim/projects/als_test/src/main.adb", "version": 0, "languageId": "ada", "text": "with Ada.Text_IO;\n\nprocedure Main is\nbegin\n Ada.Text_IO.Put_Line(\"Test\");\nend Main;\n"}}}
[ALS.MAIN] On_DidOpenTextDocument_Notification: file:///home/tim/projects/als_test/src/main.adb
[ALS.MAIN] Exception (processing notification):
_ALS.MAIN_ SYSTEM.ASSERTIONS.ASSERT_FAILURE
_ALS.MAIN_ [/usr/lib64/libgnat-11.so]
_ALS.MAIN_ 0x7fd2bf32cbb2
_ALS.MAIN_ [/usr/lib/gnatcoll.relocatable/libgnatcoll.so.2021]
_ALS.MAIN_ 0x7fd2c0808e10 gnatcoll__json__get__12 at ???
_ALS.MAIN_ 0x563cf97bc7b3
_ALS.MAIN_ 0x563cf923bba3
_ALS.MAIN_ 0x563cf974033a
_ALS.MAIN_ 0x563cf973f790
_ALS.MAIN_ [/usr/lib64/libgnarl-11.so]
_ALS.MAIN_ 0x7fd2bf52736d
_ALS.MAIN_ [/usr/lib64/libpthread.so.0]
_ALS.MAIN_ 0x7fd2bf07d257
_ALS.MAIN_ [/usr/lib64/libc.so.6]
_ALS.MAIN_ 0x7fd2bec285e1
_ALS.MAIN_ 0xfffffffffffffffe
[ALS.MAIN] In Text_Document_Did_Open
[ALS.MAIN] Uri : file:///home/tim/projects/als_test/src/main.adb
[ALS.MAIN] Project loading ...
[ALS.MAIN] Root : /home/tim/projects/als_test/src/
[ALS.MAIN] Loading the implicit project
[ALS.MAIN] Finished Text_Document_Did_Open
[ALS.MAIN] Publish_Diagnostics: file:///home/tim/projects/als_test/src/main.adb 0
[ALS.OUT] {"jsonrpc":"2.0","method":"textDocument/publishDiagnostics","params":{"uri":"file:///home/tim/projects/als_test/src/main.adb","diagnostics":[]}}
[ALS.MAIN] WorkDoneProgress_Create_Request: Request 2 ada_ls-53619-indexing-1
[ALS.OUT] {"jsonrpc":"2.0","id":2,"method":"window/workDoneProgress/create","params":{"token":"ada_ls-53619-indexing-1"}}
[ALS.MAIN] Progress_Begin: ada_ls-53619-indexing-1
[ALS.OUT] {"jsonrpc":"2.0","method":"$/progress","params":{"token":"ada_ls-53619-indexing-1","value":{"kind":"begin","title":"Indexing","percentage":0}}}
[ALS.MAIN] Progress_End: ada_ls-53619-indexing-1
[ALS.OUT] {"jsonrpc":"2.0","method":"$/progress","params":{"token":"ada_ls-53619-indexing-1","value":{"kind":"end"}}}
[ALS.IN] {"id": 2, "result": null, "jsonrpc": "2.0"}
Hello @timlag1305
The workspace/didChangeConfiguration
notification looks suspicious:
Both these properties expected to be boolean type, not a string, so should be written without quotes.
Did you change .vscode/settings.json
? Can you check these properties there? It should be
"ada.renameInComments": true
instead of
"ada.renameInComments": "true"
Thanks for the help @reznikmm. Good catch. I am using neovim lsp here. I changed the type from a string to a boolean and that resolved the issue.
Hi,
I am using ada_language_server that I compiled from the gnat community 2021 sources. I am running into an error that prevents me from navigating to a declaration. You'll see that there is actually an exception opening the Ada file as well. Perhaps this is causing the problem navigating to the declaration.
I am running on Linux. I redacted some info. I haven't tried to reproduce on a simpler example yet, but I can if that's helpful.