Skip to content
This repository has been archived by the owner on Dec 29, 2022. It is now read-only.

Commit

Permalink
Merge pull request #1094 from matthiaskrgr/typos
Browse files Browse the repository at this point in the history
fix a bunch of typos found by codespell.
  • Loading branch information
Xanewok authored Oct 20, 2018
2 parents 4b12b41 + 8d8226d commit 1c755ef
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 24 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ and the following unstable options:
This option has no effect on the standard library.
* `show_hover_context` show additional context in hover tooltips when available.
This is often the local variable declaration. When set to false the content is
only availabe when holding the `ctrl` key in some editors.
only available when holding the `ctrl` key in some editors.


## Troubleshooting
Expand Down
34 changes: 17 additions & 17 deletions src/actions/hover.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ use log::*;
use std::path::{Path, PathBuf};

/// Cleanup documentation code blocks. The `docs` are expected to have
/// the preceeding `///` or `//!` prefixes already trimmed away. Rust code
/// the preceding `///` or `//!` prefixes already trimmed away. Rust code
/// blocks will ignore lines beginning with `#`. Code block annotations
/// that are common to Rust will be converted to `rust` allow for markdown
/// syntax coloring.
Expand Down Expand Up @@ -241,7 +241,7 @@ fn extract_and_process_docs(vfs: &Vfs, file: &Path, row_start: Row<ZeroIndexed>)
.and_then(empty_to_none)
}

/// Extracts a function, method, struct, enum, or trait decleration
/// Extracts a function, method, struct, enum, or trait declaration
/// from source.
pub fn extract_decl(
vfs: &Vfs,
Expand Down Expand Up @@ -863,7 +863,7 @@ fn format_method(rustfmt: Rustfmt, fmt_config: &FmtConfig, the_type: String) ->
result.trim().into()
}

