diff options
Diffstat (limited to 'cli/lsp')
-rw-r--r-- | cli/lsp/documents.rs | 2 | ||||
-rw-r--r-- | cli/lsp/language_server.rs | 2 | ||||
-rw-r--r-- | cli/lsp/path_to_regex.rs | 4 | ||||
-rw-r--r-- | cli/lsp/registries.rs | 24 | ||||
-rw-r--r-- | cli/lsp/tsc.rs | 4 |
5 files changed, 18 insertions, 18 deletions
diff --git a/cli/lsp/documents.rs b/cli/lsp/documents.rs index cd2ea9295..43e192517 100644 --- a/cli/lsp/documents.rs +++ b/cli/lsp/documents.rs @@ -1808,7 +1808,7 @@ impl Iterator for PreloadDocumentFinder { } } -/// Removes any directorys that are a descendant of another directory in the collection. +/// Removes any directories that are a descendant of another directory in the collection. fn sort_and_remove_non_leaf_dirs(mut dirs: Vec<PathBuf>) -> Vec<PathBuf> { if dirs.is_empty() { return dirs; diff --git a/cli/lsp/language_server.rs b/cli/lsp/language_server.rs index 2ac9ec3c0..9abdade27 100644 --- a/cli/lsp/language_server.rs +++ b/cli/lsp/language_server.rs @@ -1374,7 +1374,7 @@ impl Inner { } self.recreate_npm_services_if_necessary().await; - self.assets.intitialize(self.snapshot()).await; + self.assets.initialize(self.snapshot()).await; self.performance.measure(mark); Ok(InitializeResult { diff --git a/cli/lsp/path_to_regex.rs b/cli/lsp/path_to_regex.rs index 01dbc0287..9fc05067f 100644 --- a/cli/lsp/path_to_regex.rs +++ b/cli/lsp/path_to_regex.rs @@ -626,7 +626,7 @@ pub fn tokens_to_regex( route.push('$'); } } else { - let is_end_deliminated = match maybe_end_token { + let is_end_delimited = match maybe_end_token { Some(Token::String(mut s)) => { if let Some(c) = s.pop() { delimiter.contains(c) @@ -642,7 +642,7 @@ pub fn tokens_to_regex( write!(route, r"(?:{delimiter}(?={ends_with}))?").unwrap(); } - if !is_end_deliminated { + if !is_end_delimited { write!(route, r"(?={delimiter}|{ends_with})").unwrap(); } } diff --git a/cli/lsp/registries.rs b/cli/lsp/registries.rs index f683fa588..e4501c903 100644 --- a/cli/lsp/registries.rs +++ b/cli/lsp/registries.rs @@ -74,7 +74,7 @@ fn base_url(url: &Url) -> String { } #[derive(Debug)] -enum CompletorType { +enum CompletionType { Literal(String), Key { key: Key, @@ -85,25 +85,25 @@ enum CompletorType { /// Determine if a completion at a given offset is a string literal or a key/ /// variable. -fn get_completor_type( +fn get_completion_type( offset: usize, tokens: &[Token], match_result: &MatchResult, -) -> Option<CompletorType> { +) -> Option<CompletionType> { let mut len = 0_usize; for (index, token) in tokens.iter().enumerate() { match token { Token::String(s) => { len += s.chars().count(); if offset < len { - return Some(CompletorType::Literal(s.clone())); + return Some(CompletionType::Literal(s.clone())); } } Token::Key(k) => { if let Some(prefix) = &k.prefix { len += prefix.chars().count(); if offset < len { - return Some(CompletorType::Key { + return Some(CompletionType::Key { key: k.clone(), prefix: Some(prefix.clone()), index, @@ -120,7 +120,7 @@ fn get_completor_type( .unwrap_or_default(); len += value.chars().count(); if offset <= len { - return Some(CompletorType::Key { + return Some(CompletionType::Key { key: k.clone(), prefix: None, index, @@ -130,7 +130,7 @@ fn get_completor_type( if let Some(suffix) = &k.suffix { len += suffix.chars().count(); if offset <= len { - return Some(CompletorType::Literal(suffix.clone())); + return Some(CompletionType::Literal(suffix.clone())); } } } @@ -688,17 +688,17 @@ impl ModuleRegistry { .ok()?; if let Some(match_result) = matcher.matches(path) { did_match = true; - let completor_type = - get_completor_type(path_offset, &tokens, &match_result); - match completor_type { - Some(CompletorType::Literal(s)) => self.complete_literal( + let completion_type = + get_completion_type(path_offset, &tokens, &match_result); + match completion_type { + Some(CompletionType::Literal(s)) => self.complete_literal( s, &mut completions, current_specifier, offset, range, ), - Some(CompletorType::Key { key, prefix, index }) => { + Some(CompletionType::Key { key, prefix, index }) => { let maybe_url = registry.get_url_for_key(&key); if let Some(url) = maybe_url { if let Some(items) = self diff --git a/cli/lsp/tsc.rs b/cli/lsp/tsc.rs index 66687789b..20edf31d9 100644 --- a/cli/lsp/tsc.rs +++ b/cli/lsp/tsc.rs @@ -650,7 +650,7 @@ impl Assets { } /// Initializes with the assets in the isolate. - pub async fn intitialize(&self, state_snapshot: Arc<StateSnapshot>) { + pub async fn initialize(&self, state_snapshot: Arc<StateSnapshot>) { let assets = get_isolate_assets(&self.ts_server, state_snapshot).await; let mut assets_map = self.assets.lock(); for asset in assets { @@ -4737,7 +4737,7 @@ mod tests { } #[test] - fn include_supress_inlay_hit_settings() { + fn include_suppress_inlay_hit_settings() { let mut settings = WorkspaceSettings::default(); settings .inlay_hints |