✨ feat(vscode): 代码阅读加 FastAPI 接口卡片:请求表(URL、方法、路径 / 查询参数、请求头、Cookie、请求体)、按状态码的响应表(成功、responses、函数里抛的异常、自动带的 422);别的文件里的异常状态码、类型别名经工作区索引和语言扩展查

This commit is contained in:
cruldra committed 2026-09-27 20:19:24 +08:00
1 parent 1dfc0c7b1e
commit 0798f7d1c7
18 files changed
+1745 -28

No files matched your search

@@ -1,5 +1,5 @@
import type { LucideIcon } from 'lucide-react'
import type { ReactElement } from 'react'
import type { CSSProperties, ReactElement } from 'react'
import type { GroupStyle, Inline, SegmentGroup } from './types'
import { useContext } from 'react'
import { DisplayNameContext, shownName } from './displayNames'
@@ -8,7 +8,7 @@ import { isCurrent, segmentOccurrence } from './occurrences'
import { HighlightContext } from './useOccurrences'
/**
* 按词性给每一段上色,颜色在 codeReader.css 的 .cr-role-* 里按主题切换;带源码下标的名字记在 data-offset 上,
* 按词性给每一段上色,颜色在 codeReader.css 的 .cr-role-* 里按主题切换,带自己颜色(color)的段用它(.cr-colored);带源码下标的名字记在 data-offset 上,
* 跳到定义、高亮各处出现用;是眼下高亮着的名字的一处出现时 data-occurrence 标出底色,是当前那一处(点中的、用键盘跳到的)时
* 再标 data-current。起了中文名的名字显示中文名(data-name),悬停看原名,定义处本身在后面淡淡写原名;下标照旧,跳到定义、高亮照常。
* 框起来的一组词画成小框,框里的词同样处理。
@@ -25,7 +25,8 @@ export function SegmentText({ segments }: { segments: Inline[] }): ReactElement
return (
<span
key={index}
className={`cr-role-${piece.role}`}
className={piece.color ? `cr-role-${piece.role} cr-colored` : `cr-role-${piece.role}`}
style={piece.color && { '--color-dark': piece.color.dark, '--color-light': piece.color.light } as CSSProperties}
data-offset={piece.offset}
data-occurrence={highlight && segmentOccurrence(piece, highlight.occurrences)}
data-current={highlight && isCurrent(piece, highlight) ? '' : undefined}