-
Notifications
You must be signed in to change notification settings - Fork 375
Closed
Labels
bugIssue identified by VS Code Team member as probable bugIssue identified by VS Code Team member as probable bug
Milestone
Description
Disposing the LSP client seems to trigger this error. I see it in the Dart server when we restart the server (eg. if you change something that requires changing the command line arguments), but I can also reproduce it in an integration test using the source repo/test server here.
'use strict';
import * as child_process from "child_process";
import * as path from 'path';
import * as lsclient from 'vscode-languageclient/node';
suite('Client integration', () => {
const serverModule = path.join(__dirname, './servers/testServer.js');
const documentSelector: lsclient.DocumentSelector = [{ scheme: 'lsptests', language: 'bat' }];
const middleware = {};
const clientOptions: lsclient.LanguageClientOptions = {
documentSelector,
synchronize: {},
initializationOptions: {},
middleware
};
test.only('Can dispose and re-create language server', async () => {
while (true) {
const process = child_process.spawn(`node`, [serverModule, '--stdio']);
process.stderr.on("data", (data) => console.error(data.toString()));
process.on("exit", () => console.log(`LSP Server quit!`));
console.log(`Creating server`);
const client = new lsclient.LanguageClient(
'test svr',
'Test Language Server',
() => Promise.resolve({ reader: process.stdout, writer: process.stdin }),
clientOptions,
);
console.log(`Starting server`);
const disp = client.start();
console.log(`Waiting for server to be ready`);
await client.onReady();
console.log(`Waiting a little while before disposing...`);
await new Promise((resolve) => setTimeout(resolve, 1000));
console.log(`Disposing server`);
disp.dispose();
await new Promise((resolve) => setTimeout(resolve, 1000));
console.log(`...`);
}
}).timeout(99999);
});I'm not certain, but it seems like it might be when it tries to send {"jsonrpc":"2.0","method":"exit"}.
Metadata
Metadata
Assignees
Labels
bugIssue identified by VS Code Team member as probable bugIssue identified by VS Code Team member as probable bug
