createConnection overloads not visible in package
See original GitHub issueI recently tried to update my language server to 7.0.0
but my connection creation on the server-side keeps returning an error. And I cannot find any documentation on the new parameters that are apparently needed on how to properly set it up.
The code that I used:
let connection = createConnection(ProposedFeatures.all);
returns the following error:
Expected 2-3 arguments
.
So I went looking through the package and found the following:
in lib/common/server.d.ts
is the function for:
export declare function createConnection<PConsole = _, PTracer = _, PTelemetry = _, PClient = _, PWindow = _, PWorkspace = _, PLanguages = _>(connectionFactory: (logger: Logger) => ProtocolConnection, watchDog: WatchDog, factories?: Features<PConsole, PTracer, PTelemetry, PClient, PWindow, PWorkspace, PLanguages>): _Connection<PConsole, PTracer, PTelemetry, PClient, PWindow, PWorkspace, PLanguages>;
But there are 4 overloads in lib/node/main.d.ts
that I believe to be the correct overloads for the user to be using.
However, the only one I get recommended or seems to exist is the one in server.js
I’m unsure if it is something I have done wrong gets wrongly exported or is just missing documentation atm.
My project in question: https://github.com/Blockception/VSCode-Bedrock-Development-Extension/tree/Language-server-update
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:10 (5 by maintainers)
Top GitHub Comments
@DaanV2 You should also update your
vscode-languageserver
dependency to 7.x instead of using 6.x. That’s what I did with my language server.@DaanV2 I ran into this yesterday as well. I had to fix it by importing from
vscode-languageserver/node
instead ofvscode-languageserver
.