Skip to content

Commit

Permalink
🐛 Use correct completion kind in nbt completer
Browse files Browse the repository at this point in the history
  • Loading branch information
misode committed Jun 16, 2024
1 parent b41356b commit d337cf7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
5 changes: 2 additions & 3 deletions packages/mcdoc/src/runtime/checker/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1247,9 +1247,8 @@ function simplifyDispatcher<T>(
}
const structFields: StructTypePairField[] = []
for (const key in dispatcher) {
// TODO Better way to access typedef without any cast?
const data = dispatcher[key].data as any
if (data && data.typeDef) {
const data = dispatcher[key].data
if (TypeDefSymbolData.is(data)) {
structFields.push({ kind: 'pair', key, type: data.typeDef })
}
}
Expand Down
4 changes: 2 additions & 2 deletions packages/nbt/src/completer/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,9 @@ function getValues(
ctx: core.CompleterContext,
): core.CompletionItem[] {
return mcdoc.runtime.completer.getValues(typeDef, ctx)
.map(({ value, detail, kind }) =>
.map(({ value, detail, kind, completionKind }) =>
core.CompletionItem.create(value, range, {
kind: core.CompletionKind.Value,
kind: completionKind ?? core.CompletionKind.Value,
detail,
filterText: formatValue(value, kind),
insertText: formatValue(value, kind),
Expand Down

0 comments on commit d337cf7

Please sign in to comment.