You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: .github/copilot-instructions.md
+19-7Lines changed: 19 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -9,23 +9,29 @@ Most of our development takes place in the `internal` directory, and most behavi
9
9
10
10
Most development on the codebase is in Go.
11
11
Standard Go commands and practices apply, but we primarily use a tool called `hereby` to build, run tests, and other tasks.
12
-
Feel free to install `hereby` globally (`npm install -g hereby`) if it is easier, and run `hereby --list` to see all available commands.
12
+
Run `npx hereby --list` to see all available commands.
13
13
14
14
```sh
15
-
hereby build # Build the project
16
-
hereby test# Run tests
17
-
hereby format # Format the code
18
-
hereby lint # Run linters
15
+
npx hereby build # Build the project
16
+
npx hereby test# Run tests
17
+
npx hereby format # Format the code
18
+
npx hereby lint # Run linters
19
+
20
+
# To run a specific compiler test:
21
+
go test -run='TestSubmodule/<test name>' ./internal/testrunner # For submodule tests in _submodules/TypeScript
22
+
go test -run='TestLocal/<test name>' ./internal/testrunner # For local tests in testdata/tests/cases
19
23
```
20
24
21
-
Always make sure code is formatted, linted, and tested before sending a pull request.
22
-
25
+
Always make sure code is formatted, linted, and tested before sending a pull request.
26
+
23
27
## Compiler Features, Fixes, and Tests
24
28
25
29
When fixing a bug or implementing a new feature, at least one minimal test case should always be added in advance to verify the fix.
26
30
This project primarily uses snapshot/baseline/golden tests rather than unit tests.
27
31
New compiler tests are written in `.ts`/`.tsx` files in the directory `testdata/tests/cases/compiler/`, and are written in the following format:
28
32
33
+
**Note:** Issues with editor features cannot be tested with compiler tests in `testdata/tests/cases/`. Editor functionality requires integration testing with the language server.
34
+
29
35
```ts
30
36
// @target: esnext
31
37
// @module: preserve
@@ -79,6 +85,12 @@ It is ideal to implement features and fixes in the following order, and commit c
79
85
80
86
It is fine to implement more and more of a feature across commits, but be sure to update baselines every time so that reviewers can measure progress.
81
87
88
+
## Code Porting Reference
89
+
90
+
The code in `internal` is ported from the code in `_submodules/TypeScript`.
91
+
When implementing features or fixing bugs, those files should be searched for similar functions when code is either missing or potentially wrong.
92
+
The TypeScript submodule serves as the reference implementation for behavior and functionality.
93
+
82
94
# Other Instructions
83
95
84
96
- Do not add or change existing dependencies unless asked to.
0 commit comments