Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Preview not updating on type #1028

Closed
SylvanFranklin opened this issue Dec 18, 2024 · 4 comments
Closed

Preview not updating on type #1028

SylvanFranklin opened this issue Dec 18, 2024 · 4 comments
Labels
question Further information is requested

Comments

@SylvanFranklin
Copy link
Contributor

Describe the bug
When running :TypstPreview command inside of neovim, the front end starts without problems, however changes that I make to the document only appear after I write with :w. It is possible that I am missing some kind of configuration option, but I could not find it easily in any of the docs for tinymist or typst-preview.nvim. I get a log message saying updating... but no update occurs, I think relating to this error. I am currently trying to debug this myself but could use some help.

Package/Software version:
Tinymist: installed version v0.12.12, latest.
Typst-Preview: version 1.2.1

Latest:

NVIM v0.10.2
Build type: Release
LuaJIT 2.1.1713484068
Run "nvim -V1 -v" for more info

tinymist extension version:

tinymist
Build Timestamp:     2024-12-18T20:15:58.153085000Z
Build Git Describe:  de8e45a
Commit SHA:          de8e45a539df45521c683e284fc704d882dc1da2
Commit Date:         None
Commit Branch:       None
Cargo Target Triple: aarch64-apple-darwin
Typst Version:       0.12.0
Typst Source:        git+https://github.com/Myriad-Dreamin/typst.git?tag=tinymist-v0.12.0#58426a90a7ef721738a01be09793d33e55eb75a9

Logs:

