【问题标题】:How to set position of the lsp-ui-doc in spacemacs如何在 spacemacs 中设置 lsp-ui-doc 的位置
【发布时间】:2021-12-20 22:37:42
【问题描述】:

我是 spacemacs 的新手,并且在使用 lsp 时遇到了问题,因为我也不熟悉 elisp 语言。我设置了一些东西,但我一生都无法弄清楚如何将 lsp-ui-doc 的位置设置为光标下方/上方。我在 github 上引用了 lsp ui 模块,它说可以配置,但我没有看到任何示例,也不知道在我的 .spacemacs 文件中设置它的位置。

另外,如果有人知道我是如何自己解决这个问题的,也请告诉我。如果可以的话,我宁愿不必求助于堆栈溢出来回答这些问题。

任何帮助将不胜感激

作为参考,当光标在某个工件上时,lsp-ui-doc 会显示在右上角:

【问题讨论】:

    标签: emacs spacemacs


    【解决方案1】:

    好的,所以我能够在 github repo 的问题页面中找到答案。

    对此的简短回答是将'(lsp-ui-doc-position 'at-point) 放在标题(custom-set-variables 下的.spacemacs 文件中。它应该看起来像这样:

    (custom-set-variables
    
      '(lsp-ui-doc-position 'at-point)
    

    注意这里的警告:

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

    执行此操作的适当方法是按照此问题中链接的说明进行操作:

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

    对于不熟悉“自定义”选项页面的任何人,当我单击这些按钮时,它们对我不起作用(尽管我确信有一种方法可以在 emacs 中将其设置为与点击一起使用)但我不得不将光标放在在我想点击的按钮上按回车键。这带来了一个上下文菜单,当我在“值菜单”上按 Enter 时,它允许我设置变量。

    “点击”(放置光标并按下回车键)State 允许我保存它。

    【讨论】:

      猜你喜欢
      • 2021-11-13
      • 2021-09-26
      • 1970-01-01
      • 1970-01-01
      • 2011-09-25
      • 1970-01-01
      • 1970-01-01
      • 2011-10-25
      • 1970-01-01
      相关资源
      最近更新 更多