Giter VIP home page Giter VIP logo

Comments (8)

dbaeumer avatar dbaeumer commented on June 24, 2024

Since the request is async you can answer the request when your server is ready. VS Code is not blocked in that state.

from vscode-languageserver-node.

dbaeumer avatar dbaeumer commented on June 24, 2024

If you want to be nice your server can show progress if the initialization happens during the initialize request.

from vscode-languageserver-node.

LordOfDragons avatar LordOfDragons commented on June 24, 2024

If you want to be nice your server can show progress if the initialization happens during the initialize request.

How can I do this? I can only print to the console.

from vscode-languageserver-node.

LordOfDragons avatar LordOfDragons commented on June 24, 2024

Since the request is async you can answer the request when your server is ready. VS Code is not blocked in that state.

I tried getting this to work but it is not working because "connection.onDocumentSymbol" is not an async function so I can not "wait" inside it until parsing finished. How is one supposed to solve this?

from vscode-languageserver-node.

dbaeumer avatar dbaeumer commented on June 24, 2024

The handler you pass in can be an async function. Something like

connection.onDocumentSymbols(async (params) => { ... });

The connection will then await the result of the async function.

from vscode-languageserver-node.

dbaeumer avatar dbaeumer commented on June 24, 2024

For the progress you can enable this via a client options:

progressOnInitialization?: boolean;

And then the server will receive a progress token in its initialize request like here:

connection.onInitialize((params, cancel, progress): Thenable<InitializeResult> | ResponseError<InitializeError> | InitializeResult => {

from vscode-languageserver-node.

LordOfDragons avatar LordOfDragons commented on June 24, 2024

How is this mapping to an "async/await" system?

from vscode-languageserver-node.

dbaeumer avatar dbaeumer commented on June 24, 2024

How is this mapping to an "async/await" system?

For the handlers yes.

For the work done progress no. The partial result progress maps to async/await hover it is not supported in VS Code.

from vscode-languageserver-node.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.