-
Notifications
You must be signed in to change notification settings - Fork 0
2.1 | How to build and run (Linux)
-
Open the Terminal
-
Install VS Code
snap install --classic code
-
Install npm
sudo apt install npm
-
Install git
sudo apt install git
-
Install the OpenJDK
sudo apt-get install msopenjdk-21
-
Clone the repository
git clone https://github.com/GaijinEntertainment/Dagor-Shader-Language-Support-for-Visual-Studio-Code.git --recursive
Don't forget to use the
--recursive
flag otherwise git won't download the language server. -
Go inside the repository's root folder
cd Dagor-Shader-Language-Support-for-Visual-Studio-Code
-
Install dependencies
npm install
-
Go inside the language server's folder
cd Dagor-Shader-Language-Server
-
Install the language server's dependencies
npm install
-
Generate code with ANTLR
npm run generate-dshl-antlr
and
npm run generate-condition-antlr
You have to generate code again, every time you change ANTLR grammars in the Dagor-Shader-Language-Server/grammar/antlr folder.
-
Go back to the client's folder
cd ..
-
Open the client's folder in VS Code
code .
When VS Code opens, it'll suggest you to install the recommended extensions. They're all useful, but TypeScript + Webpack Problem Matchers is required, without it, you won't be able to run the extension.
-
Run the extension, by pressing
F5
or choose between the different options in the Run and Debug tab:
- Run Desktop Extension: Builds the desktop extension and runs a new instance of VS Code where the extension is installed. You can use a breakpoint in the client as usual, but if you want to put it into the server, run the extension, using Debug Desktop Extension.
- Run Web Extension: Builds the web extension and runs a new instance of VS Code where the extension is installed. It basically simulates how the extension would run in the browser. If you want to try it in a real browser, use open-in-browser script instead.
- Attach to Server: After running the Run Desktop Extension, this makes debugging possible. For a shorthand, you can use Debug Desktop Extension which starts both of them.
- Run E2E Tests: Starts a new VS Code instance and runs the E2E tests. It doesn't build the extension, so you have to run the build or watch scripts before (or just start the extension with Run Desktop Extension or Run Web Extension).
- Debug DSHL ANTLR grammar: It'll create a parse tree based on the grammar and the input provided in launch.json.
- Debug Desktop Extension: Runs both Run Desktop Extension and Attach to Server and makes debugging possible.
- Debug Web Extension: Runs both Run Web Extension and Attach to Server and it should make debugging possible. However it doesn't work at the moment, use the desktop version for debugging.