From 4fd361343449bcdf7af4642851dc5dbf772f1a68 Mon Sep 17 00:00:00 2001 From: Pascal Hertleif Date: Mon, 11 Feb 2019 17:18:27 +0100 Subject: Fix some typos --- crates/ra_ide_api/src/completion.rs | 2 +- crates/ra_ide_api/src/completion/complete_fn_param.rs | 2 +- crates/ra_ide_api/src/goto_definition.rs | 8 ++++---- crates/ra_ide_api/src/hover.rs | 4 ++-- crates/ra_ide_api/src/impls.rs | 4 ++-- crates/ra_ide_api/src/lib.rs | 10 +++++----- crates/ra_ide_api/src/mock_analysis.rs | 2 +- crates/ra_ide_api/src/references.rs | 6 +++--- crates/ra_ide_api/src/symbol_index.rs | 12 ++++++------ 9 files changed, 25 insertions(+), 25 deletions(-) (limited to 'crates/ra_ide_api/src') diff --git a/crates/ra_ide_api/src/completion.rs b/crates/ra_ide_api/src/completion.rs index 83c243944..2b94931c6 100644 --- a/crates/ra_ide_api/src/completion.rs +++ b/crates/ra_ide_api/src/completion.rs @@ -30,7 +30,7 @@ pub use crate::completion::completion_item::{CompletionItem, CompletionItemKind, /// incomplete and can look really weird. /// /// Once the context is collected, we run a series of completion routines which -/// look at the context and produce completion items. One subtelty about this +/// look at the context and produce completion items. One subtlety about this /// phase is that completion engine should not filter by the substring which is /// already present, it should give all possible variants for the identifier at /// the caret. In other words, for diff --git a/crates/ra_ide_api/src/completion/complete_fn_param.rs b/crates/ra_ide_api/src/completion/complete_fn_param.rs index 43532226f..4d6416284 100644 --- a/crates/ra_ide_api/src/completion/complete_fn_param.rs +++ b/crates/ra_ide_api/src/completion/complete_fn_param.rs @@ -7,7 +7,7 @@ use rustc_hash::FxHashMap; use crate::completion::{CompletionContext, Completions, CompletionKind, CompletionItem}; -/// Complete repeated parametes, both name and type. For example, if all +/// Complete repeated parameters, both name and type. For example, if all /// functions in a file have a `spam: &mut Spam` parameter, a completion with /// `spam: &mut Spam` insert text/label and `spam` lookup string will be /// suggested. diff --git a/crates/ra_ide_api/src/goto_definition.rs b/crates/ra_ide_api/src/goto_definition.rs index 413720960..96ed8c8e9 100644 --- a/crates/ra_ide_api/src/goto_definition.rs +++ b/crates/ra_ide_api/src/goto_definition.rs @@ -93,10 +93,10 @@ pub(crate) fn reference_definition( return Exact(nav); } Some(Resolution::GenericParam(..)) => { - // TODO go to the generic param def + // TODO: go to the generic param def } Some(Resolution::SelfType(_impl_block)) => { - // TODO go to the implemented type + // TODO: go to the implemented type } None => {} } @@ -133,8 +133,8 @@ mod tests { use crate::mock_analysis::analysis_and_position; - fn check_goto(fixuture: &str, expected: &str) { - let (analysis, pos) = analysis_and_position(fixuture); + fn check_goto(fixture: &str, expected: &str) { + let (analysis, pos) = analysis_and_position(fixture); let mut navs = analysis.goto_definition(pos).unwrap().unwrap().info; assert_eq!(navs.len(), 1); diff --git a/crates/ra_ide_api/src/hover.rs b/crates/ra_ide_api/src/hover.rs index 60b81567c..0888ab6de 100644 --- a/crates/ra_ide_api/src/hover.rs +++ b/crates/ra_ide_api/src/hover.rs @@ -71,8 +71,8 @@ pub(crate) fn type_of(db: &RootDatabase, frange: FileRange) -> Option { } } -// FIXME: this should not really use navigation target. Rather, approximatelly -// resovled symbol should return a `DefId`. +// FIXME: this should not really use navigation target. Rather, approximately +// resolved symbol should return a `DefId`. fn doc_text_for(db: &RootDatabase, nav: NavigationTarget) -> Option { match (nav.description(db), nav.docs(db)) { (Some(desc), Some(docs)) => Some("```rust\n".to_string() + &*desc + "\n```\n\n" + &*docs), diff --git a/crates/ra_ide_api/src/impls.rs b/crates/ra_ide_api/src/impls.rs index 444c4aeb2..681bd808d 100644 --- a/crates/ra_ide_api/src/impls.rs +++ b/crates/ra_ide_api/src/impls.rs @@ -78,8 +78,8 @@ fn impls_for_trait( mod tests { use crate::mock_analysis::analysis_and_position; - fn check_goto(fixuture: &str, expected: &[&str]) { - let (analysis, pos) = analysis_and_position(fixuture); + fn check_goto(fixture: &str, expected: &[&str]) { + let (analysis, pos) = analysis_and_position(fixture); let navs = analysis.goto_implementation(pos).unwrap().unwrap().info; assert_eq!(navs.len(), expected.len()); diff --git a/crates/ra_ide_api/src/lib.rs b/crates/ra_ide_api/src/lib.rs index 2d090d9b4..de3ec4e0a 100644 --- a/crates/ra_ide_api/src/lib.rs +++ b/crates/ra_ide_api/src/lib.rs @@ -7,7 +7,7 @@ //! However, IDE specific bits of the analysis (most notably completion) happen //! in this crate. //! -//! The sibling `ra_ide_api_light` handles thouse bits of IDE functionality +//! The sibling `ra_ide_api_light` handles those bits of IDE functionality //! which are restricted to a single file and need only syntax. // For proving that RootDatabase is RefUnwindSafe. @@ -67,7 +67,7 @@ pub use ra_db::{ pub use hir::Documentation; // We use jemalloc mainly to get heap usage statistics, actual performance -// differnece is not measures. +// difference is not measures. #[cfg(feature = "jemalloc")] #[global_allocator] static ALLOC: jemallocator::Jemalloc = jemallocator::Jemalloc; @@ -221,12 +221,12 @@ impl Analysis { self.db.line_index(file_id) } - /// Selects the next syntactic nodes encopasing the range. + /// Selects the next syntactic nodes encompassing the range. pub fn extend_selection(&self, frange: FileRange) -> Cancelable { self.with_db(|db| extend_selection::extend_selection(db, frange)) } - /// Returns position of the mathcing brace (all types of braces are + /// Returns position of the matching brace (all types of braces are /// supported). pub fn matching_brace(&self, position: FilePosition) -> Option { let file = self.db.parse(position.file_id); @@ -316,7 +316,7 @@ impl Analysis { self.with_db(|db| references::find_all_refs(db, position)) } - /// Returns a short text descrbing element at position. + /// Returns a short text describing element at position. pub fn hover(&self, position: FilePosition) -> Cancelable>> { self.with_db(|db| hover::hover(db, position)) } diff --git a/crates/ra_ide_api/src/mock_analysis.rs b/crates/ra_ide_api/src/mock_analysis.rs index 8d8603062..017ac5de3 100644 --- a/crates/ra_ide_api/src/mock_analysis.rs +++ b/crates/ra_ide_api/src/mock_analysis.rs @@ -18,7 +18,7 @@ impl MockAnalysis { } /// Creates `MockAnalysis` using a fixture data in the following format: /// - /// ```notrust + /// ```rust,ignore /// //- /main.rs /// mod foo; /// fn main() {} diff --git a/crates/ra_ide_api/src/references.rs b/crates/ra_ide_api/src/references.rs index 2cb1cc9be..ca145f3e4 100644 --- a/crates/ra_ide_api/src/references.rs +++ b/crates/ra_ide_api/src/references.rs @@ -295,17 +295,17 @@ mod tests { fn test_rename(text: &str, new_name: &str, expected: &str) { let (analysis, position) = single_file_with_position(text); let source_change = analysis.rename(position, new_name).unwrap(); - let mut text_edit_bulder = ra_text_edit::TextEditBuilder::default(); + let mut text_edit_builder = ra_text_edit::TextEditBuilder::default(); let mut file_id: Option = None; if let Some(change) = source_change { for edit in change.source_file_edits { file_id = Some(edit.file_id); for atom in edit.edit.as_atoms() { - text_edit_bulder.replace(atom.delete, atom.insert.clone()); + text_edit_builder.replace(atom.delete, atom.insert.clone()); } } } - let result = text_edit_bulder.finish().apply(&*analysis.file_text(file_id.unwrap())); + let result = text_edit_builder.finish().apply(&*analysis.file_text(file_id.unwrap())); assert_eq_text!(expected, &*result); } } diff --git a/crates/ra_ide_api/src/symbol_index.rs b/crates/ra_ide_api/src/symbol_index.rs index de0f46134..15348124b 100644 --- a/crates/ra_ide_api/src/symbol_index.rs +++ b/crates/ra_ide_api/src/symbol_index.rs @@ -5,20 +5,20 @@ //! symbols. The backbone of the index is the **awesome** `fst` crate by //! @BurntSushi. //! -//! In a nutshell, you give a set of strings to the `fst`, and it builds a +//! In a nutshell, you give a set of strings to `fst`, and it builds a //! finite state machine describing this set of strings. The strings which //! could fuzzy-match a pattern can also be described by a finite state machine. -//! What is freakingly cool is that you can now traverse both state machines in +//! What is freaking cool is that you can now traverse both state machines in //! lock-step to enumerate the strings which are both in the input set and //! fuzz-match the query. Or, more formally, given two languages described by -//! fsts, one can build an product fst which describes the intersection of the +//! FSTs, one can build a product FST which describes the intersection of the //! languages. //! //! `fst` does not support cheap updating of the index, but it supports unioning -//! of state machines. So, to account for changing source code, we build an fst -//! for each library (which is assumed to never change) and an fst for each rust +//! of state machines. So, to account for changing source code, we build an FST +//! for each library (which is assumed to never change) and an FST for each Rust //! file in the current workspace, and run a query against the union of all -//! those fsts. +//! those FSTs. use std::{ cmp::Ordering, hash::{Hash, Hasher}, -- cgit v1.2.3