Skip to content

Commit 8fc659c

Browse files
author
Philippe Gil
committed
Merge branch 'topic/1298-external-tools-attributes-documentation' into 'master'
Add external tools attribute documentation Closes #1298 See merge request eng/ide/ada_language_server!1504
2 parents 11a384b + 08ec78c commit 8fc659c

File tree

3 files changed

+68
-3
lines changed

3 files changed

+68
-3
lines changed

source/gpr/lsp-gpr_external_tools.adb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
------------------------------------------------------------------------------
22
-- Language Server Protocol --
33
-- --
4-
-- Copyright (C) 2023, AdaCore --
4+
-- Copyright (C) 2023-2024, 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- --
@@ -184,7 +184,7 @@ package body LSP.GPR_External_Tools is
184184
Inherit_From_Extended => Inherit_From_Extended,
185185
Is_Set => Is_Set);
186186
end if;
187-
if Get_Attribute_Description (Name)'Length > 0
187+
if Get_Attribute_Description (Name)'Length = 0
188188
and then Description'Length > 0
189189
then
190190
Set_Attribute_Description (Name, Description);

testsuite/gpr_lsp/hover/prj1.gpr

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,7 @@ for Source_Dirs use ("src");
33
package Compiler is
44
for Switches ("Ada") use ();
55
end Compiler;
6+
package IDE is
7+
for Artifacts_Dir use "";
8+
end IDE;
69
end Prj1;

testsuite/gpr_lsp/hover/test.json

Lines changed: 63 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@
149149
"uri":"$URI{prj1.gpr}",
150150
"languageId":"Gpr",
151151
"version":1,
152-
"text":"project Prj1 is\nfor Source_Dirs use (\"src\");\npackage Compiler is\nfor Switches (\"Ada\") use ();\nend Compiler;\nend Prj1;"
152+
"text":"project Prj1 is\nfor Source_Dirs use (\"src\");\npackage Compiler is\nfor Switches (\"Ada\") use ();\nend Compiler;\npackage IDE is\nfor Artifacts_Dir use \"\";\nend IDE;\nend Prj1;"
153153
}
154154
}
155155
},
@@ -330,6 +330,68 @@
330330
]
331331
}
332332
},
333+
{
334+
"send":{
335+
"request":{
336+
"params":{
337+
"position":{
338+
"line":5,
339+
"character":8
340+
},
341+
"textDocument":{
342+
"uri":"$URI{prj1.gpr}"
343+
}
344+
},
345+
"jsonrpc":"2.0",
346+
"id":7,
347+
"method":"textDocument/hover"
348+
},
349+
"wait":[
350+
{
351+
"id":7,
352+
"result":{
353+
"contents":[
354+
{
355+
"language": "plaintext",
356+
"value": "This package specifies the options used by 'gnatstudio' IDE."
357+
}
358+
]
359+
}
360+
}
361+
]
362+
}
363+
},
364+
{
365+
"send":{
366+
"request":{
367+
"params":{
368+
"position":{
369+
"line":6,
370+
"character":9
371+
},
372+
"textDocument":{
373+
"uri":"$URI{prj1.gpr}"
374+
}
375+
},
376+
"jsonrpc":"2.0",
377+
"id":8,
378+
"method":"textDocument/hover"
379+
},
380+
"wait":[
381+
{
382+
"id":8,
383+
"result":{
384+
"contents":[
385+
{
386+
"language": "plaintext",
387+
"value": "The directory in which the files generated by 'gnatstudio' for this project (cross-references database, locations etc.) are stored by default. Defaults to Object_Dir if not specified."
388+
}
389+
]
390+
}
391+
}
392+
]
393+
}
394+
},
333395
{
334396
"send":{
335397
"request":{

0 commit comments

Comments
 (0)