15
15
-- of the license. --
16
16
-- ----------------------------------------------------------------------------
17
17
18
+ with GNATCOLL.Traces ; use GNATCOLL.Traces;
19
+
18
20
package body LSP.Ada_Handlers.Project_Diagnostics is
19
21
22
+ Me : constant Trace_Handle := Create (" ALS.PROJECT.DIAGNOSTICS" , On);
23
+
20
24
-- ------------------
21
25
-- Get_Diagnostic --
22
26
-- ------------------
@@ -26,15 +30,17 @@ package body LSP.Ada_Handlers.Project_Diagnostics is
26
30
Context : LSP.Ada_Contexts.Context;
27
31
Errors : out LSP.Structures.Diagnostic_Vector) is
28
32
begin
29
- Self.Last_Status := Self.Handler.Project_Status;
33
+ if Me.Active then
34
+ Self.Last_Status := Self.Handler.Project_Status;
30
35
31
- Self.Handler.Tracer.Trace (" Diag: " & Self.Last_Status'Image);
32
- -- If we have a valid project return immediately: we want to display
33
- -- diagnostics only if there is an issue to solve or a potential
34
- -- enhancement.
36
+ Self.Handler.Tracer.Trace (" Diag: " & Self.Last_Status'Image);
37
+ -- If we have a valid project return immediately: we want to display
38
+ -- diagnostics only if there is an issue to solve or a potential
39
+ -- enhancement.
35
40
36
- Errors.Append_Vector
37
- (LSP.Ada_Project_Loading.Get_Diagnostics (Self.Last_Status));
41
+ Errors.Append_Vector
42
+ (LSP.Ada_Project_Loading.Get_Diagnostics (Self.Last_Status));
43
+ end if ;
38
44
end Get_Diagnostic ;
39
45
40
46
-- ----------------------
@@ -48,9 +54,13 @@ package body LSP.Ada_Handlers.Project_Diagnostics is
48
54
is
49
55
pragma Unreferenced (Context);
50
56
begin
51
- return LSP.Ada_Project_Loading.Has_New_Diagnostics
52
- (Self.Last_Status,
53
- Self.Handler.Project_Status);
57
+ if Me.Active then
58
+ return LSP.Ada_Project_Loading.Has_New_Diagnostics
59
+ (Self.Last_Status,
60
+ Self.Handler.Project_Status);
61
+ else
62
+ return False;
63
+ end if ;
54
64
end Has_New_Diagnostic ;
55
65
56
66
end LSP.Ada_Handlers.Project_Diagnostics ;
0 commit comments