给 spacemacs 添加 +tools/lsp

我的 elisp 技艺还是太低了,希望大家能在上面改进

另外给 Linux 用户做了 github releases, cquery 编译好的版本 https://github.com/jacobdufault/cquery/releases/tag/0.0.0%2B20180121

1 个赞

lsp-ui有一堆选项,是不是能加入config.el? 比如

(defvar lsp-ui-sideline-enable t
  "whether enable sideline")
(defvar lsp-enable-completion-at-point t
  "whether enable complition at point")
(defvar lsp-ui-doc-position 'at-point
  "specify doc position")
(defvar lsp-ui-doc-header t
  "whether enable doc header")
(defvar lsp-ui-doc-include-signature t
  "whether include signature")

我记得以前spacemacs的SPC+g+devil-goto-definition,但好像没了?

是不是能加个keybindings.el,加一下

(spacemacs/set-leader-keys (kbd "jd") 'evil-goto-definition)

啥的 ?

弄不來……

我是用

    (setq lsp-ui-doc-include-signature nil)  ; don't include type signature in the child frame

的,和 Rust rls 用戶不一樣。

我就举个栗子,你也可以默认设置成nil啊。这样在(defun dotspacemacs/layers ()里面直接就能设置。很多layer不都这么搞嘛。

然后我改了一下lsp-ui的代码你看成不成?

(defun lsp/init-lsp-ui ()
  (use-package lsp-ui
    :after lsp-mode
    :after markdown-mode
    :config
    (add-hook 'lsp-mode-hook #'lsp-ui-mode)
    ;; bind peek key
    ;; lsp-ui的readme里面推荐的设置
    (define-key lsp-ui-mode-map (kbd "M-.") #'xref-find-definitions)
    (define-key lsp-ui-mode-map [remap xref-find-definitions] #'lsp-ui-peek-find-definitions)
    (define-key lsp-ui-mode-map [remap xref-find-references] #'lsp-ui-peek-find-references)
    ;; 默认的peek颜色不跟theme走
    ;; set peek color face
    (sync-peek-face)
    (add-hook 'spacemacs-post-theme-change-hook #'sync-peek-face)
    ))

然后sync-peek-face

(defun sync-peek-face ()
  (set-face-attribute 'lsp-ui-peek-list nil :background (face-attribute 'hl-line :background))
  (set-face-attribute 'lsp-ui-peek-peek nil :background (face-attribute 'hl-line :background))
  (set-face-attribute 'lsp-ui-peek-selection nil :background (face-attribute 'highlight :background) :foreground (face-attribute 'default :foreground))
  (set-face-attribute 'lsp-ui-peek-filename nil :foreground (face-attribute 'font-lock-constant-face :foreground))
  (set-face-attribute 'lsp-ui-peek-highlight nil :background (face-attribute 'highlight :background) :foreground (face-attribute 'highlight :foreground) :distant-foreground (face-attribute 'highlight :foreground))
  (set-face-attribute 'lsp-ui-peek-header nil :background (face-attribute 'highlight :background) :foreground (face-attribute 'default :foreground))
)

感谢。添加了

1 个赞

我又想到一个,在lsp/init-lsp-mode里加上

    (spacemacs|diminish lsp-mode " Ⓛ" " L")

能让modeline好看点。 49 PM

你的README.org格式检查没过。

cquery 的沒過。lsp根本沒有README.org … 我就希望早日收了,別人好繼續改

!!!!!!!!!!!!!! TEST FAILED !!!!!!!!!!!!!!
File "/root/.emacs.d/layers/+tools/cquery/README.org" doesn't have "Features:"(With a colon) list in the top level "Description" headline
See "https://github.com/syl20bnr/spacemacs/blob/develop/core/templates/README.org.template"
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

对对,我说的就是cquery。

spacemacs PR的效率是不高。

pull request咋没人理啊。这么多天过去了也没人回复。

好歹给我提提意见也好😭

我给你点赞的。。可惜毫无用

我看见你的👍了😄

是spacemacs处理比较慢还是都慢啊,我第一次提交pull request