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

Commit 1c755ef

Browse files
authored
Merge pull request #1094 from matthiaskrgr/typos
fix a bunch of typos found by codespell.
2 parents 4b12b41 + 8d8226d commit 1c755ef

File tree

7 files changed

+24
-24
lines changed

7 files changed

+24
-24
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ and the following unstable options:
141141
This option has no effect on the standard library.
142142
* `show_hover_context` show additional context in hover tooltips when available.
143143
This is often the local variable declaration. When set to false the content is
144-
only availabe when holding the `ctrl` key in some editors.
144+
only available when holding the `ctrl` key in some editors.
145145

146146

147147
## Troubleshooting

src/actions/hover.rs

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ use log::*;
2525
use std::path::{Path, PathBuf};
2626

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

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

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

@@ -1277,7 +1277,7 @@ pub mod test {
12771277
}
12781278

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

16431643
let expected = "pub struct Foo<T>";
16441644
let row_start = Row::new_zero_indexed(15);
16451645
let actual = extract_decl(&vfs, file, row_start)
1646-
.expect("struct decleration")
1646+
.expect("struct declaration")
16471647
.join("\n");
16481648
assert_eq!(expected, actual);
16491649

16501650
let expected = "pub enum Bar";
16511651
let row_start = Row::new_zero_indexed(20);
16521652
let actual = extract_decl(&vfs, file, row_start)
1653-
.expect("enum decleration")
1653+
.expect("enum declaration")
16541654
.join("\n");
16551655
assert_eq!(expected, actual);
16561656

16571657
let expected = "pub struct NewType(pub u32, f32)";
16581658
let row_start = Row::new_zero_indexed(25);
16591659
let actual = extract_decl(&vfs, file, row_start)
1660-
.expect("tuple decleration")
1660+
.expect("tuple declaration")
16611661
.join("\n");
16621662
assert_eq!(expected, actual);
16631663

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

16711671
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>)>";
16721672
let row_start = Row::new_zero_indexed(32);
16731673
let actual = extract_decl(&vfs, file, row_start)
1674-
.expect("long struct method decleration with generics")
1674+
.expect("long struct method declaration with generics")
16751675
.join("\n");
16761676
assert_eq!(expected, actual);
16771677

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

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

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

@@ -1719,7 +1719,7 @@ pub mod test {
17191719
);
17201720
let row_start = Row::new_zero_indexed(53);
17211721
let actual = extract_decl(&vfs, file, row_start)
1722-
.expect("function decleration multiline")
1722+
.expect("function declaration multiline")
17231723
.join("\n");
17241724
assert_eq!(expected, actual);
17251725
}

src/actions/requests.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -441,7 +441,7 @@ impl server::Response for ExecuteCommandResponse {
441441
}
442442

443443
// The formal request response is a simple ACK, though the objective
444-
// is the preceeding client requests.
444+
// is the preceding client requests.
445445
Ack.send(id, out);
446446
}
447447
}
@@ -565,7 +565,7 @@ fn make_deglob_actions(
565565

566566
// for all indices which are a `*`
567567
// check if we can deglob them
568-
// this handles badly formated text containing multiple "use"s in one line
568+
// this handles badly formatted text containing multiple "use"s in one line
569569
let deglob_results: Vec<_> = line
570570
.char_indices()
571571
.filter(|&(_, chr)| chr == '*')

src/config.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ pub struct Config {
152152
/// in the future.
153153
pub full_docs: Inferrable<bool>,
154154
/// Show additional context in hover tooltips when available. This is often the type
155-
/// local variable declaration. When set to false, the content is only availabe when
155+
/// local variable declaration. When set to false, the content is only available when
156156
/// holding the `ctrl` key in some editors.
157157
pub show_hover_context: bool,
158158
/// Use provided rustfmt binary instead of the statically linked one.

src/lsp_data.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@ impl RangeExt for Range {
257257

258258
/* ----------------- JSON-RPC protocol types ----------------- */
259259

260-
/// Supported initilization options that can be passed in the `initialize`
260+
/// Supported initialization options that can be passed in the `initialize`
261261
/// request, under `initialization_options` key. These are specific to the RLS.
262262
#[derive(Debug, PartialEq, Deserialize, Serialize)]
263263
#[serde(default, rename_all = "camelCase")]

src/server/dispatch.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ use std::time::Duration;
2929
#[cfg(not(test))]
3030
pub const DEFAULT_REQUEST_TIMEOUT: Duration = Duration::from_millis(1500);
3131

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

src/test/harness.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,7 @@ impl Cache {
326326
ls_types::Position::new((src.line - 1) as u64, char_of_byte_index(&line, col) as u64)
327327
}
328328

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

0 commit comments

Comments
 (0)