| 64 | |
| 65 | == Enabling the clangd LSP backend |
| 66 | |
| 67 | |
| 68 | If you're using spacemacs, enable the c-c++ layer in `dotspacemacs-configuration-layers`: |
| 69 | |
| 70 | {{{ |
| 71 | dotspacemacs-configuration-layers |
| 72 | '( |
| 73 | (c-c++ :variables |
| 74 | c-c++-backend 'lsp-clangd |
| 75 | c-c++-lsp-enable-semantic-highlight 'rainbow) |
| 76 | ... |
| 77 | ) |
| 78 | }}} |
| 79 | |
| 80 | And then in `dotspacemacs/user-config`: |
| 81 | |
| 82 | {{{ |
| 83 | (dir-locals-set-class-variables |
| 84 | 'webkit-instance |
| 85 | '((nil . ((c-basic-offset . 4) |
| 86 | (indent-tabs-mode . nil) |
| 87 | (fill-column . 100) |
| 88 | (lsp-clients-clangd-executable . "/home/phil/WebKit/Tools/flatpak/webkit-clangd") |
| 89 | (lsp-clients-clangd-args . ("--enable-config" |
| 90 | "--gtk" |
| 91 | )) |
| 92 | (projectile-project-name . "WebKit") |
| 93 | (lsp-enable-file-watchers . nil) |
| 94 | (lsp-ui-peek-find-references nil (list :folders (vector (projectile-project-root)))) |
| 95 | )) |
| 96 | ) |
| 97 | ) |
| 98 | |
| 99 | (dir-locals-set-directory-class |
| 100 | "/home/phil/WebKit/" 'webkit-instance) |
| 101 | }}} |