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

Fixes https://github.com/emacs-lsp/lsp-java/issues/18 #22

Merged
merged 3 commits into from
Apr 25, 2018

Conversation

yyoncho
Copy link
Member

@yyoncho yyoncho commented Mar 31, 2018

  • Registered jdt uri handler and handled the cases when the user has opened a
    file downloaded from the jdt.

* Registered jdt uri handler and handled the cases when the user has opened a
  file downloaded from the jdt.
@yyoncho
Copy link
Member Author

yyoncho commented Apr 20, 2018

Depends on emacs-lsp/lsp-mode#328

@vibhavp
Copy link
Member

vibhavp commented Apr 20, 2018

Are you sure JDT'S applyEdit is a code action, and not a request? The whole idea behind code actions is to get TextEdits from the server to be applied to a document.

@yyoncho
Copy link
Member Author

yyoncho commented Apr 20, 2018

@vibhavp Yes, here it is the corresponding code in the vscode java extension: https://github.com/redhat-developer/vscode-java/blob/b47708dca469d084bc2e869dd0f85ff99a4b31b9/src/extension.ts#L178

Here it is sample response from JDT:

{"jsonrpc":"2.0","id":"9","result":[{"title":"Extract to method","command":"java.apply.workspaceEdit","arguments":[{"changes":{"file:///home/kyoncho/Documents/Sources/demo/2/src/main/java/some/test/Axx.java":[{"range":{"start":{"line":5,"character":8},"end":{"line":5,"character":8}},"newText":"extracted"},{"range":{"start":{"line":5,"character":8},"end":{"line":5,"character":8}},"newText":"();"},{"range":{"start":{"line":5,"character":8},"end":{"line":5,"character":15}},"newText":""},{"range":{"start":{"line":6,"character":5},"end":{"line":6,"character":5}},"newText":"\n\t"},{"range":{"start":{"line":6,"character":5},"end":{"line":6,"character":5}},"newText":"private"},{"range":{"start":{"line":6,"character":5},"end":{"line":6,"character":5}},"newText":" "},{"range":{"start":{"line":6,"character":5},"end":{"line":6,"character":5}},"newText":"void"},{"range":{"start":{"line":6,"character":5},"end":{"line":6,"character":5}},"newText":" "},{"range":{"start":{"line":6,"character":5},"end":{"line":6,"character":5}},"newText":"extracted"},{"range":{"start":{"line":6,"character":5},"end":{"line":6,"character":5}},"newText":"() {\n\t\t"},{"range":{"start":{"line":6,"character":5},"end":{"line":6,"character":5}},"newText":"x \u003d 10;"},{"range":{"start":{"line":6,"character":5},"end":{"line":6,"character":5}},"newText":"\n\t}"}]}}]}]}

@yyoncho
Copy link
Member Author

yyoncho commented Apr 21, 2018

Just to clarify - the response cited in the previous comment was for code actions. See also: microsoft/language-server-protocol#432

@vibhavp vibhavp merged commit 2b5970f into emacs-lsp:master Apr 25, 2018
@yyoncho yyoncho deleted the dynamic-references branch May 24, 2018 10:38
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.

None yet

2 participants