Skip to content

Commit 8842d7c

Browse files
committed
V331-019 Support for 'plaintext' language.
Change-Id: If476464a2bdbfedc5a95d2622b26ecd60f826565
1 parent 177931b commit 8842d7c

File tree

1 file changed

+16
-14
lines changed

1 file changed

+16
-14
lines changed

lsp_client/src/gps-lsp_client-editors-tooltips.adb

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -373,21 +373,13 @@ package body GPS.LSP_Client.Editors.Tooltips is
373373
for Tooltip_Block of Result.Value.contents.Vector loop
374374
New_Tooltip_Block_Label;
375375

376-
-- If the tooltip block is a simple string, display it as it is.
377-
-- Otherwise, if a language is specified, try to highlight the
378-
-- tooltip block (this only works for Ada currently).
376+
-- If language is specified for the tooltip block and it is "ada",
377+
-- try to highlight this block. Otherwise process tooltip block
378+
-- as plaintext.
379379

380-
if Tooltip_Block.Is_String then
381-
Tooltip_Block_Label.Set_Use_Markup (False);
382-
Tooltip_Block_Label.Set_Text
383-
(To_String
384-
(String_Utils.Wrap_At_Words
385-
(S =>
386-
VSS.Strings.Conversions.To_UTF_8_String
387-
(Tooltip_Block.value),
388-
Limit => Max_Width_Chars)));
389-
390-
elsif Tooltip_Block.language = "ada" then
380+
if not Tooltip_Block.Is_String
381+
and then Tooltip_Block.language = "ada"
382+
then
391383
declare
392384
use Libadalang.Analysis;
393385
use Libadalang.Common;
@@ -431,6 +423,16 @@ package body GPS.LSP_Client.Editors.Tooltips is
431423
Limit => Max_Width_Chars)));
432424
end if;
433425
end;
426+
427+
else
428+
Tooltip_Block_Label.Set_Use_Markup (False);
429+
Tooltip_Block_Label.Set_Text
430+
(To_String
431+
(String_Utils.Wrap_At_Words
432+
(S =>
433+
VSS.Strings.Conversions.To_UTF_8_String
434+
(Tooltip_Block.value),
435+
Limit => Max_Width_Chars)));
434436
end if;
435437
end loop;
436438
else

0 commit comments

Comments
 (0)