Skip to content

Commit 643fa11

Browse files
testforstephenfbricon
authored andcommitted
Update contribution about using VS Code to run eclipse.jdt.ls application
Signed-off-by: Jinbo Wang <jinbwan@microsoft.com>
1 parent abff678 commit 643fa11

File tree

3 files changed

+25
-32
lines changed

3 files changed

+25
-32
lines changed

CONTRIBUTING.md

Lines changed: 25 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -87,9 +87,17 @@ This will build and place the binaries under the `server` folder. Alternately yo
8787
$ cd ../vscode-java
8888
$ ./node_modules/.bin/gulp download_server
8989
```
90-
### Setting up the JDT Language Server in Eclipse
90+
### Setting up the JDT Language Server
91+
Below are the details about how to set up the JDT Language Server in different IDEs. **Notice**: You only need set up it once in any of your preferred IDE.
9192

92-
4. In Eclipse, import a maven project:
93+
### B-1) Setting up the JDT Language Server in VS Code
94+
1) Please install [Eclipse PDE support](https://marketplace.visualstudio.com/items?itemName=yaozheng.vscode-pde) extension in your VS Code first. The PDE extension's home page provides more usage details about _Reload Target Platform_, _Run JUnit Plug-in Test_, _Run Eclipse Application_.
95+
96+
2) Open VS Code on the `eclipse.jdt.ls` folder. The PDE extension will work with Java extension together to automatically load the eclipse.jdt.ls project. Check the status of the language tools on the lower right corner. It should show ready (thumbs up) as the image below.
97+
![status indicator](images/statusMarker.png)
98+
99+
### B-2) Setting up the JDT Language Server in Eclipse
100+
1) In Eclipse, import a maven project:
93101

94102
![Import Project](images/changelog/importProject.png)
95103

@@ -100,7 +108,7 @@ following prompts:
100108

101109
![Import Project](images/changelog/importedMavenProject.png)
102110

103-
5) Now we need to use Tycho to download the dependencies,
111+
2) Now we need to use Tycho to download the dependencies,
104112
this will get rid of the errors.
105113

106114
At the top right arrow it will say `Set Target Platform`, select that and continue.
@@ -111,7 +119,7 @@ this will get rid of the errors.
111119

112120
![Import Project](images/changelog/reloadTargetPlatform.png)
113121

114-
6) Wait till the bottom right is done loading:
122+
3) Wait till the bottom right is done loading:
115123

116124
![Import Project](images/changelog/loadingTargetPlatform.png)
117125

@@ -126,51 +134,36 @@ this will get rid of the errors.
126134

127135
## **C)** Run with a remote JDT language server
128136

129-
While developing the language server and the extension, you don't need to deploy the server every time to try out changes. Instead you can run the language server out of its Eclipse workspace:
130-
137+
While developing the language server and the extension, you don't need to deploy the server every time to try out changes. Instead you can run the language server out of its Eclipse workspace. Currently we provide two kinds of connection modes between the extension and the language server.
138+
## **C-1)** The extension opens the connection first, and waits the language server to connect to it.
131139
### a) _Launch Extension - Client Side_
132140

133141
1. Open VSCode on the `vscode-java` folder
134142

135-
2. In the debug viewlet, run the launch _Launch Extension - Remote Server_
143+
2. In the debug viewlet, run the launch _Launch Extension - Remote Server_
136144
![Remote Server](images/changelog/RemoteServer.png)
137145

138146
3. The extension will open a socket on port 3333 and will wait for the JDT language server to connect
139147

148+
### b) _Launch Debug Server - Server Side_
140149

150+
- With the client side **(vscode-java) running**, you can start the remote server in your preferred IDE.
151+
- Start the remote server via VS Code.
152+
![Remote Server In VS Code](images/changelog/RemoteServerInVSCode.png)
141153

142-
### b) _Setup Debug Server - Server Side_
143-
144-
[**\*Skip to C if this option exists\***](#c-launch-debug-server---server-side)
145-
146-
In Eclipse, run the JDT language server as an Eclipse application.
147-
1) Create a debug configuration of type _Eclipse Application_.
148-
![Creation Menu](images/changelog/DebugConfigurationOpen.png)
149-
150-
![New Configuration](images/changelog/CreateNewConfiguration.png)
151-
2) in the main tab of the debug configuration set the product to `org.eclipse.jdt.ls.core.product`.
152-
153-
![Choose Product](./images/changelog/ChooseProduct.png)
154-
3) in the Environment tab, define a variable `CLIENT_PORT` with value `3333`.
155-
156-
![Define Port](images/changelog/ClientPort.png)
157-
4) If your workspace contains 'org.eclipse.jdt.ui', use the Plug-Ins tab in the debug configuration to exclude the plug-in. The presence of 'org.eclipse.jdt.ui' will cause the language server to hang.
158-
159-
### c) _Launch Debug Server - Server Side_
160-
161-
- With the client side **(vscode-java) running**, you can start the remote server.
162-
163-
![Define Port](images/changelog/DebugRemoteServer.png)
154+
- Start the remote server via Eclipse.
155+
![Remote Server In Eclipse](images/changelog/DebugRemoteServer.png)
164156

165157
- In the debug console of VSCode you can see if the connection was successful.
166158
- When the server is running breakpoints can be reached and hot code replace can be used to make fixes without restarting the server.
167159
- You can modify `launch.json` to use a different port:
168160
- Modify `SERVER_PORT` to specify the port the JDT LS server should connect to.
169161

170-
### _Launch Extension - JDTLS Client_
162+
## C-2) The language server opens the connection first, and waits the extension to connect to it.
163+
- Start the language server via `jdt.ls.socket-stream` launch configuration in VS Code or Eclipse
164+
![Socket Steam in VS Code](images/changelog/SocketSteamInVSCode.png)
171165

172-
- start the `jdt.ls.socket-stream` launch configuration in Eclipse
173-
- start the _Launch Extension - JDTLS Client_ in VS Code
166+
- Start the extenion via _Launch Extension - JDTLS Client_ in VS Code
174167
- You can modify `launch.json` to use a different port:
175168
- Modify `JDTLS_CLIENT_PORT` to specify the port VS Code should connect to.
176169

30.6 KB
Loading
30.7 KB
Loading

0 commit comments

Comments
 (0)