✨ feat(vscode): 代码阅读侧栏跟着当前文件走,目录链接在侧栏树上定位
This commit is contained in:
1 parent
ff713db6e7
commit
c841ae678a
10 files changed
+464
-7
No files matched your search
@@ -79,6 +79,8 @@ export class PreviewEditorProvider implements CustomTextEditorProvider {
|
||||
readonly diffBases: DiffBases,
|
||||
/** 哪些文件是项目写明的入口、预览里哪些名字的块标成入口 */
|
||||
readonly entries: Pick<WorkspaceEntries, 'namesOf' | 'onDidChange'>,
|
||||
/** 在代码阅读侧栏的树上定位一个目录(仓库链接指到目录时);树上没有它时返回 false */
|
||||
readonly revealInTree: (uri: Uri) => Promise<boolean>,
|
||||
) {}
|
||||
|
||||
/** 侧栏「问 AI」打开预览,并把光标放进顶部输入框。已经开着的就揭到前面再聚焦。 */
|
||||
@@ -704,7 +706,7 @@ class Preview {
|
||||
}
|
||||
|
||||
/**
|
||||
* 打开注释里的仓库链接:目录在资源管理器里定位,文件用编辑器打开。
|
||||
* 打开注释里的仓库链接:目录在代码阅读侧栏的树上定位,文件用编辑器打开。
|
||||
* 带了符号就按文档符号的名字跳过去;文件或符号没有就不打开。
|
||||
*/
|
||||
private async openRepoLink(rel: string, symbol?: string): Promise<void> {
|
||||
@@ -721,7 +723,8 @@ class Preview {
|
||||
this.markRepoLinkBroken(rel, symbol)
|
||||
return
|
||||
}
|
||||
await commands.executeCommand('revealInExplorer', uri)
|
||||
if (!await this.owner.revealInTree(uri))
|
||||
void window.showInformationMessage(`代码阅读:侧栏的树上没有 ${rel}`)
|
||||
this.markRepoLinkOpened(rel)
|
||||
return
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user