Skip to content

Commit

Permalink
Jump to other files when clicking items in tree view
Browse files Browse the repository at this point in the history
  • Loading branch information
NoahTheDuke committed Feb 5, 2024
1 parent 04ab210 commit e1acc3e
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/tree.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,11 +113,14 @@ class ProjectTree implements TreeDataProvider<ProjectTreeNode> {
if (node.uri) {
item.resourceUri = Uri.parse(node.uri);
}
if (this.doc === item.resourceUri && node.range && this.winid) {
if (node.range && this.winid) {
item.command = {
title: "Jump to",
command: "workspace.openLocation",
arguments: [this.winid, { uri: this.doc, range: node.range }],
arguments: [
this.winid,
{ uri: item.resourceUri || this.doc, range: node.range },
],
};
}
return item;
Expand Down

0 comments on commit e1acc3e

Please sign in to comment.