@algosail/lsp 0.1.5 → 0.1.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/completion.js +14 -14
- package/package.json +2 -2
package/lib/completion.js
CHANGED
|
@@ -18,7 +18,7 @@ export function getCompletionItems(parser, uri) {
|
|
|
18
18
|
if (!ast) return items
|
|
19
19
|
|
|
20
20
|
for (const [key, module] of Object.entries(ast.modules)) {
|
|
21
|
-
for (const group of module.groups) {
|
|
21
|
+
for (const group of Object.values(module.groups)) {
|
|
22
22
|
items.push({
|
|
23
23
|
label: `~${key}&${group.name}`,
|
|
24
24
|
kind: CompletionItemKind.Enum,
|
|
@@ -27,33 +27,33 @@ export function getCompletionItems(parser, uri) {
|
|
|
27
27
|
})
|
|
28
28
|
}
|
|
29
29
|
|
|
30
|
-
for (const tag of module.tags) {
|
|
30
|
+
for (const tag of Object.values(module.tags)) {
|
|
31
31
|
items.push({
|
|
32
32
|
label: `~${key}#${tag.name}`,
|
|
33
33
|
kind: CompletionItemKind.EnumMember,
|
|
34
|
-
detail: `Tag constructor in ~${key}&${tag.group}`,
|
|
34
|
+
detail: `Tag constructor in ~${key}&${tag.group.name}`,
|
|
35
35
|
documentation: tag.doc ? { kind: MarkupKind.Markdown, value: tag.doc } : undefined,
|
|
36
36
|
})
|
|
37
37
|
items.push({
|
|
38
38
|
label: `~${key}_${tag.name}`,
|
|
39
39
|
kind: CompletionItemKind.EnumMember,
|
|
40
|
-
detail: `Tag pattern in ~${key}&${tag.group}`,
|
|
40
|
+
detail: `Tag pattern in ~${key}&${tag.group.name}`,
|
|
41
41
|
documentation: tag.doc ? { kind: MarkupKind.Markdown, value: tag.doc } : undefined,
|
|
42
42
|
})
|
|
43
43
|
}
|
|
44
44
|
|
|
45
|
-
for (const map of module.maps) {
|
|
45
|
+
for (const map of Object.values(module.maps)) {
|
|
46
46
|
items.push({
|
|
47
47
|
label: `~${key}$${map.name}`,
|
|
48
48
|
kind: CompletionItemKind.Struct,
|
|
49
|
-
detail: `Map
|
|
49
|
+
detail: `Map $${map.name}`,
|
|
50
50
|
documentation: map.doc ? { kind: MarkupKind.Markdown, value: map.doc } : undefined,
|
|
51
51
|
})
|
|
52
52
|
for (const field of map.fields) {
|
|
53
53
|
items.push({
|
|
54
54
|
label: `~${key}$${map.name}.${field.name}`,
|
|
55
55
|
kind: CompletionItemKind.Field,
|
|
56
|
-
detail: `Field
|
|
56
|
+
detail: `Field .${field.name}${field.type ? ` (${field.type.kind})` : ''} of ~${key}$${map.name}`,
|
|
57
57
|
documentation: field.doc ? { kind: MarkupKind.Markdown, value: field.doc } : undefined,
|
|
58
58
|
})
|
|
59
59
|
}
|
|
@@ -69,7 +69,7 @@ export function getCompletionItems(parser, uri) {
|
|
|
69
69
|
}
|
|
70
70
|
}
|
|
71
71
|
|
|
72
|
-
for (const group of ast.groups) {
|
|
72
|
+
for (const group of Object.values(ast.groups)) {
|
|
73
73
|
items.push({
|
|
74
74
|
label: `&${group.name}`,
|
|
75
75
|
kind: CompletionItemKind.Enum,
|
|
@@ -78,33 +78,33 @@ export function getCompletionItems(parser, uri) {
|
|
|
78
78
|
})
|
|
79
79
|
}
|
|
80
80
|
|
|
81
|
-
for (const tag of ast.tags) {
|
|
81
|
+
for (const tag of Object.values(ast.tags)) {
|
|
82
82
|
items.push({
|
|
83
83
|
label: `#${tag.name}`,
|
|
84
84
|
kind: CompletionItemKind.EnumMember,
|
|
85
|
-
detail: `Tag constructor in &${tag.group}`,
|
|
85
|
+
detail: `Tag constructor in &${tag.group.name}`,
|
|
86
86
|
documentation: tag.doc ? { kind: MarkupKind.Markdown, value: tag.doc } : undefined,
|
|
87
87
|
})
|
|
88
88
|
items.push({
|
|
89
89
|
label: `_${tag.name}`,
|
|
90
90
|
kind: CompletionItemKind.EnumMember,
|
|
91
|
-
detail: `Tag pattern in &${tag.group}`,
|
|
91
|
+
detail: `Tag pattern in &${tag.group.name}`,
|
|
92
92
|
documentation: tag.doc ? { kind: MarkupKind.Markdown, value: tag.doc } : undefined,
|
|
93
93
|
})
|
|
94
94
|
}
|
|
95
95
|
|
|
96
|
-
for (const map of ast.maps) {
|
|
96
|
+
for (const map of Object.values(ast.maps)) {
|
|
97
97
|
items.push({
|
|
98
98
|
label: `$${map.name}`,
|
|
99
99
|
kind: CompletionItemKind.Struct,
|
|
100
|
-
detail: `Map
|
|
100
|
+
detail: `Map $${map.name}`,
|
|
101
101
|
documentation: map.doc ? { kind: MarkupKind.Markdown, value: map.doc } : undefined,
|
|
102
102
|
})
|
|
103
103
|
for (const field of map.fields) {
|
|
104
104
|
items.push({
|
|
105
105
|
label: `$${map.name}.${field.name}`,
|
|
106
106
|
kind: CompletionItemKind.Field,
|
|
107
|
-
detail: `Field
|
|
107
|
+
detail: `Field .${field.name}${field.type ? ` (${field.type.kind})` : ''} of $${map.name}`,
|
|
108
108
|
documentation: field.doc ? { kind: MarkupKind.Markdown, value: field.doc } : undefined,
|
|
109
109
|
})
|
|
110
110
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@algosail/lsp",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.6",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"bin": {
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
},
|
|
9
9
|
"dependencies": {
|
|
10
10
|
"@algosail/builtins": "^0.0.1",
|
|
11
|
-
"@algosail/parser": "^0.0.
|
|
11
|
+
"@algosail/parser": "^0.0.7",
|
|
12
12
|
"vscode-languageserver": "^9.0.1",
|
|
13
13
|
"vscode-languageserver-textdocument": "^1.0.11"
|
|
14
14
|
}
|