✨ feat(vscode): Rust 的 #![…] 内部属性做成「编译属性」卡片

This commit is contained in:
cruldra committed 2026-10-08 07:17:25 +08:00
1 parent 2f610e9cb8
commit 04a11eb0b2
14 files changed
+386 -20

No files matched your search

+3 -1
View File
@@ -428,6 +428,7 @@ export interface DocumentViews {
* 命令名的命令规则(SourceDocument.commandRule)。
*/
export interface DocumentExtras {
fileName?: SourceDocument['fileName']
rules?: RuleRun
calleeKind?: SourceDocument['calleeKind']
commandRule?: SourceDocument['commandRule']
@@ -467,7 +468,7 @@ export async function readBlockViews(
parts.set(code.node.startIndex, { code, root, document, translator: language.translator, steps })
}
const { names, markers } = adapter.displayNames?.find(tree.rootNode, source, languageId) ?? { names: [], markers: [] }
const { calleeKind, commandRule } = extras
const { fileName, calleeKind, commandRule } = extras
const readings = new Map<number, EmbeddedReading>()
const embedded = (node: Node): EmbeddedReading | undefined => {
const part = parts.get(node.startIndex)
@@ -481,6 +482,7 @@ export async function readBlockViews(
source,
language: adapter,
markers,
...(fileName && { fileName }),
...(calleeKind && { calleeKind }),
...(commandRule && { commandRule }),
...(parts.size > 0 && { embedded }),