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
734 stars 30 forks source link

Typst Preview: Preview Current File - No Method Found #571

Closed ItsCrem closed 2 months ago

ItsCrem commented 2 months ago

Describe the bug I am trying to use your plugin on my NixOS machine and the preview functionality does not seem to work. In the logs it seems to refer to "No Method Found".

Package/Software version:

VSCode version(Help -> About):

Version: 1.81.1
Commit: 6c3e3dba23e8fadc360aed75ce363ba185c49794
Date: 2023-08-09T22:18:39.991Z
Electron: 22.3.18
ElectronBuildId: 22689846
Chromium: 108.0.5359.215
Node.js: 16.17.1
V8: 10.8.168.25-electron.0
OS: Linux x64 6.4.12-x64v4-xanmod1

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

tinymist 
Build Timestamp:     1980-01-01T00:00:00.000000000Z
Build Git Describe:  VERGEN_IDEMPOTENT_OUTPUT
Commit SHA:          VERGEN_IDEMPOTENT_OUTPUT
Commit Date:         None
Commit Branch:       None
Cargo Target Triple: x86_64-unknown-linux-gnu
Typst Version:       0.11.1

Logs:

tinymist server log(Output Panel -> tinymist):

2024-08-27T01:08:07Z INFO  tinymist::server::lsp] notifying $/setTrace - at Instant { tv_sec: 1351, tv_nsec: 719734371 }
[2024-08-27T01:08:07Z WARN  tinymist::server::lsp] unhandled notification: $/setTrace
[2024-08-27T01:08:07Z INFO  tinymist::server::lsp] notifying workspace/didChangeConfiguration - at Instant { tv_sec: 1351, tv_nsec: 719787298 }
[2024-08-27T01:08:07Z INFO  tinymist::server::lsp] notifing workspace/didChangeConfiguration succeeded in 58.90µs
[2024-08-27T01:08:07Z INFO  tinymist::server::compiler] new settings applied
[2024-08-27T01:08:07Z INFO  tinymist::server::lsp] new settings applied
[2024-08-27T01:08:08Z INFO  tinymist::harness] handling workspace/executeCommand - (68) at Instant { tv_sec: 1352, tv_nsec: 632101069 }
[2024-08-27T01:08:08Z INFO  tinymist::harness] handled  workspace/executeCommand - (68) in 72.40µs
[2024-08-27T01:08:14Z INFO  tinymist::harness] handling workspace/executeCommand - (69) at Instant { tv_sec: 1358, tv_nsec: 617102183 }
[2024-08-27T01:08:14Z INFO  tinymist::actor::typ_client] the entry file of TypstActor(primary) is changing to Workspace { root: "/home/crem/Documents/projects/typst-demo", main: Some(/main.typ) }
[2024-08-27T01:08:14Z INFO  typst_ts_compiler::service::diag::console] /main.typ: compiling ...
[2024-08-27T01:08:14Z INFO  tinymist::server::lsp] file focused: Some("/home/crem/Documents/projects/typst-demo/main.typ")
[2024-08-27T01:08:14Z INFO  tinymist::harness] handled  workspace/executeCommand - (69) in 217.28µs
[2024-08-27T01:08:14Z INFO  typst_ts_compiler::service::diag::console] /main.typ: Compilation succeeded in 125.912µs
[2024-08-27T01:08:14Z INFO  tinymist::actor::typ_server] CompileServerActor: evict compilation cache in 9.478µs
[2024-08-27T01:08:14Z INFO  typst_ts_compiler::service::diag::console] /main.typ: compiling ...
[2024-08-27T01:08:14Z INFO  tinymist::actor::editor] received diagnostics from primary: diag(Some(0))
[2024-08-27T01:08:14Z INFO  typst_ts_compiler::service::diag::console] /main.typ: Compilation succeeded in 32.33µs
[2024-08-27T01:08:14Z INFO  tinymist::actor::typ_server] CompileServerActor: evict compilation cache in 1.202µs
[2024-08-27T01:08:14Z INFO  tinymist::actor::editor] received diagnostics from primary: diag(Some(0))
[2024-08-27T01:08:14Z INFO  tinymist::harness] handling textDocument/documentColor - (70) at Instant { tv_sec: 1358, tv_nsec: 619398786 }
[2024-08-27T01:08:14Z INFO  tinymist::harness] handled  textDocument/documentColor - (70) in 147.32µs
[2024-08-27T01:08:14Z INFO  tinymist::harness] handling textDocument/codeAction - (71) at Instant { tv_sec: 1358, tv_nsec: 628592082 }
[2024-08-27T01:08:14Z INFO  tinymist::harness] handled  textDocument/codeAction - (71) in 245.58µs
[2024-08-27T01:08:14Z INFO  tinymist::harness] handling textDocument/foldingRange - (72) at Instant { tv_sec: 1358, tv_nsec: 803619968 }
[2024-08-27T01:08:14Z INFO  tinymist_query::syntax::lexical_hierarchy] lexical hierarchy analysis took 9.497µs
[2024-08-27T01:08:14Z INFO  tinymist::harness] handled  textDocument/foldingRange - (72) in 108.28µs
[2024-08-27T01:08:14Z INFO  tinymist::harness] handling textDocument/codeAction - (73) at Instant { tv_sec: 1358, tv_nsec: 863444361 }
[2024-08-27T01:08:14Z WARN  tinymist_query::lsp_typst_boundary::lsp_to_typst] LSP position is out of bounds: Position { line: 0, character: 6 }, while only 1 lines and Some(0..6) characters at the end.
[2024-08-27T01:08:14Z WARN  tinymist_query::lsp_typst_boundary::lsp_to_typst] LSP position is out of bounds: Position { line: 0, character: 6 }, while only 1 lines and Some(0..6) characters at the end.
[2024-08-27T01:08:14Z INFO  tinymist::harness] handled  textDocument/codeAction - (73) in 272.88µs
[2024-08-27T01:08:14Z INFO  tinymist::harness] handling textDocument/semanticTokens/full/delta - (74) at Instant { tv_sec: 1358, tv_nsec: 899750294 }
[2024-08-27T01:08:14Z INFO  tinymist::harness] handled  textDocument/semanticTokens/full/delta - (74) in 91.27µs
[2024-08-27T01:08:14Z INFO  tinymist::harness] handling textDocument/codeLens - (75) at Instant { tv_sec: 1358, tv_nsec: 907358167 }
[2024-08-27T01:08:14Z INFO  tinymist::harness] handled  textDocument/codeLens - (75) in 220.17µs
[2024-08-27T01:08:14Z INFO  tinymist::harness] handling textDocument/documentSymbol - (76) at Instant { tv_sec: 1358, tv_nsec: 907956500 }
[2024-08-27T01:08:14Z INFO  tinymist_query::syntax::lexical_hierarchy] lexical hierarchy analysis took 7.243µs
[2024-08-27T01:08:14Z INFO  tinymist::harness] handled  textDocument/documentSymbol - (76) in 101.86µs
[2024-08-27T01:08:14Z INFO  tinymist::harness] handling textDocument/foldingRange - (77) at Instant { tv_sec: 1358, tv_nsec: 911167869 }
[2024-08-27T01:08:14Z INFO  tinymist_query::syntax::lexical_hierarchy] lexical hierarchy analysis took 4.549µs
[2024-08-27T01:08:14Z INFO  tinymist::harness] handled  textDocument/foldingRange - (77) in 62.46µs
[2024-08-27T01:08:16Z INFO  tinymist::server::lsp] notifying textDocument/didClose - at Instant { tv_sec: 1360, tv_nsec: 169437229 }
[2024-08-27T01:08:16Z INFO  tinymist::state] remove source: "/home/crem/.config/Code/logs/20240827T110441/window1/exthost/output_logging_20240827T110443/2-Tinymist Typst Language Server.log"
[2024-08-27T01:08:16Z INFO  tinymist::server::lsp] notifing textDocument/didClose succeeded in 5.28ms
[2024-08-27T01:08:16Z INFO  typst_ts_compiler::service::diag::console] /main.typ: compiling ...
[2024-08-27T01:08:16Z INFO  typst_ts_compiler::service::diag::console] /main.typ: Compilation succeeded in 141.451µs
[2024-08-27T01:08:16Z INFO  tinymist::actor::typ_server] CompileServerActor: evict compilation cache in 9.087µs
[2024-08-27T01:08:16Z INFO  tinymist::actor::editor] received diagnostics from primary: diag(Some(0))
[2024-08-27T01:08:19Z INFO  tinymist::harness] handling workspace/executeCommand - (78) at Instant { tv_sec: 1363, tv_nsec: 473496030 }
[2024-08-27T01:08:19Z ERROR tinymist::server::lsp] asked to execute unknown command
[2024-08-27T01:08:19Z INFO  tinymist::harness] handling textDocument/codeLens - (79) at Instant { tv_sec: 1363, tv_nsec: 721844947 }
[2024-08-27T01:08:19Z INFO  tinymist::harness] handled  textDocument/codeLens - (79) in 343.03µs
[2024-08-27T01:08:25Z INFO  tinymist::harness] handling workspace/executeCommand - (80) at Instant { tv_sec: 1369, tv_nsec: 151481662 }
[2024-08-27T01:08:25Z INFO  tinymist::actor::typ_client] the entry file of TypstActor(primary) is changing to Workspace { root: "/home/crem/Documents/projects/typst-demo", main: None }
[2024-08-27T01:08:25Z INFO  tinymist::actor::typ_client] TypstActor: removing diag
[2024-08-27T01:08:25Z INFO  tinymist::actor::editor] received diagnostics from primary: diag(None)
[2024-08-27T01:08:25Z INFO  tinymist::server::lsp] file focused: None
[2024-08-27T01:08:25Z INFO  tinymist::harness] handled  workspace/executeCommand - (80) in 289.25µs

