@@ -13,8 +13,7 @@ import { renameFile } from "../explorerCommands/rename";
13
13
import { getCmdNode } from "../explorerCommands/utility" ;
14
14
import { Jdtls } from "../java/jdtls" ;
15
15
import { INodeData } from "../java/nodeData" ;
16
- import { languageServerApiManager } from "../languageServerApi/languageServerApiManager" ;
17
- import { Settings } from "../settings" ;
16
+ import { Utility } from "../utility" ;
18
17
import { Lock } from "../utils/Lock" ;
19
18
import { DataNode } from "./dataNode" ;
20
19
import { DependencyDataProvider } from "./dependencyDataProvider" ;
@@ -38,34 +37,30 @@ export class DependencyExplorer implements Disposable {
38
37
39
38
private _dataProvider : DependencyDataProvider ;
40
39
41
- private readonly SUPPORTED_URI_SCHEMES : string [ ] = [ "file" , "jdt" ] ;
42
-
43
40
constructor ( public readonly context : ExtensionContext ) {
44
41
this . _dataProvider = new DependencyDataProvider ( context ) ;
45
42
this . _dependencyViewer = window . createTreeView ( "javaProjectExplorer" , { treeDataProvider : this . _dataProvider , showCollapseAll : true } ) ;
46
43
47
44
context . subscriptions . push (
48
- window . onDidChangeActiveTextEditor ( ( textEditor : TextEditor ) => {
49
- if ( this . _dependencyViewer . visible && textEditor && textEditor . document && Settings . syncWithFolderExplorer ( ) ) {
45
+ window . onDidChangeActiveTextEditor ( ( textEditor : TextEditor | undefined ) => {
46
+ if ( this . _dependencyViewer . visible && textEditor ? .document ) {
50
47
const uri : Uri = textEditor . document . uri ;
51
- if ( this . SUPPORTED_URI_SCHEMES . includes ( uri . scheme ) ) {
52
- this . reveal ( uri ) ;
53
- }
48
+ this . reveal ( uri ) ;
54
49
}
55
50
} ) ,
56
51
) ;
57
52
58
53
context . subscriptions . push (
59
54
this . _dependencyViewer . onDidChangeVisibility ( ( e : TreeViewVisibilityChangeEvent ) => {
60
- if ( e . visible && window . activeTextEditor && Settings . syncWithFolderExplorer ( ) ) {
55
+ if ( e . visible && window . activeTextEditor ) {
61
56
this . reveal ( window . activeTextEditor . document . uri ) ;
62
57
}
63
58
} ) ,
64
59
) ;
65
60
66
61
context . subscriptions . push (
67
62
this . _dataProvider . onDidChangeTreeData ( ( ) => {
68
- if ( window . activeTextEditor && Settings . syncWithFolderExplorer ( ) ) {
63
+ if ( window . activeTextEditor ) {
69
64
this . reveal ( window . activeTextEditor . document . uri ) ;
70
65
}
71
66
} ) ,
@@ -140,7 +135,7 @@ export class DependencyExplorer implements Disposable {
140
135
try {
141
136
await this . _lock . acquire ( ) ;
142
137
143
- if ( ! await languageServerApiManager . isStandardServerReady ( ) ) {
138
+ if ( ! await Utility . isRevealable ( uri ) ) {
144
139
return ;
145
140
}
146
141
0 commit comments