Skip to content

Commit 54911c3

Browse files
authored
fix: Cannot reveal the explorer when 'java.dependency.syncWithFolderExplorer' is off (#460)
1 parent 8dbf3b8 commit 54911c3

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

src/utility.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import { Uri, window, workspace, WorkspaceFolder } from "vscode";
55
import { setUserError } from "vscode-extension-telemetry-wrapper";
66
import { INodeData } from "./java/nodeData";
77
import { languageServerApiManager } from "./languageServerApi/languageServerApiManager";
8-
import { Settings } from "./settings";
98

109
export class Utility {
1110

@@ -31,7 +30,7 @@ export class Utility {
3130
if (uri.scheme === "file" && !workspace.getWorkspaceFolder(uri)) {
3231
return false;
3332
}
34-
if (!Settings.syncWithFolderExplorer() || !await languageServerApiManager.isStandardServerReady()) {
33+
if (!await languageServerApiManager.isStandardServerReady()) {
3534
return false;
3635
}
3736
return true;

src/views/dependencyExplorer.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import { renameFile } from "../explorerCommands/rename";
1414
import { getCmdNode } from "../explorerCommands/utility";
1515
import { Jdtls } from "../java/jdtls";
1616
import { INodeData } from "../java/nodeData";
17+
import { Settings } from "../settings";
1718
import { EventCounter, Utility } from "../utility";
1819
import { Lock } from "../utils/Lock";
1920
import { DataNode } from "./dataNode";
@@ -76,7 +77,7 @@ export class DependencyExplorer implements Disposable {
7677
await commands.executeCommand(Commands.VSCODE_OPEN, uri, { preserveFocus: true });
7778
}
7879

79-
this.reveal(uri);
80+
this.reveal(uri, false /*force to reveal even the sync setting is turned off*/);
8081
}),
8182
);
8283

@@ -128,10 +129,14 @@ export class DependencyExplorer implements Disposable {
128129
}
129130
}
130131

131-
public async reveal(uri: Uri): Promise<void> {
132+
public async reveal(uri: Uri, needCheckSyncSetting: boolean = true): Promise<void> {
132133
try {
133134
await this._lock.acquire();
134135

136+
if (needCheckSyncSetting && !Settings.syncWithFolderExplorer()) {
137+
return;
138+
}
139+
135140
if (!await Utility.isRevealable(uri)) {
136141
return;
137142
}

0 commit comments

Comments
 (0)