From ebed95cbcdc0391ac1687c9ab8c10e8791e11a6e Mon Sep 17 00:00:00 2001 From: QuarticCat Date: Wed, 10 Apr 2024 11:34:18 +0800 Subject: [PATCH] fix: improve release profile & fix typos (#177) * dev: split a gh-release profile to accelerate development * fix: many typos * fix: miri warnings * fix: update fixtures --- .github/workflows/release.yml | 32 ++++---- .vscode/launch.json | 76 +++++++++++++++++++ Cargo.toml | 8 +- crates/tinymist-query/src/analysis/global.rs | 16 ++-- crates/tinymist-query/src/completion.rs | 1 - crates/tinymist-query/src/diagnostics.rs | 2 +- ...pression.typ => incomplete-expression.typ} | 0 ...p => smart@incomplete-expression.typ.snap} | 2 +- crates/tinymist-query/src/goto_declaration.rs | 3 +- crates/tinymist-query/src/goto_definition.rs | 3 +- crates/tinymist-query/src/lib.rs | 20 ++--- .../tinymist-query/src/lsp_typst_boundary.rs | 2 - crates/tinymist-query/src/syntax/import.rs | 2 +- crates/tinymist-query/src/syntax/module.rs | 2 +- crates/tinymist-query/src/tests.rs | 4 +- crates/tinymist/src/actor/typ_client.rs | 22 +++--- crates/tinymist/src/harness.rs | 2 +- editors/neovim/README.md | 2 +- syntaxes/textmate/main.ts | 4 +- .../src/features/symbol-picker.ts | 4 +- tools/editor-tools/src/main.ts | 2 +- yarn.lock | 21 ++++- 22 files changed, 159 insertions(+), 71 deletions(-) rename crates/tinymist-query/src/fixtures/inlay_hints/{imcomplete-expression.typ => incomplete-expression.typ} (100%) rename crates/tinymist-query/src/fixtures/inlay_hints/snaps/{smart@imcomplete-expression.typ.snap => smart@incomplete-expression.typ.snap} (68%) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 52c84e25..0c5ee0f5 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -114,53 +114,53 @@ jobs: - name: Build tinymist binary shell: pwsh run: | - cargo build --release -p tinymist --target ${{ matrix.rust-target }} + cargo build --profile=gh-release -p tinymist --target ${{ matrix.rust-target }} if: startsWith(github.ref, 'refs/tags/') || matrix.regular_build == 'true' - name: Rename debug symbols for windows if: matrix.platform == 'win32' && (startsWith(github.ref, 'refs/tags/') || matrix.regular_build == 'true') run: | - cd target/${{ matrix.rust-target }}/release + cd target/${{ matrix.rust-target }}/gh-release cp tinymist.pdb tinymist-${{ env.target }}.pdb - name: Split debug symbols for linux if: matrix.platform == 'linux' && (startsWith(github.ref, 'refs/tags/') || matrix.regular_build == 'true') run: | - cd target/${{ matrix.rust-target }}/release + cd target/${{ matrix.rust-target }}/gh-release llvm-objcopy --compress-debug-sections --only-keep-debug "tinymist" "tinymist-${{ env.target }}.debug" llvm-objcopy --strip-debug --add-gnu-debuglink="tinymist-${{ env.target }}.debug" "tinymist" - name: Collect debug symbols for mac if: matrix.platform == 'darwin' && (startsWith(github.ref, 'refs/tags/') || matrix.regular_build == 'true') run: | - dsymutil -f "target/${{ matrix.rust-target }}/release/tinymist" - mv "target/${{ matrix.rust-target }}/release/tinymist.dwarf" "target/${{ matrix.rust-target }}/release/tinymist-${{ env.target }}.dwarf" + dsymutil -f "target/${{ matrix.rust-target }}/gh-release/tinymist" + mv "target/${{ matrix.rust-target }}/gh-release/tinymist.dwarf" "target/${{ matrix.rust-target }}/gh-release/tinymist-${{ env.target }}.dwarf" - name: Copy binary to output directory if: (startsWith(github.ref, 'refs/tags/') || matrix.regular_build == 'true') shell: pwsh run: | - cp "target/${{ matrix.rust-target }}/release/tinymist$(If ('${{ matrix.platform }}' -eq 'win32') { '.exe' } else { '' } )" "editors/vscode/out/" - cp "target/${{ matrix.rust-target }}/release/tinymist$(If ('${{ matrix.platform }}' -eq 'win32') { '.exe' } else { '' } )" "tinymist-${{ env.target }}$(If ('${{ matrix.platform }}' -eq 'win32') { '.exe' } else { '' } )" + cp "target/${{ matrix.rust-target }}/gh-release/tinymist$(If ('${{ matrix.platform }}' -eq 'win32') { '.exe' } else { '' } )" "editors/vscode/out/" + cp "target/${{ matrix.rust-target }}/gh-release/tinymist$(If ('${{ matrix.platform }}' -eq 'win32') { '.exe' } else { '' } )" "tinymist-${{ env.target }}$(If ('${{ matrix.platform }}' -eq 'win32') { '.exe' } else { '' } )" - name: Test tinymist run: | - cargo test --release --workspace --target ${{ matrix.rust-target }} + cargo test --profile=gh-release --workspace --target ${{ matrix.rust-target }} if: (startsWith(github.ref, 'refs/tags/') || matrix.regular_build == 'true') && (matrix.platform == 'linux') && (matrix.arch == 'x64') - name: Upload split debug symbols for windows if: matrix.platform == 'win32' && (startsWith(github.ref, 'refs/tags/') || matrix.regular_build == 'true') uses: actions/upload-artifact@v4 with: name: tinymist-${{ env.target }}.pdb - path: target/${{ matrix.rust-target }}/release/tinymist-${{ env.target }}.pdb + path: target/${{ matrix.rust-target }}/gh-release/tinymist-${{ env.target }}.pdb - name: Upload split debug symbols for linux if: matrix.platform == 'linux' && (startsWith(github.ref, 'refs/tags/') || matrix.regular_build == 'true') uses: actions/upload-artifact@v4 with: name: tinymist-${{ env.target }}.debug - path: target/${{ matrix.rust-target }}/release/tinymist-${{ env.target }}.debug + path: target/${{ matrix.rust-target }}/gh-release/tinymist-${{ env.target }}.debug compression-level: 0 - name: Upload split debug symbols for mac if: matrix.platform == 'darwin' && (startsWith(github.ref, 'refs/tags/') || matrix.regular_build == 'true') uses: actions/upload-artifact@v4 with: name: tinymist-${{ env.target }}.dwarf - path: target/${{ matrix.rust-target }}/release/tinymist-${{ env.target }}.dwarf + path: target/${{ matrix.rust-target }}/gh-release/tinymist-${{ env.target }}.dwarf - name: Upload binary artifact if: (startsWith(github.ref, 'refs/tags/') || matrix.regular_build == 'true') uses: actions/upload-artifact@v4 @@ -209,22 +209,22 @@ jobs: working-directory: ./editors/vscode - name: Build tinymist binary run: | - cargo build --release -p tinymist --target $RUST_TARGET + cargo build --profile=gh-release -p tinymist --target $RUST_TARGET - name: Split debug symbols run: | - cd target/$RUST_TARGET/release + cd target/$RUST_TARGET/gh-release objcopy --compress-debug-sections --only-keep-debug "tinymist" "tinymist-${{ env.target }}.debug" objcopy --strip-debug --add-gnu-debuglink="tinymist-${{ env.target }}.debug" "tinymist" - name: Upload split debug symbols uses: actions/upload-artifact@v4 with: name: tinymist-${{ env.target }}.debug - path: target/${{ env.RUST_TARGET }}/release/tinymist-${{ env.target }}.debug + path: target/${{ env.RUST_TARGET }}/gh-release/tinymist-${{ env.target }}.debug - name: Copy binary to output directory run: | mkdir -p editors/vscode/out - cp "target/${{ env.RUST_TARGET }}/release/tinymist" "editors/vscode/out/" - cp "target/${{ env.RUST_TARGET }}/release/tinymist" "tinymist-${{ env.target }}" + cp "target/${{ env.RUST_TARGET }}/gh-release/tinymist" "editors/vscode/out/" + cp "target/${{ env.RUST_TARGET }}/gh-release/tinymist" "tinymist-${{ env.target }}" - name: Upload binary artifact uses: actions/upload-artifact@v4 with: diff --git a/.vscode/launch.json b/.vscode/launch.json index e555bf26..16ceb05d 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -26,6 +26,82 @@ "${workspaceFolder}/editors/vscode/out/**/*.js" ], "preLaunchTask": "VS Code Extension Prelaunch [Jaeger]" + }, + { + "type": "lldb", + "request": "launch", + "name": "Debug unit tests in executable 'tinymist'", + "cargo": { + "args": [ + "test", + "--no-run", + "--bin=tinymist", + "--package=tinymist" + ], + "filter": { + "name": "tinymist", + "kind": "bin" + } + }, + "args": [], + "cwd": "${workspaceFolder}" + }, + { + "type": "lldb", + "request": "launch", + "name": "Debug unit tests in library 'tinymist-query'", + "cargo": { + "args": [ + "test", + "--no-run", + "--lib", + "--package=tinymist-query" + ], + "filter": { + "name": "tinymist-query", + "kind": "lib" + } + }, + "args": [], + "cwd": "${workspaceFolder}" + }, + { + "type": "lldb", + "request": "launch", + "name": "Debug unit tests in library 'tinymist-render'", + "cargo": { + "args": [ + "test", + "--no-run", + "--lib", + "--package=tinymist-render" + ], + "filter": { + "name": "tinymist-render", + "kind": "lib" + } + }, + "args": [], + "cwd": "${workspaceFolder}" + }, + { + "type": "lldb", + "request": "launch", + "name": "Debug integration test 'tinymist-e2e-tests'", + "cargo": { + "args": [ + "test", + "--no-run", + "--test=tinymist-e2e-tests", + "--package=tests" + ], + "filter": { + "name": "tinymist-e2e-tests", + "kind": "test" + } + }, + "args": [], + "cwd": "${workspaceFolder}" } ] } diff --git a/Cargo.toml b/Cargo.toml index e6fac93b..81e3edaf 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -96,11 +96,13 @@ opt-level = 3 opt-level = 3 [profile.release] -# lto = true # Enable link-time optimization debug = true -opt-level = 3 # Optimize for speed + +[profile.gh-release] +inherits = "release" +# lto = true # Enable link-time optimization codegen-units = 1 # Reduce number of codegen units to increase optimizations -panic = 'abort' # Abort on panic +panic = "abort" # Abort on panic [workspace.lints.rust] missing_docs = "warn" diff --git a/crates/tinymist-query/src/analysis/global.rs b/crates/tinymist-query/src/analysis/global.rs index e3042cac..aecccbe6 100644 --- a/crates/tinymist-query/src/analysis/global.rs +++ b/crates/tinymist-query/src/analysis/global.rs @@ -78,7 +78,7 @@ impl Analysis { .modules .values() .map(|v| { - v.def_use_lexical_heirarchy + v.def_use_lexical_hierarchy .output .as_ref() .map_or(0, |e| e.iter().map(|e| e.estimated_memory()).sum()) @@ -145,13 +145,13 @@ impl ComputingNode { /// /// You should not holds across requests, because source code may change. pub struct ModuleAnalysisGlobalCache { - def_use_lexical_heirarchy: ComputingNode>, + def_use_lexical_hierarchy: ComputingNode>, } impl Default for ModuleAnalysisGlobalCache { fn default() -> Self { Self { - def_use_lexical_heirarchy: ComputingNode::new("def_use_lexical_heirarchy"), + def_use_lexical_hierarchy: ComputingNode::new("def_use_lexical_hierarchy"), } } } @@ -172,7 +172,7 @@ pub struct AnalysisCaches { } /// The resources for analysis. -pub trait AnaylsisResources { +pub trait AnalysisResources { /// Get the world surface for Typst compiler. fn world(&self) -> &dyn World; @@ -201,7 +201,7 @@ pub trait AnaylsisResources { /// The context for analyzers. pub struct AnalysisContext<'a> { /// The world surface for Typst compiler - pub resources: &'a dyn AnaylsisResources, + pub resources: &'a dyn AnalysisResources, /// The analysis data pub analysis: CowMut<'a, Analysis>, caches: AnalysisCaches, @@ -209,7 +209,7 @@ pub struct AnalysisContext<'a> { impl<'w> AnalysisContext<'w> { /// Create a new analysis context. - pub fn new(resources: &'w dyn AnaylsisResources, a: Analysis) -> Self { + pub fn new(resources: &'w dyn AnalysisResources, a: Analysis) -> Self { Self { resources, analysis: CowMut::Owned(a), @@ -218,7 +218,7 @@ impl<'w> AnalysisContext<'w> { } /// Create a new analysis context with borrowing the analysis data. - pub fn new_borrow(resources: &'w dyn AnaylsisResources, a: &'w mut Analysis) -> Self { + pub fn new_borrow(resources: &'w dyn AnalysisResources, a: &'w mut Analysis) -> Self { Self { resources, analysis: CowMut::Borrowed(a), @@ -355,7 +355,7 @@ impl<'w> AnalysisContext<'w> { .modules .entry(source.id()) .or_default() - .def_use_lexical_heirarchy + .def_use_lexical_hierarchy .compute(source, |_before, after| { crate::syntax::get_lexical_hierarchy(after, crate::syntax::LexicalScopeKind::DefUse) }) diff --git a/crates/tinymist-query/src/completion.rs b/crates/tinymist-query/src/completion.rs index 55250960..6f5b2396 100644 --- a/crates/tinymist-query/src/completion.rs +++ b/crates/tinymist-query/src/completion.rs @@ -310,7 +310,6 @@ fn complete_path( #[cfg(test)] mod tests { use insta::with_settings; - use lsp_types::{CompletionItem, CompletionList}; use super::*; use crate::tests::*; diff --git a/crates/tinymist-query/src/diagnostics.rs b/crates/tinymist-query/src/diagnostics.rs index d7ef92d2..31f03285 100644 --- a/crates/tinymist-query/src/diagnostics.rs +++ b/crates/tinymist-query/src/diagnostics.rs @@ -1,4 +1,4 @@ -use crate::{path_to_url, prelude::*}; +use crate::prelude::*; /// Stores diagnostics for files. pub type DiagnosticsMap = HashMap>; diff --git a/crates/tinymist-query/src/fixtures/inlay_hints/imcomplete-expression.typ b/crates/tinymist-query/src/fixtures/inlay_hints/incomplete-expression.typ similarity index 100% rename from crates/tinymist-query/src/fixtures/inlay_hints/imcomplete-expression.typ rename to crates/tinymist-query/src/fixtures/inlay_hints/incomplete-expression.typ diff --git a/crates/tinymist-query/src/fixtures/inlay_hints/snaps/smart@imcomplete-expression.typ.snap b/crates/tinymist-query/src/fixtures/inlay_hints/snaps/smart@incomplete-expression.typ.snap similarity index 68% rename from crates/tinymist-query/src/fixtures/inlay_hints/snaps/smart@imcomplete-expression.typ.snap rename to crates/tinymist-query/src/fixtures/inlay_hints/snaps/smart@incomplete-expression.typ.snap index 1b89d079..0ef2638d 100644 --- a/crates/tinymist-query/src/fixtures/inlay_hints/snaps/smart@imcomplete-expression.typ.snap +++ b/crates/tinymist-query/src/fixtures/inlay_hints/snaps/smart@incomplete-expression.typ.snap @@ -1,6 +1,6 @@ --- source: crates/tinymist-query/src/inlay_hint.rs expression: "JsonRepr::new_redacted(result, &REDACT_LOC)" -input_file: crates/tinymist-query/src/fixtures/inlay_hints/imcomplete-expression.typ +input_file: crates/tinymist-query/src/fixtures/inlay_hints/incomplete-expression.typ --- [] diff --git a/crates/tinymist-query/src/goto_declaration.rs b/crates/tinymist-query/src/goto_declaration.rs index 88f1c7d6..8504cfd0 100644 --- a/crates/tinymist-query/src/goto_declaration.rs +++ b/crates/tinymist-query/src/goto_declaration.rs @@ -1,7 +1,6 @@ use std::ops::Range; use log::debug; -use lsp_types::LocationLink; use crate::{ prelude::*, @@ -70,7 +69,7 @@ impl SemanticRequest for GotoDeclarationRequest { }); } - debug!("goto_declartion: {links:?}"); + debug!("goto_declaration: {links:?}"); Some(GotoDeclarationResponse::Link(links)) } } diff --git a/crates/tinymist-query/src/goto_definition.rs b/crates/tinymist-query/src/goto_definition.rs index 6f02bccb..0faff337 100644 --- a/crates/tinymist-query/src/goto_definition.rs +++ b/crates/tinymist-query/src/goto_definition.rs @@ -1,7 +1,6 @@ use std::ops::Range; use log::debug; -use typst::foundations::Value; use typst::syntax::FileId as TypstFileId; use crate::{ @@ -122,7 +121,7 @@ pub(crate) fn find_definition( } }; - // syntatic definition + // syntactic definition let def_use = ctx.def_use(source)?; let ident_ref = match use_site.cast::()? { ast::Expr::Ident(e) => IdentRef { diff --git a/crates/tinymist-query/src/lib.rs b/crates/tinymist-query/src/lib.rs index cb36e9f1..03824d75 100644 --- a/crates/tinymist-query/src/lib.rs +++ b/crates/tinymist-query/src/lib.rs @@ -175,7 +175,7 @@ mod polymorphic { pub struct ServerInfoRequest {} #[derive(Debug, Clone, Serialize, Deserialize)] - pub struct ServerInfoReponse { + pub struct ServerInfoResponse { pub root: Option, #[serde(rename = "fontPaths")] pub font_paths: Vec, @@ -188,7 +188,7 @@ mod polymorphic { pub enum FoldRequestFeature { PinnedFirst, Unique, - Mergable, + Mergeable, ContextFreeUnique, } @@ -224,8 +224,8 @@ mod polymorphic { pub fn fold_feature(&self) -> FoldRequestFeature { use FoldRequestFeature::*; match self { - CompilerQueryRequest::OnExport(..) => Mergable, - CompilerQueryRequest::OnSaveExport(..) => Mergable, + CompilerQueryRequest::OnExport(..) => Mergeable, + CompilerQueryRequest::OnSaveExport(..) => Mergeable, CompilerQueryRequest::Hover(..) => PinnedFirst, CompilerQueryRequest::GotoDefinition(..) => PinnedFirst, CompilerQueryRequest::GotoDeclaration(..) => PinnedFirst, @@ -234,12 +234,12 @@ mod polymorphic { CompilerQueryRequest::DocumentColor(..) => PinnedFirst, CompilerQueryRequest::ColorPresentation(..) => ContextFreeUnique, CompilerQueryRequest::CodeLens(..) => Unique, - CompilerQueryRequest::Completion(..) => Mergable, + CompilerQueryRequest::Completion(..) => Mergeable, CompilerQueryRequest::SignatureHelp(..) => PinnedFirst, - CompilerQueryRequest::Rename(..) => Mergable, - CompilerQueryRequest::PrepareRename(..) => Mergable, + CompilerQueryRequest::Rename(..) => Mergeable, + CompilerQueryRequest::PrepareRename(..) => Mergeable, CompilerQueryRequest::DocumentSymbol(..) => ContextFreeUnique, - CompilerQueryRequest::Symbol(..) => Mergable, + CompilerQueryRequest::Symbol(..) => Mergeable, CompilerQueryRequest::SemanticTokensFull(..) => ContextFreeUnique, CompilerQueryRequest::SemanticTokensDelta(..) => ContextFreeUnique, CompilerQueryRequest::Formatting(..) => ContextFreeUnique, @@ -247,7 +247,7 @@ mod polymorphic { CompilerQueryRequest::SelectionRange(..) => ContextFreeUnique, CompilerQueryRequest::DocumentMetrics(..) => PinnedFirst, - CompilerQueryRequest::ServerInfo(..) => Mergable, + CompilerQueryRequest::ServerInfo(..) => Mergeable, } } @@ -306,7 +306,7 @@ mod polymorphic { SelectionRange(Option>), DocumentMetrics(Option), - ServerInfo(Option>), + ServerInfo(Option>), } } diff --git a/crates/tinymist-query/src/lsp_typst_boundary.rs b/crates/tinymist-query/src/lsp_typst_boundary.rs index fa135024..88b17479 100644 --- a/crates/tinymist-query/src/lsp_typst_boundary.rs +++ b/crates/tinymist-query/src/lsp_typst_boundary.rs @@ -372,8 +372,6 @@ mod test { use lsp_types::Position; use typst::syntax::Source; - use crate::{lsp_to_typst, PositionEncoding}; - use super::*; #[test] diff --git a/crates/tinymist-query/src/syntax/import.rs b/crates/tinymist-query/src/syntax/import.rs index f2b76011..6c8401f3 100644 --- a/crates/tinymist-query/src/syntax/import.rs +++ b/crates/tinymist-query/src/syntax/import.rs @@ -45,7 +45,7 @@ pub fn find_source_by_expr( current: TypstFileId, e: ast::Expr, ) -> Option { - // todo: this could be vaild: import("path.typ"), where v is parenthesized + // todo: this could be valid: import("path.typ"), where v is parenthesized match e { ast::Expr::Str(s) => find_source_by_import_path(world, current, s.get().as_str()), _ => None, diff --git a/crates/tinymist-query/src/syntax/module.rs b/crates/tinymist-query/src/syntax/module.rs index 97821204..87b3adaa 100644 --- a/crates/tinymist-query/src/syntax/module.rs +++ b/crates/tinymist-query/src/syntax/module.rs @@ -1,4 +1,4 @@ -use std::{collections::HashMap, sync::Once}; +use std::sync::Once; use super::find_imports; use crate::prelude::*; diff --git a/crates/tinymist-query/src/tests.rs b/crates/tinymist-query/src/tests.rs index ff6b71fb..33e7457d 100644 --- a/crates/tinymist-query/src/tests.rs +++ b/crates/tinymist-query/src/tests.rs @@ -27,14 +27,14 @@ pub use insta::assert_snapshot; pub use typst_ts_compiler::TypstSystemWorld; use crate::{ - analysis::{Analysis, AnaylsisResources}, + analysis::{Analysis, AnalysisResources}, prelude::AnalysisContext, typst_to_lsp, LspPosition, PositionEncoding, }; struct WrapWorld<'a>(&'a mut TypstSystemWorld); -impl<'a> AnaylsisResources for WrapWorld<'a> { +impl<'a> AnalysisResources for WrapWorld<'a> { fn world(&self) -> &dyn typst::World { self.0 } diff --git a/crates/tinymist/src/actor/typ_client.rs b/crates/tinymist/src/actor/typ_client.rs index 9a1d7dd4..3c3ec57f 100644 --- a/crates/tinymist/src/actor/typ_client.rs +++ b/crates/tinymist/src/actor/typ_client.rs @@ -1,14 +1,14 @@ //! The typst actors running compilations. //! //! ```ascii -//! ┌────────────────────────────────┐ -//! │ main::compile_actor (client)│ -//! └─────┬────────────────────▲─────┘ -//! │ │ +//! ┌────────────────────────────────┐ +//! │ main::compile_actor (client)│ +//! └─────┬────────────────────▲─────┘ +//! │ │ //! ┌─────▼────────────────────┴─────┐ ┌────────────┐ //! │compiler::compile_actor (server)│◄───────►│notify_actor│ //! └─────┬────────────────────▲─────┘ └────────────┘ -//! │ │ +//! │ │ //! ┌─────▼────────────────────┴─────┐ handler ┌────────────┐ //! │compiler::compile_driver ├────────►│ rest actors│ //! └────────────────────────────────┘ └────────────┘ @@ -16,7 +16,7 @@ //! //! We generally use typst in two ways. //! + creates a [`CompileDriver`] and run compilation in fly. -//! + creates a [`CompileServerActor`], wraps the drvier, and runs +//! + creates a [`CompileServerActor`], wraps the driver, and runs //! [`CompileDriver`] incrementally. //! //! For latter case, an additional [`CompileClientActor`] is created to @@ -36,8 +36,8 @@ use anyhow::anyhow; use log::{error, info, trace}; use parking_lot::Mutex; use tinymist_query::{ - analysis::{Analysis, AnalysisContext, AnaylsisResources}, - DiagnosticsMap, ExportKind, ServerInfoReponse, VersionedDocument, + analysis::{Analysis, AnalysisContext, AnalysisResources}, + DiagnosticsMap, ExportKind, ServerInfoResponse, VersionedDocument, }; use tinymist_render::PeriscopeRenderer; use tokio::sync::{broadcast, mpsc, oneshot, watch}; @@ -245,7 +245,7 @@ impl CompileDriver { struct WrapWorld<'a>(&'a mut LspWorld, &'a PeriscopeRenderer); - impl<'a> AnaylsisResources for WrapWorld<'a> { + impl<'a> AnalysisResources for WrapWorld<'a> { fn world(&self) -> &dyn typst::World { self.0 } @@ -433,12 +433,12 @@ impl CompileClientActor { }); } - pub fn collect_server_info(&self) -> anyhow::Result> { + pub fn collect_server_info(&self) -> anyhow::Result> { let dg = self.diag_group.clone(); let res = self.steal(move |c| { let cc = &c.compiler.compiler; - let info = ServerInfoReponse { + let info = ServerInfoResponse { root: cc.world().entry.root().map(|e| e.as_ref().to_owned()), font_paths: cc.world().font_resolver.font_paths().to_owned(), inputs: cc.world().inputs.as_ref().deref().clone(), diff --git a/crates/tinymist/src/harness.rs b/crates/tinymist/src/harness.rs index b770af2a..019cb976 100644 --- a/crates/tinymist/src/harness.rs +++ b/crates/tinymist/src/harness.rs @@ -261,7 +261,7 @@ impl ProtocolError { ProtocolError("disconnected channel".into(), true) } - /// Whether this error occured due to a disconnected channel. + /// Whether this error occurred due to a disconnected channel. pub fn channel_is_disconnected(&self) -> bool { self.1 } diff --git a/editors/neovim/README.md b/editors/neovim/README.md index ed0732fe..f45ef7bd 100644 --- a/editors/neovim/README.md +++ b/editors/neovim/README.md @@ -46,7 +46,7 @@ Please see [Extra Settings](#extra-settings) for more configuration. ### Working with Multiple-File Projects -The solution is a bit internal, which should get futher improvement, but you can pin a main file by command. +The solution is a bit internal, which should get further improvement, but you can pin a main file by command. ```lua # pin the main file diff --git a/syntaxes/textmate/main.ts b/syntaxes/textmate/main.ts index da00492f..b942f5cc 100644 --- a/syntaxes/textmate/main.ts +++ b/syntaxes/textmate/main.ts @@ -27,7 +27,7 @@ const PAREN_BLOCK = generatePattern(6, "\\(", "\\)"); const CODE_BLOCK = generatePattern(6, "\\{", "\\}"); const BRACE_FREE_EXPR = /[^\s\}\{\[\]][^\}\{\[\]]*/.source; -// todo: This is invokable +// todo: This is invocable const codeBlock: textmate.Pattern = { // name: "meta.block.continuous.typst", begin: /\{/, @@ -534,7 +534,7 @@ const expression = (): textmate.Grammar => { }, }, /// parentheisized expressions: (...) - // todo: This is invokable + // todo: This is invocable { begin: /\(/, end: /\)/, diff --git a/tools/editor-tools/src/features/symbol-picker.ts b/tools/editor-tools/src/features/symbol-picker.ts index 27dff1b2..7aaefbc0 100644 --- a/tools/editor-tools/src/features/symbol-picker.ts +++ b/tools/editor-tools/src/features/symbol-picker.ts @@ -441,7 +441,7 @@ export const SymbolPicker = () => { ), div({ style: "flex: 1;" }, (_dom?: Element) => div( - ...catergorize( + ...categorize( CATEGORY_INFO, pickSymbols(pickers.val, filteredPickers.val) ) @@ -452,7 +452,7 @@ export const SymbolPicker = () => { ); }; -function catergorize( +function categorize( catsRaw: SymbolCategory[], symInfo: InstantiatedSymbolItem[] ): InstantiatedSymbolCategory[] { diff --git a/tools/editor-tools/src/main.ts b/tools/editor-tools/src/main.ts index bc0cf663..abc5a361 100644 --- a/tools/editor-tools/src/main.ts +++ b/tools/editor-tools/src/main.ts @@ -8,7 +8,7 @@ import { Diagnostics } from "./features/diagnostics"; import { SymbolPicker } from "./features/symbol-picker"; /// The components that can be rendered by the frontend. -/// Typicially, each component corresponds to a single tool (Application). +/// Typically, each component corresponds to a single tool (Application). type PageComponent = | "template-gallery" | "tracing" diff --git a/yarn.lock b/yarn.lock index 2d184375..6684de31 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2678,8 +2678,16 @@ std-env@^3.3.3: resolved "https://registry.yarnpkg.com/std-env/-/std-env-3.7.0.tgz#c9f7386ced6ecf13360b6c6c55b8aaa4ef7481d2" integrity sha512-JPbdCEQLj1w5GilpiHAx3qJvFndqybBysA3qUOnznweH4QbNYUsW/ea8QzSrnh0vNsezMMw5bcVool8lM0gwzg== -"string-width-cjs@npm:string-width@^4.2.0", string-width@^4.1.0: - name string-width-cjs +"string-width-cjs@npm:string-width@^4.2.0": + version "4.2.3" + resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" + integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== + dependencies: + emoji-regex "^8.0.0" + is-fullwidth-code-point "^3.0.0" + strip-ansi "^6.0.1" + +string-width@^4.1.0: version "4.2.3" resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== @@ -2731,7 +2739,14 @@ string_decoder@^1.1.1: dependencies: safe-buffer "~5.2.0" -"strip-ansi-cjs@npm:strip-ansi@^6.0.1", strip-ansi@^6.0.0, strip-ansi@^6.0.1: +"strip-ansi-cjs@npm:strip-ansi@^6.0.1": + version "6.0.1" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" + integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== + dependencies: + ansi-regex "^5.0.1" + +strip-ansi@^6.0.0, strip-ansi@^6.0.1: version "6.0.1" resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==