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

Implemented changes to LSP versions 3.6 and 3.7 #179

Merged
merged 1 commit into from
Apr 19, 2018
Merged

Conversation

spoenemann
Copy link
Contributor

Fixes #167, #178, and #118.

Unfortunately, this change massively breaks API. I don't know how else we could realize the change in LSP from

  • method: ‘textDocument/completion’
  • params: TextDocumentPositionParams

to

  • method: ‘textDocument/completion’
  • params: CompletionParams

In TypeScript this change is API compatible, in Java it's not :-(

@@ -26,6 +30,18 @@
*/
private String name;
Copy link
Contributor

Choose a reason for hiding this comment

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

In the spec it is not marked as optional. Is it bug there?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The LSP documentation says "The name of the workspace folder. Defaults to the uri's basename." I think it's a bug in the specification: either the property should be optional, or the second part of the property documentation should be removed.

@@ -1618,7 +1869,7 @@ class MarkupContent {
* The type of the Markup.
*/
@NonNull
String MarkupKind;
String kind;
Copy link
Contributor

Choose a reason for hiding this comment

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

It is named as kind in the spec

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That's why I corrected it here :-)

Copy link
Contributor

@akosyakov akosyakov left a comment

Choose a reason for hiding this comment

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

@spoenemann please see my comments, i was not able to spot anything else, although it is hard to check whether everything is covered

Do you think it will make sense to have a change log with breaking changes or developers will notice it anyway it? cc @svenefftinge

@jvalkeal
Copy link

Just out of curiosity if you could start over, what comes for a textDocument/completion and other objects, would you simply go with TextDocumentCompletion and then postfixing request/response classes with Request or Response? Then all changes would be internal to those classes.

@spoenemann
Copy link
Contributor Author

@akosyakov I'll prepare a change log for the release.

@jvalkeal I don't understand what you mean. Could you explain further?

@jvalkeal
Copy link

@spoenemann I just asked that if you'd have originally used custom TextDocumentCompletionRequest extending TextDocumentPositionParams then now changing it to extends CompletionParams would not have broken any api's.

@jonahgraham
Copy link
Contributor

While you are updating LS versions, it may be worth updating the Readme, it currently says:

Supported LSP Versions

  • LSP4J 0.2.x → LSP 3.x
  • LSP4J 0.1.x → LSP 2.x

@spoenemann
Copy link
Contributor Author

Up to now we have only implemented the data types from the specification, and have not added any additional types.

Even then we wouldn't get around breaking the API. The root of the problem is that the LSP is designed for TypeScript, which has a completely different type system than Java. Some kinds of API changes that are 100% compatible in TypeScript break the corresponding Java representations.

@spoenemann
Copy link
Contributor Author

spoenemann commented Apr 18, 2018

https://github.com/eclipse/lsp4j/blob/master/CHANGELOG.md

I'll document where the API has been broken now.

@spoenemann spoenemann merged commit 35254a3 into master Apr 19, 2018
@spoenemann spoenemann deleted the msp_protocol3-6 branch April 19, 2018 11:00
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.

4 participants