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

newline at eof in justfile creates livelock #8226

Closed
silentbat opened this issue Sep 9, 2023 · 4 comments · Fixed by #11306
Closed

newline at eof in justfile creates livelock #8226

silentbat opened this issue Sep 9, 2023 · 4 comments · Fixed by #11306
Labels
A-language-support Area: Support for programming/text languages C-bug Category: This is a bug upstream

Comments

@silentbat
Copy link

Summary

I think there is a livelock, when adding a newline at the end of a justfile.
Helix hangs and I could only kill it externally.

I can only guess that it maybe has something to do with lsp for justfiles?

Logfile with -vvv did not produce useful information afaik, see below.

Windows Terminal version: 1.17.11461.0
Nushell version: 0.84.0

Reproduction Steps

I tried this:

  1. hx
  2. ihello:<enter><tab>echo bla<esc>:w justfile<enter>o

I expected this to happen:
newline at the end of the file

Instead, this happened:
helix hangs with high CPU usage

Alternative tests:
when instead of pressing o in the end, I just move the cursor, everything is fine. I can also add a line (O instead of o) above the last line no problem.

Alternative to pressing o in the end: pressing A (this is fine) and then <enter> (the newline seems to be the problem).

Helix log

~/.cache/helix/helix.log 2023-09-09T23:07:28.461 helix_vcs [INFO] file is untracked 2023-09-09T23:07:28.461 helix_vcs [INFO] failed to open diff base for C:\Users\Jonathan\Documents\rust\sandbox\justfile 2023-09-09T23:07:28.464 helix_view::editor [DEBUG] editor status: Loaded 1 file. 2023-09-09T23:07:28.464 helix_tui::backend::crossterm [DEBUG] The keyboard enhancement protocol is not supported in this terminal (checked in 0ns) 2023-09-09T23:07:28.464 helix_view::document [DEBUG] id 1 modified - last saved: 0, current: 0 2023-09-09T23:07:28.466 helix_view::document [DEBUG] id 1 modified - last saved: 0, current: 0 2023-09-09T23:07:28.818 helix_term::application [DEBUG] received editor event: IdleTimer 2023-09-09T23:07:29.092 helix_view::document [DEBUG] id 1 modified - last saved: 0, current: 0 2023-09-09T23:07:29.308 helix_view::document [DEBUG] id 1 modified - last saved: 0, current: 0 2023-09-09T23:07:29.710 helix_term::application [DEBUG] received editor event: IdleTimer

Platform

Windows

Terminal Emulator

Windows Terminal with nushell

Helix Version

helix 23.05 (7f5940b)

@silentbat silentbat added the C-bug Category: This is a bug label Sep 9, 2023
@pascalkuthe
Copy link
Member

its a problem with the treesitter grammar not the LSP.

In general I found the TS grammar for the justfile fairly immature (not that surprising as its a bit niche)

@the-mikedavis the-mikedavis added upstream A-language-support Area: Support for programming/text languages labels Sep 10, 2023
@NickNick
Copy link

I have a similar issue in markdown documents. Looking at the perf output, it also looks like it is hanging in treesitter.

Is there some way the editor could be changed to not run into this issue? I would like to help with this if possible, this issue affects my daily work.

@the-mikedavis
Copy link
Member

Hangs like this need to be fixed upstream in tree-sitter-just (or tree-sitter-markdown in that case)

@pascalkuthe
Copy link
Member

Hangs like this need to be fixed upstream in tree-sitter-just (or tree-sitter-markdown in that case)

I think that is likely #8709. The justice grammar has some problems which need to be fixed and we can't do anything about that. I don't think markdown does tough. If you are using the latest release building from source instead should be enough

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-language-support Area: Support for programming/text languages C-bug Category: This is a bug upstream
Projects
None yet
4 participants