Skip to content

Commit

Permalink
feat(vscode): cycle through definitions
Browse files Browse the repository at this point in the history
  • Loading branch information
mxsdev committed Oct 17, 2022
1 parent 2564263 commit 97b5218
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/typescript-explorer/src/view/typeTreeView.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,14 @@ export class TypeTreeItem extends vscode.TreeItem {
protected createTypeNode(typeInfo: LocalizedTypeInfo) {
return this.provider.createTypeNode(typeInfo, this)
}

private definitionIndex = 0

goToDefinition() {
assert(this.typeInfo.locations && this.typeInfo.locations.length > 0, "Type has no locations!")

const location = this.typeInfo.locations[0]
const location = this.typeInfo.locations[this.definitionIndex]
this.definitionIndex = (this.definitionIndex + 1) % this.typeInfo.locations.length

const range = {
start: (location.range.start),
Expand Down

0 comments on commit 97b5218

Please sign in to comment.