mirror of
https://github.com/misode/misode.github.io.git
synced 2026-05-01 21:23:12 +00:00
Add support for mcdoc:block_state_keys
This commit is contained in:
@@ -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' },
|
||||
})
|
||||
})
|
||||
})
|
||||
},
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user