Skip to content

Commit f5fff3c

Browse files
Merge branch 'topic/compl_pragmas' into 'master'
Use EnumMember completion kind for pragmas See merge request eng/ide/ada_language_server!1636
2 parents 4d224d9 + fb123e6 commit f5fff3c

File tree

3 files changed

+24
-85
lines changed

3 files changed

+24
-85
lines changed

source/ada/lsp-predefined_completion.adb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ package body LSP.Predefined_Completion is
9797
Virtual_String =>
9898
VSS.Strings.Conversions.To_Virtual_String
9999
(String'(Value.Get ("DOC")))));
100-
Item.kind := (Is_Set => True, Value => LSP.Enumerations.Text);
100+
Item.kind := (Is_Set => True, Value => LSP.Enumerations.EnumMember);
101101

102102
Items.Append (Item);
103103
end Load_Item;

testsuite/ada_lsp/V216-030.completion.attribute_in_decl/test.json

Lines changed: 8 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,10 @@
11
[
22
{
3-
"comment": [
4-
"test automatically generated"
5-
]
3+
"comment": ["test automatically generated"]
64
},
75
{
86
"start": {
9-
"cmd": [
10-
"${ALS}"
11-
]
7+
"cmd": ["${ALS}"]
128
}
139
},
1410
{
@@ -25,9 +21,7 @@
2521
"applyEdit": true,
2622
"workspaceEdit": {
2723
"documentChanges": true,
28-
"resourceOperations": [
29-
"rename"
30-
]
24+
"resourceOperations": ["rename"]
3125
}
3226
},
3327
"textDocument": {
@@ -36,15 +30,9 @@
3630
"dynamicRegistration": true,
3731
"completionItem": {
3832
"snippetSupport": false,
39-
"documentationFormat": [
40-
"plaintext",
41-
"markdown"
42-
],
33+
"documentationFormat": ["plaintext", "markdown"],
4334
"resolveSupport": {
44-
"properties": [
45-
"detail",
46-
"documentation"
47-
]
35+
"properties": ["detail", "documentation"]
4836
}
4937
}
5038
},
@@ -80,12 +68,7 @@
8068
"capabilities": {
8169
"textDocumentSync": 2,
8270
"completionProvider": {
83-
"triggerCharacters": [
84-
".",
85-
",",
86-
"'",
87-
"("
88-
],
71+
"triggerCharacters": [".", ",", "'", "("],
8972
"resolveProvider": true
9073
}
9174
}
@@ -204,13 +187,13 @@
204187
"<HAS>",
205188
{
206189
"label": "Abort_Signal",
207-
"kind": 1,
190+
"kind": 20,
208191
"detail": "GNAT RM",
209192
"documentation": "`Standard'Abort_Signal' (`Standard' is the only allowed prefix)\nprovides the entity for the special exception used to signal task abort\nor asynchronous transfer of control. Normally this attribute should\nonly be used in the tasking runtime (it is highly peculiar, and\ncompletely outside the normal semantics of Ada, for a user program to\nintercept the abort exception)."
210193
},
211194
{
212195
"label": "First_Bit",
213-
"kind": 1,
196+
"kind": 20,
214197
"detail": "Ada RM",
215198
"documentation": "For a component C of a composite, non-array object R:\n\n\nIf the nondefault bit ordering applies to the composite type,\nand if a component_clause specifies the placement of C,\ndenotes the value given for the first_bit of the\ncomponent_clause; otherwise, denotes the offset, from the\nstart of the first of the storage elements occupied by C, of\nthe first bit occupied by C. This offset is measured in bits.\nThe first bit of a storage element is numbered zero. The value\nof this attribute is of the type universal_integer. See"
216199
}

testsuite/ada_lsp/completion.aspects/test.json

Lines changed: 15 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,10 @@
11
[
22
{
3-
"comment": [
4-
"Check completions for an empty aspect clause"
5-
]
3+
"comment": ["Check completions for an empty aspect clause"]
64
},
75
{
86
"start": {
9-
"cmd": [
10-
"${ALS}"
11-
]
7+
"cmd": ["${ALS}"]
128
}
139
},
1410
{
@@ -29,11 +25,7 @@
2925
"applyEdit": true,
3026
"workspaceEdit": {
3127
"documentChanges": true,
32-
"resourceOperations": [
33-
"create",
34-
"rename",
35-
"delete"
36-
],
28+
"resourceOperations": ["create", "rename", "delete"],
3729
"normalizesLineEndings": true
3830
},
3931
"didChangeConfiguration": {},
@@ -60,16 +52,11 @@
6052
"completionItem": {
6153
"snippetSupport": true,
6254
"commitCharactersSupport": true,
63-
"documentationFormat": [
64-
"markdown",
65-
"plaintext"
66-
],
55+
"documentationFormat": ["markdown", "plaintext"],
6756
"deprecatedSupport": true,
6857
"preselectSupport": true,
6958
"tagSupport": {
70-
"valueSet": [
71-
1
72-
]
59+
"valueSet": [1]
7360
},
7461
"insertReplaceSupport": true,
7562
"resolveSupport": {
@@ -80,39 +67,13 @@
8067
]
8168
},
8269
"insertTextModeSupport": {
83-
"valueSet": [
84-
1,
85-
2
86-
]
70+
"valueSet": [1, 2]
8771
}
8872
},
8973
"completionItemKind": {
9074
"valueSet": [
91-
1,
92-
2,
93-
3,
94-
4,
95-
5,
96-
6,
97-
7,
98-
8,
99-
9,
100-
10,
101-
11,
102-
12,
103-
13,
104-
14,
105-
15,
106-
16,
107-
17,
108-
18,
109-
19,
110-
20,
111-
21,
112-
22,
113-
23,
114-
24,
115-
25
75+
1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
76+
16, 17, 18, 19, 20, 21, 22, 23, 24, 25
11677
]
11778
}
11879
},
@@ -132,12 +93,7 @@
13293
"capabilities": {
13394
"textDocumentSync": 2,
13495
"completionProvider": {
135-
"triggerCharacters": [
136-
".",
137-
",",
138-
"'",
139-
"("
140-
],
96+
"triggerCharacters": [".", ",", "'", "("],
14197
"resolveProvider": true
14298
}
14399
}
@@ -219,10 +175,10 @@
219175
"<HAS>",
220176
{
221177
"label": "Address",
222-
"kind": 1,
178+
"kind": 20,
223179
"detail": "Ada RM",
224180
"documentation": "<ANY>"
225-
}
181+
}
226182
]
227183
}
228184
}
@@ -236,9 +192,9 @@
236192
"id": 14,
237193
"method": "completionItem/resolve",
238194
"params": {
239-
"label": "Address",
240-
"kind": 1,
241-
"detail": "Ada RM"
195+
"label": "Address",
196+
"kind": 1,
197+
"detail": "Ada RM"
242198
}
243199
},
244200
"wait": [
@@ -268,7 +224,7 @@
268224
]
269225
}
270226
},
271-
{
227+
{
272228
"stop": {
273229
"exit_code": 0
274230
}

0 commit comments

Comments
 (0)