|
1 | 1 | # Contributing Guide |
2 | | -Thanks for your interest in improving vscode-vba! |
| 2 | +Thank you for your interest in contributing to vscode-vba! |
3 | 3 |
|
4 | 4 |
|
5 | 5 | ## Creating Issues |
6 | 6 | Report bugs or suggest new features. |
7 | 7 |
|
8 | | -Before opening a issue, please first search in [open issues][issues] to check it is not already reported. |
| 8 | +Before opening an issue, please check that your issue or a similar one has not already been reported in the [open issues][issues]. |
9 | 9 |
|
10 | | -In case your issue already exists, add a reaction and if possible, comment with further information. |
| 10 | +In case it already is, add a reaction and any additional information. |
11 | 11 |
|
12 | 12 |
|
13 | | -## Creating Pull Requests |
14 | | -> Before making bigger changes, please discuss them in an issue. |
| 13 | +## Pull Request Best Practices |
| 14 | +- **Discuss bigger changes:** For significant changes, please discuss them first , so no effort is wasted. |
| 15 | +- **Small and focused PRs:** Aim for one feature or bug fix per pull request. This simplifies reviews and accelerates merging |
15 | 16 |
|
16 | | -In general PRs should be kept as small as possible (e.g. one feature/fix per PR). |
17 | | -It allows merging them faster with less conflicts and will reduce review time. |
18 | 17 |
|
| 18 | +## Syntax Highlighting Grammar (Regexes and Scopes) |
| 19 | +VS Code uses TextMate Grammars and Oniguruma regexes. |
19 | 20 |
|
20 | | -### Repository Setup |
21 | | -- Install the Bait programming language: https://github.com/bait-lang/bait#building-from-source |
22 | | -- Create and clone a fork of https://github.com/serkonda7/vscode-vba |
23 | | -- Run `pnpm install` inside the cloned directory |
24 | | -- Create a new working branch for your changes |
| 21 | +Oniguruma is mostly compatible with PCRE _([Comparison][oniguruma-overview])_, |
| 22 | +so [regexr][regexr] in PCRE mode is a good choice for development. |
25 | 23 |
|
| 24 | +For a list of predefined grammar scopes see the [TextMate Manual][textmate-manual]. |
26 | 25 |
|
27 | | -## Regexes and TextMate Scopes (Syntax Highlighting) |
28 | | -TextMate uses Oniguruma regexes which are mostly compatible with PCRE ([Compariosn][oniguruma-overview]). |
29 | | -A good tool to test these regexes is https://regexr.com/ in PCRE mode. |
30 | | - |
31 | | -For a list of predefined scopes see https://macromates.com/manual/en/language_grammars#naming_conventions. |
| 26 | +To manually inspect the scopes in the editor, |
| 27 | +execute `Developer: Inspect Tokens and Scopes` from the command palette (<kbd>F1</kbd>). |
32 | 28 |
|
33 | 29 |
|
34 | 30 | ### Unit Tests |
35 | | -Every PR should contain a test case that covers the added feature or bug fix. |
| 31 | +Ensure your PR contains tests to cover the feature or bug fix. |
36 | 32 | This prevents regressions and makes reviewing the changes easier by providing a proof of correct functionality. |
37 | 33 |
|
38 | | -Tests for the language grammar (syntax highlighting) are in [`syntaxes/tests`](syntaxes/tests/). |
39 | | -They can be run with the following command: |
| 34 | +Tests for the language grammar are in [`syntaxes/tests/`](syntaxes/tests/). |
| 35 | +Run them using: |
40 | 36 | ``` |
41 | 37 | pnpm run test |
42 | 38 | ``` |
43 | 39 |
|
44 | 40 |
|
45 | | -### Install a dev version |
46 | | -If you'd like to install a development version of the extension, follow these steps: |
| 41 | +## Snippets |
| 42 | +Adding snippets is as simple as editing [`snippets/vba_snippets.yml`](snippets/vba_snippets.yml). |
| 43 | + |
| 44 | +Refer to the [official documentation][docs-snippets] for guidance. |
| 45 | + |
| 46 | + |
| 47 | +## Install a development version |
| 48 | +To install a development version of the extension, follow these steps: |
47 | 49 | 1. ```sh |
48 | 50 | pnpm run install-dev-ext |
49 | 51 | ``` |
50 | 52 | 2. Reload the VS Code window: |
51 | | - - Open command palette (<kbd>F1</kbd>) |
52 | | - - Run `>reload window` |
| 53 | + - Execute `Reload Window` from the command palette (<kbd>F1</kbd>) |
| 54 | + |
| 55 | +> Note: Uninstalling previous versions is not necessary. |
53 | 56 |
|
54 | | -> Note: It is not required to uninstall any previous versions. |
| 57 | + |
| 58 | +## Development Environment Setup |
| 59 | +Follow these steps to set up your development environment: |
| 60 | + |
| 61 | +1. Install development tools |
| 62 | + - [Node.js](https://nodejs.org/) >= 18 |
| 63 | + - The latest version should work fine |
| 64 | + - Otherwise use [NVM][nvm] for management: `nvm install 18 && nvm use 18` |
| 65 | + - [pnpm](https://pnpm.io/): `pnpm -v || npm install -g pnpm` |
| 66 | + - Bait programming language: [Installation guide][bait] |
| 67 | +2. Fork and clone the repository https://github.com/serkonda7/vscode-vba |
| 68 | +3. Install dependencies |
| 69 | + ```sh |
| 70 | + cd vscode-vba |
| 71 | + pnpm install |
| 72 | + ``` |
| 73 | +4. Create a new branch and make your changes |
55 | 74 |
|
56 | 75 |
|
57 | 76 | <!-- links --> |
58 | 77 | [issues]: https://github.com/serkonda7/vscode-vba/issues |
59 | 78 | [oniguruma-overview]: https://rbuckton.github.io/regexp-features/engines/oniguruma.html |
| 79 | +[regexr]: https://regexr.com/ |
| 80 | +[textmate-manual]: https://macromates.com/manual/en/language_grammars#naming_conventions |
| 81 | +[docs-snippets]: https://code.visualstudio.com/docs/editor/userdefinedsnippets#_create-your-own-snippets |
| 82 | + |
| 83 | +[nvm]: https://github.com/nvm-sh/nvm |
| 84 | +[bait]: https://github.com/bait-lang/bait#installation |
0 commit comments