Skip to content

Commit 3910ea5

Browse files
committed
Fix typos in docs/dev/README.md
Small grammar and spelling changes
1 parent 6b21758 commit 3910ea5

File tree

1 file changed

+20
-20
lines changed

1 file changed

+20
-20
lines changed

docs/dev/README.md

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Contributing Quick Start
22

3-
Rust Analyzer is just a usual rust project, which is organized as a Cargo
3+
Rust Analyzer is an ordinary Rust project, which is organized as a Cargo
44
workspace, builds on stable and doesn't depend on C libraries. So, just
55

66
```
@@ -65,31 +65,31 @@ directory).
6565

6666
# Launching rust-analyzer
6767

68-
Debugging language server can be tricky: LSP is rather chatty, so driving it
68+
Debugging the language server can be tricky: LSP is rather chatty, so driving it
6969
from the command line is not really feasible, driving it via VS Code requires
7070
interacting with two processes.
7171

7272
For this reason, the best way to see how rust-analyzer works is to find a
7373
relevant test and execute it (VS Code includes an action for running a single
7474
test).
7575

76-
However, launching a VS Code instance with locally build language server is
76+
However, launching a VS Code instance with a locally built language server is
7777
possible. There's **"Run Extension (Debug Build)"** launch configuration for this.
7878

7979
In general, I use one of the following workflows for fixing bugs and
8080
implementing features.
8181

8282
If the problem concerns only internal parts of rust-analyzer (i.e. I don't need
83-
to touch `rust-analyzer` crate or TypeScript code), there is a unit-test for it.
83+
to touch the `rust-analyzer` crate or TypeScript code), there is a unit-test for it.
8484
So, I use **Rust Analyzer: Run** action in VS Code to run this single test, and
8585
then just do printf-driven development/debugging. As a sanity check after I'm
8686
done, I use `cargo xtask install --server` and **Reload Window** action in VS
8787
Code to sanity check that the thing works as I expect.
8888

8989
If the problem concerns only the VS Code extension, I use **Run Installed Extension**
9090
launch configuration from `launch.json`. Notably, this uses the usual
91-
`rust-analyzer` binary from `PATH`. For this it is important to have the following
92-
in `setting.json` file:
91+
`rust-analyzer` binary from `PATH`. For this, it is important to have the following
92+
in your `settings.json` file:
9393
```json
9494
{
9595
"rust-analyzer.serverPath": "rust-analyzer"
@@ -107,7 +107,7 @@ things up, sometimes I open a temporary hello-world project which has
107107
`"rust-analyzer.withSysroot": false` in `.code/settings.json`. This flag causes
108108
rust-analyzer to skip loading the sysroot, which greatly reduces the amount of
109109
things rust-analyzer needs to do, and makes printf's more useful. Note that you
110-
should only use `eprint!` family of macros for debugging: stdout is used for LSP
110+
should only use the `eprint!` family of macros for debugging: stdout is used for LSP
111111
communication, and `print!` would break it.
112112

113113
If I need to fix something simultaneously in the server and in the client, I
@@ -119,20 +119,20 @@ performance optimizations, or for bug minimization.
119119

120120
# Code Style & Review Process
121121

122-
Our approach to "clean code" is two fold:
122+
Our approach to "clean code" is two-fold:
123123

124124
* We generally don't block PRs on style changes.
125125
* At the same time, all code in rust-analyzer is constantly refactored.
126126

127-
It is explicitly OK for reviewer to flag only some nits in the PR, and than send a follow up cleanup PR for things which are easier to explain by example, cc-ing the original author.
128-
Sending small cleanup PRs (like rename a single local variable) is encouraged.
127+
It is explicitly OK for a reviewer to flag only some nits in the PR, and then send a follow-up cleanup PR for things which are easier to explain by example, cc-ing the original author.
128+
Sending small cleanup PRs (like renaming a single local variable) is encouraged.
129129

130130
## Scale of Changes
131131

132132
Everyone knows that it's better to send small & focused pull requests.
133133
The problem is, sometimes you *have* to, eg, rewrite the whole compiler, and that just doesn't fit into a set of isolated PRs.
134134

135-
The main thing too keep an eye on is the boundaries between various components.
135+
The main things to keep an eye on are the boundaries between various components.
136136
There are three kinds of changes:
137137

138138
1. Internals of a single component are changed.
@@ -144,20 +144,20 @@ There are three kinds of changes:
144144
A good example here would be expansion of assist API, for example, to implement lazy assists or assists groups.
145145

146146
3. A new dependency between components is introduced.
147-
Specifically, you add a `pub use` reexport from another crate or you add a new line to `[dependencies]` section of `Cargo.toml`.
147+
Specifically, you add a `pub use` reexport from another crate or you add a new line to the `[dependencies]` section of `Cargo.toml`.
148148
A good example here would be adding reference search capability to the assists crates.
149149

150150
For the first group, the change is generally merged as long as:
151151

152152
* it works for the happy case,
153153
* it has tests,
154-
* it doesn't panic for unhappy case.
154+
* it doesn't panic for the unhappy case.
155155

156156
For the second group, the change would be subjected to quite a bit of scrutiny and iteration.
157157
The new API needs to be right (or at least easy to change later).
158158
The actual implementation doesn't matter that much.
159159
It's very important to minimize the amount of changed lines of code for changes of the second kind.
160-
Often, you start doing change of the first kind, only to realise that you need to elevate to a change of the second kind.
160+
Often, you start doing a change of the first kind, only to realise that you need to elevate to a change of the second kind.
161161
In this case, we'll probably ask you to split API changes into a separate PR.
162162

163163
Changes of the third group should be pretty rare, so we don't specify any specific process for them.
@@ -239,7 +239,7 @@ struct Foo {
239239
## Variable Naming
240240

241241
We generally use boring and long names for local variables ([yay code completion](https://github.com/rust-analyzer/rust-analyzer/pull/4162#discussion_r417130973)).
242-
The default name is lowercased named of the type: `global_state: GlobalState`.
242+
The default name is a lowercased name of the type: `global_state: GlobalState`.
243243
Avoid ad-hoc acronyms and contractions, but use the ones that exist consistently (`db`, `ctx`, `acc`).
244244
The default name for "result of the function" local variable is `res`.
245245

@@ -265,8 +265,8 @@ fn frobnicate(walrus: Option<Walrus>) {
265265

266266
## Premature Pessimization
267267

268-
While we don't specifically optimize code yet, avoid writing the code which is slower than it needs to be.
269-
Don't allocate a `Vec` were an iterator would do, don't allocate strings needlessly.
268+
While we don't specifically optimize code yet, avoid writing code which is slower than it needs to be.
269+
Don't allocate a `Vec` where an iterator would do, don't allocate strings needlessly.
270270

271271
```rust
272272
// Good
@@ -305,7 +305,7 @@ always obvious from the low-level code.
305305
## Incomplete syntax trees
306306

307307
Syntax trees are by design incomplete and do not enforce well-formedness.
308-
If ast method returns an `Option`, it *can* be `None` at runtime, even if this is forbidden by the grammar.
308+
If an AST method returns an `Option`, it *can* be `None` at runtime, even if this is forbidden by the grammar.
309309

310310
## LSP independence
311311

@@ -333,7 +333,7 @@ The results are 100% Rust specific though.
333333

334334
## Parser Tests
335335

336-
Test for parser (`ra_parser`) live in `ra_syntax` crate (see `test_data` direcotory).
336+
Tests for the parser (`ra_parser`) live in the `ra_syntax` crate (see `test_data` directory).
337337
There are two kinds of tests:
338338

339339
* Manually written test cases in `parser/ok` and `parser/err`
@@ -374,7 +374,7 @@ To log all communication between the server and the client, there are two choice
374374
[@DJMcNab](https://github.com/DJMcNab) for setting this awesome infra up!
375375

376376

377-
There's also two VS Code commands which might be of interest:
377+
There are also two VS Code commands which might be of interest:
378378

379379
* `Rust Analyzer: Status` shows some memory-usage statistics. To take full
380380
advantage of it, you need to compile rust-analyzer with jemalloc support:

0 commit comments

Comments
 (0)