Skip to content

Latest commit

 

History

History
100 lines (73 loc) · 2.87 KB

File metadata and controls

100 lines (73 loc) · 2.87 KB

Developing Extension for VS Code

Prerequisities

  • JDK, version 11 or later upto JDK 22
  • Ant, latest version
  • Maven, latest version
  • Node.js, latest LTS (to build VSIX)

Fetching and building the code

$ git clone https://github.com/oracle/javavscode.git
$ cd javavscode/
$ git clone https://github.com/apache/netbeans.git
$ cd netbeans/
$ git checkout 22
$ cd ..
# the following target requires git executable to be on PATH:
$ ant apply-patches
$ ant build-netbeans

Building VS Code extension

To build the VS Code extension invoke:

ant build-vscode-ext

The resulting extension is then in the build directory, with the .vsix extension. The typical file name is oracle-java-0.1.0.vsix.

Building for Development

If you want to develop the extension, use these steps for building instead:

ant build-lsp-server

This target is faster than building the .vsix file. Find the instructions for running and debugging below.

Cleaning

Often it is also important to properly clean everything. Use:

ant clean-vscode-ext
cd netbeans/
netbeans$ ant clean

Testing

The java.lsp.server module has classical (as other NetBeans modules) tests. The most important one is ServerTest which simulates LSP communication and checks expected replies. In addition to that there are VS Code integration tests - those launch VS Code with the VS extension and check behavior of the TypeScript integration code:

$ ant build-vscode-ext # first and then
$ ant test-vscode-ext

In case you are behind a proxy, you may want to run the tests with

$ npm_config_https_proxy=http://your.proxy.com:port ant test-vscode-ext

when executing the tests for the first time. That shall overcome the proxy and download an instance of code to execute the tests with.