✨ feat(vscode): FastAPI 接口卡片的调用树带上前端调用它的地方

This commit is contained in:
cruldra committed 2026-10-12 12:22:51 +11:00
1 parent d4459e93b3
commit 29cedcb751
30 files changed
+1316 -130

No files matched your search

+14
View File
@@ -51,6 +51,20 @@ function translationText(view: BlockView): string {
}
describe('blockView', () => {
it('有名字的函数、类(含嵌在里面的方法)标上能看调用树,别的块不标', async () => {
const source = 'import os\n\nLIMIT = 1\n\n\nclass Order:\n def pay(self):\n print(os.name)\n\n\ndef main():\n Order().pay()\n'
const found = flatten(await views(py, 'python', pythonZhTranslator, source)).map(view => [view.kind, view.callTree])
expect(found).toEqual([
['import', undefined],
['const', undefined],
['class', {}],
['function', {}],
['statement', undefined],
['function', {}],
['statement', undefined],
])
})
it.each(SAMPLES)('%#: codeTokens 拼起来等于 code,code 是编辑范围整行去共同缩进', async (adapter, languageId, translator, fixture) => {
const source = readFixture(fixture)
const lines = source.split('\n')