How to set position of the lsp-ui-doc in spacemacs

Viewed 332

I'm new to spacemacs and am having trouble with LSP as I'm also unfamiliar with the elisp language. I have a few things set up, but I can't for the life of me figure out how to set the position of the lsp-ui-doc to be under/above the cursor. I referenced the lsp-ui module on Github and it says that this can be configured, but I don't see any examples and I also don't know where I'd set it in my .spacemacs file.

Also, if anyone has any clues as to how I could have figured this out by myself, please let me know as well. I'd rather not have to resort to stack overflow to answer these questions if I can help it.

Any help would be greatly appreciated

elsp-ui-doc customization

For reference, the lsp-ui-doc shows up in the top right when the cursor is over some artifact:

enter image description here

1 Answers

Ok, so I was able to find the answer in the issues page on the github repo.

Short answer for this is to put '(lsp-ui-doc-position 'at-point) in the .spacemacs file under the heading (custom-set-variables. It should look something like this:

(custom-set-variables

  '(lsp-ui-doc-position 'at-point)

Possible values for lsp-ui-doc-position are: top, bottom, at-point.

Take note of the warning here:

 ;; custom-set-variables was added by Custom.
 ;; If you edit it by hand, you could mess it up, so be careful.
 ;; Your init file should contain only one such instance.
 ;; If there is more than one, they won't work right.

The appropriate way to do it is by following the instructions linked in this issue:

https://github.com/emacs-lsp/lsp-ui/issues/508

For anyone unfamiliar with the Customization option page, The buttons didn't work for me when I clicked them (though I'm certain there's a way to set this in emacs to work with clicks) but I had to put the cursor on the buttons I wanted to click and press enter. This brought up a context menu that allowed me to set the varables when I pressed enter on `Value Menu'.

"Clicking" (placing cursor and pressing enter) State allowed me to save it.

Related