Skip to content

Commit

Permalink
chore: Fix typos throughout code base (automatic)
Browse files Browse the repository at this point in the history
This is all the typos that `typos` is confident can just be fixed
automatically, minus the overrides added to the manifest for the false
positives I found.
  • Loading branch information
alerque authored and Myriad-Dreamin committed Nov 25, 2024
1 parent 3eee445 commit 6f4aba4
Show file tree
Hide file tree
Showing 28 changed files with 55 additions and 55 deletions.
2 changes: 1 addition & 1 deletion contrib/typlite/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ pub struct CompileArgs {
#[clap(flatten)]
pub compile: CompileOnceArgs,

/// Path to ouput file
/// Path to output file
#[clap(value_name = "OUTPUT")]
pub output: Option<String>,
}
Expand Down
2 changes: 1 addition & 1 deletion contrib/typst-preview/editors/vscode/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# [DEPRECATION NOTICE] Typst preivew extension has been integrated into [tinymist](https://github.com/Myriad-Dreamin/tinymist)
# [DEPRECATION NOTICE] Typst preview extension has been integrated into [tinymist](https://github.com/Myriad-Dreamin/tinymist)

We recommend all users migrate to tinymist for the following benefits:

Expand Down
2 changes: 1 addition & 1 deletion crates/sync-lsp/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ pub type LspResponseFuture<T> = LspResult<ResponseFuture<T>>;
pub type SchedulableResponse<T> = LspResponseFuture<LspResult<T>>;
/// The common future type for the language server.
pub type AnySchedulableResponse = SchedulableResponse<JsonValue>;
/// The result of a scheduled response which could be finally catched by
/// The result of a scheduled response which could be finally caught by
/// `schedule_tail`.
/// - Returns Ok(Some()) -> Already responded
/// - Returns Ok(None) -> Need to respond none
Expand Down
2 changes: 1 addition & 1 deletion crates/tinymist-query/src/analysis/bib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ Euclid2:
}

