Code Monkey home page Code Monkey logo

tinymist's Introduction

Tinymist

Tinymist [ˈtaɪni mɪst] is an integrated language service for Typst [taɪpst]. You can also call it "微霭" [wēi ǎi] in Chinese.

It contains:

Features

Language service (LSP) features:

  • Semantic highlighting
    • Also known as "syntax highlighting".
  • Diagnostics
    • Also known as "error checking" or "error reporting".
  • Document highlight
    • Highlight all break points in a loop context.
    • (Todo) Highlight all exit points in a function context.
    • (Todo) Highlight all captures in a closure context.
    • (Todo) Highlight all occurrences of a symbol in a document.
  • Document symbols
    • Also known as "document outline" or "table of contents" in Typst.
  • Folding ranges
    • You can collapse code/content blocks and headings.
  • Goto definitions
    • Right-click on a symbol and select "Go to Definition".
    • Or ctrl+click on a symbol.
  • References
    • Right-click on a symbol and select "Go to References" or "Find References".
    • Or ctrl+click on a symbol.
  • Hover tips
    • Also known as "hovering tooltip".
  • Inlay hints
    • Inlay hints are special markers that appear in the editor and provide you with additional information about your code, like the names of the parameters that a called method expects.
  • Color Provider
    • View all inlay colorful label for color literals in your document.
    • Change the color literal's value by a color picker or its code presentation.
  • Code Lens
    • Should give contextual buttons along with code. For example, a button for exporting your document to various formats at the start of the document.
  • Rename symbols
  • Help with function and method signatures
  • Workspace Symbols
  • Code Action
    • Increasing/Decreasing heading levels.
  • experimental/onEnter
    • Enter inside triple-slash comments automatically inserts ///
    • Enter in the middle or after a trailing space in // inserts //
    • Enter inside //! doc comments automatically inserts //!

Extra features:

  • Compiles to PDF on save (configurable to as-you-type, or other options).
  • Compiles to SVG, PNG, HTML, Markdown, Text, and other formats by commands, vscode tasks, or code lenses.
  • Provides code lenses for exporting to PDF/SVG/PNG/etc.
  • Provides a status bar item to show the current document's compilation status and words count.
  • Editor tools:
    • View a list of templates in template gallery. (tinymist.showTemplateGallery)
    • Click a button in template gallery to initialize a new project with a template. (tinymist.initTemplate and tinymist.initTemplateInPlace)
    • Trace execution in current document (tinymist.profileCurrentFile).

Release Cycle

Tinymist follows the Semantic Versioning scheme. The version number is in the format of MAJOR.MINOR.PATCH. The release cycle is as follows:

  • If there is a typst version update, a new major or minor version will be released intermediately. This means tinymist will always align the minor version with typst.
  • If there is at least a bug or feature added this week, a new patch version will be released.

Installation

Follow the instructions to enable tinymist in your favorite editor.

  1. Helix
  2. Neovim
  3. Sublime Text
  4. VSCode
  5. Zed

Installing Regular/Nightly Prebuilds from GitHub

Note: if you are not knowing what is a regular/nightly release, please don't follow this section.

Besides published releases specific for each editors, you can also download the latest regular/nightly prebuilts from GitHub and install them manually.

To install extension file (the file with .vsix extension) manually, please Ctrl+Shift+X in the editor window and drop the downloaded vsix file into the opended extensions view.

Documentation

See Online Documentation.

Packaging

Packaging status

Roadmap

After development for two months, most of the features are implemented. There are still some features to be implemented, but I would like to leave them in typst v0.12.0. I'll also pick some of them to implement on my weekends. Also please feel free to contribute if you are interested in the following features.

  • Documentation and refactoring: It is my current focus.
  • Spell checking: There is already a branch but no suitable (default) spell checking library is found.
  • Periscope renderer: It is disabled since vscode reject to render SVGs containing foreignObjects.
  • Inlay hint: It is disabled by default because of performance issues.
  • Find references of labels, dictionary fields, and named function arguments.
  • Go to definition of dictionary fields and named function arguments.
  • Autocompletion for raw language tags.
  • Improve symbol view's appearance.

Contributing

Please read the CONTRIBUTING.md file for contribution guidelines.

Acknowledgements

tinymist's People

Contributors

7sdream avatar cskeeters avatar enter-tainer avatar eric-song-nop avatar kririae avatar myriad-dreamin avatar nerixyz avatar otto-aa avatar quarticcat avatar setsuikihyoryu avatar upsidedownsweetfood avatar wrenger avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

tinymist's Issues

VSCode extension: Useless inlay hints

Describe the bug

Sometimes, inlay hints are displayed even when not necessary.

To Reproduce

  1. Create a new Typst file with the following contents.

    #let f(arg: none) = {}
    #f(arg: "hey")
    $ cal(M) $
  2. Notice how hints appears after "hey" and M.

Expected behavior

The hint after "hey" should not exist, because the this is a named parameter and the hint is therefore redundant.

The hint after M is useless ("body" does not convey any additional information), and it takes up horizontal space for nothing. I think inlay hints should not appear for arguments named body (and maybe some other highly generic names).

Additionally, I think there should be a way to disable inlay hints, as some people don't like this feature.

Package/Software version

tinymist extension version: v0.10.1

Template gallery index.html is not included in packaging

Describe the bug
Invoking the template gallery command Typst: Show available Typst templates (gallery) for picking up a template to initialize on VSCode leads to error:

image

and there is no content in the template gallery tab consequently.

To Reproduce
Steps to reproduce the behavior (Library test):

  1. Invoke the Typst: Show available Typst templates (gallery) for picking up a template to initialize command in VSCode command palette
  2. See error

