Skip to content

1.0 | Project structure

zalan-racz-gaijin edited this page Jun 13, 2024 · 1 revision

Tree view of the project structure

πŸ“‚Dagor-Shader-Language-Server
β”œβ”€β”€ πŸ“‚.github
β”‚   β”œβ”€β”€ πŸ“‚workflows
β”‚   β”‚   β”œβ”€β”€ πŸ“„build.yml
β”œβ”€β”€ πŸ—€.husky
β”œβ”€β”€ πŸ“‚.vscode
β”‚   β”œβ”€β”€ πŸ“„extensions.json
β”‚   β”œβ”€β”€ πŸ“„settings.json
β”œβ”€β”€ πŸ—€bin
β”œβ”€β”€ πŸ“‚grammar
β”‚   β”œβ”€β”€ πŸ“‚antlr
β”‚   β”‚   β”œβ”€β”€ πŸ—€.antlr
β”‚   β”‚   β”œβ”€β”€ πŸ“„ConditionLexer.g4
β”‚   β”‚   β”œβ”€β”€ πŸ“„ConditionParser.g4
β”‚   β”‚   β”œβ”€β”€ πŸ“„DshlLexer.g4
β”‚   β”‚   β”œβ”€β”€ πŸ“„DshlParser.g4
β”‚   β”œβ”€β”€ πŸ“„dshl.tmLanguage.json
β”‚   β”œβ”€β”€ πŸ“„dshl.tmLanguage.json
β”‚   β”œβ”€β”€ πŸ“„language-configuration.json
β”œβ”€β”€ πŸ—€node_modules
β”œβ”€β”€ πŸ—€out
β”œβ”€β”€ πŸ“‚src
β”‚   β”œβ”€β”€ πŸ—€_generated
β”œβ”€β”€ πŸ“„.editorconfig
β”œβ”€β”€ πŸ“„.eslintignore
β”œβ”€β”€ πŸ“„.eslintrc.js
β”œβ”€β”€ πŸ“„.gitattributes
β”œβ”€β”€ πŸ“„.gitignore
β”œβ”€β”€ πŸ“„.prettierignore
β”œβ”€β”€ πŸ“„.prettierrc.json
β”œβ”€β”€ πŸ“„LICENSE
β”œβ”€β”€ πŸ“„package-lock.json
β”œβ”€β”€ πŸ“„package.json
β”œβ”€β”€ πŸ“„README.md
β”œβ”€β”€ πŸ“„tsconfig.json
└── πŸ“„webpack.config.js

Legend

  • πŸ“‚Regular folder
  • πŸ—€A folder that contains generated files, build artifacts, or downloadable packages
  • πŸ“„File

Files and folders

This section describes the more important files and folders in the project.

The .github/workflows folder contains the configurations of the GitHub Actions CI pipeline. The build.yml file configures the CI pipeline, which runs on Pull Requests, and checks the code with static analysis tools.

The .husky folder contains configurations about the pre-commit hook, and you never have to touch these files.

The .vscode folder contains VS Code-specific configurations. The extensions.json contains the recommended extensions to this project, VS Code will offer you to install them when you open the workspace. The settings.json contains workspace-specific settings, for example, to make Prettier the default formatter.

The out folder will contain both the desktop and the web language servers' final JavaScript code and the mappings to the original TypeScript source code, after you build the language server.

The grammar folder contains the TextMate grammars for syntax highlight: dshl.tmLanguage.json for the DSHL coloring, while hlsl.tmLanguage.json, for the HLSL coloring. The language-configuration.json file defines declarative language features, for example, it tells the IDE, how to comment out a line. The antlr folder inside grammar contains the ANTLR lexer and parser grammars: ConditionLexer.g4, and ConditionParser.g4, DshlLexer.g4, DshlParser.g4, and the files needed for the code generation in the .antlr folder.

The bin folder will contain operating system-specific executables of the language server, after you build it in production mode.

The node_modules folder will contain the project's dependencies, defined in the package.json file.

The src folder contains the language server's source code, mostly the programmatic language features, and the _generated folder contains the code, generated by ANTLR.

The .editorconfig, .prettierignore, and the .prettierrc.json files configure formatting. The .eslintrc.js, and the .eslintignore files configure the static analysis tools. The .gitignore, and the .gitattributes files configure git, describing what files to include in commits and how to handle newline characters.

The README.md file contains the description of the language server, and the LICENSE file contains the language server's license.

The tsconfig.json configures the TypeScript Compiler, and the webpack.config.js file configures Webpack how to build the source code.

The package.json file is the heart of the language server, and it contains many things. It defines the project's dependencies, scripts, and metadata, for example, the language server's name, description, publisher, and a lot more. The package-lock.json is a generated file, and you shouldn't modify it. It ensures consistent builds.

Useful resources