Comments (22)
When using lsp-python
, the same phenomenon happens. And also, when cursor is at the end of a line, the cursor will go down one line, seems strange..
(I am using the lasted spacemacs with the newest merge of lsp-python ).
from lsp-ui.
Have you try lsp-ui
without spacemacs ? If so, did it happen before ?
Tomorrow I'm going on holliday for 2 weeks, so unfortunately I won't be able to fix :(
from lsp-ui.
Same problem here, I'm not under spacemacs.
from lsp-ui.
Seeing a similar issue with lsp-python
, Emacs 25.3 and latest Spacemacs. Haven't looked into the exact configuration for LSP, but I could if you need it.
Repro steps:
- rename attached file
bug.py.txt
(see below) tobug.py
and open it. point (the cursor) should be at bob (beginning of buffer) - move point forward until it reaches the
n
ofnumpy
(e.g. withC-f
a few times, or withw
if using evil-mode) - observe: doc for numpy is shown at the right side, point is at top right (is it inside the margin?) - see image below
- move point forward by one character (
C-f
again, orl
if using evil-mode) - observe: point is at eob (end of buffer), doc is still shown
- press
C-f
(orl
) again - observe: point is still at eob, doc disappeared
Side note: would be easier to read the doc if it were aligned to the left, rather than the right.
from lsp-ui.
Tried with Emacs 26.0.91 and all is good there.
from lsp-ui.
Idem. I'm not able to reproduce the bug in emacs 27.
from lsp-ui.
from lsp-ui.
Yes but... The bug is not totally resolved in emacs 26+. The doc is indeed in a separate frame. But the lints are still in sideline... Is this still related to lsp-ui ?
from lsp-ui.
@bmag Thanks for the detailed report, now I understand what is wrong.
@davidelbaze Yes it's still lsp-ui.
I will fix that when I'm back ;)
from lsp-ui.
No pb. Have fun for holidays 🙂
from lsp-ui.
@sebastiencs ping, hope you had a good holiday.
from lsp-ui.
It seems that the problem is in lsp-ui-doc--inline
, where the result of calling
(lsp-ui-doc--inline-merge buffer-string)
is bigger than the already-created overlay. Which in turn runs past the end of the buffer.
from lsp-ui.
@alanz I just come back, it was very good, thanks !
Yes it is related to this todo.
I'm working on it
from lsp-ui.
c4dc6fd should fixes the bug, can you test it ?
from lsp-ui.
Hi, thanks for getting to this.
I just tried it, and I get a stack trace, seems -on
is not defined for my system,
GNU Emacs 25.2.2 (x86_64-pc-linux-gnu, GTK+ Version 3.22.28) of 2018-02-19, modified by Debian
Debugger entered--Lisp error: (void-function -on)
(-on (quote >) (quote string-width))
(-max-by (-on (quote >) (quote string-width)) doc-strings)
(length (-max-by (-on (quote >) (quote string-width)) doc-strings))
(let* ((len-max (length (-max-by (-on (quote >) (quote string-width)) doc-strings)))) (setq lsp-ui-doc--inline-width len-max) (mapcar (function (lambda (it) (lsp-ui-doc--inline-padding it len-max))) doc-strings))
lsp-ui-doc--inline-faking-frame(("_ :: Integer" "" #("```haskell" 0 3 (invisible markdown-markup face (markdown-code-face) markdown-gfm-block-begin (1 11 1 4 4 4 4 11 nil nil 11 11 #<killed buffer>)) 3 10 (invisible markdown-markup face (markdown-code-face) markdown-gfm-block-begin (1 11 1 4 4 4 4 11 nil nil 11 11 #<killed buffer>))) #("bar :: Integer" 0 3 (font-lock-multiline t fontified t font-lock-fontified t face (haskell-definition-face markdown-code-face) markdown-metadata-key (12 26 12 16 16 17 17 26 #<killed buffer>) markdown-gfm-code (12 27)) 3 4 (face (markdown-code-face) font-lock-multiline t fontified t font-lock-fontified t markdown-metadata-key (12 26 12 16 16 17 17 26 #<killed buffer>) markdown-gfm-code (12 27)) 4 5 (font-lock-multiline t fontified t font-lock-fontified t face (haskell-operator-face markdown-code-face) markdown-metadata-markup (12 26 12 16 16 17 17 26 #<killed buffer>) markdown-gfm-code (12 27)) 5 6 (font-lock-multiline t fontified t font-lock-fontified t face (haskell-operator-face markdown-code-face) markdown-metadata-value (12 26 12 16 16 17 17 26 #<killed buffer>) markdown-gfm-code (12 27)) 6 7 (face (markdown-code-face) font-lock-multiline t fontified t font-lock-fontified t markdown-metadata-value (12 26 12 16 16 17 17 26 #<killed buffer>) markdown-gfm-code (12 27)) 7 14 (font-lock-multiline t fontified t font-lock-fontified t face (haskell-type-face markdown-code-face) markdown-metadata-value (12 26 12 16 16 17 17 26 #<killed buffer>) markdown-gfm-code (12 27))) #("```" 0 1 (font-lock-multiline t invisible markdown-markup face (markdown-code-face) markdown-gfm-block-end (27 30 27 30 30 30 #<killed buffer>)) 1 3 (invisible markdown-markup face (markdown-code-face) markdown-gfm-block-end (27 30 27 30 30 30 #<killed buffer>))) "" "" "" "Bar"))
(let ((it (lsp-ui-doc--inline-faking-frame doc-string))) (let ((it (-zip-with (quote lsp-ui-doc--inline-zip) buffer-strings it))) (let ((it (string-join it "\n"))) (concat it "\n"))))
(let* ((buffer-strings (split-string strings "\n")) (doc-string (split-string (let ((parent-vars (list :buffer ... :window ... :workspace-root ...))) (save-current-buffer (set-buffer (get-buffer-create ...)) (setq lsp-ui-doc--parent-vars parent-vars) (prog1 (let ... ...) (setq buffer-read-only t)))) "\n")) (merged (let ((it (lsp-ui-doc--inline-faking-frame doc-string))) (let ((it (-zip-with ... buffer-strings it))) (let ((it ...)) (concat it "\n")))))) (add-face-text-property 0 (length merged) (quote default) t merged) merged)
...
from lsp-ui.
I forgot to add dash-functional
to the dependencies
from lsp-ui.
I tried to search for it, but "-on" is impossible to query :)
from lsp-ui.
Ok, it now starts up fine, and the cursor does not jump. But the docs show up as a black blob.
And the docs should be about 10 lines worth, for that function.
from lsp-ui.
And I just noticed if I look really closely at the blob that there is actually text in it, but the contrast is impossible.
from lsp-ui.
The color depends on the variable lsp-ui-doc-background
, I will make it a face to adapt on light backgrounds.
It doesn't show the 10 lines because you are at the end of the buffer, and the overlay is ending there too, I don't know yet how to solve that
from lsp-ui.
ok, but this is a great step forward, it makes the emacs client usable again, for me.
And it seems the original width calculation was fine, there is now a one column gap on the RHS
from lsp-ui.
For me this is fixed by the series of commits ending 85976aa
from lsp-ui.
Related Issues (20)
- Changing semantic token face category of specific tokens? HOT 1
- doc-render issue in 29 HOT 6
- Long file paths in lsp-ui-peek-find show only prefix HOT 1
- lsp-ui-sideline pop message break line on emacs 29.0.60 HOT 11
- webkit lsp-ui-doc popup not showing up in emacs HOT 1
- lsp-ui-doc overlaps with completion-at-point popup and lsp-ui-doc-position not working
- lsp-ui breaks C-x 1
- lsp-ui-sideline no diagnostics HOT 1
- lsp-ui-doc-hide make emacs not responding unless press a arrow key HOT 2
- lsp-lens crashes, and get wrong-type-argument message HOT 1
- Add HTML space rendering to lsp-ui-doc
- LSP signature when typing function args HOT 2
- lsp-ui-doc-position 'at-point not working on terminal Emacs HOT 1
- code actions shown for entire line instead of only for issue at point HOT 1
- Bug: Warnings "Invalid face reference: lsp-flycheck-info-unnecessary" when using lsp-ui-sideline HOT 1
- Flymake support HOT 1
- Wrong key bindings in LSP UI flycheck <M-return> <return> HOT 1
- Another lsp-ui-doc markdown issue (lists) HOT 2
- lsp-ui-doc uses obsolete variable 'inhibit-point-motion-hooks'
- Show diagnostics for all lines in lsp-ui-sideline HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from lsp-ui.