🐛 fix(vscode): 注释里不带路径的引用从被注释的声明起一层层往外找,同类的方法、类的成员都能链到
This commit is contained in:
1 parent
15972c0b35
commit
5120e50228
15 files changed
+450
-167
No files matched your search
@@ -9,6 +9,7 @@ import { createRoot } from 'react-dom/client'
|
||||
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'
|
||||
import { DefinitionPeeks, linkPeekSource } from './definitionPeek'
|
||||
import { DiffText } from './DiffText'
|
||||
import { commentLinkOf } from './repoLink'
|
||||
import { MarkdownKindContext, TextPreview } from './TextPreview'
|
||||
|
||||
let container: HTMLDivElement
|
||||
@@ -121,7 +122,7 @@ describe.each(['TextPreview', 'DiffText'] as const)('%s 的 Markdown 页面元
|
||||
controller.setDelays(300, 500)
|
||||
const point = (): void => {
|
||||
const link = anchor()
|
||||
const source = linkPeekSource(link.getAttribute('href')!)
|
||||
const source = linkPeekSource(commentLinkOf(link))
|
||||
if (!source)
|
||||
throw new Error('符号链接不能预览')
|
||||
controller.point({ anchor: link, source })
|
||||
|
||||
Reference in new issue
Block a user