AdaCore / ada_language_server

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

Weird issues in VSCode #999

Closed garryspins closed 2 years ago

garryspins commented 2 years ago

In VSCode occasionally highlighting will almost completely stop functioning properly.

Example

When this happens the language server also stops working on new code.

Another Example

This has been happening as long as I've used the extension, Any ideas?

reznikmm commented 2 years ago

Could you provide a complete reproducer? Or, at least, log files (from $HOME/.als/)?

garryspins commented 2 years ago

This happens every time I start up VSCode, theres nothing that triggers it (it seems). I can't seem to find any log files anywhere, I'm on Windows and my %HOMEPATH% has no sign of als anywhere. I have the settings for traces to be generated both on verbose.

nobody-famous commented 2 years ago

I'm seeing the same thing on Ubuntu.

There's something in the config stuff that "alr init" creates that's messing it up. In the root .gpr file, it references some config/*.gpr file that it generates. If I comment that out, along with the references to the config package, everything seems to work fine.

So, recreate steps:

  1. alr init --bin hello (accept all defaults)
  2. cd hello
  3. alr config --set editor.cmd 'code .'
  4. alr edit
  5. open src/hello.adb
  6. add/remove lines and the syntax highlighting doesn't update.
  7. open hello.gpr
  8. comment out first line (with "config/hello_config.gpr";)
  9. remove references to the Hello_Config package
  10. reload window
  11. everything's fine
nobody-famous commented 2 years ago

After poking around some more, the problem has to do with the ADAFLAGS compiler switches.

Either removing the list of switches after this line and changing the & to a semi-colon or removing this External_As_List call and only keeping the following list will fix the issue.

Ada_Compiler_Switches := External_As_List ("ADAFLAGS", " ") &

reznikmm commented 2 years ago

This was fixed in 23.0.8 and #571