From e856906f766aa6d58aba6f6bca9e2e1879b1629d Mon Sep 17 00:00:00 2001 From: Daniel Sedlak Date: Fri, 7 Apr 2023 17:10:38 +0200 Subject: Fix typos (#6643) --- helix-lsp/src/client.rs | 14 +++++++------- helix-lsp/src/lib.rs | 6 +++--- helix-lsp/src/snippet.rs | 12 ++++++------ 3 files changed, 16 insertions(+), 16 deletions(-) (limited to 'helix-lsp') diff --git a/helix-lsp/src/client.rs b/helix-lsp/src/client.rs index 29a67988..93e822c4 100644 --- a/helix-lsp/src/client.rs +++ b/helix-lsp/src/client.rs @@ -52,8 +52,8 @@ pub struct Client { root_path: std::path::PathBuf, root_uri: Option, workspace_folders: Mutex>, - initalize_notify: Arc, - /// workspace folders added while the server is still initalizing + initialize_notify: Arc, + /// workspace folders added while the server is still initializing req_timeout: u64, } @@ -92,14 +92,14 @@ impl Client { return true; } - // this server definitly doesn't support multiple workspace, no need to check capabilities + // this server definitely doesn't support multiple workspace, no need to check capabilities if !may_support_workspace { return false; } let Some(capabilities) = self.capabilities.get() else { let client = Arc::clone(self); - // initalization hasn't finished yet, deal with this new root later + // initialization hasn't finished yet, deal with this new root later // TODO: In the edgecase that a **new root** is added // for an LSP that **doesn't support workspace_folders** before initaliation is finished // the new roots are ignored. @@ -108,7 +108,7 @@ impl Client { // documents LSP client handle. It's doable but a pretty weird edgecase so let's // wait and see if anyone ever runs into it. tokio::spawn(async move { - client.initalize_notify.notified().await; + client.initialize_notify.notified().await; if let Some(workspace_folders_caps) = client .capabilities() .workspace @@ -234,7 +234,7 @@ impl Client { root_path, root_uri, workspace_folders: Mutex::new(workspace_folders), - initalize_notify: initialize_notify.clone(), + initialize_notify: initialize_notify.clone(), }; Ok((client, server_rx, initialize_notify)) @@ -279,7 +279,7 @@ impl Client { "utf-16" => Some(OffsetEncoding::Utf16), "utf-32" => Some(OffsetEncoding::Utf32), encoding => { - log::error!("Server provided invalid position encording {encoding}, defaulting to utf-16"); + log::error!("Server provided invalid position encoding {encoding}, defaulting to utf-16"); None }, }) diff --git a/helix-lsp/src/lib.rs b/helix-lsp/src/lib.rs index a59fa31e..31ee1d75 100644 --- a/helix-lsp/src/lib.rs +++ b/helix-lsp/src/lib.rs @@ -152,10 +152,10 @@ pub mod util { // > ‘\n’, ‘\r\n’ and ‘\r’. Positions are line end character agnostic. // > So you can not specify a position that denotes \r|\n or \n| where | represents the character offset. // - // This means that while the line must be in bounds the `charater` + // This means that while the line must be in bounds the `character` // must be capped to the end of the line. // Note that the end of the line here is **before** the line terminator - // so we must use `line_end_char_index` istead of `doc.line_to_char(pos_line + 1)` + // so we must use `line_end_char_index` instead of `doc.line_to_char(pos_line + 1)` // // FIXME: Helix does not fully comply with the LSP spec for line terminators. // The LSP standard requires that line terminators are ['\n', '\r\n', '\r']. @@ -893,7 +893,7 @@ fn start_client( /// * if the file is outside `workspace` return `None` /// * start at `file` and search the file tree upward /// * stop the search at the first `root_dirs` entry that contains `file` -/// * if no `root_dirs` matchs `file` stop at workspace +/// * if no `root_dirs` matches `file` stop at workspace /// * Returns the top most directory that contains a `root_marker` /// * If no root marker and we stopped at a `root_dirs` entry, return the directory we stopped at /// * If we stopped at `workspace` instead and `workspace_is_cwd == false` return `None` diff --git a/helix-lsp/src/snippet.rs b/helix-lsp/src/snippet.rs index a4f049e8..ebf3da24 100644 --- a/helix-lsp/src/snippet.rs +++ b/helix-lsp/src/snippet.rs @@ -61,7 +61,7 @@ fn render_elements( offset: &mut usize, tabstops: &mut Vec<(usize, (usize, usize))>, newline_with_offset: &str, - include_placeholer: bool, + include_placeholder: bool, ) { use SnippetElement::*; @@ -89,7 +89,7 @@ fn render_elements( offset, tabstops, newline_with_offset, - include_placeholer, + include_placeholder, ); } &Tabstop { tabstop } => { @@ -100,14 +100,14 @@ fn render_elements( value: inner_snippet_elements, } => { let start_offset = *offset; - if include_placeholer { + if include_placeholder { render_elements( inner_snippet_elements, insert, offset, tabstops, newline_with_offset, - include_placeholer, + include_placeholder, ); } tabstops.push((*tabstop, (start_offset, *offset))); @@ -127,7 +127,7 @@ fn render_elements( pub fn render( snippet: &Snippet<'_>, newline_with_offset: &str, - include_placeholer: bool, + include_placeholder: bool, ) -> (Tendril, Vec>) { let mut insert = Tendril::new(); let mut tabstops = Vec::new(); @@ -139,7 +139,7 @@ pub fn render( &mut offset, &mut tabstops, newline_with_offset, - include_placeholer, + include_placeholder, ); // sort in ascending order (except for 0, which should always be the last one (per lsp doc)) -- cgit v1.2.3-70-g09d2