Skip to content

Commit

Permalink
build: bump version to 0.11.2 (#136)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
Myriad-Dreamin authored Mar 30, 2024
1 parent f7fd47d commit b635f06
Show file tree
Hide file tree
Showing 14 changed files with 129 additions and 69 deletions.
32 changes: 16 additions & 16 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -126,35 +142,19 @@ 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
with:
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
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[CHANGELOG.md](./editors/vscode/CHANGELOG.md)
10 changes: 5 additions & 5 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[workspace.package]
description = "An integrated language service for Typst."
authors = ["Myriad-Dreamin <[email protected]>", "Nathan Varner"]
version = "0.11.1"
version = "0.11.2"
edition = "2021"
readme = "README.md"
license = "Apache-2.0"
Expand Down Expand Up @@ -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"
Expand Down
6 changes: 3 additions & 3 deletions crates/tinymist/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions crates/tinymist/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
28 changes: 1 addition & 27 deletions crates/tinymist/src/server/lsp.rs
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
21 changes: 18 additions & 3 deletions editors/helix/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
7 changes: 4 additions & 3 deletions editors/neovim/Configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -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"`
42 changes: 42 additions & 0 deletions editors/vscode/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 4 additions & 3 deletions editors/vscode/Configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -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"`
32 changes: 29 additions & 3 deletions editors/vscode/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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.

Expand Down
2 changes: 1 addition & 1 deletion editors/vscode/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "tinymist",
"version": "0.11.1",
"version": "0.11.2",
"description": "An integrated language service for Typst",
"categories": [
"Programming Languages",
Expand Down
2 changes: 1 addition & 1 deletion syntaxes/textmate/package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down

0 comments on commit b635f06

Please sign in to comment.