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
544 stars 27 forks source link

Multiple file development bug in tinymist 0.11.8 #515

Closed liu20080331 closed 1 month ago

liu20080331 commented 1 month ago

Describe the bug 在进行tinymist多文件编写的时候,最新版本无法处理子文件有error但是主文件编译不出现error时的preview刷新。具体来说,当子文件(例如子组件或子模块)中存在错误时,tinymist不会正确地更新预览界面,即使主文件编译没有错误。 When doing tinymist multi-file authoring, the latest version cannot handle preview refreshes when there are errors in subfiles but the main file compiles without errors. Specifically, tinymist will not correctly update the preview screen when there are errors in subfiles (e.g., subcomponents or submodules), even if the main file compiles without errors. Package/Software version: 0.11.8 VSCode version(Help -> About):

版本: 1.88.1 (user setup)
提交: e170252f762678dec6ca2cc69aba1570769a5d39
日期: 2024-04-10T17:41:02.734Z
Electron: 28.2.8
ElectronBuildId: 27744544
Chromium: 120.0.6099.291
Node.js: 18.18.2
V8: 12.0.267.19-electron.0
OS: Windows_NT x64 10.0.26100

tinymist extension version: v0.11.8.

复现不稳定,等出现了我再来add细节

liu20080331 commented 1 month ago

45a493a57e4dbd56f9d3e5053456600f 一个案例,但是依旧不稳定

liu20080331 commented 1 month ago

观察到的现象:在更新并重启插件之后会将跨文件link识别为error,导致主文件出现不编译的情况。

https://github.com/user-attachments/assets/779d03c4-3976-4803-9ac8-a90e1dfb840d

Myriad-Dreamin commented 1 month ago

When you uninstalled tinymist, a lsp server in backend is shut down (last session). Similarly, Reinstalling tinymist means restarting lsp server (this session).

Within the same session, lsp server holds the state of the preview and previewing main file. This state is lost at the end of the session. In other words, the state of the preview and the previewing main file is not shared between sessions.

However, the right side preview should have been disconnected from the lsp server at the last session, thus it will not respond you in this session. For same reason, the left side source code panel starts compiling only by the sub file because it no longer knows which (previewing) main file it is, which results in an (expected) error.

State can be hinted or recovered but it is not a bug but an enhancement.


卸载 tinymist 时,后台的 lsp 服务器会关闭(上次会话)。同样,重新安装 tinymist 意味着重新启动 lsp 服务器(本次会话)。

在同一会话中,lsp 服务器保存着预览和预览主文件的状态。会话结束后,该状态将丢失。换句话说,预览和预览主文件的状态不会在会话之间共享。

不过,右侧预览在上一次会话时应已与 lsp 服务器断开连接,因此在本次会话时不会响应您。出于同样的原因,左侧源代码面板开始编译时只能编译子文件,因为它不再知道是哪个(预览)主文件,这将导致(预期的)错误。

可以提示或恢复该状态,但这不是一个错误,而是一个改进。

Translated by Meow GPT.