File tree Expand file tree Collapse file tree 1 file changed +10
-4
lines changed
Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Original file line number Diff line number Diff line change 88 TreeItem ,
99 TreeView ,
1010 TextEditorSelectionChangeEvent ,
11+ TextEditorSelectionChangeKind ,
1112 Location ,
1213 Range
1314} from 'vscode' ;
@@ -33,7 +34,7 @@ export interface ChildAstItem extends AstItem {
3334 parent : ChildAstItem | AstItem ;
3435}
3536
36- class AstViewerDataProvider extends DisposableObject implements TreeDataProvider < AstItem > {
37+ class AstViewerDataProvider extends DisposableObject implements TreeDataProvider < AstItem > {
3738
3839 public roots : AstItem [ ] = [ ] ;
3940 public db : DatabaseItem | undefined ;
@@ -47,9 +48,9 @@ class AstViewerDataProvider extends DisposableObject implements TreeDataProvide
4748 super ( ) ;
4849 this . push (
4950 commandRunner ( 'codeQLAstViewer.gotoCode' ,
50- async ( item : AstItem ) => {
51- await showLocation ( item . fileLocation ) ;
52- } )
51+ async ( item : AstItem ) => {
52+ await showLocation ( item . fileLocation ) ;
53+ } )
5354 ) ;
5455 }
5556
@@ -160,6 +161,11 @@ export class AstViewer extends DisposableObject {
160161 return ;
161162 }
162163
164+ // Avoid recursive tree-source code updates.
165+ if ( e . kind === TextEditorSelectionChangeKind . Command ) {
166+ return ;
167+ }
168+
163169 if (
164170 this . treeView . visible &&
165171 e . textEditor . document . uri . fsPath === this . currentFile &&
You can’t perform that action at this time.
0 commit comments