Closed tanj closed 2 years ago
Thanks for the bug report. Can you please test it without lsp-mode activated, so we can exclude lsp as source for the issue.
Setting rustic-lsp-client
to nil clears the issue. What is the next step? report to lsp?
Does this also happen when you trigger rustic-format-file
manually ?
with lsp-mode active it also happens when triggering rustic-format-file
manually
if I turn off lsp-mode in the buffer (not removed from config) it also happens with manual rustic-format-file
Ok now it gets odd. @yyoncho I'm not up-to-date with recent lsp-mode changes, any idea which changes could be the reason for this ?
What happens after M-x toggle-debug-on-quit + C-g when hangs?
Debugger entered--Lisp error: (quit)
sit-for(0.05)
rustic-format-file(nil)
funcall-interactively(rustic-format-file nil)
call-interactively(rustic-format-file record nil)
command-execute(rustic-format-file record)
execute-extended-command(nil "rustic-format-file" "rustic-for")
funcall-interactively(execute-extended-command nil "rustic-format-file" "rustic-for")
call-interactively(execute-extended-command nil nil)
command-execute(execute-extended-command)
I don't see anything related to lsp-mode in this call-stack.... Also in order to disable lsp-mode use lsp-disconnect.
Maybe an on change hook or something similar ?
Using lsp-disconnect
and running rustic-format-file
Debugger entered--Lisp error: (quit)
rustic-format-file(nil)
funcall-interactively(rustic-format-file nil)
call-interactively(rustic-format-file record nil)
command-execute(rustic-format-file record)
execute-extended-command(nil "rustic-format-file" "rustic-for")
funcall-interactively(execute-extended-command nil "rustic-format-file" "rustic-for")
call-interactively(execute-extended-command nil nil)
command-execute(execute-extended-command)
Does rustic-format-buffer
work ?
Please remember to only require rustic.
M-x lsp-disconnect
M-x rustic-format-buffer
I really doubt this is realated to rustic or lsp-mode. It's worth trying if something detached the buffer from the file
(defun my-print-buffer-file ()
(interactive)
(print (buffer-file-name)))
However I (hopefully) fixed the buffer position issue when using rustic-format-buffer
finally, so there's still an alternative that can be used.
If anybody is still experiencing this problem, please open a new issue.
On the other hand, maybe some function writes to the file so rustic-format-file
can't do...
Running emacs
GNU Emacs 27.1 (build 1, x86_64-w64-mingw32)
with the followingSteps to reproduce
Run emacs as follows
Edit a rust file and make a change
Save file
What happens
Emacs hangs until I press C-g then after a slight pause the file reloads with the reformatted file.
What I expect to happen
File saves and reloads with formatted file without hanging
Installed packages