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
* Initial plan
* Deprecate @raises in favor of @throws in reanalyze
- Update reanalyze Exception.ml to accept both @throws and @raises decorators
- Update warning messages to use @throws terminology
- Add @throws decorator to completion with documentation
- Mark @raises as deprecated in completion
- Update all test files to use @throws instead of @raises
- Update expected test outputs to reflect @throws terminology
- Update Stdlib_JSON to use @throws instead of @raises
Co-authored-by: tsnobip <2479216+tsnobip@users.noreply.github.com>
* replace other references of `raise` with `throw`
* update "Contribute to the API Reference"
* update changelog
* update docs some more
* rename some more raises
* rename raise to throw in API docs
* remove unused @throws annotations
* update completion
---------
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: tsnobip <2479216+tsnobip@users.noreply.github.com>
Co-authored-by: tsnobip <dontshootthink@gmail.com>
Copy file name to clipboardExpand all lines: CONTRIBUTING.md
+6-20Lines changed: 6 additions & 20 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -334,30 +334,15 @@ Note that there's currently still a manual step involved on [rescript-lang.org](
334
334
335
335
## Contribute to the API Reference
336
336
337
-
The API reference is generated from doc comments in the source code. [Here](https://github.com/rescript-lang/rescript-compiler/blob/99650/jscomp/others/js_re.mli#L146-L161)'s a good example.
337
+
The API reference is generated from doc comments in the source code. [Here](https://github.com/rescript-lang/rescript/blob/57c696b1a38f53badaddcc082ed29188d80df70d/packages/%40rescript/runtime/Stdlib_String.resi#L441-L458)'s a good example.
338
338
339
339
Some tips:
340
340
341
-
- The first sentence or line should be a very short summary. This is used in indexes and by tools like merlin.
342
-
- Ideally, every function should have **at least one**`@example`.
343
-
- Cross-reference another definition with `{! identifier}`. But use them sparingly, they’re a bit verbose (currently, at least).
344
-
- Wrap non-cross-referenced identifiers and other code in `[ ... ]`.
345
-
- Escape `{`, `}`, `[`, `]` and `@` using `\`.
346
-
- It’s possible to use `{%html ...}` to generate custom html, but use this very, very sparingly.
347
-
- A number of "documentation tags" are provided that would be nice to use, but unfortunately they’re often not supported for \`external\`s. Which is of course most of the API.
348
-
-`@param` usually doesn’t work. Use `{b <param>} ...` instead
349
-
-`@returns` usually doesn’t work. Use `{b returns} ...` instead.
341
+
- The first sentence or line should show the function call with a very short summary.
342
+
- Ideally, every function should have an `## Examples` section with **at least one** example. The examples are compiled to check that they are correct. Use `==` to generate tests from the examples.
350
343
- Always use `@deprecated` when applicable.
351
-
- Always use `@raise` when applicable.
352
-
- Always provide a `@see` tag pointing to MDN for more information when available.
353
-
354
-
See [Ocamldoc documentation](http://caml.inria.fr/pub/docs/manual-ocaml/ocamldoc.html#sec333) for more details.
355
-
356
-
To generate the html:
357
-
358
-
```sh
359
-
../scripts/ninja docs
360
-
```
344
+
- Always use `@throw` when applicable.
345
+
- Always provide a `See` section pointing to MDN for more information when available.
361
346
362
347
## Contribute to JSX `domProps`
363
348
@@ -389,6 +374,7 @@ Adding a new entry there requires re-running the analysis tests. Follow these st
389
374
(If a `make`command fails, consider using the [DevContainer](#b-devcontainer).)
390
375
391
376
Finally, add a line to [CHANGELOG.md](CHANGELOG.md), using the `#### :nail_care: Polish` section.
377
+
392
378
## Code structure
393
379
394
380
The highlevel architecture is illustrated as below:
0 commit comments