Skip to content

Commit 74ecfc2

Browse files
bors[bot]killercup
andcommitted
Merge #804
804: Fix some typos r=killercup a=killercup Cherry-picked and updated from my now-closed PR. All credit goes to [Code Spell Checker](https://marketplace.visualstudio.com/items?itemName=streetsidesoftware.code-spell-checker). Co-authored-by: Pascal Hertleif <killercup@gmail.com>
2 parents a36e310 + 4fd3613 commit 74ecfc2

File tree

26 files changed

+69
-65
lines changed

26 files changed

+69
-65
lines changed

crates/ra_assists/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//! `ra_assits` crate provides a bunch of code assists, aslo known as code
1+
//! `ra_assits` crate provides a bunch of code assists, also known as code
22
//! actions (in LSP) or intentions (in IntelliJ).
33
//!
44
//! An assist is a micro-refactoring, which is automatically activated in

crates/ra_assists/src/remove_dbg.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@ pub(crate) fn remove_dbg(mut ctx: AssistCtx<impl HirDatabase>) -> Option<Assist>
1717

1818
let macro_range = macro_call.syntax().range();
1919

20-
// If the cursor is inside the macrocall, we'll try to maintain
21-
// the cursor position by subtracting the length of dbg!( from the start
22-
// of the filerange, otherwise we'll default to using the start of the macrocall
20+
// If the cursor is inside the macro call, we'll try to maintain the cursor
21+
// position by subtracting the length of dbg!( from the start of the file
22+
// range, otherwise we'll default to using the start of the macro call
2323
let cursor_pos = {
2424
let file_range = ctx.frange.range;
2525

@@ -61,7 +61,7 @@ fn is_valid_macrocall(macro_call: &ast::MacroCall, macro_name: &str) -> Option<b
6161
let path = macro_call.path()?;
6262
let name_ref = path.segment()?.name_ref()?;
6363

64-
// Make sure it is actually a dbg-macrocall, dbg followed by !
64+
// Make sure it is actually a dbg-macro call, dbg followed by !
6565
let excl = path.syntax().next_sibling()?;
6666

6767
if name_ref.text() != macro_name || excl.kind() != EXCL {

crates/ra_db/src/cancellation.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
//! any background processing (this bit is handled by salsa, see the
1616
//! `BaseDatabase::check_canceled` method).
1717
18-
/// An "error" signifing that the operation was canceled.
18+
/// An "error" signifying that the operation was canceled.
1919
#[derive(Clone, PartialEq, Eq, Hash)]
2020
pub struct Canceled {
2121
_private: (),

crates/ra_hir/src/code_model_api.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ impl Module {
134134

135135
/// Topmost parent of this module. Every module has a `crate_root`, but some
136136
/// might be missing `krate`. This can happen if a module's file is not included
137-
/// in the module tree of any target in Cargo.toml.
137+
/// in the module tree of any target in `Cargo.toml`.
138138
pub fn crate_root(&self, db: &impl PersistentHirDatabase) -> Module {
139139
self.crate_root_impl(db)
140140
}
@@ -351,7 +351,7 @@ impl Enum {
351351
db.type_for_def((*self).into())
352352
}
353353

354-
// TODO move to a more general type
354+
// TODO: move to a more general type
355355
/// Builds a resolver for type references inside this struct.
356356
pub fn resolver(&self, db: &impl HirDatabase) -> Resolver {
357357
// take the outer scope...
@@ -495,7 +495,7 @@ impl Function {
495495
db.generic_params((*self).into())
496496
}
497497

498-
// TODO move to a more general type for 'body-having' items
498+
// TODO: move to a more general type for 'body-having' items
499499
/// Builds a resolver for code inside this item.
500500
pub fn resolver(&self, db: &impl HirDatabase) -> Resolver {
501501
// take the outer scope...

crates/ra_hir/src/expr/scope.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ impl ExprScopes {
8484
fn add_bindings(&mut self, body: &Body, scope: ScopeId, pat: PatId) {
8585
match &body[pat] {
8686
Pat::Bind { name, .. } => {
87-
// bind can have a subpattern, but it's actually not allowed
87+
// bind can have a sub pattern, but it's actually not allowed
8888
// to bind to things in there
8989
let entry = ScopeEntry { name: name.clone(), pat };
9090
self.scopes[scope].entries.push(entry)

crates/ra_hir/src/ids.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -46,24 +46,24 @@ impl HirInterner {
4646
/// This module defines a bunch of ids we are using. The most important ones are
4747
/// probably `HirFileId` and `DefId`.
4848
49-
/// Input to the analyzer is a set of files, where each file is indentified by
49+
/// Input to the analyzer is a set of files, where each file is identified by
5050
/// `FileId` and contains source code. However, another source of source code in
5151
/// Rust are macros: each macro can be thought of as producing a "temporary
5252
/// file". To assign an id to such a file, we use the id of the macro call that
5353
/// produced the file. So, a `HirFileId` is either a `FileId` (source code
5454
/// written by user), or a `MacroCallId` (source code produced by macro).
5555
///
56-
/// What is a `MacroCallId`? Simplifying, it's a `HirFileId` of a file containin
57-
/// the call plus the offset of the macro call in the file. Note that this is a
58-
/// recursive definition! However, the size_of of `HirFileId` is finite
59-
/// (because everything bottoms out at the real `FileId`) and small
56+
/// What is a `MacroCallId`? Simplifying, it's a `HirFileId` of a file
57+
/// containing the call plus the offset of the macro call in the file. Note that
58+
/// this is a recursive definition! However, the size_of of `HirFileId` is
59+
/// finite (because everything bottoms out at the real `FileId`) and small
6060
/// (`MacroCallId` uses the location interner).
6161
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
6262
pub struct HirFileId(HirFileIdRepr);
6363

6464
impl HirFileId {
6565
/// For macro-expansion files, returns the file original source file the
66-
/// expansionoriginated from.
66+
/// expansion originated from.
6767
pub fn original_file(self, db: &impl PersistentHirDatabase) -> FileId {
6868
match self.0 {
6969
HirFileIdRepr::File(file_id) => file_id,
@@ -324,9 +324,9 @@ impl SourceFileItems {
324324

325325
fn init(&mut self, source_file: &SourceFile) {
326326
// By walking the tree in bread-first order we make sure that parents
327-
// get lower ids then children. That is, addding a new child does not
327+
// get lower ids then children. That is, adding a new child does not
328328
// change parent's id. This means that, say, adding a new function to a
329-
// trait does not chage ids of top-level items, which helps caching.
329+
// trait does not change ids of top-level items, which helps caching.
330330
bfs(source_file.syntax(), |it| {
331331
if let Some(module_item) = ast::ModuleItem::cast(it) {
332332
self.alloc(module_item.syntax());

crates/ra_hir/src/nameres.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -490,7 +490,7 @@ impl ItemMap {
490490
None => {
491491
// we still have path segments left, but the path so far
492492
// didn't resolve in the types namespace => no resolution
493-
// (don't break here because curr_per_ns might contain
493+
// (don't break here because `curr_per_ns` might contain
494494
// something in the value namespace, and it would be wrong
495495
// to return that)
496496
return (PerNs::none(), ReachedFixedPoint::No);

crates/ra_hir/src/nameres/lower.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ impl LoweredModule {
208208
}
209209
}
210210
ast::ModuleItemKind::Module(_) => {
211-
// modules are handled separately direclty by nameres
211+
// modules are handled separately directly by name res
212212
}
213213
};
214214
}

crates/ra_hir/src/path.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ impl Path {
9797
return Some(q);
9898
}
9999
// TODO: this bottom up traversal is not too precise.
100-
// Should we handle do a top-down analysiss, recording results?
100+
// Should we handle do a top-down analysis, recording results?
101101
let use_tree_list = path.syntax().ancestors().find_map(ast::UseTreeList::cast)?;
102102
let use_tree = use_tree_list.parent_use_tree();
103103
use_tree.path()

crates/ra_ide_api/src/completion.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ pub use crate::completion::completion_item::{CompletionItem, CompletionItemKind,
3030
/// incomplete and can look really weird.
3131
///
3232
/// Once the context is collected, we run a series of completion routines which
33-
/// look at the context and produce completion items. One subtelty about this
33+
/// look at the context and produce completion items. One subtlety about this
3434
/// phase is that completion engine should not filter by the substring which is
3535
/// already present, it should give all possible variants for the identifier at
3636
/// the caret. In other words, for

0 commit comments

Comments
 (0)