Skip to content

Commit 70b8412

Browse files
committed
Merge branch 'topic/iv_fix' into 'master'
Add defensive code for inliveValue request Closes #1687 See merge request eng/ide/ada_language_server!2048
2 parents 49ee5a8 + 61ff903 commit 70b8412

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

source/ada/lsp-ada_inline_value.adb

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -331,18 +331,20 @@ package body LSP.Ada_Inline_Value is
331331
(Id : Libadalang.Analysis.Identifier) return Boolean
332332
is
333333
Decl : Libadalang.Analysis.Basic_Decl;
334-
Tipe : Libadalang.Analysis.Base_Type_Decl;
334+
Decl_Type : Libadalang.Analysis.Base_Type_Decl;
335335
begin
336336
Decl := Id.P_Referenced_Decl (Imprecise_Fallback => False);
337-
Tipe := Id.P_Expression_Type;
337+
Decl_Type := Id.P_Expression_Type;
338338

339-
if Id.P_Is_Defining or else Decl.Is_Null or else Tipe.Is_Null then
339+
if Id.P_Is_Defining or else Decl.Is_Null or else Decl_Type.Is_Null then
340340
return False;
341-
else
342-
Tipe := Tipe.P_Full_View;
341+
elsif not Decl_Type.P_Full_View.Is_Null then
342+
Decl_Type := Decl_Type.P_Full_View;
343343
end if;
344344

345-
if not Tipe.P_Is_Scalar_Type (Tipe) and then not Is_String (Tipe) then
345+
if not Decl_Type.P_Is_Scalar_Type (Decl_Type)
346+
and then not Is_String (Decl_Type)
347+
then
346348
-- Let's display only variables of elementary and string types for
347349
-- now.
348350
return False;

0 commit comments

Comments
 (0)