tinymist client log(Help -> Toggle Developer Tools -> Console):

[Extension Host] stack trace: Error: Method not found
    at wn (/home/crem/.vscode/extensions/myriad-dreamin.tinymist-0.11.20-linux-x64/out/extension.js:6:228)
    at Mn (/home/crem/.vscode/extensions/myriad-dreamin.tinymist-0.11.20-linux-x64/out/extension.js:5:6250)
    at Zn (/home/crem/.vscode/extensions/myriad-dreamin.tinymist-0.11.20-linux-x64/out/extension.js:5:6387)
    at Immediate.<anonymous> (/home/crem/.vscode/extensions/myriad-dreamin.tinymist-0.11.20-linux-x64/out/extension.js:5:6137)
    at process.processImmediate (node:internal/timers:478:21)

myriad-dreamin.tinymist]Method not found $onExtensionRuntimeErrror @ mainThreadExtensionsService.ts:78

Error: Method not found
    at wn (/home/crem/.vscode/extensions/myriad-dreamin.tinymist-0.11.20-linux-x64/out/extension.js:6:228)
    at Mn (/home/crem/.vscode/extensions/myriad-dreamin.tinymist-0.11.20-linux-x64/out/extension.js:5:6250)
    at Zn (/home/crem/.vscode/extensions/myriad-dreamin.tinymist-0.11.20-linux-x64/out/extension.js:5:6387)
    at Immediate.<anonymous> (/home/crem/.vscode/extensions/myriad-dreamin.tinymist-0.11.20-linux-x64/out/extension.js:5:6137)
    at process.processImmediate (node:internal/timers:478:21)
