Skip to content

Commit c3f18c3

Browse files
authored
Only show the import notification for the first time (#2065)
Signed-off-by: Sheng Chen <[email protected]>
1 parent 4190edd commit c3f18c3

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

src/extension.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -390,7 +390,7 @@ async function startStandardServer(context: ExtensionContext, requirements: requ
390390
apiManager.getApiInstance().serverMode = ServerMode.HYBRID;
391391
apiManager.fireDidServerModeChange(ServerMode.HYBRID);
392392
}
393-
standardClient.initialize(context, requirements, clientOptions, workspacePath, jdtEventEmitter, resolve);
393+
await standardClient.initialize(context, requirements, clientOptions, workspacePath, jdtEventEmitter, resolve);
394394
standardClient.start();
395395
serverStatusBarProvider.showStandardStatus();
396396
}

src/standardLanguageClient.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import { onExtensionChange, collectBuildFilePattern } from "./plugin";
1313
import { activationProgressNotification, serverTaskPresenter } from "./serverTaskPresenter";
1414
import { RequirementsData } from "./requirements";
1515
import * as net from 'net';
16+
import * as fse from 'fs-extra';
1617
import * as path from 'path';
1718
import { getJavaConfiguration } from "./utils";
1819
import { logger } from "./log";
@@ -40,11 +41,13 @@ export class StandardLanguageClient {
4041
private languageClient: LanguageClient;
4142
private status: ClientStatus = ClientStatus.Uninitialized;
4243

43-
public initialize(context: ExtensionContext, requirements: RequirementsData, clientOptions: LanguageClientOptions, workspacePath: string, jdtEventEmitter: EventEmitter<Uri>, resolve: (value: ExtensionAPI) => void): void {
44+
public async initialize(context: ExtensionContext, requirements: RequirementsData, clientOptions: LanguageClientOptions, workspacePath: string, jdtEventEmitter: EventEmitter<Uri>, resolve: (value: ExtensionAPI) => void): Promise<void> {
4445
if (this.status !== ClientStatus.Uninitialized) {
4546
return;
4647
}
4748

49+
const hasImported: boolean = await fse.pathExists(path.join(workspacePath, ".metadata", ".plugins"));
50+
4851
if (workspace.getConfiguration().get("java.showBuildStatusOnStart.enabled") === "terminal") {
4952
commands.executeCommand(Commands.SHOW_SERVER_TASK_STATUS);
5053
}
@@ -97,7 +100,9 @@ export class StandardLanguageClient {
97100
apiManager.updateServerMode(ServerMode.STANDARD);
98101
apiManager.fireDidServerModeChange(ServerMode.STANDARD);
99102
activationProgressNotification.hide();
100-
showImportFinishNotification(context);
103+
if (!hasImported) {
104+
showImportFinishNotification(context);
105+
}
101106
break;
102107
case 'Started':
103108
this.status = ClientStatus.Started;

0 commit comments

Comments
 (0)