diff options
Diffstat (limited to 'docs/dev')
-rw-r--r-- | docs/dev/README.md | 33 | ||||
-rw-r--r-- | docs/dev/lsp-extensions.md | 20 | ||||
-rw-r--r-- | docs/dev/style.md | 21 |
3 files changed, 58 insertions, 16 deletions
diff --git a/docs/dev/README.md b/docs/dev/README.md index 9c0eb1358..16b23adc6 100644 --- a/docs/dev/README.md +++ b/docs/dev/README.md | |||
@@ -208,20 +208,26 @@ Release process is handled by `release`, `dist` and `promote` xtasks, `release` | |||
208 | 208 | ||
209 | Additionally, it assumes that remote for `rust-analyzer` is called `upstream` (I use `origin` to point to my fork). | 209 | Additionally, it assumes that remote for `rust-analyzer` is called `upstream` (I use `origin` to point to my fork). |
210 | 210 | ||
211 | `release` calls the GitHub API calls to scrape pull request comments and categorize them in the changelog. | ||
212 | This step uses the `curl` and `jq` applications, which need to be available in `PATH`. | ||
213 | Finally, you need to obtain a GitHub personal access token and set the `GITHUB_TOKEN` environment variable. | ||
214 | |||
211 | Release steps: | 215 | Release steps: |
212 | 216 | ||
213 | 1. Inside rust-analyzer, run `cargo xtask release`. This will: | 217 | 1. Set the `GITHUB_TOKEN` environment variable. |
218 | 2. Inside rust-analyzer, run `cargo xtask release`. This will: | ||
214 | * checkout the `release` branch | 219 | * checkout the `release` branch |
215 | * reset it to `upstream/nightly` | 220 | * reset it to `upstream/nightly` |
216 | * push it to `upstream`. This triggers GitHub Actions which: | 221 | * push it to `upstream`. This triggers GitHub Actions which: |
217 | * runs `cargo xtask dist` to package binaries and VS Code extension | 222 | * runs `cargo xtask dist` to package binaries and VS Code extension |
218 | * makes a GitHub release | 223 | * makes a GitHub release |
219 | * pushes VS Code extension to the marketplace | 224 | * pushes VS Code extension to the marketplace |
220 | * create new changelog in `rust-analyzer.github.io` | 225 | * call the GitHub API for PR details |
221 | 2. While the release is in progress, fill in the changelog | 226 | * create a new changelog in `rust-analyzer.github.io` |
222 | 3. Commit & push the changelog | 227 | 3. While the release is in progress, fill in the changelog |
223 | 4. Tweet | 228 | 4. Commit & push the changelog |
224 | 5. Inside `rust-analyzer`, run `cargo xtask promote` -- this will create a PR to rust-lang/rust updating rust-analyzer's submodule. | 229 | 5. Tweet |
230 | 6. Inside `rust-analyzer`, run `cargo xtask promote` -- this will create a PR to rust-lang/rust updating rust-analyzer's submodule. | ||
225 | Self-approve the PR. | 231 | Self-approve the PR. |
226 | 232 | ||
227 | If the GitHub Actions release fails because of a transient problem like a timeout, you can re-run the job from the Actions console. | 233 | If the GitHub Actions release fails because of a transient problem like a timeout, you can re-run the job from the Actions console. |
@@ -229,18 +235,27 @@ If it fails because of something that needs to be fixed, remove the release tag | |||
229 | Make sure to remove the new changelog post created when running `cargo xtask release` a second time. | 235 | Make sure to remove the new changelog post created when running `cargo xtask release` a second time. |
230 | 236 | ||
231 | We release "nightly" every night automatically and promote the latest nightly to "stable" manually, every week. | 237 | We release "nightly" every night automatically and promote the latest nightly to "stable" manually, every week. |
238 | |||
232 | We don't do "patch" releases, unless something truly egregious comes up. | 239 | We don't do "patch" releases, unless something truly egregious comes up. |
240 | To do a patch release, cherry-pick the fix on top of the current `release` branch and push the branch. | ||
241 | There's no need to write a changelog for a patch release, it's OK to include the notes about the fix into the next weekly one. | ||
242 | Note: we tag releases by dates, releasing a patch release on the same day should work (by overwriting a tag), but I am not 100% sure. | ||
233 | 243 | ||
234 | ## Permissions | 244 | ## Permissions |
235 | 245 | ||
236 | There are three sets of people with extra permissions: | 246 | There are three sets of people with extra permissions: |
237 | 247 | ||
238 | * rust-analyzer GitHub organization **admins** (which include current t-compiler leads). | 248 | * rust-analyzer GitHub organization [**admins**](https://github.com/orgs/rust-analyzer/people?query=role:owner) (which include current t-compiler leads). |
239 | Admins have full access to the org. | 249 | Admins have full access to the org. |
240 | * **review** team in the organization. | 250 | * [**review**](https://github.com/orgs/rust-analyzer/teams/review) team in the organization. |
241 | Reviewers have `r+` access to all of organization's repositories and publish rights on crates.io. | 251 | Reviewers have `r+` access to all of organization's repositories and publish rights on crates.io. |
242 | They also have direct commit access, but all changes should via bors queue. | 252 | They also have direct commit access, but all changes should via bors queue. |
243 | It's ok to self-approve if you think you know what you are doing! | 253 | It's ok to self-approve if you think you know what you are doing! |
244 | bors should automatically sync the permissions. | 254 | bors should automatically sync the permissions. |
245 | * **triage** team in the organization. | 255 | Feel free to request a review or assign any PR to a reviewer with the relevant expertise to bring the work to their attention. |
256 | Don't feel pressured to review assigned PRs though. | ||
257 | If you don't feel like reviewing for whatever reason, someone else will pick the review up! | ||
258 | * [**triage**](https://github.com/orgs/rust-analyzer/teams/triage) team in the organization. | ||
246 | This team can label and close issues. | 259 | This team can label and close issues. |
260 | |||
261 | Note that at the time being you need to be a member of the org yourself to view the links. | ||
diff --git a/docs/dev/lsp-extensions.md b/docs/dev/lsp-extensions.md index a46121bb2..f0f981802 100644 --- a/docs/dev/lsp-extensions.md +++ b/docs/dev/lsp-extensions.md | |||
@@ -1,8 +1,8 @@ | |||
1 | <!--- | 1 | <!--- |
2 | lsp_ext.rs hash: faae991334a151d0 | 2 | lsp_ext.rs hash: 28a9d5a24b7ca396 |
3 | 3 | ||
4 | If you need to change the above hash to make the test pass, please check if you | 4 | If you need to change the above hash to make the test pass, please check if you |
5 | need to adjust this doc as well and ping this issue: | 5 | need to adjust this doc as well and ping this issue: |
6 | 6 | ||
7 | https://github.com/rust-analyzer/rust-analyzer/issues/4604 | 7 | https://github.com/rust-analyzer/rust-analyzer/issues/4604 |
8 | 8 | ||
@@ -46,6 +46,7 @@ If this capability is set, `WorkspaceEdit`s returned from `codeAction` requests | |||
46 | ```typescript | 46 | ```typescript |
47 | interface SnippetTextEdit extends TextEdit { | 47 | interface SnippetTextEdit extends TextEdit { |
48 | insertTextFormat?: InsertTextFormat; | 48 | insertTextFormat?: InsertTextFormat; |
49 | annotationId?: ChangeAnnotationIdentifier; | ||
49 | } | 50 | } |
50 | ``` | 51 | ``` |
51 | 52 | ||
@@ -421,7 +422,7 @@ Reloads project information (that is, re-executes `cargo metadata`). | |||
421 | 422 | ||
422 | ## Server Status | 423 | ## Server Status |
423 | 424 | ||
424 | **Experimental Client Capability:** `{ "serverStatus": boolean }` | 425 | **Experimental Client Capability:** `{ "serverStatusNotification": boolean }` |
425 | 426 | ||
426 | **Method:** `experimental/serverStatus` | 427 | **Method:** `experimental/serverStatus` |
427 | 428 | ||
@@ -432,11 +433,13 @@ interface ServerStatusParams { | |||
432 | /// `ok` means that the server is completely functional. | 433 | /// `ok` means that the server is completely functional. |
433 | /// | 434 | /// |
434 | /// `warning` means that the server is partially functional. | 435 | /// `warning` means that the server is partially functional. |
435 | /// It can server requests, but some results might be wrong due to, | 436 | /// It can answer correctly to most requests, but some results |
436 | /// for example, some missing dependencies. | 437 | /// might be wrong due to, for example, some missing dependencies. |
437 | /// | 438 | /// |
438 | /// `error` means that the server is not functional. For example, | 439 | /// `error` means that the server is not functional. For example, |
439 | /// there's a fatal build configuration problem. | 440 | /// there's a fatal build configuration problem. The server might |
441 | /// still give correct answers to simple requests, but most results | ||
442 | /// will be incomplete or wrong. | ||
440 | health: "ok" | "warning" | "error", | 443 | health: "ok" | "warning" | "error", |
441 | /// Is there any pending background work which might change the status? | 444 | /// Is there any pending background work which might change the status? |
442 | /// For example, are dependencies being downloaded? | 445 | /// For example, are dependencies being downloaded? |
@@ -450,6 +453,9 @@ This notification is sent from server to client. | |||
450 | The client can use it to display *persistent* status to the user (in modline). | 453 | The client can use it to display *persistent* status to the user (in modline). |
451 | It is similar to the `showMessage`, but is intended for stares rather than point-in-time events. | 454 | It is similar to the `showMessage`, but is intended for stares rather than point-in-time events. |
452 | 455 | ||
456 | Note that this functionality is intended primarily to inform the end user about the state of the server. | ||
457 | In particular, it's valid for the client to completely ignore this extension. | ||
458 | Clients are discouraged from but are allowed to use the `health` status to decide if it's worth sending a request to the server. | ||
453 | 459 | ||
454 | ## Syntax Tree | 460 | ## Syntax Tree |
455 | 461 | ||
@@ -620,7 +626,7 @@ This request is sent from client to server to move item under cursor or selectio | |||
620 | 626 | ||
621 | **Request:** `MoveItemParams` | 627 | **Request:** `MoveItemParams` |
622 | 628 | ||
623 | **Response:** `TextDocumentEdit | null` | 629 | **Response:** `SnippetTextEdit[]` |
624 | 630 | ||
625 | ```typescript | 631 | ```typescript |
626 | export interface MoveItemParams { | 632 | export interface MoveItemParams { |
diff --git a/docs/dev/style.md b/docs/dev/style.md index 468dedff2..6ab60b50e 100644 --- a/docs/dev/style.md +++ b/docs/dev/style.md | |||
@@ -83,8 +83,19 @@ This makes it easier to prepare a changelog. | |||
83 | 83 | ||
84 | If the change adds a new user-visible functionality, consider recording a GIF with [peek](https://github.com/phw/peek) and pasting it into the PR description. | 84 | If the change adds a new user-visible functionality, consider recording a GIF with [peek](https://github.com/phw/peek) and pasting it into the PR description. |
85 | 85 | ||
86 | To make writing the release notes easier, you can mark a pull request as a feature, fix, internal change, or minor. | ||
87 | Minor changes are excluded from the release notes, while the other types are distributed in their corresponding sections. | ||
88 | There are two ways to mark this: | ||
89 | |||
90 | * use a `feat: `, `feature: `, `fix: `, `internal: ` or `minor: ` prefix in the PR title | ||
91 | * write `changelog [feature|fix|internal|skip] [description]` in a comment or in the PR description; the description is optional, and will replace the title if included. | ||
92 | |||
93 | These comments don't have to be added by the PR author. | ||
94 | Editing a comment or the PR description or title is also fine, as long as it happens before the release. | ||
95 | |||
86 | **Rationale:** clean history is potentially useful, but rarely used. | 96 | **Rationale:** clean history is potentially useful, but rarely used. |
87 | But many users read changelogs. | 97 | But many users read changelogs. |
98 | Including a description and GIF suitable for the changelog means less work for the maintainers on the release day. | ||
88 | 99 | ||
89 | ## Clippy | 100 | ## Clippy |
90 | 101 | ||
@@ -152,6 +163,16 @@ Do not reuse marks between several tests. | |||
152 | 163 | ||
153 | **Rationale:** marks provide an easy way to find the canonical test for each bit of code. | 164 | **Rationale:** marks provide an easy way to find the canonical test for each bit of code. |
154 | This makes it much easier to understand. | 165 | This makes it much easier to understand. |
166 | More than one mark per test / code branch doesn't add significantly to understanding. | ||
167 | |||
168 | ## `#[should_panic]` | ||
169 | |||
170 | Do not use `#[should_panic]` tests. | ||
171 | Instead, explicitly check for `None`, `Err`, etc. | ||
172 | |||
173 | **Rationale:** `#[should_panic]` is a tool for library authors, to makes sure that API does not fail silently, when misused. | ||
174 | `rust-analyzer` is not a library, we don't need to test for API misuse, and we have to handle any user input without panics. | ||
175 | Panic messages in the logs from the `#[should_panic]` tests are confusing. | ||
155 | 176 | ||
156 | ## Function Preconditions | 177 | ## Function Preconditions |
157 | 178 | ||