Closed Anton-Latukha closed 2 years ago
On hover (with mouse or keyboard) on function/module documentation/comments - the selection is plainly should be fixed, since selection selects the scope one lever higher than it should.
-- |
in videos shared) - may select the function body and should show the parsed doc & function type information.Further going to try to get result bisecting on lsp-ui/lsp-ui-doc
, but you may not hold the horses, since I've seen that lsp-ui-doc
had wide changes on selections recently, and my experience correlates with those changes.
Well, it is HLS (Haskell Language Server) problem. I've tracked it down into it, in other editors - the selection behavior is the same.
Headpost updates to the current status results of the discussion
Previous thread: https://github.com/haskell/haskell-mode/issues/1764
There seems to be a bug of a computational data spike during the hover on the comment.
It probably may not be 100% a
lsp-ui/lsp-ui-doc
bug, but an intercommunication between several projects,lsp-ui-doc
it is the closest entity I found currently.I have 100% reproducible hang in largish (~>1kLoC) Haskell files - directly in the moment of hovering over comments.
Observe syndrome behaviour
Smaller file
![1](https://user-images.githubusercontent.com/20933385/132835407-434d95dc-f5a0-4809-b541-176e257b43a6.gif)Bigger file
Sorry for the somewhat longish GIF file, it took numerous attempts of initial selection positioning (to not hang Emacs right away) and so numerous Emacs restarts to somewhat properly record and show this behavior. ![2](https://user-images.githubusercontent.com/20933385/132851914-88ac5359-0eb1-4d67-9943-e85393f1b78e.gif) My symbol map (`pretty-symbols-mode`) does not matter - the hang happens regardless of it.So Emacs hangs on selecting comments on big files. During hover over any comment -
lsp-ui
tries to select the whole file (if module head doc is selected, and whole module if function doc is selected) & overflows Emacs function with data & their computations, and there is a small size point (~1kLoC) and so never calculates data and so never arrives to spawn the minibuffer.Debugging information:
{lsp-mode, lsp-haskell, haskell-mode, markdown-mode}
. Maybe I missed something there, but their versions are not important, the selection of the whole file - is.I have small Emacs skill, but would try to pinpoint the issue to: It happens between:
lsp-ui-doc--extract
lsp-ui-doc--highlight-hover
match-data
set-match-data 'evaporate
Profiler trace
``` 1293 58% - redisplay_internal (C function) 1276 57% - eval 1191 54% - spaceline-ml-main 925 41% - -difference 925 41% - let 925 41% - let 925 41% - while 925 41% - setq 925 41% - car-safe 925 41% - prog1 922 41% - helm-execute-selection-action-1 922 41% - let 836 37% - if 453 20% - progn 453 20% - funcall 446 20% - #So far despite of efforts, I can not track the problem deeper. From all modes (packages) mentioned, only when the mode is turned off - then Emacs works normally in large Haskell files, but at that point - there is no Haskell functionality there.
An example of a project/file when it happens 100% of the time is - https://github.com/haskell-nix/hnix
Nix.Expr.Types
module, but got the hang in other big Haskell files also.What we can do to observe the problem more closely, and stop
lsp-ui/lsp-ui-doc
from selecting, in Haskell files and maybe others, almost the whole file while the mouse or keyboard hovers on comments.