✨ feat(vscode): Rust 的模块、常量和外部函数拆成卡片
This commit is contained in:
1 parent
e6345e3309
commit
04c4b9f710
13 files changed
+220
-92
No files matched your search
@@ -1,4 +1,4 @@
|
||||
import type { ClassBlock, CodeBlock, EnumBlock, FunctionBlock, ImplBlock, ImportBlock, Inline, PropertyItem, PropertyRow, TokenRole, TraitBlock } from '../contract'
|
||||
import type { ClassBlock, CodeBlock, EnumBlock, FunctionBlock, ImplBlock, ImportBlock, Inline, ModuleBlock, PropertyItem, PropertyRow, TokenRole, TraitBlock } from '../contract'
|
||||
import type { RustVisibility } from './rustTree'
|
||||
import { bodyFunctions, docSentence, isMethod, matchArms, oneLine, returnText, signatureParams, structFields, variantPayload } from './rustTree'
|
||||
|
||||
@@ -64,6 +64,14 @@ export function structRows(block: ClassBlock, say: RustSay): PropertyRow[] {
|
||||
]
|
||||
}
|
||||
|
||||
export function moduleRows(block: ModuleBlock, say: RustSay): PropertyRow[] {
|
||||
return [
|
||||
nameRow(block.facts.name, say, 'variable'),
|
||||
...docRow(block.facts.doc),
|
||||
visibilityRow(block),
|
||||
]
|
||||
}
|
||||
|
||||
export function enumRows(block: EnumBlock, say: RustSay): PropertyRow[] {
|
||||
return [
|
||||
nameRow(block.facts.name, say, 'type'),
|
||||
|
||||
Reference in new issue
Block a user