Skip to content

Commit 818a730

Browse files
committed
Don't use LAL as fallback to obtain documentation.
GNATdoc supports all constructs now.
1 parent 945e796 commit 818a730

File tree

1 file changed

+3
-23
lines changed

1 file changed

+3
-23
lines changed

source/ada/lsp-lal_utils.adb

Lines changed: 3 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
------------------------------------------------------------------------------
22
-- Language Server Protocol --
33
-- --
4-
-- Copyright (C) 2018-2021, AdaCore --
4+
-- Copyright (C) 2018-2023, AdaCore --
55
-- --
66
-- This is free software; you can redistribute it and/or modify it under --
77
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -31,7 +31,6 @@ with VSS.Unicode;
3131
with Langkit_Support;
3232
with Langkit_Support.Symbols; use Langkit_Support.Symbols;
3333
with Libadalang.Common; use Libadalang.Common;
34-
with Libadalang.Doc_Utils;
3534
with Libadalang.Sources;
3635

3736
with Laltools.Call_Hierarchy;
@@ -805,6 +804,8 @@ package body LSP.Lal_Utils is
805804
Doc_Text : out VSS.Strings.Virtual_String;
806805
Decl_Text : out VSS.Strings.Virtual_String)
807806
is
807+
pragma Unreferenced (Trace);
808+
808809
Options : constant
809810
GNATdoc.Comments.Options.Extractor_Options :=
810811
(Style => Style,
@@ -833,27 +834,6 @@ package body LSP.Lal_Utils is
833834
Decl_Text := Get_Decl_Text (BD);
834835
end if;
835836

836-
-- Obtain documentation via the old engine when GNATdoc fails to extract
837-
-- the comments.
838-
if Doc_Text.Is_Empty then
839-
840-
-- Property_Errors can occur when calling
841-
-- Libadalang.Doc_Utils.Get_Documentation on unsupported
842-
-- docstrings, so add an exception handler to catch them and recover.
843-
begin
844-
Doc_Text :=
845-
VSS.Strings.To_Virtual_String
846-
(Libadalang.Doc_Utils.Get_Documentation
847-
(BD).Doc.To_String);
848-
exception
849-
when Libadalang.Common.Property_Error =>
850-
Trace.Trace
851-
("Failed to compute documentation with LAL"
852-
& "(unsupported docstring) for: " & BD.Image);
853-
Doc_Text := VSS.Strings.Empty_Virtual_String;
854-
end;
855-
end if;
856-
857837
Loc_Text := LSP.Lal_Utils.Node_Location_Image (BD);
858838
end Get_Tooltip_Text;
859839

0 commit comments

Comments
 (0)