✨ feat(vscode): 代码阅读的名字高亮更显眼(当前那处描框、别处画细线),⌘↓ / ⌘↑ 在各处之间跳,跳到折叠处自动展开,筛选栏写第几处

This commit is contained in:
cruldra committed 2026-09-26 23:47:43 +08:00
1 parent c5c5d2b517
commit 49f253b80f
18 files changed
+731 -53

No files matched your search

+10 -1
View File
@@ -1,6 +1,7 @@
import type { ReactElement } from 'react'
import type { BlockTreeState } from './BlockTree'
import type { DocumentMessage, Excluded, Reveal } from './types'
import type { OccurrencePage } from './useOccurrences'
import type { ViewState } from './viewState'
import { TriangleAlert } from 'lucide-react'
import { useCallback, useEffect, useMemo, useRef, useState } from 'react'
@@ -53,7 +54,15 @@ export function App(): ReactElement | null {
useScrollPosition(doc)
useReveal(doc, reveal, collapsed, filter.hidden, covered, show, expand, revealed)
useDefinitionLinks(doc?.version)
const highlight = useOccurrences(doc?.version, doc?.translatorId)
const occurrencePage = useMemo((): OccurrencePage | undefined => doc
? {
blocks: doc.blocks,
skip: id => filter.hidden.has(id) || covered.has(id) || view.editing.includes(id),
collapsed,
expand,
}
: undefined, [doc, filter, covered, view.editing, collapsed, expand])
const highlight = useOccurrences(doc?.version, doc?.translatorId, occurrencePage)
useEffect(() => {
const off = onMessage((msg) => {