AdaCore / ada_language_server

Server implementing the Microsoft Language Protocol for Ada and SPARK
GNU General Public License v3.0
230 stars 54 forks source link

als raises CONSTRAINT_ERROR if iniitalization drops a TokenModifier #1070

Closed stephe-ada-guru closed 1 year ago

stephe-ada-guru commented 1 year ago

In Emacs ada-mode, I don't want identifiers with TokenModifier defaultLibrary highlighted; that would highlight Ada.Text_IO differently than My_Package.

So I drop the defaultLibrary tokenModifier in the initialization capabilities. That causes a CONSTRAINT_ERROR in response to a SemanticTokens request.

Attached is a test that shows the problem, and a patch to fix it (as semantic_tokens_delete_modifier.diff.txt). I couldn't attach a .tgz of the test directory, so it's just test.json.txt and foo.adb.txt (although it appears the content of foo.adb doesn't actually matter?) foo.adb.txt test.json.txt semantic_tokens_delete_modifier.diff.txt