Code Monkey home page Code Monkey logo

Comments (7)

svenefftinge avatar svenefftinge commented on August 24, 2024

Whether this should go to the LSP was discussed here microsoft/language-server-protocol#109

Maybe we should have an additional interface for such things that clients can optionally implement. Longterm we will need to use additional interfaces for LSP extensions anyway to avoid breaking clients.

from lsp4j.

kdvolder avatar kdvolder commented on August 24, 2024

If it is possible for a client to send notification messages not strictly defined by the protocol, the current way of handling it in lsp4j... i.e. crashing the server... is not very nice.

As mentioned in the link above by @dbaeumer:

$ messages should/could be ignored since they depend on the implementation capabilities on the server. That is why I used the $ prefix.

We've implemented our own 'wrapper' to catch these errors, log them and ignore these. But perhaps lsp4j should just ignore these unknown messages by default?

from lsp4j.

svenefftinge avatar svenefftinge commented on August 24, 2024

I think they should at least be logged with warn level.

from lsp4j.

kdvolder avatar kdvolder commented on August 24, 2024

I think they should at least be logged with warn level.

Agreed. Especially if they are totally 'unknown' notification messages. However, if its a specific message, like say $/setTraceNotification, then perhaps a decision can explicitly be made that that particular type of message is not one the server should want to handle. Then, dropping it silently might be okay too.

What I mean is, unless the warning serves a purpose, like, informing someone that they need to make a decision (whether they do or do not want to handle it), a warning seems right. If however the decision has already been made, then the warning is just a nuisance.

from lsp4j.

spoenemann avatar spoenemann commented on August 24, 2024

I changed the UnsupportedOperationExceptions to log warnings.

@dbaeumer wrote:

$ messages should/could be ignored since they depend on the implementation capabilities on the server. That is why I used the $ prefix.

Should we include this behavior in LSP4J, i.e. suppress the log warnings in case the method name starts with $?

from lsp4j.

svenefftinge avatar svenefftinge commented on August 24, 2024

I would prefer to not do it.

from lsp4j.

spoenemann avatar spoenemann commented on August 24, 2024

Then we can close this issue.

In order to explicitly ignore a certain type of message, one must add a @JsonNotification annotated method with an empty implementation to the service class.

from lsp4j.

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.