Ability to Utilize JDT LS for one-off refactorings via API #2523
Unanswered
AlexShypula
asked this question in
Q&A
Replies: 2 comments 2 replies
-
@AlexShypula You may want to take a look at https://github.com/eclipse/eclipse.jdt.ls/blob/master/org.eclipse.jdt.ls.tests/src/org/eclipse/jdt/ls/core/internal/refactoring/ExtractMethodTest.java |
Beta Was this translation helpful? Give feedback.
2 replies
-
@AlexShypula You have to create/import an Eclipse project and java source file. After that you can send and receive json data. ExtractMethodTest is an example. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi,
I'm working on a research project where I'd like to programmatically leverage the JDT LS extract method functionality.
As I understand, the language server protocol is a universal protocol between editors and language servers. I was interested in leveraging the fact, and I was curious if there is some way to hack together a way to start up the java language server, and send one-off requests (such as extract a method from this .java file starting at location=XXX and ending at location=XXX). These requests/files/edits would be done entirely programmatically and would have nothing to do with me manually opening VSCode.
From what I've found out, the JDT LS requires that this VSCode Java server is first started, that way JDT LS can actually start running. If I start the VSCode server so that JDT LS can then begin, is there any way I could try to exploit any of the functionality in the JDT Language Server in the way I'm hoping to?
Beta Was this translation helpful? Give feedback.
All reactions