$onExtensionRuntimeError @ mainThreadExtensionService.ts:79

Additional context Add any other context about the problem here.

So it might be a NixOS specific issue. I tried on my Mac and it worked perfectly.

The same problem happens when I installed the plugin via NixOS configuration or just through the VSCode Marketplace as well.

Path Location of tinymist binary: /etc/profiles/per-user/crem/bin/tinymist

Please let me know if you require any additional logs or configurations.

Myriad-Dreamin commented 2 months ago

You seems to use an outdated tinymist binary. Please check and upgrade it. This is being an common issue of nix users

ItsCrem commented 2 months ago

OK when I upgrade to unstable.tinymist, the preview works now.

Interesting though that my tinymist binary still reports weird information.

Observe the difference between -V and --version flags.

❯ tinymist -V    
tinymist 0.11.16
❯ tinymist --version
tinymist 
Build Timestamp:     1980-01-01T00:00:00.000000000Z
Build Git Describe:  VERGEN_IDEMPOTENT_OUTPUT
Commit SHA:          VERGEN_IDEMPOTENT_OUTPUT
Commit Date:         None
Commit Branch:       None
Cargo Target Triple: x86_64-unknown-linux-gnu
Typst Version:       0.11.1
Myriad-Dreamin commented 2 months ago

VERGEN_IDEMPOTENT_OUTPUT

I think this is expected since nix doesn't like you embed these version informatio. They exclude it when building tinymist.

ItsCrem commented 2 months ago

Everything seems to be working though :)

Thanks for the help!