Auto merge of #13566 - lnicola:therefor, r=lnicola

minor: Fix typos
This commit is contained in:
bors 2022-11-07 10:54:38 +00:00
commit 364820a296
7 changed files with 8 additions and 8 deletions

View file

@ -365,7 +365,7 @@ struct JodChild(GroupChild);
/// A handle to a cargo process used for fly-checking. /// A handle to a cargo process used for fly-checking.
struct CargoHandle { struct CargoHandle {
/// The handle to the actual cargo process. As we cannot cancel directly from with /// The handle to the actual cargo process. As we cannot cancel directly from with
/// a read syscall dropping and therefor terminating the process is our best option. /// a read syscall dropping and therefore terminating the process is our best option.
child: JodChild, child: JodChild,
thread: jod_thread::JoinHandle<io::Result<(bool, String)>>, thread: jod_thread::JoinHandle<io::Result<(bool, String)>>,
receiver: Receiver<CargoMessage>, receiver: Receiver<CargoMessage>,

View file

@ -814,7 +814,7 @@ impl<'a> InFile<&'a SyntaxNode> {
pub fn original_syntax_node(self, db: &dyn db::AstDatabase) -> Option<InFile<SyntaxNode>> { pub fn original_syntax_node(self, db: &dyn db::AstDatabase) -> Option<InFile<SyntaxNode>> {
// This kind of upmapping can only be achieved in attribute expanded files, // This kind of upmapping can only be achieved in attribute expanded files,
// as we don't have node inputs otherwise and therefor can't find an `N` node in the input // as we don't have node inputs otherwise and therefore can't find an `N` node in the input
if !self.file_id.is_macro() { if !self.file_id.is_macro() {
return Some(self.map(Clone::clone)); return Some(self.map(Clone::clone));
} else if !self.file_id.is_attr_macro(db) { } else if !self.file_id.is_attr_macro(db) {
@ -926,7 +926,7 @@ impl<N: AstNode> InFile<N> {
pub fn original_ast_node(self, db: &dyn db::AstDatabase) -> Option<InFile<N>> { pub fn original_ast_node(self, db: &dyn db::AstDatabase) -> Option<InFile<N>> {
// This kind of upmapping can only be achieved in attribute expanded files, // This kind of upmapping can only be achieved in attribute expanded files,
// as we don't have node inputs otherwise and therefor can't find an `N` node in the input // as we don't have node inputs otherwise and therefore can't find an `N` node in the input
if !self.file_id.is_macro() { if !self.file_id.is_macro() {
return Some(self); return Some(self);
} else if !self.file_id.is_attr_macro(db) { } else if !self.file_id.is_attr_macro(db) {

View file

@ -157,7 +157,7 @@ config_data! {
checkOnSave_noDefaultFeatures: Option<bool> = "null", checkOnSave_noDefaultFeatures: Option<bool> = "null",
/// Override the command rust-analyzer uses instead of `cargo check` for /// Override the command rust-analyzer uses instead of `cargo check` for
/// diagnostics on save. The command is required to output json and /// diagnostics on save. The command is required to output json and
/// should therefor include `--message-format=json` or a similar option. /// should therefore include `--message-format=json` or a similar option.
/// ///
/// If you're changing this because you're using some tool wrapping /// If you're changing this because you're using some tool wrapping
/// Cargo, you might also want to change /// Cargo, you might also want to change

View file

@ -42,7 +42,7 @@ impl LineEndings {
loop { loop {
let idx = match find_crlf(&tail[gap_len..]) { let idx = match find_crlf(&tail[gap_len..]) {
None if crlf_seen => tail.len(), None if crlf_seen => tail.len(),
// SAFETY: buf is unchanged and therefor still contains utf8 data // SAFETY: buf is unchanged and therefore still contains utf8 data
None => return (unsafe { String::from_utf8_unchecked(buf) }, LineEndings::Unix), None => return (unsafe { String::from_utf8_unchecked(buf) }, LineEndings::Unix),
Some(idx) => { Some(idx) => {
crlf_seen = true; crlf_seen = true;

View file

@ -86,7 +86,7 @@ fn generate_nodes(kinds: KindsSrc<'_>, grammar: &AstSrc) -> String {
.traits .traits
.iter() .iter()
.filter(|trait_name| { .filter(|trait_name| {
// Loops have two expressions so this might collide, therefor manual impl it // Loops have two expressions so this might collide, therefore manual impl it
node.name != "ForExpr" && node.name != "WhileExpr" node.name != "ForExpr" && node.name != "WhileExpr"
|| trait_name.as_str() != "HasLoopBody" || trait_name.as_str() != "HasLoopBody"
}) })

View file

@ -173,7 +173,7 @@ Whether to pass `--no-default-features` to Cargo. Defaults to
-- --
Override the command rust-analyzer uses instead of `cargo check` for Override the command rust-analyzer uses instead of `cargo check` for
diagnostics on save. The command is required to output json and diagnostics on save. The command is required to output json and
should therefor include `--message-format=json` or a similar option. should therefore include `--message-format=json` or a similar option.
If you're changing this because you're using some tool wrapping If you're changing this because you're using some tool wrapping
Cargo, you might also want to change Cargo, you might also want to change

View file

@ -623,7 +623,7 @@
] ]
}, },
"rust-analyzer.checkOnSave.overrideCommand": { "rust-analyzer.checkOnSave.overrideCommand": {
"markdownDescription": "Override the command rust-analyzer uses instead of `cargo check` for\ndiagnostics on save. The command is required to output json and\nshould therefor include `--message-format=json` or a similar option.\n\nIf you're changing this because you're using some tool wrapping\nCargo, you might also want to change\n`#rust-analyzer.cargo.buildScripts.overrideCommand#`.\n\nIf there are multiple linked projects, this command is invoked for\neach of them, with the working directory being the project root\n(i.e., the folder containing the `Cargo.toml`).\n\nAn example command would be:\n\n```bash\ncargo check --workspace --message-format=json --all-targets\n```\n.", "markdownDescription": "Override the command rust-analyzer uses instead of `cargo check` for\ndiagnostics on save. The command is required to output json and\nshould therefore include `--message-format=json` or a similar option.\n\nIf you're changing this because you're using some tool wrapping\nCargo, you might also want to change\n`#rust-analyzer.cargo.buildScripts.overrideCommand#`.\n\nIf there are multiple linked projects, this command is invoked for\neach of them, with the working directory being the project root\n(i.e., the folder containing the `Cargo.toml`).\n\nAn example command would be:\n\n```bash\ncargo check --workspace --message-format=json --all-targets\n```\n.",
"default": null, "default": null,
"type": [ "type": [
"null", "null",