Contributions are essential for keeping this extension great. We try to keep it as easy as possible to contribute changes and we are open to suggestions for making it even easier. There are only a few guidelines that we need contributors to follow.
- latest Visual Studio Code
- Node.js v4.0.0 or higher
- JDK 8+
- Maven
-
Fork and clone this repository
-
Fork and clone the LemMinX - XML Language Server
-
Note: The directory format has to match the following:
YOUR_FOLDER/ ├──── lemminx/ │ ├──── vscode-xml/
-
cd lemminx/
-
Install the maven dependencies Mac/Linux:
$ ./mvnw verify
or for Windows:
$ mvnw.cmd verify
-
cd vscode-xml/
-
Install the dependencies:
$ npm install
-
In
vscode-xml/
, build the server by running:$ npm run build-server
-
To run the extension, open the Debugging tab in VSCode.
-
Select and run 'Launch Extension (vscode-xml)' at the top left:
After completing the prerequisite steps above, and after launching the Extension Development Host for vscode-xml
, you can also debug the language server/lemminx
and can be used as follows:
-
Ensure that the most recent changes of
lemminx
have been built before launching the Extension Development Host (as per Step 7 in Steps), and that the Extension Development Host is running. -
Open
lemminx
in VSCode. This should display the "Debug (Attach) - Remote" option in the "Debugging" tab. -
To run the debugger, open the "Debugging" tab in VSCode.
-
Select and run "Debug (Attach) - Remote" at the top left:
This will make the lemminx
debugger attach to the Extension Development Host instance.
To confirm that the debugger has properly attached, the "Call Stack" dropdown in the "Debugging" tab should be populated as follows:
Now that the lemminx
debugger is properly attached, any language server interactions can be debugged and breakpoints in lemminx
will be tracked.
-
Copy the binary version of LemMinX to:
OS Location (relative to root of repository) Linux ./server/lemminx-linux
macOS ./server/lemminx-darwin-x86_64
Windows .\server\lemminx-win32.exe
Alternatively, you can set the
xml.server.binary.path
preference to specify the path of the binary to run. -
Make sure that you set
xml.server.preferBinary
totrue
, disable any LemMinX extensions by commenting outxml.extension.jars
in yoursettings.json
, and uninstall or disable any VS Code extensions that provide extra LemMinX features. -
Launch vscode-xml in development mode, and double check that the binary server is running by checking the server logging (Output > XML Support)
-
Open the GitHub page for your PR.
-
Click on "Checks":
-
Click "Artifacts", then select the binary for your operating system:
If you submit a LemMinX PR, GitHub Actions will generate a binary for your PR that you can use for testing. If you need to generate a LemMinX binary locally for whatever reason, follow these steps:
- Download and set up GraalVM and its dependencies
- either 20.x or 21.x should work
- The version for Java 11 is preferred, since it is hard to set up GraalVM Java 8 on Windows
- Make sure that the environment variable
JAVA_HOME
points to the GraalVM installation. - Run
./mvnw clean package -DskipTests -Dnative
from the root of the LemMinX repository- This will use a lot of memory (> 4 GB) and take a while
- The binary is generated in
./org.eclipse.lemminx/target
By contributing to this project you agree to the Developer Certificate of Origin (DCO). This document was created by the Linux Kernel community and is a simple statement that you, as a contributor, have the legal right to make the contribution. See the DCO file for details.