Giter Site home page Giter Site logo

Comments (22)

iromise avatar iromise commented on July 21, 2024

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.

sebastiencs avatar sebastiencs commented on July 21, 2024

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.

Denommus avatar Denommus commented on July 21, 2024

Same problem here, I'm not under spacemacs.

from lsp-ui.

bmag avatar bmag commented on July 21, 2024

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) to bug.py and open it. point (the cursor) should be at bob (beginning of buffer)
  • move point forward until it reaches the n of numpy (e.g. with C-f a few times, or with w 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, or l if using evil-mode)
  • observe: point is at eob (end of buffer), doc is still shown
  • press C-f (or l) again
  • observe: point is still at eob, doc disappeared

bug.py.txt
image

Side note: would be easier to read the doc if it were aligned to the left, rather than the right.

from lsp-ui.

bmag avatar bmag commented on July 21, 2024

Tried with Emacs 26.0.91 and all is good there.

from lsp-ui.

xdev-x avatar xdev-x commented on July 21, 2024

Idem. I'm not able to reproduce the bug in emacs 27.

from lsp-ui.

alanz avatar alanz commented on July 21, 2024

from lsp-ui.

xdev-x avatar xdev-x commented on July 21, 2024

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.

sebastiencs avatar sebastiencs commented on July 21, 2024

@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.

xdev-x avatar xdev-x commented on July 21, 2024

No pb. Have fun for holidays 🙂

from lsp-ui.

alanz avatar alanz commented on July 21, 2024

@sebastiencs ping, hope you had a good holiday.

from lsp-ui.

alanz avatar alanz commented on July 21, 2024

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.

sebastiencs avatar sebastiencs commented on July 21, 2024

@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.

sebastiencs avatar sebastiencs commented on July 21, 2024

c4dc6fd should fixes the bug, can you test it ?

from lsp-ui.

alanz avatar alanz commented on July 21, 2024

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.

sebastiencs avatar sebastiencs commented on July 21, 2024

I forgot to add dash-functional to the dependencies

from lsp-ui.

alanz avatar alanz commented on July 21, 2024

I tried to search for it, but "-on" is impossible to query :)

from lsp-ui.

alanz avatar alanz commented on July 21, 2024

Ok, it now starts up fine, and the cursor does not jump. But the docs show up as a black blob.

screenshot from 2018-03-10 11-35-21

And the docs should be about 10 lines worth, for that function.

from lsp-ui.

alanz avatar alanz commented on July 21, 2024

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.

sebastiencs avatar sebastiencs commented on July 21, 2024

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.

alanz avatar alanz commented on July 21, 2024

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.

alanz avatar alanz commented on July 21, 2024

For me this is fixed by the series of commits ending 85976aa

from lsp-ui.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.