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 version 3.0 #61

Merged
merged 4 commits into from
Feb 1, 2017
Merged

LSP version 3.0 #61

merged 4 commits into from
Feb 1, 2017

Conversation

akosyakov
Copy link
Contributor

No description provided.

@akosyakov
Copy link
Contributor Author

akosyakov commented Feb 1, 2017

Breaking changes:

  • [jsonrpc] error code is not enum anymore but integer to support user defined error codes
  • [lsp] a type of ServerCapabilities.textDocumentSync is Either now instead of Integer, but JsonRpcData active annotation infers setters for left and right type arguments of Either type, so at least it should not break on the server side
  • [lsp] a return type of window/showMessageRequest request is changed to MessageActionItem

@akosyakov
Copy link
Contributor Author

akosyakov commented Feb 1, 2017

There is one vague point for me: microsoft/language-server-protocol#165.

I will stick to the latest changes in the node implementation and protocol.md: microsoft/vscode-languageserver-node@c97f94a

@akosyakov
Copy link
Contributor Author

akosyakov commented Feb 1, 2017

@svenefftinge There is a new contract for initialized method: https://github.com/Microsoft/language-server-protocol/blob/master/protocol.md#initialize

if the server receives request or notification before the initialize request it should act as follows:

  • for a request the respond should be errored with code: -32002. The message can be picked by the server.
  • notifications should be dropped.

During the initialize request the server is allowed to sent the notifications window/showMessage, window/logMessage and telemetry/event as well as the window/showMessageRequest request to the client.

We can provide decorators for LanguageServer and LanguageClient which enforce the contract, but it still will be up to clients whether apply decorators or enforce the contract themself.

window/showMessageRequest request
@akosyakov
Copy link
Contributor Author

A review of correspondence to the spec is welcome.

@svenefftinge
Copy link
Contributor

The initialization contract is something the actual implementers should take care of.

return this.code;
}

public void setCode(ResponseErrorCode code) {
public void setCode(int code) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this now an int?

Copy link
Contributor Author

@akosyakov akosyakov Feb 1, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@svenefftinge The protocol says that for requests custom error codes can be defined and there is such for the initialization request in the version 3.0.

@akosyakov akosyakov merged commit 9b9f7a6 into master Feb 1, 2017
@akosyakov akosyakov deleted the ak/lsp_version_3.0 branch February 1, 2017 10:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants