Skip to content

Commit 8148120

Browse files
Use \n instead of \r for GPR tooltips
Some LSP clients don't support \r to display multiline tooltips. For eng/ide/ada_language_server#1422
1 parent 2c87c44 commit 8148120

File tree

3 files changed

+18
-18
lines changed

3 files changed

+18
-18
lines changed

source/gpr/lsp-gpr_documentation.adb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ package body LSP.GPR_Documentation is
215215
Declaration_Text.Prepend
216216
(VSS.Strings.Conversions.To_Virtual_String
217217
(GPR2.Project.Typ.Image (Typ)
218-
& Ada.Characters.Latin_1.CR));
218+
& Ada.Characters.Latin_1.LF));
219219
end if;
220220
end;
221221
end if;
@@ -232,7 +232,7 @@ package body LSP.GPR_Documentation is
232232
Declaration_Text.Append
233233
(VSS.Strings.Conversions.To_Virtual_String
234234
(GPR2.Project.Attribute.Image (Attribute)
235-
& Ada.Characters.Latin_1.CR));
235+
& Ada.Characters.Latin_1.LF));
236236
Location_Text.Append
237237
(VSS.Strings.Conversions.To_Virtual_String
238238
(GPR2.Source_Reference.Format
@@ -253,7 +253,7 @@ package body LSP.GPR_Documentation is
253253
Declaration_Text.Append
254254
(VSS.Strings.Conversions.To_Virtual_String
255255
(GPR2.Project.Typ.Image (Typ)
256-
& Ada.Characters.Latin_1.CR));
256+
& Ada.Characters.Latin_1.LF));
257257
Location_Text.Append
258258
(VSS.Strings.Conversions.To_Virtual_String
259259
(GPR2.Source_Reference.Format

testsuite/gpr_lsp/hover/test.json

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@
217217
"contents": [
218218
{
219219
"language": "gpr",
220-
"value": "for Source_Dirs use (\"src\");\r"
220+
"value": "for Source_Dirs use (\"src\");\n"
221221
},
222222
"prj1.gpr:2:05",
223223
{
@@ -253,7 +253,7 @@
253253
"contents": [
254254
{
255255
"language": "gpr",
256-
"value": "for Switches (\"Ada\") use ();\r"
256+
"value": "for Switches (\"Ada\") use ();\n"
257257
},
258258
"prj1.gpr:4:05",
259259
{
@@ -320,7 +320,7 @@
320320
"contents": [
321321
{
322322
"language": "gpr",
323-
"value": "for Artifacts_Dir use \"\";\r"
323+
"value": "for Artifacts_Dir use \"\";\n"
324324
},
325325
"prj1.gpr:7:05",
326326
{
@@ -373,7 +373,7 @@
373373
"contents": [
374374
{
375375
"language": "gpr",
376-
"value": "type T is (\"project.Var value \");\rVar : T := \"project.Var value \";"
376+
"value": "type T is (\"project.Var value \");\nVar : T := \"project.Var value \";"
377377
},
378378
"prj3.gpr:3:03"
379379
]
@@ -437,7 +437,7 @@
437437
"contents": [
438438
{
439439
"language": "gpr",
440-
"value": "type T is (\"project.Var value \");\rVar : T := \"project.Var value \";"
440+
"value": "type T is (\"project.Var value \");\nVar : T := \"project.Var value \";"
441441
},
442442
"prj3.gpr:3:03"
443443
]
@@ -493,7 +493,7 @@
493493
"contents": [
494494
{
495495
"language": "gpr",
496-
"value": "type T is (\"project.Var value \");\rVar : T := \"project.Var value \";"
496+
"value": "type T is (\"project.Var value \");\nVar : T := \"project.Var value \";"
497497
},
498498
"prj3.gpr:3:03"
499499
]
@@ -588,7 +588,7 @@
588588
"contents": [
589589
{
590590
"language": "gpr",
591-
"value": "for Name use \"prj3\";\r"
591+
"value": "for Name use \"prj3\";\n"
592592
},
593593
"prj3.gpr",
594594
{
@@ -624,7 +624,7 @@
624624
"contents": [
625625
{
626626
"language": "gpr",
627-
"value": "for Name use \"prj3\";\r"
627+
"value": "for Name use \"prj3\";\n"
628628
},
629629
"prj3.gpr",
630630
{
@@ -691,7 +691,7 @@
691691
"contents": [
692692
{
693693
"language": "gpr",
694-
"value": "for Switches (\"main.adb\") use (\"value1\");\r"
694+
"value": "for Switches (\"main.adb\") use (\"value1\");\n"
695695
},
696696
"prj3.gpr:10:09",
697697
{
@@ -727,7 +727,7 @@
727727
"contents": [
728728
{
729729
"language": "gpr",
730-
"value": "for Switches (\"main.adb\") use (\"value2\");\r"
730+
"value": "for Switches (\"main.adb\") use (\"value2\");\n"
731731
},
732732
"prj3.gpr:11:09",
733733
{
@@ -763,7 +763,7 @@
763763
"contents": [
764764
{
765765
"language": "gpr",
766-
"value": "for Switches (others) use (\"value3\");\r"
766+
"value": "for Switches (others) use (\"value3\");\n"
767767
},
768768
"prj3.gpr:12:09",
769769
{
@@ -830,7 +830,7 @@
830830
"contents": [
831831
{
832832
"language": "gpr",
833-
"value": "for Switches (\"main.adb\") use (\"value1\");\r"
833+
"value": "for Switches (\"main.adb\") use (\"value1\");\n"
834834
},
835835
"prj3.gpr:10:09",
836836
{
@@ -866,7 +866,7 @@
866866
"contents": [
867867
{
868868
"language": "gpr",
869-
"value": "for Switches (others) use (\"value3\");\r"
869+
"value": "for Switches (others) use (\"value3\");\n"
870870
},
871871
"prj3.gpr:12:09",
872872
{

testsuite/gpr_lsp/hover_type_comment/test.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@
131131
"contents": [
132132
{
133133
"language": "gpr",
134-
"value": "type My_Type is (\"a\", \"b\");\r"
134+
"value": "type My_Type is (\"a\", \"b\");\n"
135135
},
136136
"prj.gpr:6:09",
137137
{
@@ -202,7 +202,7 @@
202202
"contents": [
203203
{
204204
"language": "gpr",
205-
"value": "type My_Type is (\"a\", \"b\");\r"
205+
"value": "type My_Type is (\"a\", \"b\");\n"
206206
},
207207
"prj.gpr:6:09",
208208
{

0 commit comments

Comments
 (0)