1
1
mirror of https://github.com/oxalica/nil.git synced 2024-11-21 15:56:00 +03:00

Mass fix typos with typos

This commit is contained in:
oxalica 2023-08-06 22:20:45 +08:00
parent 175c791e62
commit 565472e8ae
16 changed files with 29 additions and 20 deletions

View File

@ -2,7 +2,7 @@
//! It locates uncessary or inaccessible bindings and expressions, based on name resolution.
//!
//! Our goals are,
//! - Applicatable.
//! - Applicable.
//! Removing ALL unused items will work and be semantically identical.
//! - Closed.
//! If there is an unused binding, it either has no references,

View File

@ -66,7 +66,7 @@ impl LowerCtx<'_> {
if let Some(expr) = expr {
return self.lower_expr(expr);
}
// Synthetic syntax has no coresponding text.
// Synthetic syntax has no corresponding text.
self.module.exprs.alloc(Expr::Missing)
}

View File

@ -226,7 +226,7 @@ pub struct NameResolution {
// `None` value for unresolved names.
resolve_map: HashMap<ExprId, Option<ResolveResult>>,
// All names from the common pattern `inherit (builtins) ...`.
// This is used for tracking builtins names even through alising.
// This is used for tracking builtins names even through aliasing.
inherited_builtins: HashSet<NameId>,
}

View File

@ -17,7 +17,7 @@ stdenv.mkDerivation {
let (mut db, file) = TestDB::single_file(src).unwrap();
let module = db.module(file);
for (before, after) in [("comment", "editted cmt"), (";", " ; \n ")] {
for (before, after) in [("comment", "edited cmt"), (";", " ; \n ")] {
let new_src = src.replace(before, after);
assert_ne!(src, new_src);
db.set_file_content(file, new_src.into());

View File

@ -1,5 +1,5 @@
//! Flatten binding with Attrset RHS into multiple bindings of outer level.
//! FIXME: Indentations are not reformated well.
//! FIXME: Indentations are not reformatted well.
//!
//! ```nix
//! {

View File

@ -152,14 +152,14 @@ mod tests {
fixture: &str,
expect: Expect,
) {
let got = try_apply_assist(handler, fixture).expect("Not applicatable");
let got = try_apply_assist(handler, fixture).expect("Not applicable");
expect.assert_eq(&got);
}
#[track_caller]
pub(crate) fn check_assist_no(handler: fn(&mut AssistsCtx) -> Option<()>, fixture: &str) {
if let Some(got) = try_apply_assist(handler, fixture) {
panic!("Unexpected applicatable:\n{got}");
panic!("Unexpected applicable:\n{got}");
}
}
}

View File

@ -1,5 +1,5 @@
//! Pack multiple bindings with the same prefix into nested one.
//! FIXME: Indentations are not reformated well.
//! FIXME: Indentations are not reformatted well.
//!
//! ```nix
//! {

View File

@ -202,7 +202,7 @@ fn complete_expr(
.map(|kw| keyword_to_completion(kw, source_range))
.for_each(&mut feed);
// Contectual keywords.
// Contextual keywords.
if ref_node
.syntax()
.ancestors()
@ -298,7 +298,7 @@ fn complete_attrpath(
}
// We are inside the first Attr of a Let.
// Completes all static names in the same `Let` for splited definition.
// Completes all static names in the same `Let` for split definition.
// ```nix
// let
// foo.bar = 42;

View File

@ -187,7 +187,7 @@ fn main_parse(args: ParseArgs) {
#[derive(Debug, FromArgs)]
#[argh(subcommand, name = "ssr")]
/// Search structural patterns and optionaly replace them.
/// Search structural patterns and optionally replace them.
/// WARNING: This functionality is experimental.
struct SsrArgs {
/// nix file to check, or read from stdin for `-`.

View File

@ -303,7 +303,7 @@ impl Server {
fn on_did_close(&mut self, params: DidCloseTextDocumentParams) -> NotifyResult {
// N.B. Don't clear text here.
// `DidCloseTextDocument` means the client ends its maintainance to a file but
// `DidCloseTextDocument` means the client ends its maintenance to a file but
// not deletes it.
self.opened_files.remove(&params.text_document.uri);

View File

@ -1,6 +1,6 @@
[package]
name = "ssr"
description = "Structual search and replace"
description = "Structural search and replace"
version.workspace = true
edition.workspace = true
license.workspace = true

View File

@ -183,7 +183,7 @@ impl<'i> Parser<'i> {
}
}
/// Expect the termination of an experssion by a followed `guard` token.
/// Expect the termination of an expression by a followed `guard` token.
/// Return whether the expected token is consumed.
fn require_expr_end(&mut self, guard: SyntaxKind) -> bool {
if matches!(self.peek_non_ws(), Some(k) if k == guard) {
@ -192,7 +192,7 @@ impl<'i> Parser<'i> {
}
self.error(ErrorKind::ExpectToken(guard));
// Try to consume more experssions as recovery.
// Try to consume more expressions as recovery.
loop {
match self.peek_non_ws() {
Some(k) if k == guard => {
@ -675,7 +675,7 @@ impl<'i> Parser<'i> {
self.want(T![;]);
self.finish_node();
}
// Ensure we always consume somthing in the loop!
// Ensure we always consume something in the loop!
Some(k) if k.can_start_attr() => {
self.start_node(ATTR_PATH_VALUE);
self.attrpath_opt();

View File

@ -43,7 +43,7 @@ it is allowed to have recursive references (but may not be infinite recursion).
### `flatten_attrset`
Flatten binding with Attrset RHS into multiple bindings of outer level.
FIXME: Indentations are not reformated well.
FIXME: Indentations are not reformatted well.
```nix
{
@ -64,7 +64,7 @@ foo.baz = 2;
### `pack_bindings`
Pack multiple bindings with the same prefix into nested one.
FIXME: Indentations are not reformated well.
FIXME: Indentations are not reformatted well.
```nix
{

View File

@ -59,7 +59,7 @@ Default configuration:
// Auto-archiving behavior which may use network.
//
// - null: Ask every time.
// - true: Automaticaly run `nix flake archive` when necessary.
// - true: Automatically run `nix flake archive` when necessary.
// - false: Do not archive. Only load inputs that are already on disk.
// Type: null | boolean
// Example: true

View File

@ -47,7 +47,7 @@ This incomplete list tracks noteble features currently implemented or planned.
- [x] Syntax errors.
- [x] Hard semantic errors reported as parse errors by Nix, like duplicated keys in attrsets.
- [x] Undefiend names.
- [x] Undefined names.
- [x] Warnings of legacy syntax.
- [x] Warnings of unnecessary syntax.
- [x] Warnings of unused bindings, `with` and `rec`.

9
typos.toml Normal file
View File

@ -0,0 +1,9 @@
[files]
extend-exclude = [
"crates/syntax/test_data",
]
[default.extend-words]
froms = "froms"
regist = "regist" # coc.nvim `registLanguageClient`
withs = "withs"