AdaCore / ada_language_server

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

Duplicate definitions in a file causes the Language Server to Spaz out #1040

Closed Joebeazelman closed 1 year ago

Joebeazelman commented 2 years ago

Duplicate definitions cause ALS to spaz out and spit out error messages. The following reproduces the issue:

package Test is 
      type Command_Bits is array (0..7) of Boolean with
           Component_Size => 1;
      type Command_Bits is array (0..7) of Boolean with
           Component_Size => 1;
end Test

Other errors syntax errors don't cause this issue. I suspect ALS's internal data structures have difficulty handling duplicate entries and spazzes out. ALS will recover if the duplicate definition is removed in that it won't stall, but formatting no longer works.

The issue also seems to occur even if the two lines are similar but not identical but without dumping error messages on the console. The second line loses syntax coloring.

    Send (NewCommand);     -- Send the new command 
    Send (OldCommand);       -- Send the new command 
reznikmm commented 1 year ago

Can't reproduce this with 23.0.15. Could you check? Closing the issue for now. Don't hesitate to reopen if the bug persists.

Joebeazelman commented 1 year ago

Can't reproduce this with 23.0.15. Could you check? Closing the issue for now. Don't hesitate to reopen if the bug persists.

I don't know what you're on, but you've been slaying bugs like crazy. I can actually use VSCode with Ada!