Skip to content

2.1 | How to build and run (Linux)

zalan-racz-gaijin edited this page Jun 14, 2024 · 4 revisions
  1. Open the Terminal

  2. Install VS Code

    snap install --classic code
  3. Install npm

    sudo apt install npm
  4. Install git

    sudo apt install git
  5. Install the OpenJDK

    sudo apt-get install msopenjdk-21
  6. 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.

  7. Go inside the repository's root folder

    cd Dagor-Shader-Language-Support-for-Visual-Studio-Code
  8. Install dependencies

    npm install
  9. Go inside the language server's folder

    cd Dagor-Shader-Language-Server
  10. Install the language server's dependencies

    npm install
  11. 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.

  12. Go back to the client's folder

    cd ..
  13. 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.

  14. 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.
Clone this wiki locally