Myriad-Dreamin / tinymist

Tinymist [ˈtaɪni mɪst] is an integrated language service for Typst [taɪpst].
https://myriad-dreamin.github.io/tinymist
Apache License 2.0
278 stars 11 forks source link

Export not working in Helix #327

Closed devanlooches closed 2 weeks ago

devanlooches commented 3 weeks ago

Describe the bug I have installed tinymist and everything works perfectly except for the export function. I have tried onType and I have tried triggering the lsp-workspace-command manually but neither seems to do anything.

Package/Software version:

helix 24.3 (2cadec0b)

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

tinymist 
Build Timestamp:     2024-06-15T14:48:29.661533000Z
Build Git Describe:  8d753d8
Commit SHA:          8d753d8c565636ab01011f9e22b1ef00d04ce617
Commit Date:         None
Commit Branch:       None
Cargo Target Triple: aarch64-apple-darwin
Typst Version:       0.11.1

Logs:

Helix Logs (This is opening a file and manually triggering the lsp-workspace-command tinymist.exportPdf):

2024-06-15T08:49:31.212 helix_lsp::transport [ERROR] tinymist err <- "[2024-06-15T15:49:31Z INFO  tinymist] starting generic LSP server: LspArgs {\n"
2024-06-15T08:49:31.212 helix_lsp::transport [ERROR] tinymist err <- "        mirror: MirrorArgs {\n"
2024-06-15T08:49:31.212 helix_lsp::transport [ERROR] tinymist err <- "            mirror: \"\",\n"
2024-06-15T08:49:31.212 helix_lsp::transport [ERROR] tinymist err <- "            replay: \"\",\n"
2024-06-15T08:49:31.212 helix_lsp::transport [ERROR] tinymist err <- "        },\n"
2024-06-15T08:49:31.212 helix_lsp::transport [ERROR] tinymist err <- "        font: FontArgs {\n"
2024-06-15T08:49:31.212 helix_lsp::transport [ERROR] tinymist err <- "            font_paths: [],\n"
2024-06-15T08:49:31.212 helix_lsp::transport [ERROR] tinymist err <- "            no_system_fonts: false,\n"
2024-06-15T08:49:31.212 helix_lsp::transport [ERROR] tinymist err <- "        },\n"
2024-06-15T08:49:31.212 helix_lsp::transport [ERROR] tinymist err <- "    }\n"
2024-06-15T08:49:31.212 helix_lsp::transport [ERROR] tinymist err <- "[2024-06-15T15:49:31Z INFO  tinymist::harness] handling initialize - (0) at Instant { tv_sec: 755941, tv_nsec: 880753041 }\n"
2024-06-15T08:49:31.212 helix_lsp::transport [ERROR] tinymist err <- "[2024-06-15T15:49:31Z INFO  tinymist::server::lsp_init] initialized with const_config ConstConfig { position_encoding: Utf8, cfg_change_registration: true, tokens_dynamic_registration: false, tokens_overlapping_token_support: false, tokens_multiline_token_support: false, doc_line_folding_only: true, doc_fmt_dynamic_registration: false }\n"
2024-06-15T08:49:31.212 helix_lsp::transport [ERROR] tinymist err <- "[2024-06-15T15:49:31Z INFO  tinymist::server::lsp_init] initialized with config Config { notify_compile_status: false, compile: CompileConfig { roots: [], output_path: \"\", export_pdf: OnType, root_path: None, font_opts: CompileFontOpts { font_profile_cache_path: \"\", font_paths: [], no_system_fonts: false }, system_fonts: None, font_paths: [], fonts: OnceCell(Uninit), notify_compile_status: false, periscope_args: None, typst_extra_args: None, preferred_theme: None, has_default_entry_path: false }, semantic_tokens: Enable, formatter: Typstyle, formatter_print_width: 0 }\n"
2024-06-15T08:49:31.212 helix_lsp::transport [ERROR] tinymist err <- "[2024-06-15T15:49:31Z INFO  tinymist::actor::format] formatting thread with config: FormatConfig {\n"
2024-06-15T08:49:31.212 helix_lsp::transport [ERROR] tinymist err <- "        mode: Typstyle,\n"
2024-06-15T08:49:31.212 helix_lsp::transport [ERROR] tinymist err <- "        width: 120,\n"
2024-06-15T08:49:31.212 helix_lsp::transport [ERROR] tinymist err <- "    }\n"
2024-06-15T08:49:31.212 helix_lsp::transport [ERROR] tinymist err <- "[2024-06-15T15:49:31Z INFO  tinymist::server::compiler_init] creating SharedFontResolver with CompileFontOpts { font_profile_cache_path: \"\", font_paths: [], no_system_fonts: false }\n"
2024-06-15T08:49:31.212 helix_lsp::transport [ERROR] tinymist err <- "[2024-06-15T15:49:31Z INFO  tinymist::actor] TypstActor: creating server for primary, entry: Detached, inputs: {}\n"
2024-06-15T08:49:31.212 helix_lsp::transport [ERROR] tinymist err <- "[2024-06-15T15:49:31Z INFO  tinymist::harness] handled  initialize - (0) in 653.71µs\n"
2024-06-15T08:49:31.212 helix_lsp::transport [ERROR] tinymist err <- "[2024-06-15T15:49:31Z INFO  tinymist::harness] waiting for initialized notification\n"
2024-06-15T08:49:31.213 helix_lsp::transport [ERROR] tinymist err <- "[2024-06-15T15:49:31Z INFO  tinymist::server::lsp] server initialized\n"
2024-06-15T08:49:31.213 helix_lsp::transport [ERROR] tinymist err <- "[2024-06-15T15:49:31Z INFO  tinymist::server::lsp] notifying textDocument/didOpen - at Instant { tv_sec: 755941, tv_nsec: 881618875 }\n"
2024-06-15T08:49:31.213 helix_lsp::transport [ERROR] tinymist err <- "[2024-06-15T15:49:31Z INFO  tinymist::server::lsp] did open Url { scheme: \"file\", cannot_be_a_base: false, username: \"\", password: None, host: None, port: None, path: \"/Users/devanlooches/Downloads/matrix_practice.typ\", query: None, fragment: None }\n"
2024-06-15T08:49:31.213 helix_term::application [WARN] Ignoring a client/registerCapability request because dynamic capability registration is not enabled. Please report this upstream to the language server
2024-06-15T08:49:31.213 helix_lsp::transport [ERROR] tinymist err <- "[2024-06-15T15:49:31Z INFO  tinymist::state] create source: \"/Users/devanlooches/Downloads/matrix_practice.typ\"\n"
2024-06-15T08:49:31.213 helix_lsp::transport [ERROR] tinymist err <- "[2024-06-15T15:49:31Z INFO  tinymist::actor::typ_client] the entry file of TypstActor(primary) is changing to Workspace { root: \"/Users/devanlooches/Downloads\", main: Some(/matrix_practice.typ) }\n"
2024-06-15T08:49:31.347 helix_lsp::transport [ERROR] tinymist err <- "[2024-06-15T15:49:31Z INFO  typst_ts_compiler::service::diag::console] /matrix_practice.typ: compiling ...\n"
2024-06-15T08:49:31.347 helix_lsp::transport [ERROR] tinymist err <- "[2024-06-15T15:49:31Z INFO  tinymist::state] file focused[implicit,o]: Some(\"/Users/devanlooches/Downloads/matrix_practice.typ\")\n"
2024-06-15T08:49:31.347 helix_lsp::transport [ERROR] tinymist err <- "[2024-06-15T15:49:31Z INFO  tinymist::server::lsp] notifing textDocument/didOpen succeeded in 134.75ms\n"
2024-06-15T08:49:31.347 helix_lsp::transport [ERROR] tinymist err <- "[2024-06-15T15:49:31Z INFO  tinymist::actor::export] RenderActor: document is not ready\n"
2024-06-15T08:49:31.347 helix_lsp::transport [ERROR] tinymist err <- "[2024-06-15T15:49:31Z INFO  tinymist::server::lsp] notifying workspace/didChangeConfiguration - at Instant { tv_sec: 755942, tv_nsec: 16376208 }\n"
2024-06-15T08:49:31.347 helix_lsp::transport [ERROR] tinymist err <- "[2024-06-15T15:49:31Z INFO  tinymist::server::compiler] new settings applied\n"
2024-06-15T08:49:31.347 helix_lsp::transport [ERROR] tinymist err <- "[2024-06-15T15:49:31Z INFO  tinymist::server::lsp] new settings applied\n"
2024-06-15T08:49:31.347 helix_lsp::transport [ERROR] tinymist err <- "[2024-06-15T15:49:31Z INFO  tinymist::server::lsp] notifing workspace/didChangeConfiguration succeeded in 15.83µs\n"
2024-06-15T08:49:31.355 helix_lsp::transport [ERROR] tinymist err <- "[2024-06-15T15:49:31Z INFO  tinymist::actor::export] RenderActor: check path None and root None with output directory \n"
2024-06-15T08:49:31.355 helix_lsp::transport [ERROR] tinymist err <- "[2024-06-15T15:49:31Z INFO  typst_ts_compiler::service::diag::console] /matrix_practice.typ: Compilation succeeded in 7.742ms\n"
2024-06-15T08:49:31.355 helix_lsp::transport [ERROR] tinymist err <- "[2024-06-15T15:49:31Z INFO  tinymist::actor::editor] received diagnostics from primary: diag(Some(0))\n"
2024-06-15T08:49:31.355 helix_lsp::transport [ERROR] tinymist err <- "[2024-06-15T15:49:31Z INFO  tinymist::actor::typ_server] CompileServerActor: evict compilation cache in 8.416µs\n"
2024-06-15T08:49:31.357 helix_lsp::transport [ERROR] tinymist err <- "[2024-06-15T15:49:31Z INFO  typst_ts_compiler::service::diag::console] /matrix_practice.typ: compiling ...\n"
2024-06-15T08:49:31.357 helix_lsp::transport [ERROR] tinymist err <- "[2024-06-15T15:49:31Z INFO  typst_ts_compiler::service::diag::console] /matrix_practice.typ: Compilation succeeded in 103µs\n"
2024-06-15T08:49:31.357 helix_lsp::transport [ERROR] tinymist err <- "[2024-06-15T15:49:31Z INFO  tinymist::actor::export] RenderActor: check path None and root None with output directory \n"
2024-06-15T08:49:31.357 helix_lsp::transport [ERROR] tinymist err <- "[2024-06-15T15:49:31Z INFO  tinymist::actor::editor] received diagnostics from primary: diag(Some(0))\n"
2024-06-15T08:49:31.357 helix_lsp::transport [ERROR] tinymist err <- "[2024-06-15T15:49:31Z INFO  tinymist::actor::typ_server] CompileServerActor: evict compilation cache in 5.375µs\n"
2024-06-15T08:49:31.417 helix_lsp::transport [ERROR] tinymist err <- "[2024-06-15T15:49:31Z INFO  tinymist::harness] handling textDocument/inlayHint - (1) at Instant { tv_sec: 755942, tv_nsec: 85603083 }\n"
2024-06-15T08:49:31.417 helix_lsp::transport [ERROR] tinymist err <- "[2024-06-15T15:49:31Z INFO  tinymist_query::analysis::global] def_use_lexical_hierarchy(/matrix_practice.typ): compute\n"
2024-06-15T08:49:31.417 helix_lsp::transport [ERROR] tinymist err <- "[2024-06-15T15:49:31Z INFO  tinymist_query::syntax::lexical_hierarchy] lexical hierarchy analysis took 235µs\n"
2024-06-15T08:49:31.417 helix_lsp::transport [ERROR] tinymist err <- "[2024-06-15T15:49:31Z INFO  tinymist_query::analysis::global] import(4): compute\n"
2024-06-15T08:49:31.417 helix_lsp::transport [ERROR] tinymist err <- "[2024-06-15T15:49:31Z INFO  tinymist_query::analysis::global] def_use((4, 0)): compute\n"
2024-06-15T08:49:31.433 helix_lsp::transport [ERROR] tinymist err <- "[2024-06-15T15:49:31Z INFO  tinymist::harness] handled  textDocument/inlayHint - (1) in 16.75ms\n"
2024-06-15T08:49:36.387 helix_lsp::transport [ERROR] tinymist err <- "[2024-06-15T15:49:36Z INFO  tinymist::harness] handling workspace/executeCommand - (2) at Instant { tv_sec: 755947, tv_nsec: 55992500 }\n"
2024-06-15T08:49:36.387 helix_lsp::transport [ERROR] tinymist <- InvalidParams: The first parameter is not a valid path
2024-06-15T08:49:36.387 helix_term::commands::lsp [ERROR] execute LSP command: protocol error: InvalidParams: The first parameter is not a valid path
2024-06-15T08:49:36.387 helix_lsp::transport [ERROR] tinymist err <- "[2024-06-15T15:49:36Z INFO  tinymist::harness] handled  workspace/executeCommand - (2) in 98.71µs\n"

Configuration

[[language]]
name = "typst"
auto-format = true
language-servers = [ "tinymist", "typos"]

[language-server.tinymist]
command = "tinymist"
config = { exportPdf = "onType", formatterMode = "typstyle" }
Myriad-Dreamin commented 3 weeks ago

Note that tinymist's commands doesn't work in helix at all, since helix doesn't support to call command with arguments:

2024-06-15T08:49:36.387 helix_lsp::transport [ERROR] tinymist <- InvalidParams: The first parameter is not a valid path
2024-06-15T08:49:36.387 helix_term::commands::lsp [ERROR] execute LSP command: protocol error: InvalidParams: The first parameter is not a valid path
Myriad-Dreamin commented 3 weeks ago

I'll check it in next week.