Changes between Initial Version and Version 1 of WebKitEmacsTips


Ignore:
Timestamp:
May 8, 2020 9:03:41 AM (4 years ago)
Author:
Philippe Normand
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • WebKitEmacsTips

    v1 v1  
     1
     2== Enabling LSP mode
     3
     4If you're using spacemacs, enable the c-c++ layer in `dotspacemacs-configuration-layers`:
     5
     6{{{
     7dotspacemacs-configuration-layers
     8   '(
     9       (c-c++ :variables
     10            c-c++-backend 'lsp-ccls
     11            c-c++-lsp-enable-semantic-highlight 'rainbow)
     12       ...
     13)
     14}}}
     15
     16And then in `dotspacemacs/user-config`:
     17
     18{{{
     19  (dir-locals-set-class-variables
     20     'webkit-instance
     21     '((nil . ((c-basic-offset . 4)
     22               (indent-tabs-mode . nil)
     23               (fill-column . 100)
     24               (ccls-executable . "webkit-ccls")
     25               (projectile-project-name . "WebKit")
     26               (lsp-enable-file-watchers . nil)
     27               (lsp-ui-peek-find-references nil (list :folders (vector (projectile-project-root))))
     28               ))
     29       (prog-mode (ccls-initialization-options . (:compilationDatabaseDirectory "/app/webkit/WebKitBuild/Release"
     30                                                  :cache (:directory ".ccls-cache")
     31                                                  ;;:clang (:extraArgs ("%h -x c++-header"))
     32                                                  ))
     33  )))
     34(dir-locals-set-directory-class
     35     "/home/phil/WebKit/" 'webkit-instance)
     36}}}
     37
     38'''DO NOT CHANGE''' `/app/webkit/WebKitBuild` in `compilationDatabaseDirectory` because it refers to the standard Flatpak SDK sandbox path.
     39
     40Then add a new executable script in your PATH, called `webkit-ccls` with the following contents (YMMV):
     41
     42{{{
     43#!/bin/sh
     44set -eu
     45cd $HOME/WebKit/
     46Tools/Scripts/webkit-flatpak -c ccls "$@"
     47}}}