Skip to content

Commit fe6d524

Browse files
committed
update contributing to list helpful PRs for getting into editor tooling analysis development
1 parent 7d5e69f commit fe6d524

File tree

1 file changed

+17
-4
lines changed

1 file changed

+17
-4
lines changed

CONTRIBUTING.md

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,14 +42,17 @@ Thanks for your interest. Below is an informal spec of how the plugin's server c
4242
<img width="235" alt="image" src="https://user-images.githubusercontent.com/1909539/97448097-7d186a80-18ed-11eb-82d6-d55b70f54811.png">
4343

4444
If you're getting some Promise-related error alert: this is a VSCode and/or template bug.
45+
4546
- If that newly launched VSCode test instance has no project in its explorer view, drag in a random project.
4647
- Kill all your node processes.
4748
- Redo the launch.
49+
4850
- In the [Extension Development Host] instance of VSCode that just opened, open a `.res` file.
4951
- Try various features.
5052
- When you make a change, Go to the same Debug viewlet's Call Stack panel and restart the client and the server:
5153

5254
<img width="359" alt="image" src="https://user-images.githubusercontent.com/1909539/97448639-19db0800-18ee-11eb-875a-d17cd1b141d1.png">
55+
5356
- For the native analysis binary tests: `cd analysis && make test`.
5457

5558
## Change the Grammar
@@ -59,6 +62,7 @@ The _real_ source of truth for our grammar is at https://github.com/rescript-lan
5962
- Modify `grammars/rescript.tmLanguage.json`.
6063

6164
For more grammar inspirations, check:
65+
6266
- [TypeScript's grammar](https://github.com/microsoft/TypeScript-TmLanguage/blob/a771bc4e79deeae81a01d988a273e300290d0072/TypeScript.YAML-tmLanguage)
6367
- [Writing a TextMate Grammar: Some Lessons Learned](https://www.apeth.com/nonblog/stories/textmatebundle.html)
6468

@@ -132,6 +136,7 @@ We currently do that; we wish we aren't.
132136
It's possible to open files from different projects into the same editor instance. In that case, also read _that_ file's project's `.compiler.log`.
133137

134138
The bad alternatives are:
139+
135140
- Not show that file's project's errors. That's wrong for several reasons (looks like the file has no error, assumes an editor window has a default project, etc.).
136141
- Show only that file's error. That's just weird, the errors are already read from that project's `.compiler.log`. Might as well show all of them (?).
137142

@@ -149,9 +154,10 @@ Drawbacks:
149154
## Format
150155

151156
To find the location of `bsc.exe` to run the formatter:
157+
152158
- Search in the file's directory's `node_modules/bs-platform/{platform}/bsc.exe`. If not found, recursively search upward (because [monorepos](https://github.com/rescript-lang/rescript-vscode/blob/0dbf2eb9cdb0bd6d95be1aee88b73830feecb5cc/server/src/utils.ts#L39-L45)).
153-
- Do **not** directly use `node_modules/.bin/bsc` if you can help it. That's a Nodejs wrapper. Slow startup. We don't want our formatting to be momentarily stalled because some Nodejs cache went cold.
154-
- `platform` can be `darwin`, `linux`, `win32` or `freebsd`.
159+
- Do **not** directly use `node_modules/.bin/bsc` if you can help it. That's a Nodejs wrapper. Slow startup. We don't want our formatting to be momentarily stalled because some Nodejs cache went cold.
160+
- `platform` can be `darwin`, `linux`, `win32` or `freebsd`.
155161

156162
### Formatting Newline
157163

@@ -163,9 +169,16 @@ The errors returned from `bsc.exe -format` should be discarded; in theory, they
163169

164170
In the future, we should consier showing the format errors when `.compiler.log` isn't found.
165171

166-
## Release
172+
## Analysis bin
173+
174+
Analysis bin is what we currently call the OCaml code that does deeper language related analysis, and that powers most of the language specific functionality like hovers, completion, and so on. Here's a list of PRs and other resources you can have a look at if you're interested in contributing to the analysis bin:
175+
176+
- Implementing "code lens" for function definitions. PR + commits have a bunch of comments intended to be educational as to what's done where, and why. https://github.com/rescript-lang/rescript-vscode/pull/513
177+
- Cristiano fixes a bug where autocomplete wasn't working in switch branches, because the analysis did not cover that context. Contains a bunch of good comments on how the test setup works, etc. https://github.com/rescript-lang/rescript-vscode/pull/415
167178

168-
Currently the release is vetted and done by @chenglou.
179+
We're happy to gather more resources over time here, including more in-depth getting started guides.
180+
181+
## Release
169182

170183
1. Bump the version properly in `package.json` and `server/package.json` and their lockfiles. Commit and push the version bump.
171184
2. Make sure @ryyppy is aware of your changes. He needs to sync them over to the vim plugin.

0 commit comments

Comments
 (0)