Error executing vim.schedule lua callback: ....10.2/share/nvim/runtime/lua/vim/lsp/semantic_tokens.lua:304: ....10.2/sha
re/nvim/runtime/lua/vim/lsp/semantic_tokens.lua:149: index out of range
stack traceback:
        [builtin#36]: at 0x01003a8724
        ....10.2/share/nvim/runtime/lua/vim/lsp/semantic_tokens.lua:304: in function 'handler'
        ...re/bob/v0.10.2/share/nvim/runtime/lua/vim/lsp/client.lua:687: in function ''
        vim/_editor.lua: in function <vim/_editor.lua:0>

From :mes

Additional context
This could all be a configuration issue as I'm also having trouble getting typstyle to work.

@Myriad-Dreamin
Copy link
Owner

Please don't submit multiple issues in a thread. This makes it harder to maintain and close the issue.

For the first issue, the full log of the typst-preview (server-side) and browser (client-side) are important. You may also provide the information about the used browser. For the second issue, it should be the well-known issue.

@Myriad-Dreamin Myriad-Dreamin added the question Further information is requested label Dec 20, 2024
@SylvanFranklin
Copy link
Contributor Author

Hello! Sorry for the delay I was busy working on a template and switched computers to solve the issue. My bad about the two issues I thought they might have been related, but I should have researched more, let's forget about the second one. This happens on all browsers I have (brave, firefox, arc, chrome, tor), but here is my firefox version info:

Screenshot 2024-12-21 at 11 54 57

Here is the log of the process form within neovim :mes. I start the server, and then update the preview which gives the updating preview... ouput line but does not actually reflect the changes. Let me know if there is something I can do to expose more info etc. On the lastest release versions of all software involved (nvim, tinymist, typst-preview, firefox):

spawning server tinymist with args:
{ "preview", "--partial-rendering", "--invert-colors", "never", "--preview-mode", "document", "--no-open", "--data-plane-host", "127.0.0.1:0", "--control-plane-host", "127.0.0.1:0", "--static-file-host", "127.0.0.1:0", "--root", "/Users/sylvanfranklin/Documents/projects/chatter", "/Users/sylvanfranklin/Documents/projects/chatter/template.typ" }
[2024-12-21T17:04:59Z INFO  tinymist::tool::preview] Arguments: PreviewCliArgs {
        preview: PreviewArgs {
            enable_partial_rendering: true,
            invert_colors: "never",
            task_id: "default_preview",
            refresh_style: OnType,
        },
        compile: CompileOnceArgs {
            input: Some(
                "/Users/sylvanfranklin/Documents/projects/chatter/template.typ",
            ),
            root: Some(
                "/Users/sylvanfranklin/Documents/projects/chatter",
            ),
            inputs: [],
            font: CompileFontArgs {
                font_paths: [],
                ignore_system_fonts: false,
            },
            package: CompilePackageArgs {
                package_path: None,
                package_cache_path: None,
            },
            creation_timestamp: None,
            cert: None,
        },
        preview_mode: Document,
        data_plane_host: "127.0.0.1:0",
        control_plane_host: "127.0.0.1:0",
        static_file_host: "127.0.0.1:0",
        not_as_primary: false,
        dont_open_in_browser: true,
    }

[2024-12-21T17:04:59Z INFO  typst_preview] Previewer: typst actor spawned
[2024-12-21T17:04:59Z INFO  typst_preview] Previewer: editor actor spawned

[2024-12-21T17:04:59Z DEBUG typst_preview::actor::typst] TypstActor: waiting for message

Connecting to server
websocat connecting to: ws://127.0.0.1:62841/
[2024-12-21T17:04:59Z INFO  tinymist::tool::preview] preview server listening on http://127.0.0.1:62841
[2024-12-21T17:04:59Z INFO  tinymist::tool::preview] Control panel server listening on: 127.0.0.1:62841

[2024-12-21T17:04:59Z INFO  reflexo_typst::diag::console] Some(/template.typ): compilation succeeded in 5.241ms

[2024-12-21T17:04:59Z INFO  tinymist::task::cache] CacheEvictTask: evict cache in 4.75µs

[2024-12-21T17:04:59Z INFO  reflexo_typst::diag::console] Some(/template.typ): compilation succeeded in 170µs

[2024-12-21T17:04:59Z INFO  tinymist::task::cache] CacheEvictTask: evict cache in 1.917µs

[2024-12-21T17:04:59Z WARN  tinymist::tool::preview] --static-file-host is deprecated, which will be removed in the future. Use --data-plane-host instead.

[2024-12-21T17:04:59Z INFO  tinymist::tool::preview] preview server listening on http://127.0.0.1:62842

Setting link
[2024-12-21T17:04:59Z INFO  tinymist::tool::preview] preview server listening on http://127.0.0.1:62843
[2024-12-21T17:04:59Z INFO  tinymist::tool::preview] Data plane server listening on: 127.0.0.1:62843
[2024-12-21T17:04:59Z INFO  tinymist::tool::preview] Static file server listening on: 127.0.0.1:62842

Opening preview with command: open http://127.0.0.1:62842
[2024-12-21T17:05:00Z DEBUG typst_preview::actor::render] OutlineRenderActor: waiting for message
[2024-12-21T17:05:00Z DEBUG typst_preview::actor::render] RenderActor: waiting for message

[2024-12-21T17:05:00Z DEBUG typst_preview::actor::render] RenderActor: has_full_render: true
[2024-12-21T17:05:00Z DEBUG typst_preview::actor::render] OutlineRenderActor: received message: RenderFullLatest
[2024-12-21T17:05:00Z DEBUG typst_preview::actor::render] OutlineRenderActor: sending outline
[2024-12-21T17:05:00Z DEBUG typst_preview::actor::render] OutlineRenderActor: waiting for message

[2024-12-21T17:05:00Z DEBUG typst_preview::actor::render] RenderActor: waiting for message
-- INSERT --

updating file: /Users/sylvanfrank...nts/projects/chatter/template.typ

@Myriad-Dreamin Myriad-Dreamin changed the title Preview not updating on type + semantic token errors Preview not updating on type Dec 22, 2024
@Myriad-Dreamin
Copy link
Owner

changes that I make to the document only appear after I write with :w

When I read it again, I find It seems like the old issue #739

@SylvanFranklin
Copy link
Contributor Author

Yes it does appear to be exactly that

@SylvanFranklin SylvanFranklin closed this as not planned Won't fix, can't repro, duplicate, stale Jan 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants