openquest-vscode/client/src/client_handler_other.ts

67 lines
1.8 KiB
TypeScript

//
/*
function connectToServer(hostname: string, path: string): Duplex {
const ws = new WebSocket(`ws://${hostname}/${path}`);
return WebSocket.createWebSocketStream(ws);
}
*/
////function makeClient() {
// // Options to control the language client
// const clientOptions: LanguageClientOptions = {
// // Register the server for plain text documents
// documentSelector: [{ scheme: 'file', language: 'plaintext' }],
// synchronize: {
// // Notify the server about file changes to '.clientrc files contained in the workspace
// fileEvents: workspace.createFileSystemWatcher('**/.clientrc')
// }
// };
//
// // The server is implemented in node
// const serverModule = context.asAbsolutePath(
// path.join('server', 'out', 'server.js')
// );
//
// // Create the language client and start it
// client = new LanguageClient(
// 'OpenQuestLSP',
// 'OpenQuest Language Server',
// serverOptionsGenerator(),
// clientOptions
// );
//
// // The client will either connect or launch the language server, depending
// // on the workspace settings
// client.start();
//}
//
//
//
///**
// * Make server options based on the workspace configuration
// */
//function serverOptionsGenerator(): ServerOptions {
// if (vscode.workspace.getConfiguration(constants.SETTINGS_NAMESPACE).get("serverAddress") !== null) {
// // If the extension is launched in debug mode then the debug server options are used
// // Otherwise the run options are used
// return {
// run: { module: serverModule, transport: TransportKind.ipc },
// debug: {
// module: serverModule,
// transport: TransportKind.ipc,
// }
// };
// } else {
// return {
// run: { module: serverModule, transport: TransportKind.ipc },
// debug: {
// module: serverModule,
// transport: TransportKind.ipc,
// }
// };
// }
//}
//*/