✨ feat(vscode): FastAPI 接口卡片的调用树带上前端调用它的地方
This commit is contained in:
1 parent
d4459e93b3
commit
29cedcb751
30 files changed
+1316
-130
No files matched your search
@@ -128,7 +128,7 @@ function shown(block: BlockView, tree: BlockTreeState): boolean {
|
||||
* 块的种类色写在哪:内置种类按 data-kind 取 CSS 里的配色;库规则认领的块(带 badge)按规则给的颜色,
|
||||
* 暗色、亮色两个都写在 style 上,CSS 按主题挑一个(见 [data-badge])。
|
||||
*/
|
||||
function kindProps(block: BlockView | undefined): { 'data-kind'?: string, 'data-badge'?: '', 'style'?: CSSProperties } {
|
||||
export function kindProps(block: Pick<BlockView, 'kind' | 'badge'> | undefined): { 'data-kind'?: string, 'data-badge'?: '', 'style'?: CSSProperties } {
|
||||
if (!block)
|
||||
return {}
|
||||
if (!block.badge)
|
||||
@@ -235,10 +235,10 @@ function BlockPreview({ block, tree, marks }: { block: BlockView, tree: BlockTre
|
||||
)
|
||||
}
|
||||
|
||||
/** 这块的「重写注释」按钮,排在右上角那排按钮里:能写注释(commentTarget)、页面上能改代码时才有。 */
|
||||
/** 这块的调用树按钮:扩展端标了能看调用树(BlockView.callTree)的块才有。 */
|
||||
function callTreeTool(block: BlockView, tree: BlockTreeState) {
|
||||
const callTree = tree.callTree
|
||||
if (!callTree || (block.kind !== 'function' && block.kind !== 'class'))
|
||||
if (!callTree || !block.callTree)
|
||||
return undefined
|
||||
return {
|
||||
anchor: block.anchor,
|
||||
|
||||
Reference in new issue
Block a user