Skip to content

Renaming typst source files causes cache inconsistency #2359

@BlueQuantumx

Description

@BlueQuantumx

Is there an existing issue for this?

  • I have searched the existing issues

Platform

Apple Silicon macOS (darwin-arm64, Most Common)

Editor

VS Cod(e,ium)

Editor Version

Version: 1.108.1
Commit: 585eba7c0c34fd6b30faac7c62a42050bfbc0086
Date: 2026-01-14T14:55:44.241Z
Electron: 39.2.7
ElectronBuildId: 12953945
Chromium: 142.0.7444.235
Node.js: 22.21.1
V8: 14.2.231.21-electron.0
OS: Darwin arm64 25.2.0

Describe the bug

This may be a related issue with #2358.

Given following case:

// content.typ
text from content.typ
---
#include "content.typ"

text from base.typ
  • Rename the content.typ to new_name.typ (directly modify in filesystem).

After that, in filesystem the change has applied, but tinymist seems to still reserve a cache of content.typ, any subsequent actions (such as compilation, preview) still work with the old content of content.typ. Editing neither new_name.typ nor base.typ can refresh the cache state.

Server Logs

[2026-01-19T09:08:52Z INFO  tinymist::lsp] did open file:///Users/user/Documents/Typst%20Projects/Playground/content.typ
[2026-01-19T09:08:53Z INFO  tinymist::input] the task of the primary is changing to TaskInputs { entry: Some(EntryState { root: Some("/Users/user/Documents/Typst Projects/Playground"), main: Some(@ws/p0:0.0.0/content.typ) }), inputs: None }
[2026-01-19T09:08:53Z INFO  tinymist::cmd] file focused: Some("/Users/user/Documents/Typst Projects/Playground/content.typ")
[2026-01-19T09:08:53Z INFO  tinymist_project::compiler] /Users/user/Documents/Typst Projects/Playground/content.typ: compilation succeeded in 146.417µs
[2026-01-19T09:08:57Z INFO  tinymist::lsp::query] will rename files RenameFilesParams { files: [FileRename { old_uri: "file:///Users/user/Documents/Typst%20Projects/Playground/content.typ", new_uri: "file:///Users/user/Documents/Typst%20Projects/Playground/new_name.typ" }] }
[2026-01-19T09:08:57Z INFO  tinymist_query::will_rename_files] did rename diff: "../new_name.typ"
[2026-01-19T09:08:57Z INFO  tinymist_query::will_rename_files] did rename def_fid: @ws/p0:0.0.0/content.typ
[2026-01-19T09:08:57Z INFO  tinymist_query::will_rename_files] did rename edits: {Url { scheme: "file", cannot_be_a_base: false, username: "", password: None, host: None, port: None, path: "/Users/user/Documents/Typst%20Projects/Playground/base.typ", query: None, fragment: None }: []}
[2026-01-19T09:08:57Z INFO  tinymist_project::compiler] /Users/user/Documents/Typst Projects/Playground/content.typ: compilation succeeded in 68.208µs
[2026-01-19T09:08:57Z INFO  tinymist::lsp] did open file:///Users/user/Documents/Typst%20Projects/Playground/new_name.typ
[2026-01-19T09:08:57Z INFO  tinymist::input] the task of the primary is changing to TaskInputs { entry: Some(EntryState { root: Some("/Users/user/Documents/Typst Projects/Playground"), main: Some(@ws/p0:0.0.0/new_name.typ) }), inputs: None }
[2026-01-19T09:08:57Z INFO  tinymist::cmd] file focused: Some("/Users/user/Documents/Typst Projects/Playground/new_name.typ")
[2026-01-19T09:08:57Z INFO  tinymist_project::compiler] /Users/user/Documents/Typst Projects/Playground/new_name.typ: compilation succeeded in 155.958µs
[2026-01-19T09:09:01Z INFO  tinymist_project::compiler] /Users/user/Documents/Typst Projects/Playground/new_name.typ: compilation succeeded in 118.209µs
[2026-01-19T09:09:01Z INFO  tinymist::input] the task of the primary is changing to TaskInputs { entry: Some(EntryState { root: Some("/Users/user/Documents/Typst Projects/Playground"), main: Some(@ws/p0:0.0.0/base.typ) }), inputs: None }
[2026-01-19T09:09:01Z INFO  tinymist::cmd] file focused: Some("/Users/user/Documents/Typst Projects/Playground/base.typ")
[2026-01-19T09:09:01Z INFO  tinymist_project::compiler] /Users/user/Documents/Typst Projects/Playground/base.typ: compilation succeeded in 67.541µs
[2026-01-19T09:09:16Z INFO  tinymist_project::compiler] /Users/user/Documents/Typst Projects/Playground/base.typ: compilation succeeded in 163.5µs
[2026-01-19T09:09:18Z INFO  tinymist_project::compiler] /Users/user/Documents/Typst Projects/Playground/base.typ: compilation succeeded in 174µs
[2026-01-19T09:09:20Z INFO  tinymist_project::compiler] /Users/user/Documents/Typst Projects/Playground/base.typ: compilation failed with 1 warnings and errors in 113.791µs
[2026-01-19T09:09:20Z INFO  tinymist_project::compiler] /Users/user/Documents/Typst Projects/Playground/base.typ: compilation succeeded in 103.666µs
[2026-01-19T09:09:20Z WARN  sync_ls::server::lsp_srv] unhandled notification: $/cancelRequest
[2026-01-19T09:09:24Z INFO  tinymist_project::compiler] /Users/user/Documents/Typst Projects/Playground/base.typ: compilation failed with 1 warnings and errors in 270.5µs
[2026-01-19T09:09:24Z INFO  tinymist_project::compiler] /Users/user/Documents/Typst Projects/Playground/base.typ: compilation failed with 1 warnings and errors in 186.167µs
[2026-01-19T09:09:24Z INFO  tinymist_project::compiler] /Users/user/Documents/Typst Projects/Playground/base.typ: compilation failed with 1 warnings and errors in 189.458µs
[2026-01-19T09:09:24Z INFO  tinymist_project::compiler] /Users/user/Documents/Typst Projects/Playground/base.typ: compilation failed with 1 warnings and errors in 269.375µs
[2026-01-19T09:09:24Z INFO  tinymist_project::compiler] /Users/user/Documents/Typst Projects/Playground/base.typ: compilation failed with 1 warnings and errors in 342.042µs
[2026-01-19T09:09:25Z INFO  tinymist_project::compiler] /Users/user/Documents/Typst Projects/Playground/base.typ: compilation failed with 1 warnings and errors in 98.083µs
[2026-01-19T09:09:25Z INFO  tinymist_project::compiler] /Users/user/Documents/Typst Projects/Playground/base.typ: compilation failed with 1 warnings and errors in 135.5µs
[2026-01-19T09:09:25Z INFO  tinymist_project::compiler] /Users/user/Documents/Typst Projects/Playground/base.typ: compilation succeeded in 315.166µs
[2026-01-19T09:09:28Z INFO  tinymist_project::compiler] /Users/user/Documents/Typst Projects/Playground/base.typ: compilation failed with 1 warnings and errors in 365.708µs
[2026-01-19T09:09:28Z INFO  tinymist_project::compiler] /Users/user/Documents/Typst Projects/Playground/base.typ: compilation failed with 1 warnings and errors in 475.375µs
[2026-01-19T09:09:28Z INFO  tinymist_project::compiler] /Users/user/Documents/Typst Projects/Playground/base.typ: compilation failed with 1 warnings and errors in 107.541µs
[2026-01-19T09:09:29Z INFO  tinymist_project::compiler] /Users/user/Documents/Typst Projects/Playground/base.typ: compilation failed with 1 warnings and errors in 211.417µs
[2026-01-19T09:09:29Z INFO  tinymist_project::compiler] /Users/user/Documents/Typst Projects/Playground/base.typ: compilation failed with 1 warnings and errors in 242.625µs
[2026-01-19T09:09:29Z INFO  tinymist_project::compiler] /Users/user/Documents/Typst Projects/Playground/base.typ: compilation failed with 1 warnings and errors in 251.208µs
[2026-01-19T09:09:29Z INFO  tinymist_project::compiler] /Users/user/Documents/Typst Projects/Playground/base.typ: compilation succeeded in 618.75µs
[2026-01-19T09:09:31Z INFO  tinymist::project] Project: emit compilation again for ProjectInsId("primary"), reason: CompileSignal { by_mem_events: false, by_fs_events: true, by_entry_update: false }
[2026-01-19T09:09:40Z INFO  tinymist::lsp] did open file:///Users/user/Documents/Typst%20Projects/Playground/new_name.typ
[2026-01-19T09:09:40Z INFO  tinymist::input] the task of the primary is changing to TaskInputs { entry: Some(EntryState { root: Some("/Users/user/Documents/Typst Projects/Playground"), main: Some(@ws/p0:0.0.0/new_name.typ) }), inputs: None }
[2026-01-19T09:09:40Z INFO  tinymist::cmd] file focused: Some("/Users/user/Documents/Typst Projects/Playground/new_name.typ")
[2026-01-19T09:09:40Z INFO  tinymist_project::compiler] /Users/user/Documents/Typst Projects/Playground/new_name.typ: compilation succeeded in 136.208µs
[2026-01-19T09:09:44Z INFO  tinymist_project::compiler] /Users/user/Documents/Typst Projects/Playground/new_name.typ: compilation succeeded in 607.5µs
[2026-01-19T09:09:44Z INFO  tinymist_project::compiler] /Users/user/Documents/Typst Projects/Playground/new_name.typ: compilation succeeded in 206.625µs
[2026-01-19T09:09:44Z INFO  tinymist_project::compiler] /Users/user/Documents/Typst Projects/Playground/new_name.typ: compilation succeeded in 248.25µs
[2026-01-19T09:09:45Z INFO  tinymist_project::compiler] /Users/user/Documents/Typst Projects/Playground/new_name.typ: compilation failed with 1 warnings and errors in 126.792µs
[2026-01-19T09:09:45Z INFO  tinymist_project::compiler] /Users/user/Documents/Typst Projects/Playground/new_name.typ: compilation succeeded in 509.542µs
[2026-01-19T09:09:45Z INFO  tinymist_project::compiler] /Users/user/Documents/Typst Projects/Playground/new_name.typ: compilation succeeded in 181.792µs
[2026-01-19T09:09:45Z INFO  tinymist_project::compiler] /Users/user/Documents/Typst Projects/Playground/new_name.typ: compilation succeeded in 140.75µs
[2026-01-19T09:09:45Z INFO  tinymist_project::compiler] /Users/user/Documents/Typst Projects/Playground/new_name.typ: compilation succeeded in 228.25µs
[2026-01-19T09:09:46Z INFO  tinymist_project::compiler] /Users/user/Documents/Typst Projects/Playground/new_name.typ: compilation succeeded in 251.667µs
[2026-01-19T09:09:46Z INFO  tinymist_project::compiler] /Users/user/Documents/Typst Projects/Playground/new_name.typ: compilation succeeded in 272µs
[2026-01-19T09:09:46Z INFO  tinymist_project::compiler] /Users/user/Documents/Typst Projects/Playground/new_name.typ: compilation succeeded in 339.875µs
[2026-01-19T09:09:47Z INFO  tinymist_project::compiler] /Users/user/Documents/Typst Projects/Playground/new_name.typ: compilation succeeded in 208.792µs
[2026-01-19T09:09:47Z INFO  tinymist::project] Project: emit compilation again for ProjectInsId("primary"), reason: CompileSignal { by_mem_events: false, by_fs_events: true, by_entry_update: false }
[2026-01-19T09:09:47Z INFO  tinymist::project] Project: skip compilation for ProjectInsId("primary") due to harmless vfs changes
[2026-01-19T09:09:48Z INFO  tinymist::input] the task of the primary is changing to TaskInputs { entry: Some(EntryState { root: Some("/Users/user/Documents/Typst Projects/Playground"), main: Some(@ws/p0:0.0.0/base.typ) }), inputs: None }
[2026-01-19T09:09:48Z INFO  tinymist::cmd] file focused: Some("/Users/user/Documents/Typst Projects/Playground/base.typ")
[2026-01-19T09:09:48Z INFO  tinymist_project::compiler] /Users/user/Documents/Typst Projects/Playground/base.typ: compilation succeeded in 231.417µs
[2026-01-19T09:09:51Z INFO  tinymist::input] the task of the primary is changing to TaskInputs { entry: Some(EntryState { root: Some("/Users/user/Documents/Typst Projects/Playground"), main: None }), inputs: None }
[2026-01-19T09:09:51Z INFO  tinymist_project::compiler] ProjectCompiler: removing diag
[2026-01-19T09:09:51Z INFO  tinymist::cmd] file focused: None

Browser Logs

Unrelated.

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions