diff --git a/src/app/services/Spyglass.ts b/src/app/services/Spyglass.ts index 0f3db15d..2e9e5f50 100644 --- a/src/app/services/Spyglass.ts +++ b/src/app/services/Spyglass.ts @@ -358,6 +358,23 @@ const initialize: core.ProjectInitializer = async (ctx) => { }) }) }) + symbols.query(uri, 'mcdoc/dispatcher', 'mcdoc:block_state_keys').enter({ + usage: { type: 'declaration' }, + }).onEach(Object.entries(summary.blocks), ([id, [properties]], blockQuery) => { + const data: mcdoc.binder.TypeDefSymbolData = { typeDef: { + kind: 'union', + members: Object.keys(properties).map(propKey => ({ + kind: 'literal', + value: { kind: 'string', value: propKey }, + })), + } } + blockQuery.member(id, (stateQuery) => { + stateQuery.enter({ + data: { data }, + usage: { type: 'declaration' }, + }) + }) + }) }, })