/// Builds a hover tooltip composed of the function signature or type decleration, doc URL
/// Builds a hover tooltip composed of the function signature or type declaration, doc URL
/// (if available in the save-analysis), source extracted documentation, and code context
/// for local variables.
pub fn tooltip(
Expand Down Expand Up @@ -1118,9 +1118,9 @@ pub mod test {
/// Clears and returns the recorded output lines
pub fn reset(&self) -> Vec<String> {
let mut lines = self.lines.lock().unwrap();
let mut swaped = Vec::new();
::std::mem::swap(&mut *lines, &mut swaped);
swaped
let mut swapped = Vec::new();
::std::mem::swap(&mut *lines, &mut swapped);
swapped
}
}

Expand Down Expand Up @@ -1277,7 +1277,7 @@ pub mod test {
}

/// Strips indentation from string literals by examining
/// the indent of the first non-empty line. Preceeding
/// the indent of the first non-empty line. Preceding
/// and trailing whitespace is also removed.
fn noindent(text: &str) -> String {
let indent = text
Expand Down Expand Up @@ -1636,56 +1636,56 @@ pub mod test {
let expected = "pub fn foo() -> Foo<u32>";
let row_start = Row::new_zero_indexed(10);
let actual = extract_decl(&vfs, file, row_start)
.expect("fuction decleration")
.expect("function declaration")
.join("\n");
assert_eq!(expected, actual);

let expected = "pub struct Foo<T>";
let row_start = Row::new_zero_indexed(15);
let actual = extract_decl(&vfs, file, row_start)
.expect("struct decleration")
.expect("struct declaration")
.join("\n");
assert_eq!(expected, actual);

let expected = "pub enum Bar";
let row_start = Row::new_zero_indexed(20);
let actual = extract_decl(&vfs, file, row_start)
.expect("enum decleration")
.expect("enum declaration")
.join("\n");
assert_eq!(expected, actual);

let expected = "pub struct NewType(pub u32, f32)";
let row_start = Row::new_zero_indexed(25);
let actual = extract_decl(&vfs, file, row_start)
.expect("tuple decleration")
.expect("tuple declaration")
.join("\n");
assert_eq!(expected, actual);

let expected = "pub fn new() -> NewType";
let row_start = Row::new_zero_indexed(28);
let actual = extract_decl(&vfs, file, row_start)
.expect("struct function decleration")
.expect("struct function declaration")
.join("\n");
assert_eq!(expected, actual);

let expected = "pub fn bar<T: Copy + Add>(&self, the_really_long_name_string: String, the_really_long_name_foo: Foo<T>) -> Vec<(String, Foo<T>)>";
let row_start = Row::new_zero_indexed(32);
let actual = extract_decl(&vfs, file, row_start)
.expect("long struct method decleration with generics")
.expect("long struct method declaration with generics")
.join("\n");
assert_eq!(expected, actual);

let expected = "pub trait Baz<T> where T: Copy";
let row_start = Row::new_zero_indexed(37);
let actual = extract_decl(&vfs, file, row_start)
.expect("enum decleration")
.expect("enum declaration")
.join("\n");
assert_eq!(expected, actual);

let expected = "fn make_copy(&self) -> Self";
let row_start = Row::new_zero_indexed(38);
let actual = extract_decl(&vfs, file, row_start)
.expect("trait method decleration")
.expect("trait method declaration")
.join("\n");
assert_eq!(expected, actual);

Expand All @@ -1705,7 +1705,7 @@ pub mod test {
);
let row_start = Row::new_zero_indexed(47);
let actual = extract_decl(&vfs, file, row_start)
.expect("trait decleration multiline")
.expect("trait declaration multiline")
.join("\n");
assert_eq!(expected, actual);

Expand All @@ -1719,7 +1719,7 @@ pub mod test {
);
let row_start = Row::new_zero_indexed(53);
let actual = extract_decl(&vfs, file, row_start)
.expect("function decleration multiline")
.expect("function declaration multiline")
.join("\n");
assert_eq!(expected, actual);
}
Expand Down
4 changes: 2 additions & 2 deletions src/actions/requests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -441,7 +441,7 @@ impl server::Response for ExecuteCommandResponse {
}

// The formal request response is a simple ACK, though the objective
// is the preceeding client requests.
// is the preceding client requests.
Ack.send(id, out);
}
}
Expand Down Expand Up @@ -565,7 +565,7 @@ fn make_deglob_actions(

// for all indices which are a `*`
// check if we can deglob them
// this handles badly formated text containing multiple "use"s in one line
// this handles badly formatted text containing multiple "use"s in one line
let deglob_results: Vec<_> = line
.char_indices()
.filter(|&(_, chr)| chr == '*')
Expand Down
2 changes: 1 addition & 1 deletion src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ pub struct Config {
/// in the future.
pub full_docs: Inferrable<bool>,
/// Show additional context in hover tooltips when available. This is often the type
/// local variable declaration. When set to false, the content is only availabe when
/// local variable declaration. When set to false, the content is only available when
/// holding the `ctrl` key in some editors.
pub show_hover_context: bool,
/// Use provided rustfmt binary instead of the statically linked one.
Expand Down
2 changes: 1 addition & 1 deletion src/lsp_data.rs
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ impl RangeExt for Range {

/* ----------------- JSON-RPC protocol types ----------------- */

/// Supported initilization options that can be passed in the `initialize`
/// Supported initialization options that can be passed in the `initialize`
/// request, under `initialization_options` key. These are specific to the RLS.
#[derive(Debug, PartialEq, Deserialize, Serialize)]
#[serde(default, rename_all = "camelCase")]
Expand Down
2 changes: 1 addition & 1 deletion src/server/dispatch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ use std::time::Duration;
#[cfg(not(test))]
pub const DEFAULT_REQUEST_TIMEOUT: Duration = Duration::from_millis(1500);

// Timeout lengthened to "never" for potenially very slow CI boxes
// Timeout lengthened to "never" for potentially very slow CI boxes
#[cfg(test)]
pub const DEFAULT_REQUEST_TIMEOUT: Duration = Duration::from_millis(3_600_000);

Expand Down
2 changes: 1 addition & 1 deletion src/test/harness.rs
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ impl Cache {
ls_types::Position::new((src.line - 1) as u64, char_of_byte_index(&line, col) as u64)
}

/// Create a range convering the initial position on the line
/// Create a range covering the initial position on the line
///
/// The line number uses a 0-based index.
crate fn mk_ls_range_from_line(&mut self, line: u64) -> ls_types::Range {
Expand Down

0 comments on commit 1c755ef

Please sign in to comment.