Giter Club home page Giter Club logo

Comments (7)

rchl avatar rchl commented on July 3, 2024

Handling server bugs would probably be the last thing we would want to do here. Why not just report it in the server repo?

The unregisterations param is required per spec so it's a spec violation.

from lsp.

deathaxe avatar deathaxe commented on July 3, 2024

I am not aware of spec details as I don't follow them anymore. Just noticed that traceback and asking for feedback. I can't judge it being malformed or not, just a hunch.

That said, changing lin 1982 to

        unregistrations = params.get("unregisterations") or []  # typo in the official specification

would cause the empty params to be ignored silently.

EDIT: I actually not sure which side initiates unregistration. Could also have been a malformed request from LSP -> LemMinX.

from lsp.

rchl avatar rchl commented on July 3, 2024

Server initiates this

<-- LemMinX client/unregisterCapability (16): {}

My feedback is that it's a spec violation on the server side. It's specified in https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#client_unregisterCapability where the unregisterations property is not optional. It can be set to empty array though although it doesn't really make sense to send it then.

And yes, my point is that we don't want to hide spec violations with changes like the suggested one.

from lsp.

deathaxe avatar deathaxe commented on July 3, 2024

Shouldn't it just return a relevant error code to the server then, instead of raising a local exception?

from lsp.

rchl avatar rchl commented on July 3, 2024

Potentially yes. But then we'd need to run all the code within a try block which could also hide real issues on our side. If I'd to pick one of those two then I'd rather prefer the current behavior. But maybe there is a third option...

from lsp.

rchl avatar rchl commented on July 3, 2024

Third option could be to verify the schema of incoming requests/notifications and raise errors in that case.

from lsp.

deathaxe avatar deathaxe commented on July 3, 2024

Yea, basing LSP on pydantic. 😆

from lsp.

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.