Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LSP: Discard publishDiagnostic from uninitialized servers #7467

Merged
merged 1 commit into from
Jun 28, 2023

Commits on Jun 27, 2023

  1. LSP: Discard publishDiagnostic from uninitialized servers

    The spec explicitly disallows publishDiagnostic to be sent before
    the initialize response:
    
    > ... the server is not allowed to send any requests or notifications to
    > the client until it has responded with an InitializeResult ...
    
    (https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#initialize)
    
    But if a non-compliant server sends this we currently panic because we
    '.expect()' the server capabilities to be known to fetch the position
    encoding. Instead of panicking we can discard the notification and log
    the non-compliant behavior.
    the-mikedavis committed Jun 27, 2023
    Configuration menu
    Copy the full SHA
    8626c34 View commit details
    Browse the repository at this point in the history