@spyglassmc/nbt 0.3.10 → 0.3.12
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/checker/index.js +6 -0
- package/lib/completer/index.js +3 -1
- package/package.json +4 -4
package/lib/checker/index.js
CHANGED
|
@@ -121,6 +121,7 @@ export function typeDefinition(typeDef, options = {}) {
|
|
|
121
121
|
node.hover = `\`\`\`typescript\n${mcdoc.McdocType.toString(definition)}\n\`\`\`\n${desc}`;
|
|
122
122
|
}
|
|
123
123
|
},
|
|
124
|
+
nodeAttacher: (node, attacher) => attacher(node),
|
|
124
125
|
stringAttacher: (node, attacher) => {
|
|
125
126
|
if (!NbtStringNode.is(node)) {
|
|
126
127
|
return;
|
|
@@ -286,6 +287,11 @@ export function path(registry, id) {
|
|
|
286
287
|
link.prev.node.hover = `\`\`\`typescript\n${link.prev.node.children[0].value}: ${mcdoc.McdocType.toString(definition)}\n\`\`\`\n${desc}`;
|
|
287
288
|
}
|
|
288
289
|
},
|
|
290
|
+
nodeAttacher: (link, attacher) => {
|
|
291
|
+
if (link.node.type !== 'leaf') {
|
|
292
|
+
attacher(link.node);
|
|
293
|
+
}
|
|
294
|
+
},
|
|
289
295
|
stringAttacher: (link, attacher) => {
|
|
290
296
|
if (!NbtPathKeyNode.is(link.node)) {
|
|
291
297
|
return;
|
package/lib/completer/index.js
CHANGED
|
@@ -111,11 +111,13 @@ function getPathKeys(typeDef, range, quote, ctx) {
|
|
|
111
111
|
}
|
|
112
112
|
function getValues(typeDef, range, ctx) {
|
|
113
113
|
return mcdoc.runtime.completer.getValues(typeDef, ctx)
|
|
114
|
-
.map(({ value, detail, kind, completionKind, insertText }) => core.CompletionItem.create(value, range, {
|
|
114
|
+
.map(({ value, labelSuffix, detail, kind, completionKind, insertText, sortText }) => core.CompletionItem.create(value, range, {
|
|
115
115
|
kind: completionKind ?? 12 /* core.CompletionKind.Value */,
|
|
116
|
+
labelSuffix,
|
|
116
117
|
detail,
|
|
117
118
|
filterText: formatValue(value, kind),
|
|
118
119
|
insertText: formatValue(insertText ?? value, kind),
|
|
120
|
+
sortText,
|
|
119
121
|
}));
|
|
120
122
|
}
|
|
121
123
|
function formatKey(key, quote) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@spyglassmc/nbt",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.12",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"types": "lib/index.d.ts",
|
|
@@ -25,8 +25,8 @@
|
|
|
25
25
|
"url": "https://github.com/SpyglassMC/Spyglass/issues"
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@spyglassmc/core": "0.4.
|
|
29
|
-
"@spyglassmc/locales": "0.3.
|
|
30
|
-
"@spyglassmc/mcdoc": "0.3.
|
|
28
|
+
"@spyglassmc/core": "0.4.9",
|
|
29
|
+
"@spyglassmc/locales": "0.3.8",
|
|
30
|
+
"@spyglassmc/mcdoc": "0.3.12"
|
|
31
31
|
}
|
|
32
32
|
}
|