Expected behavior
The template gallery works normally as the readme and update changelog described.

Package/Software version:

VSCode version(Help -> About):

版本: 1.87.2 (system setup)
提交: 863d2581ecda6849923a2118d93a088b0745d9d6
日期: 2024-03-08T15:20:17.278Z
Electron: 27.3.2
ElectronBuildId: 26836302
Chromium: 118.0.5993.159
Node.js: 18.17.1
V8: 11.8.172.18-electron.0
OS: Windows_NT x64 10.0.22631

tinymist extension version: v0.10.3

Logs:

There is no related error can be grabbed either from the output of Tinymist server or the VSCode devtool, it is located in the output of VSCode Extension Host.

2024-03-17 03:45:31.520 [error] Error: ENOENT: no such file or directory, open 'c:\Users\Falke\.vscode\extensions\myriad-dreamin.tinymist-0.10.3-win32-x64\out\editor-tools\index.html' tinymist.showTemplateGallery {"value":"myriad-dreamin.tinymist","_lower":"myriad-dreamin.tinymist"}

And the message from popout window is quite straightforward. Looking up the directory of extension also reveals the reason: there is no existence of the required file.

image

"vesrion" -> "version"

insta = { vesrion = "1.36", features = ["glob"] }

warning: /build/source/crates/tinymist-query/Cargo.toml: dependency (insta) specified without providing a local path, Git repository, version, or workspace dependency to use. This will be considered an error in future versions

found by @iynaix

VSCode extension: Fold ranges delimited by parentheses

Describe the bug
Ranges delimited by brackets or braces can be folded but not those delimited by parentheses.

To Reproduce

  1. Open a Typst file with the VSCode extension.
  2. Write
    #[
      1,
      2,
      3,
    ]
  3. Notice how the range can be folded.
  4. Now, write
    #(
      1,
      2,
      3,
    )
  5. This time, the range cannot be folded.

Expected behavior
A would expect the range delimited by parentheses to be foldable.

Package/Software version:

tinymist extension version: v0.10.1

Issues from discord (3)

  • fix symbol view.

    the current implementation is bug prone, so I would like to reimplement one instead of fixing current one. I may start to reimplement it after fixing tons of bugs and rough edges reported by andrew.

  • After opening the file it doesn't show the error unless I save the file (no-op).

    vscode invokes lsp's focus command but neovim doesn't. should add an issue, and discuss a suitable behavior to change focus file if the client is neovim.

  • Field selection doesn't seem to work in neovim.

    I need an approach to invoke editor.action.triggerSuggest and editor.action.triggerParameterHints at the same time, after a field completion, but I don't find a way other than letting client provide an extra commands,

    // https://github.com/microsoft/language-server-protocol/issues/1117
    . This is because microsoft/language-server-protocol#1117.
    I looked at rust-analyzer, and find that the parameter hints (signature help) keeps until exiting a function autocompletion. That is, if tinymist does same thing as ra, when I type text, tinymist will complete text(${content-arg}, fill: ${fill-arg}, stroke: ${stroke-arg}, ..), and I will continue finishing my function call for tabs and go to ${content-arg}, ${fill-arg}, and so on. however it is probably not what we would like to have, as we usually write text(fill: blue) and then add a content arguments by []. I may look at python lsps then.

Check out entry smartly by default

The smart mode works when you don't configure anything.

Basically there are two ideas:

  • The included files is preferred to not to be an entry (case 1).
  • Compilers prefers not to changing entry.

The red jumps will not cause entry (the blue rectangle) to change, while the green jumps will do.

image

Tracking issues from discord

  • better hovering tip
  • Rename is broken. It either says that it's not supported, or it doesn't work, or only changes the symbol in one place.
  • expression folding, currently we go three subtasks for first round of imrpoment:
    • array folding
    • dict folding
    • func folding
  • Note that you can make prerelease versions of vscode extensions. That way people can opt-in to more unstable builds
  • #27
  • #82
  • #28

LSP doesn't automatically shutdown

WARN  typst_ts_compiler::service::watch] failed to create watcher: notify error: Too many open files (os error 24)\nthread 'tokio-runtime-worker' panicked at /home/user/.cargo/git/checkouts/typst.ts-bd03698c1f5efd74/58c2c6b/compiler/src/service/watch.rs:301:25:\ninternal error: entered unreachable code

vscode color bug

vscode tinymist typst 0.11.4

triggers the bug, the coloring should be consistent within three brackets. After changing math equation from $ x^"#" = "argmin"_(A x=b) ||x||_(cal(l)_2) $ to $ x_1 $ , problem disappears.
截屏2024-04-18 10 05 42
the typst code

#import "@preview/touying:0.4.0": *

#let s = themes.simple.register()
#let (init, slides) = utils.methods(s)
#show: init

#let (slide, empty-slide) = utils.slides(s)
#show: slides

= Title

== First Slide

#slide[
  Hello, Touying! Hello, Typst!
	$ x^"#" = "argmin"_(A x=b) ||x||_(cal(l)_2) $
]

#slide[
  Hello, Touying! Hello, Typst!
	$ x^"#" = "argmin"_(A x=b) ||x||_(cal(l)_2) $
]

#slide[
  Hello, Touying! Hello, Typst!
	$ x^"#" = "argmin"_(A x=b) ||x||_(cal(l)_2) $
]

Milestone: v0.11.1

I use a todo list format to put down what I will do for v0.11.1 publish.

  • #24
  • #38
  • #55
  • perform memory/heap usage profiling and optimization.
  • create editor/neovim for maintaining configuration for neovim users.
  • write README.md for neovim users for guidance.

These issues are highlighted but I may not work on them until next publish.

