Skip to content

Commit 95ae15d

Browse files
authored
Rename 'waitForServerReady()' to 'serverReady()' (#2469)
Signed-off-by: sheche <sheche@microsoft.com>
1 parent 39cacc1 commit 95ae15d

File tree

4 files changed

+8
-7
lines changed

4 files changed

+8
-7
lines changed

src/apiManager.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ class ApiManager {
4141
const serverReadyPromise: Promise<boolean> = new Promise<boolean>((resolve) => {
4242
this.serverReadyPromiseResolve = resolve;
4343
});
44-
const waitForServerReady = async () => {
44+
const serverReady = async () => {
4545
return serverReadyPromise;
4646
};
4747

@@ -59,7 +59,7 @@ class ApiManager {
5959
serverMode,
6060
onDidServerModeChange,
6161
onDidProjectsImport,
62-
waitForServerReady,
62+
serverReady,
6363
};
6464
}
6565

@@ -91,7 +91,7 @@ class ApiManager {
9191
this.api.status = status;
9292
}
9393

94-
public standardServerReady(): void {
94+
public resolveServerReadyPromise(): void {
9595
this.serverReadyPromiseResolve(true);
9696
}
9797
}

src/extension.api.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,8 +113,9 @@ export interface ExtensionAPI {
113113

114114
/**
115115
* A promise that will be resolved when the standard language server is ready.
116+
* Note: The server here denotes for the standard server, not the lightweight.
116117
* @since API version 0.7
117118
* @since extension version 1.7.0
118119
*/
119-
readonly waitForServerReady: () => Promise<boolean>;
120+
readonly serverReady: () => Promise<boolean>;
120121
}

src/standardLanguageClient.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ export class StandardLanguageClient {
109109
case 'ServiceReady':
110110
apiManager.updateServerMode(ServerMode.STANDARD);
111111
apiManager.fireDidServerModeChange(ServerMode.STANDARD);
112-
apiManager.standardServerReady();
112+
apiManager.resolveServerReadyPromise();
113113
activationProgressNotification.hide();
114114
if (!hasImported) {
115115
showImportFinishNotification(context);

test/standard-mode-suite/publicApi.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -163,9 +163,9 @@ suite('Public APIs - Standard', () => {
163163
});
164164
});
165165

166-
test('waitForServerReady() should work', async function () {
166+
test('serverReady() should work', async function () {
167167
const api: ExtensionAPI = extensions.getExtension('redhat.java').exports;
168-
await api.waitForServerReady();
168+
await api.serverReady();
169169
});
170170

171171
suiteTeardown(async function() {

0 commit comments

Comments
 (0)