File tree Expand file tree Collapse file tree 3 files changed +10
-1
lines changed
Expand file tree Collapse file tree 3 files changed +10
-1
lines changed Original file line number Diff line number Diff line change 11import type { Tab } from 'vscode' ;
22import { Uri , window } from 'vscode' ;
33import { areUrisEqual } from '../../uri' ;
4+ import { isTrackableUri } from './uris' ;
45
56export function getTabUri ( tab : Tab | undefined ) : Uri | undefined {
67 const input = tab ?. input ;
@@ -44,6 +45,11 @@ export function getVisibleTabs(uri: Uri): Tab[] {
4445 . sort ( ( a , b ) => ( a . group . isActive ? - 1 : 1 ) - ( b . group . isActive ? - 1 : 1 ) ) ;
4546}
4647
48+ export function isTrackableTab ( tab : Tab | undefined ) : boolean {
49+ const uri = getTabUri ( tab ) ;
50+ return uri != null ? isTrackableUri ( uri ) : false ;
51+ }
52+
4753export function tabContainsUri ( tab : Tab | undefined , uri : Uri | undefined ) : boolean {
4854 if ( uri == null ) return false ;
4955
Original file line number Diff line number Diff line change @@ -20,9 +20,11 @@ export async function openUrl(url?: string): Promise<boolean | undefined> {
2020 // vscode.d.ts currently says it only supports a Uri, but it actually accepts a string too
2121 return ( env . openExternal as unknown as ( target : string ) => Thenable < boolean > ) ( url ) ;
2222}
23+
2324export function isTrackableUri ( uri : Uri ) : boolean {
2425 return trackableSchemes . has ( uri . scheme as Schemes ) ;
2526}
27+
2628export function isVirtualUri ( uri : Uri ) : boolean {
2729 return uri . scheme === Schemes . Virtual || uri . scheme === Schemes . GitHub ;
2830}
Original file line number Diff line number Diff line change @@ -139,10 +139,10 @@ export class LineHistoryTrackerNode extends SubscribeableViewNode<
139139 setLogScopeExit ( scope , `, uri=${ Logger . toLoggable ( this . _uri ) } ` ) ;
140140 return { cancel : ! updated } ;
141141 }
142+
142143 @debug ( )
143144 protected async subscribe ( ) : Promise < Disposable | undefined > {
144145 await this . updateUri ( ) ;
145-
146146 if ( this . view . container . lineTracker . subscribed ( this ) ) return undefined ;
147147
148148 const onActiveLinesChanged = debounce ( this . onActiveLinesChanged . bind ( this ) , 250 ) ;
@@ -172,6 +172,7 @@ export class LineHistoryTrackerNode extends SubscribeableViewNode<
172172 private onActiveLinesChanged ( _e : LinesChangeEvent ) {
173173 void this . triggerChange ( ) ;
174174 }
175+
175176 @gate ( )
176177 @log ( )
177178 async changeBase ( ) : Promise < void > {
You can’t perform that action at this time.
0 commit comments