#[test]
fn yaml_bib_imcomplete() {
fn yaml_bib_incomplete() {
let content = r#"
Euclid:
type: article
Expand Down
2 changes: 1 addition & 1 deletion crates/tinymist-query/src/analysis/global.rs
Original file line number Diff line number Diff line change
Expand Up @@ -601,7 +601,7 @@ impl SharedContext {
}

/// Get the real definition of a compilation.
/// Note: must be called after compliation.
/// Note: must be called after compilation.
pub(crate) fn dependencies(&self) -> EcoVec<reflexo::ImmutPath> {
let mut v = EcoVec::new();
self.world.iter_dependencies(&mut |p| {
Expand Down
2 changes: 1 addition & 1 deletion crates/tinymist-query/src/code_action.rs
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ impl<'a> CodeActionWorker<'a> {
.ctx
.to_lsp_range(body_range.end..last_dollar.range().start, &self.current);

// Retrive punctuation to move
// Retrieve punctuation to move
let mark_after_equation = self
.current
.text()
Expand Down
2 changes: 1 addition & 1 deletion crates/tinymist-query/src/package.rs
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ pub fn list_package_by_namespace(
}
// namespace/package_name/version
// 2. package_name
let Some(package_names) = once_log(std::fs::read_dir(local_path), "read local pacakge")
let Some(package_names) = once_log(std::fs::read_dir(local_path), "read local package")
else {
continue;
};
Expand Down
6 changes: 3 additions & 3 deletions crates/tinymist-query/src/syntax/expr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -489,11 +489,11 @@ impl<'a> ExprWorker<'a> {
Decl::spread(s.span()).into()
};

let spreaded = Pattern::Expr(this.check(s.expr())).into();
let spread = Pattern::Expr(this.check(s.expr())).into();
if inputs.is_empty() {
spread_left = Some((decl.clone(), spreaded));
spread_left = Some((decl.clone(), spread));
} else {
spread_right = Some((decl.clone(), spreaded));
spread_right = Some((decl.clone(), spread));
}

this.resolve_as(Decl::as_def(&decl, None));
Expand Down
4 changes: 2 additions & 2 deletions crates/tinymist-query/src/syntax/matcher.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ impl<'a> DecenderItem<'a> {
}

/// Find the decender nodes starting from the given position.
pub fn node_decenders<T>(
pub fn node_descenders<T>(
node: LinkedNode,
mut recv: impl FnMut(DecenderItem) -> Option<T>,
) -> Option<T> {
Expand Down Expand Up @@ -99,7 +99,7 @@ pub fn descending_decls<T>(
node: LinkedNode,
mut recv: impl FnMut(DescentDecl) -> Option<T>,
) -> Option<T> {
node_decenders(node, |node| {
node_descenders(node, |node| {
match (&node, node.node().cast::<ast::Expr>()?) {
(DecenderItem::Sibling(..), ast::Expr::Let(lb)) => {
for ident in lb.kind().bindings() {
Expand Down
2 changes: 1 addition & 1 deletion crates/tinymist-render/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ impl PeriscopeRenderer {
doc: VersionedDocument,
pos: FramePosition,
) -> Option<(String, f32, f32)> {
// todo: svg viewer compablity
// todo: svg viewer compatibility
type UsingExporter = SvgExporter<PeriscopeExportFeature>;
let mut doc = UsingExporter::svg_doc(&doc.document);
doc.module.prepare_glyphs();
Expand Down
16 changes: 8 additions & 8 deletions crates/tinymist/src/cmd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ struct QueryOpts {

#[derive(Debug, Clone, Default, Deserialize)]
#[serde(rename_all = "camelCase")]
struct HiglightRangeOpts {
struct HighlightRangeOpts {
range: Option<Range>,
}

Expand Down Expand Up @@ -175,7 +175,7 @@ impl LanguageState {
/// Export a range of the current document as Ansi highlighted text.
pub fn export_ansi_hl(&mut self, mut args: Vec<JsonValue>) -> AnySchedulableResponse {
let path = get_arg!(args[0] as PathBuf);
let opts = get_arg_or_default!(args[1] as HiglightRangeOpts);
let opts = get_arg_or_default!(args[1] as HighlightRangeOpts);

let s = self
.query_source(path.into(), Ok)
Expand Down Expand Up @@ -211,8 +211,8 @@ impl LanguageState {
/// Clear all cached resources.
pub fn clear_cache(&mut self, _arguments: Vec<JsonValue>) -> AnySchedulableResponse {
comemo::evict(0);
for ded in self.servers_mut() {
ded.clear_cache();
for dead in self.servers_mut() {
dead.clear_cache();
}
just_ok(JsonValue::Null)
}
Expand Down Expand Up @@ -504,7 +504,7 @@ impl LanguageState {
run_query!(req_id, self.DocumentMetrics(path))
}

/// Get all syntatic labels in workspace.
/// Get all syntactic labels in workspace.
pub fn get_workspace_labels(
&mut self,
req_id: RequestId,
Expand Down Expand Up @@ -541,7 +541,7 @@ impl LanguageState {
Err(method_not_found())
}

/// Get directory of pacakges
/// Get directory of packages
pub fn resource_package_dirs(&mut self, _arguments: Vec<JsonValue>) -> AnySchedulableResponse {
let snap = self.primary().snapshot().map_err(z_internal_error)?;
just_future(async move {
Expand All @@ -551,7 +551,7 @@ impl LanguageState {
})
}

/// Get writable directory of pacakges
/// Get writable directory of packages
pub fn resource_local_package_dir(
&mut self,
_arguments: Vec<JsonValue>,
Expand All @@ -569,7 +569,7 @@ impl LanguageState {
})
}

/// Get writable directory of pacakges
/// Get writable directory of packages
pub fn resource_package_by_ns(
&mut self,
mut arguments: Vec<JsonValue>,
Expand Down
2 changes: 1 addition & 1 deletion crates/tinymist/src/task/user_action.rs
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ pub async fn make_http_server(
// final_tx.send(()).ok();

tokio::spawn(async move {
// timemout alive_rx
// timeout alive_rx
loop {
tokio::select! {
_ = tokio::signal::ctrl_c() => {
Expand Down
2 changes: 1 addition & 1 deletion crates/tinymist/src/tool/preview.rs
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@ impl PreviewState {
// The fence must be put after the previewer is initialized.
compile_handler.flush_compile();

// Relace the data plane port in the html to self
// Replace the data plane port in the html to self
let frontend_html = frontend_html(TYPST_PREVIEW_HTML, args.preview_mode, "/");

let srv = make_http_server(frontend_html, args.data_plane_host, websocket_tx).await;
Expand Down
2 changes: 1 addition & 1 deletion docs/tinymist/feature/preview.typ
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Two ways of previewing a Typst document are provided:
- PDF Preview: let lsp export your PDF on typed, and open related PDF by your favorite PDF viewer.
- Web (SVG) Preview: use builtin preview feature.

Whenever you can get a web preview feature, it is recomended since it is much faster than PDF preview and provides bidirectional navigation feature, allowing jumping between the source code and the preview by clicking or lsp commands.
Whenever you can get a web preview feature, it is recommended since it is much faster than PDF preview and provides bidirectional navigation feature, allowing jumping between the source code and the preview by clicking or lsp commands.

== PDF Preview

Expand Down
4 changes: 2 additions & 2 deletions docs/tinymist/frontend/vscode.typ
Original file line number Diff line number Diff line change
Expand Up @@ -164,8 +164,8 @@ Supported arguments:
- entry file: The last string in the array will be treated as the entry file.
- This is used to specify the *default* entry file for the compiler, which may be overridden by other settings.
- `--input`: Add a string key-value pair visible through `sys.inputs`.
- `--font-path` (environment variable: `TYPST_FONT_PATHS`), Font paths, maybe overriden by `tinymist.fontPaths`.
- `--ignore-system-fonts`: Ensures system fonts won’t be searched, maybe overriden by `tinymist.systemFonts`.
- `--font-path` (environment variable: `TYPST_FONT_PATHS`), Font paths, maybe overridden by `tinymist.fontPaths`.
- `--ignore-system-fonts`: Ensures system fonts won’t be searched, maybe overridden by `tinymist.systemFonts`.
- `--creation-timestamp` (environment variable: `SOURCE_DATE_EPOCH`): The document’s creation date formatted as a #link("https://reproducible-builds.org/specs/source-date-epoch/")[UNIX timestamp];.
- `--cert` (environment variable: `TYPST_CERT`): Path to CA certificate file for network access, especially for downloading typst packages.

Expand Down
2 changes: 1 addition & 1 deletion docs/tinymist/guide/completion.typ
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ LSP will serve completion if you enter _trigger characters_ in the editor. Curre
If ```js Ctrl+Space``` doesn't work, please check your IME settings or keybindings.
]

When an item is selected, it will be commited if some character is typed.
When an item is selected, it will be committed if some character is typed.
1. press ```js Esc``` to avoid commit.
1. press ```js Enter``` to commit one.
2. press ```js '.'``` to commit one for those that can interact with the dot operator.
Expand Down
2 changes: 1 addition & 1 deletion docs/tinymist/inputs.typ
Original file line number Diff line number Diff line change
Expand Up @@ -103,4 +103,4 @@ This is handled by tinymist by some tricks.

=== Record and Replay

Tinymist can record these input events with assigned the logic ticks. By replaying the events, tinymist can reproduce the server state for debugging. This technique is learnt from the well-known LSP, clangd, and the well known emulator, QEMU.
Tinymist can record these input events with assigned the logic ticks. By replaying the events, tinymist can reproduce the server state for debugging. This technique is learned from the well-known LSP, clangd, and the well known emulator, QEMU.
8 changes: 4 additions & 4 deletions docs/tinymist/module/query.typ
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#import "mod.typ": *

#show: book-page.with(title: "Tinymist Languague Queries")
#show: book-page.with(title: "Tinymist Language Queries")

== Base Analyses

Expand All @@ -27,7 +27,7 @@ There are seven basic analyzers:
node-stroke: 1pt,
edge-stroke: 1pt,
// edge("-|>", align(center)[Analysis\ Request], label-pos: 0.1),
pg-node((0.3, 0.2), [`Lexical`\ `Heirarchy`]),
pg-node((0.3, 0.2), [`Lexical`\ `Hierarchy`]),
edge("<|-", []),
pg-node((1.2, 0), [`Source`]),
edge("-|>", []),
Expand All @@ -50,7 +50,7 @@ There are seven basic analyzers:
let j = 1 + i * 0.25;
edge((j, 1.4), (j, 1.8), "-|>")
},
pg-node((2, 2.3), [`Extented`\
pg-node((2, 2.3), [`Extended`\
`Language Features`]),
// for i in (1, 3, 5) {
// edge((i, 0), (i, -0.5), (5.5, -0.5), (5.6, 0), "-|>")
Expand Down Expand Up @@ -104,7 +104,7 @@ Typicial language features are implemented based on basic analyzers:

- The `textDocument/prepareRename` _finds definition_ and determines whether it can be renamed.

- The `textDocument/rename` _finds defintion and references_ and renamed them all.
- The `textDocument/rename` _finds definition and references_ and renamed them all.

== Contributing

Expand Down
2 changes: 1 addition & 1 deletion editors/vscode/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -843,7 +843,7 @@ These bugs are introduced by [Preparing for parallelizing lsp requests](https://
### Misc

* Bumped to typstyle v0.11.14 by @Enter-tainer in https://github.com/Myriad-Dreamin/tinymist/pull/200
* Preferring less uses of `analzer_expr` during definition analysis in https://github.com/Myriad-Dreamin/tinymist/pull/192
* Preferring less uses of `analyzer_expr` during definition analysis in https://github.com/Myriad-Dreamin/tinymist/pull/192

**Full Changelog**: https://github.com/Myriad-Dreamin/tinymist/compare/v0.11.4...v0.11.5

Expand Down
4 changes: 2 additions & 2 deletions editors/vscode/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -164,8 +164,8 @@ Supported arguments:
- entry file: The last string in the array will be treated as the entry file.
- This is used to specify the **default** entry file for the compiler, which may be overridden by other settings.
- `--input`: Add a string key-value pair visible through `sys.inputs`.
- `--font-path` (environment variable: `TYPST_FONT_PATHS`), Font paths, maybe overriden by `tinymist.fontPaths`.
- `--ignore-system-fonts`: Ensures system fonts won’t be searched, maybe overriden by `tinymist.systemFonts`.
- `--font-path` (environment variable: `TYPST_FONT_PATHS`), Font paths, maybe overridden by `tinymist.fontPaths`.
- `--ignore-system-fonts`: Ensures system fonts won’t be searched, maybe overridden by `tinymist.systemFonts`.
- `--creation-timestamp` (environment variable: `SOURCE_DATE_EPOCH`): The document’s creation date formatted as a [UNIX timestamp](https://reproducible-builds.org/specs/source-date-epoch/).
- `--cert` (environment variable: `TYPST_CERT`): Path to CA certificate file for network access, especially for downloading typst packages.

Expand Down
2 changes: 1 addition & 1 deletion editors/vscode/src/test/e2e/simple-docs.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ export async function getTests(ctx: Context) {
edit.replace(new vscode.Range(0, 0, 0, 0), largeDoc0);
});
await ctx.timeout(400);
// We add non-atomical edit to test lagged diagnostics
// We add non-atomic edit to test lagged diagnostics
return await mainTyp.edit((edit) => {
edit.replace(new vscode.Range(0, 0, 0, largeDoc0.length), largeDoc);
});
Expand Down
6 changes: 3 additions & 3 deletions tools/editor-tools/src/features/summary.ts
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ export const Summary = () => {
style:
"height: calc(100% - 20px); box-sizing: border-box; padding-top: 4px",
},
fontsExportPannel({
fontsExportPanel({
fonts: docMetrics.val.fontInfo,
sources: docMetrics.val.spanInfo.sources,
})
Expand Down Expand Up @@ -302,7 +302,7 @@ export const Summary = () => {
);
};

interface fontsExportPannelProps {
interface fontsExportPanelProps {
fonts: FontInfo[];
sources: FontSource[];
}
Expand Down Expand Up @@ -457,7 +457,7 @@ export const fontsExportDefaultConfigure: fontsExportConfigure = {

let savedConfigureData = `:[[preview:FontsExportConfigure]]:`;

const fontsExportPannel = ({ fonts, sources }: fontsExportPannelProps) => {
const fontsExportPanel = ({ fonts, sources }: fontsExportPanelProps) => {
const savedConfigure: fontsExportConfigure = savedConfigureData.startsWith(
":"
)
Expand Down
10 changes: 5 additions & 5 deletions tools/typst-dom/src/typst-doc.svg.mts
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,7 @@ export function provideSvgDoc<
const INNER_RECT_UNIT = 100;
const INNER_RECT_SCALE = "scale(0.01)";

/// Caclulate width
/// Calculate width
let maxWidth = 0;

interface SvgPage {
Expand Down Expand Up @@ -543,12 +543,12 @@ export function provideSvgDoc<
);
pageNumberIndicator.setAttribute("x", "0");
pageNumberIndicator.setAttribute("y", "0");
const pnPaddedX = calculatedPaddedX + pageWidth / 2;
const pnPaddedY =
const onPaddedX = calculatedPaddedX + pageWidth / 2;
const onPaddedY =
calculatedPaddedY + pageHeight + heightMargin + fontSize / 2;
pageNumberIndicator.setAttribute(
"transform",
`translate(${pnPaddedX}, ${pnPaddedY})`
`translate(${onPaddedX}, ${onPaddedY})`
);
pageNumberIndicator.setAttribute("font-size", fontSize.toString());
pageNumberIndicator.textContent = `${i + 1}`;
Expand Down Expand Up @@ -616,7 +616,7 @@ export function provideSvgDoc<

console.assert(
this.canvasRenderCToken === undefined,
"Noo!!: canvasRenderCToken should be undefined"
"No!!: canvasRenderCToken should be undefined"
);

const tok = (this.canvasRenderCToken = new TypstCancellationToken());
Expand Down
2 changes: 1 addition & 1 deletion tools/typst-dom/src/typst-outline.mts
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ function patchOutlineChildren(ctx: GenContext, prev: Element, next: Element) {
const [targetView, toPatch] = interpretTargetView<Element>(
prev.children as unknown as Element[],
next.children as unknown as Element[],
// todo: accurate calcuation
// todo: accurate calculation
false
);

Expand Down
4 changes: 2 additions & 2 deletions tools/typst-dom/src/typst-patch.svg.mts
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ function preReplaceNonSVGElements(
}

function postReplaceNonSVGElements(prev: Element, frozen: FrozenReplacement) {
/// Retrive the `<g>` elements from the `prev` element.
/// Retrieve the `<g>` elements from the `prev` element.
const gElements = Array.from(prev.children).filter(isGElem);
if (gElements.length + 1 !== frozen.inserts.length) {
throw new Error(`invalid frozen replacement: gElements.length (${gElements.length
Expand Down Expand Up @@ -174,7 +174,7 @@ function initOrPatchSvgHeader(svg: SVGElement) {
resourceHeader.append(svg.firstElementChild!);
}

/// Insert resource header to somewhere visble to the svg element.
/// Insert resource header to somewhere visible to the svg element.
document.body.prepend(resourceHeader);
}

Expand Down
Loading

0 comments on commit 6f4aba4

Please sign in to comment.