Skip to content

Commit 4b083ce

Browse files
committed
chore: cleanup
1 parent 698ac16 commit 4b083ce

2 files changed

Lines changed: 4 additions & 7 deletions

File tree

packages/salesforcedx-vscode-apex/src/languageUtils/languageClientManager.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -322,8 +322,7 @@ export class LanguageClientManager {
322322
activationTime: startTime
323323
});
324324
await this.indexerDoneHandler(retrieveEnableSyncInitJobs(), languageClient, languageServerStatusBarItem);
325-
// Do NOT push client to subscriptions - cleanup is handled only in deactivate() with timeout + force-kill.
326-
// Pushing to subscriptions causes client.dispose() to run on shutdown, which can block if LS doesn't exit.
325+
extensionContext.subscriptions.push(this.getClientInstance()!);
327326
} else {
328327
const errorMessage = nls.localize('unknown');
329328
this.setStatus(ClientStatus.Error, `${nls.localize('apex_language_server_failed_activate')} - ${errorMessage}`);

packages/salesforcedx-vscode-apex/test/jest/index.test.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -251,11 +251,9 @@ describe('index tests', () => {
251251
stopSpy = jest.fn();
252252
telemetryServiceMock = new MockTelemetryService();
253253
(getTelemetryService as jest.Mock).mockReturnValue(telemetryServiceMock);
254-
jest.spyOn(languageClientManager, 'getClientInstance').mockReturnValue({
255-
stop: stopSpy,
256-
dispose: jest.fn(),
257-
outputChannel: { dispose: jest.fn() }
258-
} as unknown as ApexLanguageClient);
254+
jest
255+
.spyOn(languageClientManager, 'getClientInstance')
256+
.mockReturnValue({ stop: stopSpy } as unknown as ApexLanguageClient);
259257
});
260258

261259
it('should call stop on the language client', async () => {

0 commit comments

Comments
 (0)