✨ feat(vscode): 代码阅读的 TypeScript interface 换成一张属性表卡片
契约加 InterfaceBlock / InterfaceFacts(种类「接口」,图标、颜色同类型块);属性签名和索引签名连同讲它的注释并进「属性 | 类型 | 说明」表,可省略带 ?、只读写在类型前、没标注写未标注,每行讲的定义是属性名;方法签名是函数子块,调用签名、构造签名照旧是子块;declare interface 也认;「了解一块代码」照旧按 接口名.属性名 找得到属性
This commit is contained in:
1 parent
f487b841ce
commit
6b1e6f3487
16 files changed
+334
-46
No files matched your search
@@ -91,7 +91,7 @@ describe('按符号名在源码里找(语言插件解析出的块)', () => {
|
||||
|
||||
it('类型(interface、type)和它们的成员按声明的名字找;shell 命令不算名字', async () => {
|
||||
const types = 'export interface Favorite {\n uri: string\n}\ntype Slot = number\n'
|
||||
expect(await find(typescript, 'typescript', types, 'Favorite')).toEqual({ text: 'Favorite', kind: 'type' })
|
||||
expect(await find(typescript, 'typescript', types, 'Favorite')).toEqual({ text: 'Favorite', kind: 'interface' })
|
||||
expect(await find(typescript, 'typescript', types, 'Favorite.uri')).toEqual({ text: 'uri', kind: 'field' })
|
||||
expect(await find(typescript, 'typescript', types, 'Slot')).toEqual({ text: 'Slot', kind: 'type' })
|
||||
expect(await find(rust, 'rust', 'pub type Id = u32;\n', 'Id')).toEqual({ text: 'Id', kind: 'statement' })
|
||||
|
||||
Reference in new issue
Block a user