@@ -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