build: bump version to 0.11.2 (#136)

* docs: update documents

* fix: correct order of building binaries

* build: bump version to 0.11.2

* docs: redirect changelog

* docs: update document tips

* docs: update insert template in place tips

* build: bump typstyle version to 0.11.7
This commit is contained in:
Myriad-Dreamin 2024-03-30 23:02:43 +08:00 committed by GitHub
parent f7fd47d62c
commit b635f06619
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
14 changed files with 129 additions and 69 deletions

View file

@ -116,6 +116,22 @@ jobs:
run: |
cargo build --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
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
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"
- name: Copy binary to output directory
if: (startsWith(github.ref, 'refs/tags/') || matrix.regular_build == 'true')
shell: pwsh
@ -126,23 +142,12 @@ jobs:
run: |
cargo test --release --workspace --target ${{ matrix.rust-target }}
if: (startsWith(github.ref, 'refs/tags/') || matrix.regular_build == 'true') && (matrix.platform == 'linux') && (matrix.arch == 'x64')
- 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
cp tinymist.pdb tinymist-${{ env.target }}.pdb
- 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
- 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
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: Upload split debug symbols for linux
if: matrix.platform == 'linux' && (startsWith(github.ref, 'refs/tags/') || matrix.regular_build == 'true')
uses: actions/upload-artifact@v4
@ -150,11 +155,6 @@ jobs:
name: tinymist-${{ env.target }}.debug
path: target/${{ matrix.rust-target }}/release/tinymist-${{ env.target }}.debug
compression-level: 0
- 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"
- 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

1
CHANGELOG.md Normal file
View file

@ -0,0 +1 @@
[CHANGELOG.md](./editors/vscode/CHANGELOG.md)

10
Cargo.lock generated
View file

@ -3595,7 +3595,7 @@ dependencies = [
[[package]]
name = "tests"
version = "0.11.1"
version = "0.11.2"
dependencies = [
"insta",
"lsp-server",
@ -3692,7 +3692,7 @@ dependencies = [
[[package]]
name = "tinymist"
version = "0.11.1"
version = "0.11.2"
dependencies = [
"anyhow",
"async-trait",
@ -3739,7 +3739,7 @@ dependencies = [
[[package]]
name = "tinymist-query"
version = "0.11.1"
version = "0.11.2"
dependencies = [
"anyhow",
"comemo 0.4.0",
@ -4371,9 +4371,9 @@ dependencies = [
[[package]]
name = "typstyle"
version = "0.11.5"
version = "0.11.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d6c988471bb18b9f743fed9bd2be724c872c442e58c213025bfe63e96b76cd18"
checksum = "fccb2f17f77e44b1ab91257f51c817ec357d768456cc1d07ba84bcb030d55ed9"
dependencies = [
"anyhow",
"clap",

View file

@ -1,7 +1,7 @@
[workspace.package]
description = "An integrated language service for Typst."
authors = ["Myriad-Dreamin <camiyoru@gmail.com>", "Nathan Varner"]
version = "0.11.1"
version = "0.11.2"
edition = "2021"
readme = "README.md"
license = "Apache-2.0"
@ -52,7 +52,7 @@ reflexo = { version = "0.5.0-rc2", default-features = false, features = [
typst-ts-core = { version = "0.5.0-rc2", default-features = false }
typst-ts-compiler = { version = "0.5.0-rc2" }
typst-preview = { version = "0.11.3" }
typstyle = "0.11.5"
typstyle = "0.11.7"
typstfmt_lib = { git = "https://github.com/astrale-sharp/typstfmt", tag = "0.2.7" }
lsp-server = "0.7.6"

View file

@ -18,9 +18,9 @@ You can record the input during running the editors with Tinymist. You can then
```sh
# Record the input
tinymist --mirror input.txt
tinymist lsp --mirror input.txt
# Replay the input
tinymist --replay input.txt
tinymist lsp --replay input.txt
```
## Analyze memory usage with DHAT
@ -34,7 +34,7 @@ cargo build --release --bin tinymist --features dhat-heap
The instrumented program is nothing different from the normal program, so you can mine the specific memory usage with a lsp session (recorded with `--mirror`) by replaying the input.
```sh
./target/release/tinymist --replay input.txt
./target/release/tinymist lsp --replay input.txt
...
dhat: Total: 740,668,176 bytes in 1,646,987 blocks
dhat: At t-gmax: 264,604,009 bytes in 317,241 blocks

View file

@ -21,9 +21,9 @@
//!
//! ```sh
//! # Record the input
//! tinymist --mirror input.txt
//! tinymist lsp --mirror input.txt
//! # Replay the input
//! tinymist --replay input.txt
//! tinymist lsp --replay input.txt
//! ```
// pub mod formatting;

View file

@ -1,30 +1,4 @@
//! # tinymist
//!
//! This crate provides an integrated service for [Typst](https://typst.app/) [taɪpst]. It provides:
//! + A language server following the [Language Server Protocol](https://microsoft.github.io/language-server-protocol/).
//!
//! ## Architecture
//!
//! Tinymist binary has multiple modes, and it may runs multiple actors in
//! background. The actors could run as an async task, in a single thread, or in
//! an isolated process.
//!
//! The main process of tinymist runs the program as a language server, through
//! stdin and stdout. A main process will fork:
//! - rendering actors to provide PDF export with watching.
//! - compiler actors to provide language APIs.
//!
//! ## Debugging with input mirroring
//!
//! You can record the input during running the editors with Tinymist. You can
//! then replay the input to debug the language server.
//!
//! ```sh
//! # Record the input
//! tinymist --mirror input.txt
//! # Replay the input
//! tinymist --replay input.txt
//! ```
//! tinymist LSP mode
use core::fmt;
use std::path::Path;

View file

@ -36,10 +36,25 @@ language-servers = ["tinymist"]
### Working with Multiple-File Projects
There is a way in [Neovim](../neovim/README.md#multiple-file-project-support), and you can invoke related commands similarly by [:lsp-workspace-command](https://docs.helix-editor.com/commands.html) in helix.
There is a way in [Neovim](../neovim/README.md#multiple-file-project-support), but you cannot invoke related commands with arguments by [:lsp-workspace-command](https://docs.helix-editor.com/commands.html) in helix. As a candidate solution, assuming your having following directory layout:
+ You can bind `:lsp-workspace-command` to a keymap for ease of use.
+ When multiple language servers are configured for a file, using `:lsp-workspace-command` will only show the commands for one of the servers, that means the tinymist commands may be overriden by other language servers, e.g. `ltex`. See [Issue: helix#9017](https://github.com/helix-editor/helix/issues/9017).
```plain
├── .helix
│ └── languages.toml
└── main.typ
```
You could create .helix/languages.toml in the project folder with the following contents:
```toml
[language-server.tinymist.config]
typstExtraArgs = ["main.typ"]
```
Then all diagnostics and autocompletion will be computed according to the `main.typ`.
Note: With that configuration, if you're seeing a file that is not reachable by `main.typ`, you will not get diagnostics and autocompletion correctly in that file.
## Extra Settings

View file

@ -72,12 +72,13 @@ Traces the communication between VS Code and the language server.
- `verbose`
- **Default**: `"off"`
## `experimentalFormatterMode`
## `formatterMode`
The extension can format Typst files using typstfmt (experimental).
The extension can format Typst files using typstfmt or typstyle.
- **Type**: `string`
- **Enum**:
- `disable`: Formatter is not activated.
- `enable`: Experimental formatter is activated.
- `typstyle`: Use typstyle formatter.
- `typstfmt`: Use typstfmt formatter.
- **Default**: `"disable"`

View file

@ -4,6 +4,48 @@ All notable changes to the "tinymist" extension will be documented in this file.
Check [Keep a Changelog](http://keepachangelog.com/) for recommendations on how to structure this file.
## v0.11.2 - [2024-03-30]
### Editor
* (Fix) Passed correct arguments to editor tools in https://github.com/Myriad-Dreamin/tinymist/pull/111
* (Fix) exposed pin/unpin commands for vscode in https://github.com/Myriad-Dreamin/tinymist/pull/121
### Compiler
* (Fix) Converting out of bounds offsets again in https://github.com/Myriad-Dreamin/tinymist/pull/115
* Supported entry configuration in https://github.com/Myriad-Dreamin/tinymist/pull/122
* Supported untitled url scheme for unsaved text buffer in https://github.com/Myriad-Dreamin/tinymist/pull/120 and https://github.com/Myriad-Dreamin/tinymist/pull/130
### Commands/Tools
* Allowed tracing typst programs in subprocess in https://github.com/Myriad-Dreamin/tinymist/pull/112
* This is part of backend for tracing tool, and we may finish a tracing tool in next week.
### Formatting
* Supported formatters in https://github.com/Myriad-Dreamin/tinymist/pull/113
* Use `"formatterMode": "typstyle"` for `typstyle 0.11.7`
* Use `"formatterMode": "typstfmt"` for `typstfmt 0.2.9`
* feat: minimal diff algorithm for source formatting in https://github.com/Myriad-Dreamin/tinymist/pull/123
### Completion
* Fixed wrong completion kind in https://github.com/Myriad-Dreamin/tinymist/pull/124 and https://github.com/Myriad-Dreamin/tinymist/pull/127
* Supported import path completion in https://github.com/Myriad-Dreamin/tinymist/pull/134
* Not completing on definition itself anymore in https://github.com/Myriad-Dreamin/tinymist/pull/135
### Syntax/Semantic Highlighting
* (Fix) Corrected identifier/keyword boundaries in https://github.com/Myriad-Dreamin/tinymist/pull/128
* Improved punctuation and keyword token kinds in https://github.com/Myriad-Dreamin/tinymist/pull/133
### Hover (Tooltip)
* fix: parse docstring dedents correctly in https://github.com/Myriad-Dreamin/tinymist/pull/132
**Full Changelog**: https://github.com/Myriad-Dreamin/tinymist/compare/v0.11.1...v0.11.2
## v0.11.1 - [2024-03-26]
### Editor

View file

@ -72,12 +72,13 @@ Traces the communication between VS Code and the language server.
- `verbose`
- **Default**: `"off"`
## `tinymist.experimentalFormatterMode`
## `tinymist.formatterMode`
The extension can format Typst files using typstfmt (experimental).
The extension can format Typst files using typstfmt or typstyle.
- **Type**: `string`
- **Enum**:
- `disable`: Formatter is not activated.
- `enable`: Experimental formatter is activated.
- `typstyle`: Use typstyle formatter.
- `typstfmt`: Use typstfmt formatter.
- **Default**: `"disable"`

View file

@ -15,8 +15,28 @@ See [Tinymist Features](https://github.com/Myriad-Dreamin/tinymist#features) for
### Initializing with a Template
To initialize a Typst project:
- Use command `Typst Init Template` (tinymist.initTemplate) to initialize a new Typst project based on a template.
- Use command `Typst Show Template` (tinymist.showTemplateGallery) to show available Typst templates for picking up a template to initialize.
- Use command `Typst init template` (tinymist.initTemplate) to initialize a new Typst project based on a template.
- Use command `Typst show template` (tinymist.showTemplateGallery) to show available Typst templates for picking up a template to initialize.
🎉 If your template contains only a single file, you can also insert the template content in place with command:
- Use command `Typst template in place` (tinymist.initTemplateInPlace) and input a template specifier for initialization.
### Configuring LSP-enhanced formatters
1. Open settings.
2. Search for "Tinymist Formatter" and modify the value.
- Use `"formatterMode": "typstyle"` for [typstyle](https://github.com/Enter-tainer/typstyle).
- Use `"formatterMode": "typstfmt"` for [typstfmt](https://github.com/astrale-sharp/typstfmt).
Tips: to enable formatting on save, you should add extra settings for typst language:
```json
{
"[typst]": {
"editor.formatOnSave": true
}
}
```
### Configuring path to search fonts
@ -74,7 +94,13 @@ You can pin a main file by command.
### Passing Extra CLI Arguments
There is a **global** configuration `tinymist.typstExtraArgs` to pass extra arguments to tinymist LSP, like what you usually do with `typst-cli` CLI. For example, you can set it to `["--input=awa=1", "--input=abaaba=2"]` to configure `sys.inputs`.
There is a **global** configuration `tinymist.typstExtraArgs` to pass extra arguments to tinymist LSP, like what you usually do with `typst-cli` CLI. For example, you can set it to `["--input=awa=1", "--input=abaaba=2", "main.typ"]` to configure `sys.inputs` and entry for compiler, which is equivalent to make LSP run like a `typst-cli` with such arguments:
```
typst watch --input=awa=1 --input=abaaba=2 main.typ
```
**Note:** Fix entry to `main.typ` may help multiple-file projects but you may loss diagnostics and autocompletions in unrelated files.
Note: the arguments has quite low priority, and that may be overridden by other settings.

View file

@ -1,6 +1,6 @@
{
"name": "tinymist",
"version": "0.11.1",
"version": "0.11.2",
"description": "An integrated language service for Typst",
"categories": [
"Programming Languages",

View file

@ -1,6 +1,6 @@
{
"name": "typst-textmate",
"version": "0.11.1",
"version": "0.11.2",
"private": true,
"scripts": {
"compile": "npx tsc && node ./dist/main.js",