diff --git a/packages/mcdoc/src/runtime/checker/index.ts b/packages/mcdoc/src/runtime/checker/index.ts index ebee915af..a6970ecb8 100644 --- a/packages/mcdoc/src/runtime/checker/index.ts +++ b/packages/mcdoc/src/runtime/checker/index.ts @@ -1247,9 +1247,8 @@ function simplifyDispatcher( } 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 }) } } diff --git a/packages/nbt/src/completer/index.ts b/packages/nbt/src/completer/index.ts index 47d5f9b43..be022f246 100644 --- a/packages/nbt/src/completer/index.ts +++ b/packages/nbt/src/completer/index.ts @@ -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),