posit-dev / positron

Positron, a next-generation data science IDE
https://positron.posit.co
Other
2.86k stars 91 forks source link

Diagnostics not fully disabled #3685

Open strengejacke opened 5 months ago

strengejacke commented 5 months ago

When I disable diagnostics ("positron.r.diagnostics.enable": false), it takes immediately effect. However, after re-starting Positron, I get diagnostics warnings for some code lines, but not for all. But why do I get the diagnostics at all?

This code line is marked:

image

Others (in the same file and function) are not (as expected, because diagnostics are disabled)

image

strengejacke commented 5 months ago

I guess the second isn't highlighted because it's a function call inside a function (i.e. used as argument). Anyway, disabling diagnostics does not have the desired effect.

DavisVaughan commented 5 months ago

I think that on startup we aren't getting a refresh of the "positron.r.diagnostics.enable" configuration variable, so we assume true.

We probably need a refresh of all global config in initialized(), or a refresh of all config (document + global) in did_open().

https://github.com/posit-dev/positron/assets/19150088/0a766b09-d68f-4875-9fec-f50730299cef

strengejacke commented 5 months ago

Whenever you run a command or enter something in the console, like x <- 1, diagnostics are disabled (i.e. the setting is realized).