Skip to content

Conversation

setton
Copy link
Member

@setton setton commented May 28, 2019

Create a trace, turned off by default, which controls the
emission of diagnostics.

To support testing diagnostics even if this feature is
swiched off:

  • add a mechanism which accepts a ".gnatdebug" in the current
    dir to specify traces, overriding ~/.als/traces.cfg
  • add a .gnatdebug activating the diagnostics trace in the
    test ada_lsp/publish_diag
  • modify the Makefile to run each test in its directory,
    so that there can be local .gnatdebug files for each tests.
Copy link
Contributor

@raph-amiard raph-amiard left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm really not fond of using traces in the ALS to activate/deactivate features.

  1. First [opinion] because traces are not meant for that IMHO, and it's just a weird GPS idiom to use the trace file to also be a config file, rather than you know, use a config file

  2. Second, because it will be unintuitive to reactivate. For me you should have a default (here probably deactivate diagnostics) that you can reactivate via a setting in the configChanged request.

Ideally, after a few small fixes to diagnostics, that I have locally, I would even prefer that diagnostics are on by default but deactivated from the GPS side, because the decision to not have diagnostics is more of a GPS one than an ALS one (eg. they are pretty usable in VS Code IMO)

@setton
Copy link
Member Author

setton commented May 29, 2019

I'm really not fond of using traces in the ALS to activate/deactivate features.

  1. First [opinion] because traces are not meant for that IMHO, and it's just a weird GPS idiom to use the trace file to also be a config file, rather than you know, use a config file
  2. Second, because it will be unintuitive to reactivate. For me you should have a default (here probably deactivate diagnostics) that you can reactivate via a setting in the configChanged request.

OK, I will add support for the configuration request. I will keep the code to activate "local traces" active, since this can be very useful, in particular for developers.

Ideally, after a few small fixes to diagnostics, that I have locally, I would even prefer that diagnostics are on by default but deactivated from the GPS side, because the decision to not have diagnostics is more of a GPS one than an ALS one (eg. they are pretty usable in VS Code IMO)

Right.

@setton setton force-pushed the topic/deactivate_diagnostics branch from efb8dd8 to 57087e8 Compare May 29, 2019 22:22
setton and others added 3 commits May 29, 2019 18:22
And document this setting, along with defaultCharset, in the README.md. Add a test for deactivation of diagnostics. Improve the traces mechanism: - add a mechanism which accepts a ".gnatdebug" in the current dir to specify traces, overriding ~/.als/traces.cfg - add a .gnatdebug activating the diagnostics trace in the test ada_lsp/publish_diag - modify the Makefile to run each test in its directory, so that there can be local .gnatdebug files for each tests.
Fix unit provider by protect Ada.Directories.Full_Name from beeing called with empty string. This could be in case of unknown Ada library units.
And default the charset to iso-8859-1, which is the GNAT default.
@setton setton force-pushed the topic/deactivate_diagnostics branch from 57087e8 to 9598345 Compare May 29, 2019 22:24
@setton setton closed this May 29, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants