Version 2 (modified by Philippe Normand, 4 years ago) (diff)


Enabling LSP mode

If you're using spacemacs, enable the c-c++ layer in dotspacemacs-configuration-layers:

       (c-c++ :variables
            c-c++-backend 'lsp-ccls
            c-c++-lsp-enable-semantic-highlight 'rainbow)

And then in dotspacemacs/user-config:

     '((nil . ((c-basic-offset . 4)
               (indent-tabs-mode . nil)
               (fill-column . 100)
               (ccls-executable . "webkit-ccls")
               (projectile-project-name . "WebKit")
               (lsp-enable-file-watchers . nil)
               (lsp-ui-peek-find-references nil (list :folders (vector (projectile-project-root))))
       (prog-mode (ccls-initialization-options . (:compilationDatabaseDirectory "/app/webkit/WebKitBuild/Release"
                                                  :cache (:directory ".ccls-cache")
     "/home/phil/WebKit/" 'webkit-instance)

DO NOT CHANGE /app/webkit/WebKitBuild in compilationDatabaseDirectory because it refers to the standard Flatpak SDK sandbox path.

Then add a new executable script in your PATH, called webkit-ccls with the following contents (YMMV):

set -eu
cd $HOME/WebKit/
Tools/Scripts/webkit-flatpak -c ccls "$@"