Compilation error for v0.11.8 (and v0.11.7)

Describe the bug
I just tried compiling tinymist using cargo with the command from the README. However, compilation fails with an error.

Package/Software version:
tinymist extension version: v0.11.8
(I also tried with v0.11.7 but the error is the same)
rust version: 1.78.0
(I first tried with rust 1.74.0 but the error is the same)
OS version: Ubuntu 23.10

I can't run tinymist --version, but here is the compilation output:

❯ cargo install --git https://github.com/Myriad-Dreamin/tinymist --locked
    Updating git repository `https://github.com/Myriad-Dreamin/tinymist`
  Installing tinymist v0.11.8 (https://github.com/Myriad-Dreamin/tinymist#398f2afb)
    Updating crates.io index
   Compiling proc-macro2 v1.0.79
   Compiling unicode-ident v1.0.12
   Compiling libc v0.2.153
   Compiling serde v1.0.197
   Compiling cfg-if v1.0.0
   Compiling version_check v0.9.4
   Compiling autocfg v1.2.0
   Compiling once_cell v1.19.0
   Compiling memchr v2.7.1
   Compiling log v0.4.21
   Compiling itoa v1.0.11
   Compiling smallvec v1.13.2
   Compiling zerocopy v0.7.32
   Compiling allocator-api2 v0.2.18
   Compiling parking_lot_core v0.9.9
   Compiling thiserror v1.0.58
   Compiling rustversion v1.0.14
   Compiling ryu v1.0.17
   Compiling ahash v0.8.11
   Compiling lock_api v0.4.11
   Compiling scopeguard v1.2.0
   Compiling stable_deref_trait v1.2.0
   Compiling equivalent v1.0.1
   Compiling tinyvec_macros v0.1.1
   Compiling num-conv v0.1.0
   Compiling tinyvec v1.6.0
   Compiling time-core v0.1.2
   Compiling syn v1.0.109
   Compiling num-traits v0.2.18
   Compiling bytemuck v1.15.0
   Compiling simd-adler32 v0.3.7
   Compiling quote v1.0.35
   Compiling hashbrown v0.14.3
   Compiling crc32fast v1.4.0
   Compiling base64 v0.21.7
   Compiling syn v2.0.55
   Compiling jobserver v0.1.28
   Compiling getrandom v0.2.12
   Compiling fnv v1.0.7
   Compiling unicode-bidi v0.3.15
   Compiling siphasher v0.3.11
   Compiling cc v1.0.90
   Compiling parking_lot v0.12.1
   Compiling adler v1.0.2
   Compiling bitflags v1.3.2
   Compiling miniz_oxide v0.7.2
   Compiling aho-corasick v1.1.3
   Compiling float-cmp v0.9.0
   Compiling regex-syntax v0.8.3
   Compiling crossbeam-utils v0.8.19
   Compiling strict-num v0.1.1
   Compiling flate2 v1.0.28
   Compiling arrayref v0.3.7
   Compiling ident_case v1.0.1
   Compiling strsim v0.10.0
   Compiling arrayvec v0.7.4
   Compiling tiny-skia-path v0.11.4
   Compiling unicode-normalization v0.1.23
   Compiling pin-project-lite v0.2.13
   Compiling unicode-script v0.5.6
   Compiling serde_json v1.0.115
   Compiling percent-encoding v2.3.1
   Compiling siphasher v1.0.1
   Compiling regex-automata v0.4.6
   Compiling spin v0.9.8
   Compiling form_urlencoded v1.2.1
   Compiling kurbo v0.9.5
   Compiling slotmap v1.0.7
   Compiling unscanny v0.1.0
   Compiling heck v0.4.1
   Compiling cobs v0.2.3
   Compiling writeable v0.5.4
   Compiling either v1.10.0
   Compiling ttf-parser v0.20.0
   Compiling roxmltree v0.19.0
   Compiling embedded-io v0.4.0
   Compiling libm v0.2.8
   Compiling idna v0.5.0
   Compiling svgtypes v0.13.0
   Compiling unicase v2.7.0
   Compiling pkg-config v0.3.30
   Compiling synstructure v0.13.1
   Compiling rand_core v0.6.4
   Compiling regex v1.10.4
   Compiling same-file v1.0.6
   Compiling unicode-segmentation v1.11.0
   Compiling byteorder v1.5.0
   Compiling paste v1.0.14
   Compiling walkdir v2.5.0
   Compiling rand v0.8.5
   Compiling phf_shared v0.11.2
   Compiling usvg-tree v0.38.0
   Compiling fontconfig-parser v0.5.6
   Compiling serde_derive v1.0.197
   Compiling thiserror-impl v1.0.58
   Compiling zerofrom-derive v0.1.3
   Compiling yoke-derive v0.7.3
   Compiling zerovec-derive v0.10.1
   Compiling displaydoc v0.2.4
   Compiling icu_provider_macros v1.4.0
   Compiling comemo-macros v0.4.0
   Compiling memmap2 v0.9.4
   Compiling fdeflate v0.3.4
   Compiling unicode-bidi-mirroring v0.1.0
   Compiling unicode-math-class v0.1.0
   Compiling powerfmt v0.2.0
   Compiling typenum v1.17.0
   Compiling unicode-width v0.1.11
   Compiling anyhow v1.0.81
   Compiling ppv-lite86 v0.2.17
   Compiling bytes v1.6.0
   Compiling unicode-properties v0.1.1
   Compiling unicode-ccc v0.1.2
   Compiling vcpkg v0.2.15
   Compiling weezl v0.1.8
   Compiling color_quant v1.1.0
   Compiling rand_chacha v0.3.1
   Compiling deranged v0.3.11
   Compiling png v0.17.13
   Compiling libz-sys v1.1.16
   Compiling zerofrom v0.1.3
   Compiling comemo v0.4.0
   Compiling fontdb v0.16.2
   Compiling phf_generator v0.11.2
   Compiling csv-core v0.1.11
   Compiling time-macros v0.2.17
   Compiling generic-array v0.14.7
   Compiling simplecss v0.2.1
   Compiling data-url v0.3.1
   Compiling unicode-vo v0.1.0
   Compiling bit-vec v0.6.3
   Compiling imagesize v0.12.0
   Compiling time v0.3.34
   Compiling bitflags v2.5.0
   Compiling yoke v0.7.3
   Compiling indexmap v2.2.6
   Compiling litemap v0.7.2
   Compiling zerovec v0.10.1
   Compiling postcard v1.0.8
   Compiling serde_spanned v0.6.5
   Compiling quick-xml v0.31.0
   Compiling url v2.5.0
   Compiling toml_datetime v0.6.5
   Compiling rustybuzz v0.12.1
   Compiling ecow v0.2.2
   Compiling csv v1.3.0
   Compiling tinystr v0.7.5
   Compiling usvg-parser v0.38.0
   Compiling bit-set v0.5.3
   Compiling icu_locid v1.4.0
   Compiling phf_macros v0.11.2
   Compiling icu_provider v1.4.0
   Compiling usvg-text-layout v0.38.0
   Compiling strum_macros v0.26.2
   Compiling psm v0.1.21
   Compiling crossbeam-epoch v0.9.18
   Compiling num-bigint v0.4.4
   Compiling half v2.4.0
   Compiling rayon-core v1.12.1
   Compiling ciborium-io v0.2.2
   Compiling linked-hash-map v0.5.6
   Compiling jpeg-decoder v0.3.1
   Compiling icu_locid_transform_data v1.4.0
   Compiling xmlwriter v0.1.0
   Compiling line-wrap v0.2.0
   Compiling semver v1.0.22
   Compiling pico-args v0.5.0
   Compiling rustix v0.38.32
   Compiling usvg v0.38.0
   Compiling plist v1.6.1
   Compiling strum v0.26.2
   Compiling icu_locid_transform v1.4.0
   Compiling yaml-rust v0.4.5
   Compiling ciborium-ll v0.2.2
   Compiling phf v0.11.2
   Compiling crossbeam-deque v0.8.5
   Compiling fancy-regex v0.11.0
   Compiling unic-langid-impl v0.9.4
   Compiling icu_collections v1.4.0
   Compiling typst-syntax v0.11.0 (https://github.com/Myriad-Dreamin/typst.git?branch=tinymist-v0.11.0-2#6f1cdbb6)
   Compiling bincode v1.3.3
   Compiling gif v0.13.1
   Compiling enum-ordinalize-derive v4.3.1
   Compiling libgit2-sys v0.16.2+1.7.2
   Compiling stacker v0.1.15
   Compiling num-integer v0.1.46
   Compiling mio v0.8.11
   Compiling slab v0.4.9
   Compiling portable-atomic v1.6.0
   Compiling numerals v0.1.4
   Compiling indexmap-nostd v0.4.0
   Compiling linux-raw-sys v0.4.13
   Compiling futures-sink v0.3.30
   Compiling winnow v0.6.5
   Compiling unsafe-libyaml v0.2.11
   Compiling typed-arena v2.0.2
   Compiling az v1.2.1
   Compiling futures-core v0.3.30
   Compiling palette v0.7.5
   Compiling camino v1.1.6
   Compiling heck v0.5.0
   Compiling downcast-rs v1.2.0
   Compiling wasmi_core v0.13.0
   Compiling clap_derive v4.5.4
   Compiling serde_yaml v0.9.34+deprecated
   Compiling toml_edit v0.22.9
   Compiling wasmparser-nostd v0.100.1
   Compiling biblatex v0.9.3
   Compiling enum-ordinalize v4.3.0
   Compiling syntect v5.2.0
   Compiling image v0.24.9
   Compiling unic-langid v0.9.4
   Compiling ciborium v0.2.2
   Compiling citationberg v0.3.0
   Compiling zerotrie v0.1.2
   Compiling core_maths v0.1.0
   Compiling tracing-attributes v0.1.27
   Compiling tokio-macros v2.2.0
   Compiling palette_derive v0.7.5
   Compiling ptr_meta_derive v0.1.4
   Compiling darling_core v0.20.8
   Compiling ring v0.17.8
   Compiling approx v0.5.1
   Compiling socket2 v0.5.6
   Compiling signal-hook-registry v1.4.1
   Compiling num_cpus v1.16.0
   Compiling ahash v0.7.8
   Compiling tracing-core v0.1.32
   Compiling icu_segmenter_data v1.4.0
   Compiling wasmi_arena v0.4.1
   Compiling chinese-variant v1.1.3
   Compiling mutate_once v0.1.1
   Compiling bytecheck v0.6.12
   Compiling icu_properties_data v1.4.0
   Compiling utf8_iter v1.0.4
   Compiling fast-srgb8 v1.0.0
   Compiling icu_segmenter v1.4.0
   Compiling darling_macro v0.20.8
   Compiling icu_properties v1.4.0
   Compiling kamadak-exif v0.5.5
   Compiling wasmi v0.31.2
   Compiling chinese-number v0.7.7
   Compiling tracing v0.1.40
   Compiling hayagriva v0.5.2
   Compiling tokio v1.36.0
   Compiling ptr_meta v0.1.4
   Compiling icu_provider_blob v1.4.0
   Compiling two-face v0.3.0
   Compiling rayon v1.10.0
   Compiling toml v0.8.12
   Compiling futures-channel v0.3.30
   Compiling typst-timing v0.11.0 (https://github.com/Myriad-Dreamin/typst.git?branch=tinymist-v0.11.0-2#6f1cdbb6)
   Compiling crypto-common v0.1.6
   Compiling block-buffer v0.10.4
   Compiling icu_provider_adapters v1.4.0
   Compiling lipsum v0.9.1
   Compiling cargo-platform v0.1.8
   Compiling futures-macro v0.3.30
   Compiling typst-macros v0.11.0 (https://github.com/Myriad-Dreamin/typst.git?branch=tinymist-v0.11.0-2#6f1cdbb6)
   Compiling bytecheck_derive v0.6.12
   Compiling vergen v8.3.1
   Compiling radium v0.7.0
   Compiling simdutf8 v0.1.4
   Compiling futures-task v0.3.30
   Compiling typst-assets v0.11.0
   Compiling num_threads v0.1.7
   Compiling utf8parse v0.2.1
   Compiling qcms v0.3.0
   Compiling futures-io v0.3.30
   Compiling pin-utils v0.1.0
   Compiling if_chain v1.0.2
   Compiling hypher v0.1.5
   Compiling rend v0.4.2
   Compiling futures-util v0.3.30
   Compiling anstyle-parse v0.2.3
   Compiling typst v0.11.0 (https://github.com/Myriad-Dreamin/typst.git?branch=tinymist-v0.11.0-2#6f1cdbb6)
   Compiling cargo_metadata v0.18.1
   Compiling digest v0.10.7
   Compiling darling v0.20.8
   Compiling rustc_version v0.4.0
   Compiling tiny-skia v0.11.4
   Compiling tap v1.0.1
   Compiling cpufeatures v0.2.12
   Compiling colorchoice v1.0.0
   Compiling rkyv v0.7.44
   Compiling anstyle v1.0.6
   Compiling httparse v1.8.0
   Compiling untrusted v0.9.0
   Compiling anstyle-query v1.0.2
   Compiling base64 v0.22.0
   Compiling anstream v0.6.13
   Compiling wyz v0.5.1
   Compiling serde_with_macros v3.7.0
   Compiling hashbrown v0.12.3
   Compiling serde_repr v0.1.18
   Compiling rkyv_derive v0.7.44
   Compiling seahash v4.1.0
   Compiling funty v2.0.0
   Compiling bitvec v1.0.1
   Compiling serde_with v3.7.0
   Compiling terminal_size v0.3.0
   Compiling http v0.2.12
   Compiling fxhash v0.2.1
   Compiling darling_core v0.14.4
   Compiling dashmap v5.5.3
   Compiling dirs-sys-next v0.1.2
   Compiling strsim v0.11.0
   Compiling rustls v0.21.10
   Compiling wasm-bindgen-shared v0.2.92
   Compiling clap_lex v0.7.0
   Compiling path-clean v1.0.1
   Compiling darling_macro v0.14.4
   Compiling reflexo v0.5.0-rc3
   Compiling clap_builder v4.5.2
   Compiling dirs-next v2.0.0
   Compiling rustls-webpki v0.101.7
   Compiling sct v0.7.1
   Compiling tokio-util v0.7.10
   Compiling encoding_rs v0.8.33
   Compiling try-lock v0.2.5
   Compiling xmlparser v0.13.6
   Compiling want v0.3.1
   Compiling clap v4.5.4
   Compiling h2 v0.3.25
   Compiling darling v0.14.4
   Compiling mime_guess v2.0.4
   Compiling git2 v0.18.3
   Compiling term v0.7.0
   Compiling http-body v0.4.6
   Compiling sha2 v0.10.8
   Compiling base64-serde v0.7.0
   Compiling crossbeam-queue v0.3.11
   Compiling is-terminal v0.4.12
   Compiling elsa v1.10.0
   Compiling httpdate v1.0.3
   Compiling hex v0.4.3
   Compiling lazy_static v1.4.0
   Compiling tower-service v0.3.2
   Compiling bumpalo v3.15.4
   Compiling rustc-hash v1.1.0
   Compiling encode_unicode v1.0.0
   Compiling pathdiff v0.2.1
   Compiling prettytable-rs v0.10.0
   Compiling wasm-bindgen-backend v0.2.92
   Compiling hyper v0.14.28
   Compiling tokio-rustls v0.24.1
   Compiling derive_builder_core v0.12.0
   Compiling typst-ts-core v0.5.0-rc3
   Compiling gif v0.12.0
   Compiling crossbeam-channel v0.5.12
   Compiling inotify-sys v0.1.5
   Compiling filetime v0.2.23
   Compiling rgb v0.8.37
   Compiling roff v0.2.1
   Compiling option-ext v0.2.0
   Compiling mime v0.3.17
   Compiling fst v0.4.7
   Compiling dirs-sys v0.4.1
   Compiling clap_mangen v0.2.20
   Compiling hyper-rustls v0.24.2
   Compiling resvg v0.38.0
   Compiling typst-ts-svg-exporter v0.5.0-rc3
   Compiling inotify v0.9.6
   Compiling derive_builder_macro v0.12.0
   Compiling wasm-bindgen-macro-support v0.2.92
   Compiling clap_complete v4.5.1
   Compiling sha1 v0.10.6
   Compiling xattr v1.3.1
   Compiling serde_urlencoded v0.7.1
   Compiling http v1.1.0
   Compiling comemo-macros v0.3.1
   Compiling pin-project-internal v1.1.5
   Compiling strum_macros v0.25.3
   Compiling itertools v0.12.1
   Compiling hashlink v0.8.4
   Compiling rustls-pemfile v1.0.4
   Compiling bstr v1.9.1
   Compiling is-docker v0.2.0
   Compiling sync_wrapper v0.1.2
   Compiling static_assertions v1.1.0
   Compiling data-encoding v2.5.0
   Compiling wasm-bindgen v0.2.92
   Compiling webpki-roots v0.25.4
   Compiling iana-time-zone v0.1.60
   Compiling winnow v0.5.40
   Compiling ipnet v2.9.0
   Compiling arraydeque v0.5.1
   Compiling termcolor v1.4.1
   Compiling utf-8 v0.7.6
   Compiling codespan-reporting v0.11.1
   Compiling toml_edit v0.19.15
   Compiling tungstenite v0.21.0
   Compiling yaml-rust2 v0.8.0
   Compiling reqwest v0.11.27
   Compiling chrono v0.4.37
   Compiling flexstr v0.9.2
   Compiling is-wsl v0.4.0
   Compiling globset v0.4.14
   Compiling strum v0.25.0
   Compiling pin-project v1.1.5
   Compiling comemo v0.3.1
   Compiling typst-preview v0.11.3
   Compiling tar v0.4.40
   Compiling wasm-bindgen-macro v0.2.92
   Compiling derive_builder v0.12.0
   Compiling notify v6.1.1
   Compiling dirs v5.0.1
   Compiling rust_iso3166 v0.1.12
   Compiling rust_iso639 v0.0.1
   Compiling typstyle v0.11.17
   Compiling lsp-types v0.95.0
   Compiling futures-executor v0.3.30
   Compiling ecow v0.1.2
   Compiling env_filter v0.1.0
   Compiling itertools v0.11.0
   Compiling pdf-writer v0.9.2
   Compiling coarsetime v0.1.34
   Compiling ena v0.14.2
   Compiling instant v0.1.12
   Compiling dissimilar v1.0.7
   Compiling weak-table v0.3.2
   Compiling indextree v4.6.0
   Compiling nohash-hasher v0.2.0
   Compiling async-trait v0.1.79
   Compiling append-only-vec v0.1.3
   Compiling humantime v2.1.0
   Compiling arrayvec v0.5.2
   Compiling env_logger v0.11.3
   Compiling pretty v0.12.3
   Compiling await-tree v0.1.2
   Compiling typst-ts-compiler v0.5.0-rc3
   Compiling svg2pdf v0.10.0
   Compiling typst-syntax v0.7.0 (https://github.com/typst/typst.git?tag=v0.7.0#da8367e1)
   Compiling futures v0.3.30
   Compiling globmatch v0.2.5
   Compiling open v5.1.2
   Compiling toml v0.7.8
   Compiling tokio-tungstenite v0.21.0
   Compiling tinymist v0.11.8 (/home/johannesrave/.cargo/git/checkouts/tinymist-b44b3e31bb485cf9/398f2af/crates/tinymist)
   Compiling pixglyph v0.3.0
   Compiling itertools v0.10.5
   Compiling xmp-writer v0.2.0
   Compiling subsetter v0.1.1
   Compiling typstfmt_lib v0.2.7 (https://github.com/astrale-sharp/typstfmt?tag=0.2.7#46b4ec34)
   Compiling tinymist-query v0.11.8 (/home/johannesrave/.cargo/git/checkouts/tinymist-b44b3e31bb485cf9/398f2af/crates/tinymist-query)
error[E0562]: `impl Trait` only allowed in function and inherent method return types, not in trait method return types
   --> crates/tinymist-query/src/analysis/global.rs:166:37
    |
166 |     fn compute_debug_repr(&self) -> impl std::fmt::Debug;
    |                                     ^^^^^^^^^^^^^^^^^^^^
    |
    = note: see issue #91611 <https://github.com/rust-lang/rust/issues/91611> for more information

error[E0562]: `impl Trait` only allowed in function and inherent method return types, not in `impl` method return types
   --> crates/tinymist-query/src/analysis/global.rs:170:37
    |
170 |     fn compute_debug_repr(&self) -> impl std::fmt::Debug {
    |                                     ^^^^^^^^^^^^^^^^^^^^
    |
    = note: see issue #91611 <https://github.com/rust-lang/rust/issues/91611> for more information

error[E0562]: `impl Trait` only allowed in function and inherent method return types, not in `impl` method return types
   --> crates/tinymist-query/src/analysis/global.rs:175:37
    |
175 |     fn compute_debug_repr(&self) -> impl std::fmt::Debug {
    |                                     ^^^^^^^^^^^^^^^^^^^^
    |
    = note: see issue #91611 <https://github.com/rust-lang/rust/issues/91611> for more information

error[E0562]: `impl Trait` only allowed in function and inherent method return types, not in `impl` method return types
   --> crates/tinymist-query/src/analysis/global.rs:180:37
    |
180 |     fn compute_debug_repr(&self) -> impl std::fmt::Debug {
    |                                     ^^^^^^^^^^^^^^^^^^^^
    |
    = note: see issue #91611 <https://github.com/rust-lang/rust/issues/91611> for more information

error[E0562]: `impl Trait` only allowed in function and inherent method return types, not in `impl` method return types
   --> crates/tinymist-query/src/analysis/global.rs:186:37
    |
186 |     fn compute_debug_repr(&self) -> impl std::fmt::Debug {
    |                                     ^^^^^^^^^^^^^^^^^^^^
    |
    = note: see issue #91611 <https://github.com/rust-lang/rust/issues/91611> for more information

error[E0562]: `impl Trait` only allowed in function and inherent method return types, not in `impl` method return types
   --> crates/tinymist-query/src/analysis/global.rs:196:37
    |
196 |     fn compute_debug_repr(&self) -> impl std::fmt::Debug {
    |                                     ^^^^^^^^^^^^^^^^^^^^
    |
    = note: see issue #91611 <https://github.com/rust-lang/rust/issues/91611> for more information

   Compiling typst-pdf v0.11.0 (https://github.com/Myriad-Dreamin/typst.git?branch=tinymist-v0.11.0-2#6f1cdbb6)
   Compiling typst-render v0.11.0 (https://github.com/Myriad-Dreamin/typst.git?branch=tinymist-v0.11.0-2#6f1cdbb6)
For more information about this error, try `rustc --explain E0562`.
error: could not compile `tinymist-query` (lib) due to 6 previous errors
warning: build failed, waiting for other jobs to finish...
error: failed to compile `tinymist v0.11.8 (https://github.com/Myriad-Dreamin/tinymist#398f2afb)`, intermediate artifacts can be found at `/tmp/cargo-install0HKAYw`.
To reuse those artifacts with a future compilation, set the environment variable `CARGO_TARGET_DIR` to that path.

Feature Request: code action to toggle math equation inline/block

Short description

I think it would be nice to have a "code action" that toggles a math equation from inline to block.

The request

Implement code action support in the LSP, and add a code action to toggle math equations from inline to block.

Inspiration could be drawn from rust analyzer code (they call it "code assists" internally).

It should only appear when the cursor is inside a math equation.

Motivation

I often find myself writing an equation inline and then halfway through realizing that it will be too long (or that I need multiple lines), and should be turned into a block equation. It is then a little bit annoying to convert the equation to a block equation. The code action could make the transition smoother.

Example

For example, if the cursor is in the math equation, and the code action is triggered, then

We thus find that $sum_(i=0)^oo x^n / (n!)$ converges absolutely.

gets converted to

We thus find that
$
sum_(i=0)^oo x^n / (n!)
$
converges absolutely.

Questions

I tried having a look at how to implement this myself, but it seems that the lsp doesn't support any code actions yet, so it is not so simple to add for someone who doesn't know the code base. If you could give some hints I might be able to do it myself.

There is no consensus at the moment on how block math equations should be formatted. I know of three different styles:

Inline with spaces before and after.

We thus find that $ sum_(i=0)^oo x^n / (n!) $ converges absolutely.

On a newline with no indent.

We thus find that
$
sum_(i=0)^oo x^n / (n!)
$
converges absolutely.

On a newline with indent.

We thus find that
$
  sum_(i=0)^oo x^n / (n!)
$
converges absolutely.

I personally don't like the first one, because it makes it hard to see the difference between block and inline equations. Another problem with it, is that it doesn't allow you to write multiline equations easily. I therefore think that the code action should either go for the second or the third one. The code formatter can then decide whether there should be an indent or not.

Milestone: v0.11.3

  • Investigate a memory exhausting bug.
  • fix neovim configuration
  • autocompletion improvement
    • fix possibly wrong cursor offset from autocompletion request.
    • autocomplete even if no word boundary occurs after cursor (possibly same root cause as the first issue).
    • complete the named arguments with a colon with an extra space and may also PR the improvement to typst-ide.
    • #144
  • document color provider

Trimmed block in documentation

Describe the bug

GQ5PN0CT4AB Q3I~AYKX1_D

Package/Software version:

tinymist extension version: v0.11.1. Get it by tinymist --version in terminal.

guide to neovim users

  • tips for enabling LSP-based folding in neovim
     { -- folds
        "kevinhwang91/nvim-ufo",
        dependencies = "kevinhwang91/promise-async",
        init = function()
          vim.o.foldcolumn = "1" -- '0' is not bad
          vim.o.foldlevel = 99 -- Using ufo provider need a large value, feel free to decrease the value
          vim.o.foldlevelstart = 99
          vim.o.foldenable = true
        end,
        config = true,
      },
      { -- configure LPS servers
        "neovim/nvim-lspconfig",
        dependencies = "kevinhwang91/nvim-ufo", -- enable LSP-based folds
        config = function()
          require "plugins.configs.lspconfig"
          require "custom.configs.lspconfig"
        end,
      },
  • But I'm not sure how to get on the mason's list. typst-lsp is on that list.

Tracking issues from Discord 2

  • Can't you also accommodate the Neovim's config file(s) in your repo?
  • fix neovim configuration: neovim/nvim-lspconfig#3075 (comment)
  • Maybe I'll give you the file in question, 70% sure it's specific to this one (either unique to this file or the effect is over amplified on this one)
  • if I have a folder open that is not the one that my typ file is in, then the lsp does not work at all

Inlay hint for `lr` wrongly displays before the first comma

Describe the bug

In math, within the parentheses of a call to lr, commas are interpreted as content instead of as argument separators by Typst. However, the extension treats them as argument separators. This causes the inlay hint to appear before the first comma.

To Reproduce

  1. Create a new Typst document.
  2. Write $lr(1, 2, 3)$.
  3. Notice how the inlay hint “: body” appears after 1.

Expected behavior

The hint should appear before the closing parenthesis, after 3.

Package/Software version

tinymist extension version: v0.10.2

Autocomplete for Reference doesn't seem to work

Describe the bug
Autocomplete for entries lies in the bibliography doesn't work perfectly. It seems like @ won't trigger an autocomplete, but only when typing the full name we will have autocomplete.

image

image

Seems like the trigger for autocomplete is not correct?

Notes from reading issues of typst-lsp

  • Neovim related: Better root directory pattern: typst-lsp/issues/263#issuecomment-1857385465
    require('lspconfig').typst_lsp.setup{
      root_dir = function(fname)
        return require('lspconfig.util').root_pattern('typst.toml', '.git')(fname)
          or vim.fn.getcwd()
      end,
    }
    But looks like nvim-lspconfig doesn't like it.
    Also I don't know whether the following issues from discord are already solved, since it was sent at tinymist 0.11.1. I may just add some tests for them for marking as completed.
    • Put some documentation about it. I'm not sure if I need to open an issue, I wanted to note that where function doesn't work for some reason:
      https://discord.com/channels/1054443721975922748/1216655435663409152/1218291484118487100
      • O!! I was finally able to understand how those damn LSP server commands work and how to execute them. And I was able to pin the main file with tinymist
    • I also have found out that not all errors are shown by tinymist. I haven't checked typst-lsp. And I don't understand why is that, if it does show all other errors. I even force-pinned the main file.
  • Add unicode input by symbol expansion.
    We had similar idea on expanding symbols after one pushing a space. But we didn't make a conclusion whether it is a good idea. The issue helps confirm it. Follows https://docs.julialang.org/en/v1/manual/unicode-input/.
  • Disable diagnosis message for specific files.
    Okay, I think of the feature proposed by me should be also handled by me.
  • Update: Do not autoclose $ after an escaping slash

The other issues are already solved, good luck.

thread 'main' panicked on invalid range

Describe the bug

 .../vim/lsp/rpc.lua:734    "rpc"    "/home/user/.local/share/cargo/bin/tinymist"    "stderr"    "thread 'main' panicked at crates/tinymist/src/query.rs:92:26:\ninvalid range

To Reproduce

Find a way to reproduce it...

Package/Software version:

tinymist extension version: v0.10.1

Feature request: feature request template

Motivation

A single (short) use case, scenario, or other argument used in support of this feature request.

Description

A clear and concise description of this feature request.

Examples/Questions

Using examples to profile how you imagine the feature should be, and raising questions to highlight the uncertain design for the feature.

Not managing to make work tinymist in Neovim

Describe the bug
I am using neovim and I can't get tinymist to work.

I am using a modify version of kickstart.nvim not a distro.

Just to be clear about what I have done :

  • tinylist is present in the "ensure installed" of my lsp. If I uninstalled it in Mason, it reinstall when I reopen nvim.

  • I have added the autocmds file and the plugin file.

    • autocmds.lua file in the root of my config
    • tinymist.lua is present in the root_config/plugin/
  • typst-lsp work but I want to test tinymist

  • .typ are registering well as typst file

  • no checkhealth warning or error about this about mason

  • no error in my config

When I call the command LspInfo on a .typ file I get this :

 Language client log: /Users/pauladam/.local/state/nvim/lsp.log
 Detected filetype:   typst
 
 0 client(s) attached to this buffer: 
 
 Configured servers list: ocamllsp, rust_analyzer, clangd, lua_ls

Package/Software version:

tinymist extension version: v0.11.0. Get it by tinymist --version in terminal.

tinymist 
Build Timestamp:     2024-03-29T09:32:33.418921000Z
Build Git Describe:  858c100
Commit SHA:          858c10014672b62e93b38c5d85666da0decf273f
Commit Date:         None
Commit Branch:       None
Cargo Target Triple: aarch64-apple-darwin
Typst Version:       0.11.0

Neovim version

NVIM v0.10.0-dev-2528+g04232a19c-Homebrew
Build type: Release
LuaJIT 2.1.1710088188

[Feature Request] Export specific pages as images with custom PPI

Describe the feature
Export specific pages as images with custom PPI.

Details (still open for discussion)
I propose adding two new options to the "Export as" menu: "PNG (Specific Pages)" and "SVG (Specific Pages)".

When one of these options is selected, the user should be prompted to input the pages to be exported, the desired PPI, and output filename.

About the input format for the pages to be exported, I suggest using a comma-separated list of values. Each value could be a single page number, or a closed interval in the form of 'a-b'.

The PPI input should remember the value from the last usage and offer multiples of 144 as selectable options.

The output directory parameter should be similar to the typst command line parameter format, which is a filename with {n}.

Textmate grammar bug

Describe the bug

J(`@Q%N_ $8HW{_~470~ACP

Package/Software version:

tinymist extension version: v0.11.1.

npm run compile fails in editors/vscode

Describe the bug
Howdy!
npm run fails with

src/features/symbol-view.detypify.ts:1:26 - error TS2307: Cannot find module '../../assets/detypify/infer.json' or its corresponding type declarations.

1 import inferSymbols from "../../assets/detypify/infer.json";
                           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Package/Software version:

tinymist extension version: v0.11.0#398f2afb043f523ec5b8de84bda0735e3370177b.

tinymist 
Build Timestamp:     2024-03-22T02:18:18.207134800Z
Build Git Describe:  v0.11.1-rc2-5-gf0a96cb-dirty
Commit SHA:          398f2afb043f523ec5b8de84bda0735e3370177b
Typst Version:       0.11.0

Cargo.lock is broken

Describe the bug
Hi i'm trying to package your project with nix, and it fails, some sources are missing, typst-preview for example
Could you please regenerate that correcly so it can be easily used (sry i'm not a rust dev yet )

Milestone: v0.11.2

  • Investigate a memory exhausting bug.
  • fix neovim configuration
  • #28
  • autocompletion improvement
    • fix possibly wrong cursor offset from autocompletion request.
    • fix some completion kind and may also PR the fix to typst-ide.
    • autocomplete even if no word boundary occurs after cursor (possibly same root cause as the first issue).
    • complete the named arguments with a colon with an extra space and may also PR the improvement to typst-ide.
    • improve completion kind and list by static analysis result.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.