Search code examples
node.jsvisual-studio-codelanguage-server-protocol

How to send custom command from client to server (LSP implementation)


My implementation is based on 'vscode-languageserver' and I would like to know how to send custom requests to vscode server implementation.


Solution

  • server

    const connection: LSP.IConnection = LSP.createConnection(LSP.ProposedFeatures.all);
    connection.onNotification("handler/do", (handler)=>{});
    

    client

    let client:LanguageClient = <initialize>
    client.sendNotification("handler/do");