Open rocher opened 7 months ago
It would be better to fix this on ALS side. Could you provide a reproducer?
It happens to me every time I save an erroneous file, with compilation errors. Is this something I can solve (or mute) with some vscode setting?? Didn't find any ..
Could it be because I'm using -gnatX0
and -gnat2022
in alire-toml
but the formatter does not use such flags when parsing the file? The formatter complains that incorrect code cannot can't be formatted, but the compiler compiles the file with no single warning.
The notifications make it hard to work in vscode because the output window steals focus from the terminal window any time there's an LSP error. Some repros that cause formatting to fail if they occur anywhere in a file:
-- works if you add `null;` between `begin` and `end P;`
procedure P is
begin
end P;
-- works if you replace `end B;` with `end A;`
procedure A is
begin
null;
end B;
Could it be because I'm using
-gnatX0
and-gnat2022
inalire-toml
but the formatter does not use such flags when parsing the file?
From my experience, the extension just goes out of its way to tell you it broke whenever it tries to process an incorrect file. Here's an example:
with Ada.Command_Line;
procedure Main is
begin
for Index in 1 .. Ada.Command_Line.Argument_Count loop
declare
Argument : String := Ada.Command_Line.Argument (Index);
begin
if not Argument -- typing in left parenthesis here does it
end;
end loop;
end Main;
[Error - 10:13:36 PM] Request textDocument/signatureHelp failed.
Message: Exception: LANGKIT_SUPPORT.ERRORS.PRECONDITION_FAILURE (null node argument)
Code: -32603
It's been like that for 3 years now, except a few months ago the message said "Imprecise fallback used to compute [...]".
When working with incomplete or erroneous code I get messages like these in the
Output
viewand a notification
A request has failed. See the output...
. Last error message can be easily reproduced every time you save incorrect code.Is it possible to suppress the error messages and the notification? I already know the code has problems and errors: red-wave underlined code, reports in the
Problems
view, basic Ada knowledge ..., so I don't need to see them in the output view nor receive the notification, which are really annoying (cancel the notification, toggle the panel).