GithubHelp home page GithubHelp logo

emacs-ccls's Introduction

title description root_file
LSP Mode - Language Server Protocol support for Emacs
Language Server Protocol support with multiples languages support for Emacs
README.md

CI

Language Server Protocol Support for Emacs

LSP mode


homepageinstallationlanguagessettingstutorialstroubleshootingscreenshotsFAQ


Why?

  • ❤️ Community Driven
  • 💎 Fully featured - supports all features in Language Server Protocol v3.14.
  • 🚀 Fast - see performance section.
  • 🌟 Flexible - choose between full-blown IDE with flashy UI or minimal distraction free.
  • ⚙️ Easy to configure - works out of the box and automatically upgrades if additional packages are present.

Overview

Client for Language Server Protocol (v3.14). lsp-mode aims to provide IDE-like experience by providing optional integration with the most popular Emacs packages like company, flycheck and projectile.

  • Non-blocking asynchronous calls
  • Real-time Diagnostics/linting via flycheck (recommended) or flymake when Emacs > 26 (requires flymake>=1.0.5)
  • Code completion - company-capf / completion-at-point (note that company-lsp is no longer supported).
  • Hovers - using lsp-ui
  • Code actions - via lsp-execute-code-action, modeline (recommended) or lsp-ui sideline.
  • Code outline - using builtin imenu or helm-imenu
  • Code navigation - using builtin xref, lsp-treemacs tree views or lsp-ui peek functions.
  • Code lens
  • Symbol highlights
  • Formatting
  • Project errors on modeline
  • Debugger - dap-mode
  • Breadcrumb on headerline
  • Helm integration - helm-lsp
  • Ivy integration - lsp-ivy
  • Consult integration - consult-lsp
  • Treemacs integration - lsp-treemacs
  • Semantic tokens as defined by LSP 3.16 (compatible language servers include recent development builds of clangd and rust-analyzer)
  • which-key integration for better discovery
  • iedit
  • dired
  • ido

Presentations/demos

See also

  • lsp-docker - provide docker image with preconfigured language servers with corresponding emacs configuration.
  • company-box - company frontend with icons.
  • dap-mode - Debugger integration for lsp-mode.
  • eglot - An alternative minimal LSP implementation.
  • which-key - Emacs package that displays available keybindings in popup
  • projectile - Project Interaction Library for Emacs
  • emacs-tree-sitter - Faster, fine-grained code highlighting via tree-sitter.
  • gccemacs - modified Emacs capable of compiling and running Emacs Lisp as native code.

Contributions

Contributions are very much welcome!

NOTE Documentation for clients is generated from doc comments in the clients themselves (see lsp-doc.el) and some metadata (see lsp-clients.json) so please submit corrections accordingly.

Support the project

The emacs-lsp organization has more than 20,000 lines of code, to keep all of this working, we need to implement new features and help the community on a lot of issues.

You can help us keep going and improving it by supporting the project

Members

Here it is a list of the current lsp-mode members and what they are primary working on/responsible for.

kurnevsky
kurnevsky

Scala | Rust
seagle0128
seagle0128

Go | Python MS
sebastiansturm
sebastiansturm

lsp-mode core | C++
vibhavp
vibhavp

lsp-mode core
yyoncho
yyoncho

lsp-mode core | Java
ericdallo
ericdallo

Dart/Flutter | Clojure
danielmartin
danielmartin

C++ | Swift
kiennq
kiennq

completions | pwsh
nbfalcon
nbfalcon

lsp-mode core | iedit
psibi
psibi

Terraform | Nix
razzmatazz
razzmatazz

C# | F#
jcs090218
jcs090218

lsp-mode core

emacs-ccls's People

Contributors

akermu avatar amosbird avatar beranekba avatar dickby avatar ericdallo avatar iromise avatar jacobdufault avatar jaelsasser avatar jcs090218 avatar jiegec avatar maskray avatar mathewprokos avatar maverobot avatar mgsb avatar myrgy avatar sarcasm avatar spaceotter avatar thaodan avatar topisani avatar vibhavp avatar yyjjl avatar yyoncho avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

emacs-ccls's Issues

compile commands is not working in lsp-mode(ccls)

Hello, I'm trying to use for the first time lsp-mode for my C/C++ projects. This is my minimal(I think) configuration for this.

2019-07-06-001628_448x629_scrot
2019-07-06-001638_388x112_scrot

When I did open the first project some functions definitions were being recognized and etc, but I was with a problem related to some libraries that were not being found. In order to solve this I read this link https://github.com/MaskRay/ccls/wiki/lsp-mode and compiled my project to generate the compile_commands.json. After that, everything seems don't work, flycheck, autocomplete and etc, and this msg(LSP :: not indexed) is being shown in every line.

2019-07-06-002338_492x453_scrot

How can I solve this and make lsp-mode work for me? Do I need to write something else in my config file? Just to be clear, I generated compile_commands.json with mkdir build && cd build && cmake -DCMAKE_EXPORT_COMPILE_COMMANDS=YES .. && ln -s compile_commands.json.

I posted this in reddit and the people tell me that the problem was with ccls and I should ask here what can be happening.

Still have the issue that ccls report unexpected compile error

Hi, I still have the issue #33
I do not know how to investigate, I updated every thing, tried with eglot and lsp.
The situation is the same (ccls report error to flymake, but there is no error when I copy and execute the command line from ccls log

Thanks in advance.

here is how to reproduce, with uptodate package, and master ccls

run with --log-file=/tmp/ccls.log --init='{"cache": {"directory": "/ssd/vanderha/cache/ccls-cache/"}, "clang": {"excludeArgs": ["-Wno-misleading-indentation"]}}' -v=1
git clone --single-branch --branch ccls --recursive https://github.com/dlyr/Radium-Engine/ TEST
cd TEST
mkdir build
cd build
cmake ../ -DCMAKE_EXPORT_COMPILE_COMMANDS=On -DRADIUM_USE_COTIRE=Off
(not sure cotire interacts, but I use to turn it off with ccls)
make -j
(not sure need to compile ... but there are some "installed" include and generated files ...)
cd ../
ln -s build/compile_commands.json .
emacs -Q config.el
evaluate the lines here
open tests/CoreTests/src/algebra.cpp
wait everything loads, no flymake errors
add a blank line, save, and I get 19 flymake erros.

flycheck macro redefined and no syntax highlighting

Hi,
I have an unexpected behavior but do not know where to search for a solution.

On a quite big projet, with some header files, I got warnings (on the flymake sense) on more or less "random" lines that state "ccls : '_DEBUG' macro redefined,
and the "ccls : 'DEBUG' macro redefined.

Which is actually the case (in the project, but not in the given file). With in a top header I have:

// Make sure all "debug" macros are defined
#if defined (DEBUG) || defined(_DEBUG) || defined (CORE_DEBUG) // ------- Debug
#   undef CORE_DEBUG
#   define CORE_DEBUG

#   undef _DEBUG

The warning is not a big issue, but the whole header is then not fontified (no syntax highlighting).

Don't know if it's linked, but I also see some warning in 'lsp-ccls stderr<2>` buffer:

warning: argument unused during compilation: '-Wall'
warning: argument unused during compilation: '-Wextra'
warning: argument unused during compilation: '-pthread'
warning: argument unused during compilation: '-msse3'
warning: argument unused during compilation: '-Wno-sign-compare'
warning: argument unused during compilation: '-Wno-unused-parameter'
warning: argument unused during compilation: '-Wno-deprecated-declarations'
warning: argument unused during compilation: '-D _DEBUG'
warning: argument unused during compilation: '-D CORE_DEBUG'
warning: argument unused during compilation: '-g3'
warning: argument unused during compilation: '-ggdb'
warning: argument unused during compilation: '-Wno-unused-parameter'
warning: argument unused during compilation: '-Wno-deprecated-declarations'
warning: argument unused during compilation: '-g'
warning: argument unused during compilation: '-Wno-ignored-attributes'
warning: argument unused during compilation: '-Wno-misleading-indentation'
warning: argument unused during compilation: '-Wno-unknown-pragmas'
warning: argument unused during compilation: '-std=c++14'
warning: argument unused during compilation: '-c'

Feel free to ask any informations or test I can make.
++ d

user-error Could not find ccls project root

ccls已经编译完成,并通过exec执行。
emacs-ccls也通过melpa安装
项目的compile_command.json通过cmake生成,并ln -s 软链接了。
但是打开一个cpp文件后,出现 user-error Could not find ccls project root提示,请问是否还有其他未配置的内容?

error in process filter: Wrong type argument: number-or-marker-p, nil

elisp debugger seems to point at function ccls--publish-semantic-highlighting and
it happens everytime open a new cpp file.

detailed debugger trace:

ccls--publish-semantic-highlighting(#s(lsp--workspace :parser #s(lsp--parser :waiting-for-response nil :response-result nil :headers nil :body nil :reading-body nil :body-length nil :body-received nil :leftovers "" :queued-notifications nil :queued-requests nil :workspace #1) :file-versions #<hash-table equal 2/65 0x412a65fb> :server-capabilities #<hash-table equal 17/65 0x43b9c383> :registered-server-capabilities nil :root "/Users/showgood/projects/leveldb/" :client #s(lsp--client :language-id #f(compiled-function (_) #<bytecode 0x442fcb3d>) :send-sync nil :send-async nil :type nil :new-connection #f(compiled-function (filter sentinel) #<bytecode 0x4399f76b>) :stderr "*lsp-ccls stderr*" :get-root ccls--get-root :ignore-regexps nil :ignore-messages nil :notification-handlers #<hash-table equal 4/65 0x40a57a37> :request-handlers #<hash-table equal 0/65 0x407da9a1> :response-handlers #<hash-table eql 4/65 0x43e0f7a9> :string-renderers (("objectivec" lambda (str) (with-temp-buffer (delay-mode-hooks (objc-mode)) (insert str) (font-lock-ensure) (buffer-string))) ("cpp" lambda (str) (with-temp-buffer (delay-mode-hooks (c++-mode)) (insert str) (font-lock-ensure) (buffer-string))) ("c" lambda (str) (with-temp-buffer (delay-mode-hooks (c-mode)) (insert str) (font-lock-ensure) (buffer-string)))) :last-id 10 :enable-function lsp-ccls-enable :prefix-function nil :uri-handlers #<hash-table equal 0/65 0x43f95cf1> :action-handlers #<hash-table equal 0/65 0x41315f85> :default-renderer nil) :change-timer-disabled nil :proc #<process lsp-ccls> :cmd-proc #<process lsp-ccls> :buffers (#<buffer block_builder.cc> #<buffer table.cc>) :highlight-overlays #<hash-table eq 0/65 0x43d65075> :extra-client-capabilities nil :status nil :metadata #<hash-table equal 0/65 0x42c7730b> :watches #<hash-table equal 0/65 0x43e0fa63>) #<hash-table equal 2/65 0x4079e553>)
  (lambda (w p) (ccls--publish-semantic-highlighting w p))(#s(lsp--workspace :parser #s(lsp--parser :waiting-for-response nil :response-result nil :headers nil :body nil :reading-body nil :body-length nil :body-received nil :leftovers "" :queued-notifications nil :queued-requests nil :workspace #1) :file-versions #<hash-table equal 2/65 0x412a65fb> :server-capabilities #<hash-table equal 17/65 0x43b9c383> :registered-server-capabilities nil :root "/Users/showgood/projects/leveldb/" :client #s(lsp--client :language-id #f(compiled-function (_) #<bytecode 0x442fcb3d>) :send-sync nil :send-async nil :type nil :new-connection #f(compiled-function (filter sentinel) #<bytecode 0x4399f76b>) :stderr "*lsp-ccls stderr*" :get-root ccls--get-root :ignore-regexps nil :ignore-messages nil :notification-handlers #<hash-table equal 4/65 0x40a57a37> :request-handlers #<hash-table equal 0/65 0x407da9a1> :response-handlers #<hash-table eql 4/65 0x43e0f7a9> :string-renderers (("objectivec" lambda (str) (with-temp-buffer (delay-mode-hooks (objc-mode)) (insert str) (font-lock-ensure) (buffer-string))) ("cpp" lambda (str) (with-temp-buffer (delay-mode-hooks (c++-mode)) (insert str) (font-lock-ensure) (buffer-string))) ("c" lambda (str) (with-temp-buffer (delay-mode-hooks (c-mode)) (insert str) (font-lock-ensure) (buffer-string)))) :last-id 10 :enable-function lsp-ccls-enable :prefix-function nil :uri-handlers #<hash-table equal 0/65 0x43f95cf1> :action-handlers #<hash-table equal 0/65 0x41315f85> :default-renderer nil) :change-timer-disabled nil :proc #<process lsp-ccls> :cmd-proc #<process lsp-ccls> :buffers (#<buffer block_builder.cc> #<buffer table.cc>) :highlight-overlays #<hash-table eq 0/65 0x43d65075> :extra-client-capabilities nil :status nil :metadata #<hash-table equal 0/65 0x42c7730b> :watches #<hash-table equal 0/65 0x43e0fa63>) #<hash-table equal 2/65 0x4079e553>)
  lsp--on-notification(#s(lsp--parser :waiting-for-response nil :response-result nil :headers nil :body nil :reading-body nil :body-length nil :body-received nil :leftovers "" :queued-notifications nil :queued-requests nil :workspace #s(lsp--workspace :parser #1 :file-versions #<hash-table equal 2/65 0x412a65fb> :server-capabilities #<hash-table equal 17/65 0x43b9c383> :registered-server-capabilities nil :root "/Users/showgood/projects/leveldb/" :client #s(lsp--client :language-id #f(compiled-function (_) #<bytecode 0x442fcb3d>) :send-sync nil :send-async nil :type nil :new-connection #f(compiled-function (filter sentinel) #<bytecode 0x4399f76b>) :stderr "*lsp-ccls stderr*" :get-root ccls--get-root :ignore-regexps nil :ignore-messages nil :notification-handlers #<hash-table equal 4/65 0x40a57a37> :request-handlers #<hash-table equal 0/65 0x407da9a1> :response-handlers #<hash-table eql 4/65 0x43e0f7a9> :string-renderers (("objectivec" lambda (str) (with-temp-buffer (delay-mode-hooks (objc-mode)) (insert str) (font-lock-ensure) (buffer-string))) ("cpp" lambda (str) (with-temp-buffer (delay-mode-hooks (c++-mode)) (insert str) (font-lock-ensure) (buffer-string))) ("c" lambda (str) (with-temp-buffer (delay-mode-hooks (c-mode)) (insert str) (font-lock-ensure) (buffer-string)))) :last-id 10 :enable-function lsp-ccls-enable :prefix-function nil :uri-handlers #<hash-table equal 0/65 0x43f95cf1> :action-handlers #<hash-table equal 0/65 0x41315f85> :default-renderer nil) :change-timer-disabled nil :proc #<process lsp-ccls> :cmd-proc #<process lsp-ccls> :buffers (#<buffer block_builder.cc> #<buffer table.cc>) :highlight-overlays #<hash-table eq 0/65 0x43d65075> :extra-client-capabilities nil :status nil :metadata #<hash-table equal 0/65 0x42c7730b> :watches #<hash-table equal 0/65 0x43e0fa63>)) #<hash-table equal 3/65 0x4079e533>)
  lsp--parser-on-message(#s(lsp--parser :waiting-for-response nil :response-result nil :headers nil :body nil :reading-body nil :body-length nil :body-received nil :leftovers "" :queued-notifications nil :queued-requests nil :workspace #s(lsp--workspace :parser #1 :file-versions #<hash-table equal 2/65 0x412a65fb> :server-capabilities #<hash-table equal 17/65 0x43b9c383> :registered-server-capabilities nil :root "/Users/showgood/projects/leveldb/" :client #s(lsp--client :language-id #f(compiled-function (_) #<bytecode 0x442fcb3d>) :send-sync nil :send-async nil :type nil :new-connection #f(compiled-function (filter sentinel) #<bytecode 0x4399f76b>) :stderr "*lsp-ccls stderr*" :get-root ccls--get-root :ignore-regexps nil :ignore-messages nil :notification-handlers #<hash-table equal 4/65 0x40a57a37> :request-handlers #<hash-table equal 0/65 0x407da9a1> :response-handlers #<hash-table eql 4/65 0x43e0f7a9> :string-renderers (("objectivec" lambda (str) (with-temp-buffer (delay-mode-hooks (objc-mode)) (insert str) (font-lock-ensure) (buffer-string))) ("cpp" lambda (str) (with-temp-buffer (delay-mode-hooks (c++-mode)) (insert str) (font-lock-ensure) (buffer-string))) ("c" lambda (str) (with-temp-buffer (delay-mode-hooks (c-mode)) (insert str) (font-lock-ensure) (buffer-string)))) :last-id 10 :enable-function lsp-ccls-enable :prefix-function nil :uri-handlers #<hash-table equal 0/65 0x43f95cf1> :action-handlers #<hash-table equal 0/65 0x41315f85> :default-renderer nil) :change-timer-disabled nil :proc #<process lsp-ccls> :cmd-proc #<process lsp-ccls> :buffers (#<buffer block_builder.cc> #<buffer table.cc>) :highlight-overlays #<hash-table eq 0/65 0x43d65075> :extra-client-capabilities nil :status nil :metadata #<hash-table equal 0/65 0x42c7730b> :watches #<hash-table equal 0/65 0x43e0fa63>)) "{\"jsonrpc\":\"2.0\",\"method\":\"$ccls/publishSemanticHighlighting\",\"params\":{\"uri\":\"file:///Users/showgood/projects/leveldb/table/block_builder.cc\",\"symbols\":[{\"stableId\":143,\"parentKind\":5,\"kind\":6,\"storage\":1,\"ranges\":[{\"start\":{\"line\":102,\"character\":12},\"end\":{\"line\":102,\"character\":18}}]},{\"stableId\":142,\"parentKind\":3,\"kind\":12,\"storage\":1,\"ranges\":[{\"start\":{\"line\":93,\"character\":2},\"end\":{\"line\":93,\"character\":13}},{\"start\":{\"line\":94,\"character\":2},\"end\":{\"line\":94,\"character\":13}},{\"start\":{\"line\":95,\"character\":2},\"end\":{\"line\":95,\"character\":13}}]},{\"stableId\":141,\"parentKind\":6,\"kind\":13,\"storage\":1,\"ranges\":[{\"start\":{\"line\":90,\"character\":15},\"end\":{\"line\":90,\"character\":25}},{\"start\":{\"line\":94,\"character\":24},\"end\":{\"line\":94,\"character\":34}},{\"start\":{\"line\":98,\"character\":38},\"end\":{\"line\":98,\"character\":48}},{\"start\":{\"line\":103,\"character\":40},\"end\":{\"line\":103,\"character\":50}}]},{\"stableId\":108,\"parentKind\":5,\"kind\":6,\"storage\":1,\"ranges\":[{\"start\":{\"line\":81,\"character\":54},\"end\":{\"line\":81,\"character\":58}},{\"start\":{\"line\":81,\"character\":66},\"end\":{\"line\":81,\"character\":70}},{\"start\":{\"line\":90,\"character\":32},\"end\":{\"line\":90,\"character\":36}},{\"start\":{\"line\":95,\"character\":30},\"end\":{\"line\":95,\"character\":34}},{\"start\":{\"line\":99,\"character\":37},\"end\":{\"line\":99,\"character\":41}}]},{\"stableId\":140,\"parentKind\":3,\"kind\":12,\"storage\":1,\"ranges\":[{\"start\":{\"line\":81,\"character\":35},\"end\":{\"line\":81,\"character\":38}}]},{\"stableId\":34,\"parentKind\":1,\"kind\":3,\"storage\":0,\"ranges\":[{\"start\":{\"line\":81,\"character\":30},\"end\":{\"line\":81,\"character\":33}}]},{\"stableId\":137,\"parentKind\":5,\"kind\":6,\"storage\":1,\"ranges\":[{\"start\":{\"line\":76,\"character\":17},\"end\":{\"line\":76,\"character\":22}}]},{\"stableId\":41,\"parentKind\":5,\"kind\":6,\"storage\":1,\"ranges\":[{\"start\":{\"line\":98,\"character\":21},\"end\":{\"line\":98,\"character\":25}},{\"start\":{\"line\":99,\"character\":23},\"end\":{\"line\":99,\"character\":27}},{\"start\":{\"line\":103,\"character\":23},\"end\":{\"line\":103,\"character\":27}}]},{\"stableId\":136,\"parentKind\":6,\"kind\":13,\"storage\":1,\"ranges\":[{\"start\":{\"line\":73,\"character\":8},\"end\":{\"line\":73,\"character\":22}},{\"start\":{\"line\":77,\"character\":47},\"end\":{\"line\":77,\"character\":61}},{\"start\":{\"line\":81,\"character\":39},\"end\":{\"line\":81,\"character\":53}},{\"start\":{\"line\":82,\"character\":37},\"end\":{\"line\":82,\"character\":51}}]},{\"stableId\":47,\"parentKind\":6,\"kind\":253,\"storage\":1,\"ranges\":[{\"start\":{\"line\":72,\"character\":36},\"end\":{\"line\":72,\"character\":39}},{\"start\":{\"line\":77,\"character\":42},\"end\":{\"line\":77,\"character\":45}},{\"start\":{\"line\":81,\"character\":62},\"end\":{\"line\":81,\"character\":65}},{\"start\":{\"line\":82,\"character\":63},\"end\":{\"line\":82,\"character\":66}},{\"start\":{\"line\":90,\"character\":28},\"end\":{\"line\":90,\"character\":31}},{\"start\":{\"line\":98,\"character\":17},\"end\":{\"line\":98,\"character\":20}},{\"start\":{\"line\":103,\"character\":19},\"end\":{\"line\":103,\"character\":22}},{\"start\":{\"line\":104,\"character\":29},\"end\":{\"line\":104,\"character\":32}}]},{\"stableId\":134,\"parentKind\":5,\"kind\":6,\"storage\":1,\"ranges\":[{\"start\":{\"line\":72,\"character\":19},\"end\":{\"line\":72,\"character\":22}}]},{\"stableId\":132,\"parentKind\":6,\"kind\":13,\"storage\":1,\"ranges\":[{\"start\":{\"line\":64,\"character\":14},\"end\":{\"line\":64,\"character\":15}},{\"start\":{\"line\":64,\"character\":21},\"end\":{\"line\":64,\"character\":22}},{\"start\":{\"line\":64,\"character\":43},\"end\":{\"line\":64,\"character\":44}},{\"start\":{\"line\":65,\"character\":35},\"end\":{\"line\":65,\"character\":36}}]},{\"stableId\":131,\"parentKind\":5,\"kind\":6,\"storage\":1,\"ranges\":[{\"start\":{\"line\":62,\"character\":20},\"end\":{\"line\":62,\"character\":26}}]},{\"stableId\":138,\"parentKind\":6,\"kind\":13,\"storage\":1,\"ranges\":[{\"start\":{\"line\":78,\"character\":9},\"end\":{\"line\":78,\"character\":15}},{\"start\":{\"line\":82,\"character\":12},\"end\":{\"line\":82,\"character\":18}},{\"start\":{\"line\":82,\"character\":52},\"end\":{\"line\":82,\"character\":58}},{\"start\":{\"line\":82,\"character\":67},\"end\":{\"line\":82,\"character\":73}},{\"start\":{\"line\":83,\"character\":6},\"end\":{\"line\":83,\"character\":12}},{\"start\":{\"line\":90,\"character\":41},\"end\":{\"line\":90,\"character\":47}},{\"start\":{\"line\":93,\"character\":24},\"end\":{\"line\":93,\"character\":30}},{\"start\":{\"line\":98,\"character\":30},\"end\":{\"line\":98,\"character\":36}},{\"start\":{\"line\":102,\"character\":19},\"end\":{\"line\":102,\"character\":25}},{\"start\":{\"line\":103,\"character\":32},\"end\":{\"line\":103,\"character\":38}}]},{\"stableId\":0,\"parentKind\":1,\"kind\":3,\"storage\":0,\"ranges\":[{\"start\":{\"line\":36,\"character\":10},\"end\":{\"line\":36,\"character\":17}}]},{\"stableId\":125,\"parentKind\":5,\"kind\":8,\"storage\":0,\"ranges\":[{\"start\":{\"line\":48,\"character\":2},\"end\":{\"line\":48,\"character\":9}},{\"start\":{\"line\":57,\"character\":10},\"end\":{\"line\":57,\"character\":17}},{\"start\":{\"line\":65,\"character\":16},\"end\":{\"line\":65,\"character\":23}},{\"start\":{\"line\":67,\"character\":14},\"end\":{\"line\":67,\"character\":21}},{\"start\":{\"line\":69,\"character\":15},\"end\":{\"line\":69,\"character\":22}},{\"start\":{\"line\":76,\"character\":9},\"end\":{\"line\":76,\"character\":16}},{\"start\":{\"line\":87,\"character\":24},\"end\":{\"line\":87,\"character\":31}},{\"start\":{\"line\":93,\"character\":15},\"end\":{\"line\":93,\"character\":22}},{\"start\":{\"line\":94,\"character\":15},\"end\":{\"line\":94,\"character\":22}},{\"start\":{\"line\":95,\"character\":15},\"end\":{\"line\":95,\"character\":22}},{\"start\":{\"line\":98,\"character\":2},\"end\":{\"line\":98,\"character\":9}},{\"start\":{\"line\":99,\"character\":2},\"end\":{\"line\":99,\"character\":9}}]},{\"stableId\":130,\"parentKind\":1,\"kind\":252,\"storage\":0,\"ranges\":[{\"start\":{\"line\":58,\"character\":36},\"end\":{\"line\":58,\"character\":44}},{\"start\":{\"line\":59,\"character\":17},\"end\":{\"line\":59,\"character\":25}}]},{\"stableId\":135,\"parentKind\":6,\"kind\":253,\"storage\":1,\"ranges\":[{\"start\":{\"line\":72,\"character\":54},\"end\":{\"line\":72,\"character\":59}},{\"start\":{\"line\":95,\"character\":24},\"end\":{\"line\":95,\"character\":29}},{\"start\":{\"line\":99,\"character\":17},\"end\":{\"line\":99,\"character\":22}},{\"start\":{\"line\":99,\"character\":31},\"end\":{\"line\":99,\"character\":36}}]},{\"stableId\":133,\"parentKind\":3,\"kind\":12,\"storage\":1,\"ranges\":[{\"start\":{\"line\":65,\"character\":4},\"end\":{\"line\":65,\"character\":14}},{\"start\":{\"line\":67,\"character\":2},\"end\":{\"line\":67,\"character\":12}}]},{\"stableId\":21,\"parentKind\":3,\"kind\":5,\"storage\":0,\"ranges\":[{\"start\":{\"line\":62,\"character\":0},\"end\":{\"line\":62,\"character\":5}},{\"start\":{\"line\":69,\"character\":9},\"end\":{\"line\":69,\"character\":14}},{\"start\":{\"line\":72,\"character\":29},\"end\":{\"line\":72,\"character\":34}},{\"start\":{\"line\":72,\"character\":47},\"end\":{\"line\":72,\"character\":52}},{\"start\":{\"line\":73,\"character\":2},\"end\":{\"line\":73,\"character\":7}},{\"start\":{\"line\":104,\"character\":9},\"end\":{\"line\":104,\"character\":14}}]},{\"stableId\":129,\"parentKind\":5,\"kind\":6,\"storage\":1,\"ranges\":[{\"start\":{\"line\":56,\"character\":21},\"end\":{\"line\":56,\"character\":40}}]},{\"stableId\":119,\"parentKind\":5,\"kind\":8,\"storage\":0,\"ranges\":[{\"start\":{\"line\":41,\"character\":6},\"end\":{\"line\":41,\"character\":14}},{\"start\":{\"line\":51,\"character\":2},\"end\":{\"line\":51,\"character\":10}},{\"start\":{\"line\":75,\"character\":9},\"end\":{\"line\":75,\"character\":17}},{\"start\":{\"line\":79,\"character\":6},\"end\":{\"line\":79,\"character\":14}},{\"start\":{\"line\":88,\"character\":4},\"end\":{\"line\":88,\"character\":12}},{\"start\":{\"line\":105,\"character\":2},\"end\":{\"line\":105,\"character\":10}}]},{\"stableId\":128,\"parentKind\":1,\"kind\":252,\"storage\":0,\"ranges\":[{\"start\":{\"line\":56,\"character\":0},\"end\":{\"line\":56,\"character\":6}},{\"start\":{\"line\":64,\"character\":7},\"end\":{\"line\":64,\"character\":13}},{\"start\":{\"line\":78,\"character\":2},\"end\":{\"line\":78,\"character\":8}},{\"start\":{\"line\":81,\"character\":10},\"end\":{\"line\":81,\"character\":16}},{\"start\":{\"line\":90,\"character\":8},\"end\":{\"line\":90,\"character\":14}}]},{\"stableId\":126,\"parentKind\":5,\"kind\":6,\"storage\":1,\"ranges\":[{\"start\":{\"line\":49,\"character\":12},\"end\":{\"line\":49,\"character\":17}}]},{\"stableId\":108,\"parentKind\":5,\"kind\":6,\"storage\":1,\"ranges\":[{\"start\":{\"line\":58,\"character\":20},\"end\":{\"line\":58,\"character\":24}},{\"start\":{\"line\":64,\"character\":35},\"end\":{\"line\":64,\"character\":39}},{\"start\":{\"line\":67,\"character\":33},\"end\":{\"line\":67,\"character\":37}}]},{\"stableId\":109,\"parentKind\":23,\"kind\":8,\"storage\":0,\"ranges\":[{\"start\":{\"line\":77,\"character\":22},\"end\":{\"line\":77,\"character\":32}}]},{\"stableId\":117,\"parentKind\":5,\"kind\":8,\"storage\":0,\"ranges\":[{\"start\":{\"line\":39,\"character\":6},\"end\":{\"line\":39,\"character\":14}},{\"start\":{\"line\":75,\"character\":21},\"end\":{\"line\":75,\"character\":29}},{\"start\":{\"line\":77,\"character\":12},\"end\":{\"line\":77,\"character\":20}},{\"start\":{\"line\":79,\"character\":17},\"end\":{\"line\":79,\"character\":25}}]},{\"stableId\":108,\"parentKind\":5,\"kind\":6,\"storage\":1,\"ranges\":[{\"start\":{\"line\":57,\"character\":18},\"end\":{\"line\":57,\"character\":22}},{\"start\":{\"line\":87,\"character\":32},\"end\":{\"line\":87,\"character\":36}}]},{\"stableId\":126,\"parentKind\":5,\"kind\":6,\"storage\":1,\"ranges\":[{\"start\":{\"line\":48,\"character\":10},\"end\":{\"line\":48,\"character\":15}},{\"start\":{\"line\":53,\"character\":12},\"end\":{\"line\":53,\"character\":17}}]},{\"stableId\":115,\"parentKind\":5,\"kind\":9,\"storage\":1,\"ranges\":[{\"start\":{\"line\":38,\"character\":14},\"end\":{\"line\":38,\"character\":26}}]},{\"stableId\":124,\"parentKind\":5,\"kind\":6,\"storage\":1,\"ranges\":[{\"start\":{\"line\":47,\"character\":19},\"end\":{\"line\":47,\"character\":24}}]},{\"stableId\":122,\"parentKind\":23,\"kind\":8,\"storage\":0,\"ranges\":[{\"start\":{\"line\":43,\"character\":18},\"end\":{\"line\":43,\"character\":40}},{\"start\":{\"line\":75,\"character\":31},\"end\":{\"line\":75,\"character\":53}},{\"start\":{\"line\":79,\"character\":27},\"end\":{\"line\":79,\"character\":49}}]},{\"stableId\":120,\"parentKind\":5,\"kind\":8,\"storage\":0,\"ranges\":[{\"start\":{\"line\":42,\"character\":6},\"end\":{\"line\":42,\"character\":15}},{\"start\":{\"line\":52,\"character\":2},\"end\":{\"line\":52,\"character\":11}},{\"start\":{\"line\":68,\"character\":2},\"end\":{\"line\":68,\"character\":11}},{\"start\":{\"line\":74,\"character\":10},\"end\":{\"line\":74,\"character\":19}}]},{\"stableId\":78,\"parentKind\":3,\"kind\":23,\"storage\":0,\"ranges\":[{\"start\":{\"line\":38,\"character\":33},\"end\":{\"line\":38,\"character\":40}}]},{\"stableId\":127,\"parentKind\":5,\"kind\":8,\"storage\":0,\"ranges\":[{\"start\":{\"line\":53,\"character\":2},\"end\":{\"line\":53,\"character\":11}},{\"start\":{\"line\":73,\"character\":23},\"end\":{\"line\":73,\"character\":32}},{\"start\":{\"line\":102,\"character\":2},\"end\":{\"line\":102,\"character\":11}},{\"start\":{\"line\":103,\"character\":2},\"end\":{\"line\":103,\"character\":11}},{\"start\":{\"line\":104,\"character\":15},\"end\":{\"line\":104,\"character\":24}}]},{\"stableId\":118,\"parentKind\":5,\"kind\":8,\"storage\":0,\"ranges\":[{\"start\":{\"line\":40,\"character\":6},\"end\":{\"line\":40,\"character\":15}},{\"start\":{\"line\":44,\"character\":2},\"end\":{\"line\":44,\"character\":11}},{\"start\":{\"line\":49,\"character\":2},\"end\":{\"line\":49,\"character\":11}},{\"start\":{\"line\":50,\"character\":2},\"end\":{\"line\":50,\"character\":11}},{\"start\":{\"line\":58,\"character\":10},\"end\":{\"line\":58,\"character\":19}},{\"start\":{\"line\":64,\"character\":25},\"end\":{\"line\":64,\"character\":34}},{\"start\":{\"line\":65,\"character\":25},\"end\":{\"line\":65,\"character\":34}},{\"start\":{\"line\":67,\"character\":23},\"end\":{\"line\":67,\"character\":32}},{\"start\":{\"line\":87,\"character\":4},\"end\":{\"line\":87,\"character\":13}}]},{\"stableId\":101,\"parentKind\":5,\"kind\":6,\"storage\":1,\"ranges\":[{\"start\":{\"line\":98,\"character\":10},\"end\":{\"line\":98,\"character\":16}},{\"start\":{\"line\":99,\"character\":10},\"end\":{\"line\":99,\"character\":16}},{\"start\":{\"line\":103,\"character\":12},\"end\":{\"line\":103,\"character\":18}}]},{\"stableId\":139,\"parentKind\":6,\"kind\":13,\"storage\":1,\"ranges\":[{\"start\":{\"line\":81,\"character\":17},\"end\":{\"line\":81,\"character\":27}},{\"start\":{\"line\":82,\"character\":21},\"end\":{\"line\":82,\"character\":31}}]},{\"stableId\":123,\"parentKind\":5,\"kind\":6,\"storage\":1,\"ranges\":[{\"start\":{\"line\":44,\"character\":12},\"end\":{\"line\":44,\"character\":21}},{\"start\":{\"line\":50,\"character\":12},\"end\":{\"line\":50,\"character\":21}},{\"start\":{\"line\":87,\"character\":14},\"end\":{\"line\":87,\"character\":23}}]},{\"stableId\":116,\"parentKind\":9,\"kind\":253,\"storage\":1,\"ranges\":[{\"start\":{\"line\":38,\"character\":42},\"end\":{\"line\":38,\"character\":49}},{\"start\":{\"line\":39,\"character\":15},\"end\":{\"line\":39,\"character\":22}},{\"start\":{\"line\":43,\"character\":9},\"end\":{\"line\":43,\"character\":16}}]},{\"stableId\":121,\"parentKind\":1,\"kind\":255,\"storage\":0,\"ranges\":[{\"start\":{\"line\":43,\"character\":2},\"end\":{\"line\":43,\"character\":8}},{\"start\":{\"line\":74,\"character\":2},\"end\":{\"line\":74,\"character\":8}},{\"start\":{\"line\":75,\"character\":2},\"end\":{\"line\":75,\"character\":8}},{\"start\":{\"line\":76,\"character\":2},\"end\":{\"line\":76,\"character\":8}},{\"start\":{\"line\":104,\"character\":2},\"end\":{\"line\":104,\"character\":8}}]},{\"stableId\":114,\"parentKind\":3,\"kind\":5,\"storage\":0,\"ranges\":[{\"start\":{\"line\":38,\"character\":0},\"end\":{\"line\":38,\"character\":12}},{\"start\":{\"line\":47,\"character\":5},\"end\":{\"line\":47,\"character\":17}},{\"start\":{\"line\":56,\"character\":7},\"end\":{\"line\":56,\"character\":19}},{\"start\":{\"line\":62,\"character\":6},\"end\":{\"line\":62,\"character\":18}},{\"start\":{\"line\":72,\"character\":5},\"end\":{\"line\":72,\"character\":17}}]}]}}")
  #f(compiled-function (proc output) #<bytecode 0x407111e7>)(#<process lsp-ccls> "}]},{\"stableId\":121,\"parentKind\":1,\"kind\":255,\"storage\":0,\"ranges\":[{\"start\":{\"line\":43,\"character\":2},\"end\":{\"line\":43,\"character\":8}},{\"start\":{\"line\":74,\"character\":2},\"end\":{\"line\":74,\"character\":8}},{\"start\":{\"line\":75,\"character\":2},\"end\":{\"line\":75,\"character\":8}},{\"start\":{\"line\":76,\"character\":2},\"end\":{\"line\":76,\"character\":8}},{\"start\":{\"line\":104,\"character\":2},\"end\":{\"line\":104,\"character\":8}}]},{\"stableId\":114,\"parentKind\":3,\"kind\":5,\"storage\":0,\"ranges\":[{\"start\":{\"line\":38,\"character\":0},\"end\":{\"line\":38,\"character\":12}},{\"start\":{\"line\":47,\"character\":5},\"end\":{\"line\":47,\"character\":17}},{\"start\":{\"line\":56,\"character\":7},\"end\":{\"line\":56,\"character\":19}},{\"start\":{\"line\":62,\"character\":6},\"end\":{\"line\":62,\"character\":18}},{\"start\":{\"line\":72,\"character\":5},\"end\":{\"line\":72,\"character\":17}}]}]}}Content-Length: 39\015\n\015\n{\"jsonrpc\":\"2.0\",\"id\":10,\"result\":null}")

lsp ui

Will emacs-ccls support lsp-ui? It is very helpful when somebody is developing in a big codebase.

Company can't provide proper auto completions

Type view_ in buffer then doing M-x company-complete.

In *Messages* buffer:

Company: An error occurred in post-command
Company: frontend company-pseudo-tooltip-unless-just-one-frontend error "Company: backend company-lsp error "Invalid function: incf" with args (match view_widget() -> Gtk::Widget *)" on command post-command

Backtrace:

Debugger entered--Lisp error: (void-function incf)
  incf(0)
  company-lsp--compute-match(#("view_widget() -> Gtk::Widget *" 0 30 (lsp-completion-item #<hash-table equal 8/65 0x226daf9> lsp-completion-prefix #("view_" 0 5 (fontified t)))))
  company-lsp(match #("view_widget() -> Gtk::Widget *" 0 30 (lsp-completion-item #<hash-table equal 8/65 0x226daf9> lsp-completion-prefix #("view_" 0 5 (fontified t)))))
  apply(company-lsp (match #("view_widget() -> Gtk::Widget *" 0 30 (lsp-completion-item #<hash-table equal 8/65 0x226daf9> lsp-completion-prefix #("view_" 0 5 (fontified t))))))
  company-call-backend-raw(match #("view_widget() -> Gtk::Widget *" 0 30 (lsp-completion-item #<hash-table equal 8/65 0x226daf9> lsp-completion-prefix #("view_" 0 5 (fontified t)))))
  apply(company-call-backend-raw (match #("view_widget() -> Gtk::Widget *" 0 30 (lsp-completion-item #<hash-table equal 8/65 0x226daf9> lsp-completion-prefix #("view_" 0 5 (fontified t))))))
  company--force-sync(company-call-backend-raw (match #("view_widget() -> Gtk::Widget *" 0 30 (lsp-completion-item #<hash-table equal 8/65 0x226daf9> lsp-completion-prefix #("view_" 0 5 (fontified t))))) company-lsp)
  company-call-backend(match #("view_widget() -> Gtk::Widget *" 0 30 (lsp-completion-item #<hash-table equal 8/65 0x226daf9> lsp-completion-prefix #("view_" 0 5 (fontified t)))))
  company-fill-propertize(#("view_widget() -> Gtk::Widget *" 0 30 (lsp-completion-item #<hash-table equal 8/65 0x226daf9> lsp-completion-prefix #("view_" 0 5 (fontified t)))) " thittam::ResourcesControllerImpl (Method)" 78 t " " " 1 ")
  company--create-lines(0 10)
  company-pseudo-tooltip-show(23 2 0)
  company-pseudo-tooltip-show-at-point(1243 5)
  company-pseudo-tooltip-frontend(post-command)
  company-pseudo-tooltip-unless-just-one-frontend(post-command)
  company-call-frontends(post-command)
  company-post-command()

xref-find-references doesn't work

I got lsp--location-to-td-position: Wrong type argument: hash-table-p, nil

I use custom build of ccls executable from github master, and melpa version of emacs-ccls(20181023.339), and I use a custom build of very recent master emacs.

full stack trace:

Debugger entered--Lisp error: (wrong-type-argument hash-table-p nil)
  gethash("uri" nil)
  lsp--location-to-td-position(nil)
  lsp--symbol-info-to-identifier(#<hash-table equal 6/65 0x5dc85bd5>)
  mapcar(lsp--symbol-info-to-identifier (#<hash-table equal 6/65 0x5dc85bd5> #<hash-table equal 6/65 0x5dc94bb5> #<hash-table equal 6/65 0x5dc997d5> #<hash-table equal 6/65 0x5dc9f3b5> #<hash-table equal 6/65 0x461168d5> #<hash-table equal 6/65 0x4611a4b5> #<hash-table equal 6/65 0x4613e955> #<hash-table equal 6/65 0x5e6206c1> #<hash-table equal 6/65 0x5e6242c1> #<hash-table equal 6/65 0x5e626ac1> #<hash-table equal 6/65 0x5e6286c1> #<hash-table equal 6/65 0x5e629ac1> #<hash-table equal 6/65 0x5e62aec1> #<hash-table equal 6/65 0x5e62eac1> #<hash-table equal 6/65 0x4107e35d> #<hash-table equal 6/65 0x4104ef71> #<hash-table equal 6/65 0x407ca2e1> #<hash-table equal 6/65 0x45995fb5> #<hash-table equal 6/65 0x459933b5> #<hash-table equal 6/65 0x4598dbd5> #<hash-table equal 6/65 0x459877b5> #<hash-table equal 6/65 0x459833d5> #<hash-table equal 6/65 0x4597dbb5> #<hash-table equal 6/65 0x40d066e9> #<hash-table equal 6/65 0x4658ab35> #<hash-table equal 6/65 0x5dc21fd5>))
  #f(compiled-function #'sequence #<bytecode 0x41ea4b57>)(lsp--symbol-info-to-identifier (#<hash-table equal 6/65 0x5dc85bd5> #<hash-table equal 6/65 0x5dc94bb5> #<hash-table equal 6/65 0x5dc997d5> #<hash-table equal 6/65 0x5dc9f3b5> #<hash-table equal 6/65 0x461168d5> #<hash-table equal 6/65 0x4611a4b5> #<hash-table equal 6/65 0x4613e955> #<hash-table equal 6/65 0x5e6206c1> #<hash-table equal 6/65 0x5e6242c1> #<hash-table equal 6/65 0x5e626ac1> #<hash-table equal 6/65 0x5e6286c1> #<hash-table equal 6/65 0x5e629ac1> #<hash-table equal 6/65 0x5e62aec1> #<hash-table equal 6/65 0x5e62eac1> #<hash-table equal 6/65 0x4107e35d> #<hash-table equal 6/65 0x4104ef71> #<hash-table equal 6/65 0x407ca2e1> #<hash-table equal 6/65 0x45995fb5> #<hash-table equal 6/65 0x459933b5> #<hash-table equal 6/65 0x4598dbd5> #<hash-table equal 6/65 0x459877b5> #<hash-table equal 6/65 0x459833d5> #<hash-table equal 6/65 0x4597dbb5> #<hash-table equal 6/65 0x40d066e9> #<hash-table equal 6/65 0x4658ab35> #<hash-table equal 6/65 0x5dc21fd5>))
  apply(#f(compiled-function #'sequence #<bytecode 0x41ea4b57>) lsp--symbol-info-to-identifier (#<hash-table equal 6/65 0x5dc85bd5> #<hash-table equal 6/65 0x5dc94bb5> #<hash-table equal 6/65 0x5dc997d5> #<hash-table equal 6/65 0x5dc9f3b5> #<hash-table equal 6/65 0x461168d5> #<hash-table equal 6/65 0x4611a4b5> #<hash-table equal 6/65 0x4613e955> #<hash-table equal 6/65 0x5e6206c1> #<hash-table equal 6/65 0x5e6242c1> #<hash-table equal 6/65 0x5e626ac1> #<hash-table equal 6/65 0x5e6286c1> #<hash-table equal 6/65 0x5e629ac1> #<hash-table equal 6/65 0x5e62aec1> #<hash-table equal 6/65 0x5e62eac1> #<hash-table equal 6/65 0x4107e35d> #<hash-table equal 6/65 0x4104ef71> #<hash-table equal 6/65 0x407ca2e1> #<hash-table equal 6/65 0x45995fb5> #<hash-table equal 6/65 0x459933b5> #<hash-table equal 6/65 0x4598dbd5> #<hash-table equal 6/65 0x459877b5> #<hash-table equal 6/65 0x459833d5> #<hash-table equal 6/65 0x4597dbb5> #<hash-table equal 6/65 0x40d066e9> #<hash-table equal 6/65 0x4658ab35> #<hash-table equal 6/65 0x5dc21fd5>) nil)
  seq-map(lsp--symbol-info-to-identifier (#<hash-table equal 6/65 0x5dc85bd5> #<hash-table equal 6/65 0x5dc94bb5> #<hash-table equal 6/65 0x5dc997d5> #<hash-table equal 6/65 0x5dc9f3b5> #<hash-table equal 6/65 0x461168d5> #<hash-table equal 6/65 0x4611a4b5> #<hash-table equal 6/65 0x4613e955> #<hash-table equal 6/65 0x5e6206c1> #<hash-table equal 6/65 0x5e6242c1> #<hash-table equal 6/65 0x5e626ac1> #<hash-table equal 6/65 0x5e6286c1> #<hash-table equal 6/65 0x5e629ac1> #<hash-table equal 6/65 0x5e62aec1> #<hash-table equal 6/65 0x5e62eac1> #<hash-table equal 6/65 0x4107e35d> #<hash-table equal 6/65 0x4104ef71> #<hash-table equal 6/65 0x407ca2e1> #<hash-table equal 6/65 0x45995fb5> #<hash-table equal 6/65 0x459933b5> #<hash-table equal 6/65 0x4598dbd5> #<hash-table equal 6/65 0x459877b5> #<hash-table equal 6/65 0x459833d5> #<hash-table equal 6/65 0x4597dbb5> #<hash-table equal 6/65 0x40d066e9> #<hash-table equal 6/65 0x4658ab35> #<hash-table equal 6/65 0x5dc21fd5>))
  #f(compiled-function (backend) #<bytecode 0x408d17b5>)(xref-lsp)
  apply(#f(compiled-function (backend) #<bytecode 0x408d17b5>) xref-lsp nil)
  xref-backend-identifier-completion-table(xref-lsp)
  xref--read-identifier("Find references of: ")
  byte-code("\300\301!C\207" [xref--read-identifier "Find references of: "] 2)
  call-interactively(xref-find-references record nil)
  command-execute(xref-find-references record)
  #f(compiled-function (cmd) #<bytecode 0x40d006e1>)("xref-find-references")
  ivy-call()
  ivy-read("M-x " ("xref-find-references" "list-packages" "flycheck-mode" "flyspell-mode" "lsp-ui-mode" "company-complete" "customize-themes" "rg" "runcpp" "calc" "ag" "compile" "customize-option" "revert-buffer" "lldb" "text-mode" "display-line-numbers-mode" "package-install-selected-packages" "ibuffer" "version" "man" "company-mode" "ivy-rich-mode" "devdocs-search" "delete-matching-lines" "align" "elfeed" "cider-jack-in" "package-delete" "indent-code-rigidly" "recompile" "ediff-buffers" "display-time-world" "term" "shell" "ansi-term" "bm-toggle" "customize-face" "clang-format-buffer" "jedi:reinstall-server" "c++-mode" "semantic-mode" "mark-paragraph" "counsel-unicode-char" "run-python" "package-autoremove" "jedi:install-server" "org-pandoc-export-to-docx" "lsp-ui-peek-find-references" "org-mode" ...) :predicate nil :require-match t :history counsel-M-x-history :action #f(compiled-function (cmd) #<bytecode 0x40d006e1>) :sort nil :keymap (keymap (67108908 . counsel--info-lookup-symbol) (67108910 . counsel-find-symbol)) :initial-input nil :caller counsel-M-x)
  counsel-M-x()
  funcall-interactively(counsel-M-x)
  call-interactively(counsel-M-x nil nil)
  command-execute(counsel-M-x)

Warning (lsp-mode): Unknown method: $ccls/setInactiveRegions

Hi, I have the following message keep showing in minibuffer

Warning (lsp-mode): Unknown method: $ccls/setInactiveRegions
Warning (lsp-mode): Unknown method: $ccls/setInactiveRegions
Warning (lsp-mode): Unknown method: $ccls/setInactiveRegions

I tried to update ccls to the latest version but the message is still there. Is this a bug? Thanks in advance.

bogus autocomplete and index

Hi,
I'm trying to setup my configuration, and get some trouble with ccls+lsp+company

First test an a unique file, give completion, but when accept a completion, the text is not what expected see here:
capture d ecran de 2018-10-08 09-45-51
after selecting the first entry:
capture d ecran de 2018-10-08 09-46-05
On this simple example, vanilla company perform well.

The other problem I face is using a bigger project, ccls seems to run (as I can see from the log file), but the proposed completion are totally wrong. reference navigation seems to me ok btw.

I new to ccls and lsp, so feel free to ask any relevant information and what I should test to resolve the situation.
I'm using vanilla emacs (no spacemacs nor doom...)

ccls hangs when there are too many files to watch

My project is based on bazel. Once I generated proper compile_commands.json. It works fine but it will hang emacs when bootstrapping emacs and open a cc file. I need to press C-g couple times to stop it.

I tried to set lsp-file-watch-threshold to nil but no luck get it working.

Creating watch for /home/ztlevi/.cache/bazel/_bazel_user/933c2f549343e099e3a6911b282cb71c/execroot/{PROJECT_NAME}/bazel-out/default-opt/bin/core/Log/EventLogger/tests/_objs/EventLogManagerTest
Creating watch for /home/ztlevi/.cache/bazel/_bazel_user/933c2f549343e099e3a6911b282cb71c/execroot/{PROJECT_NAME}/bazel-out/default-opt/bin/core/Log/EventReader
Creating watch for /home/ztlevi/.cache/bazel/_bazel_user/933c2f549343e099e3a6911b282cb71c/execroot/{PROJECT_NAME}/bazel-out/default-opt/bin/core/Log/EventReader/tests
Creating watch for /home/ztlevi/.cache/bazel/_bazel_user/933c2f549343e099e3a6911b282cb71c/execroot/{PROJECT_NAME}/bazel-out/default-opt/bin/core/Log/EventReader/tests/EventReaderTest.runfiles
Creating watch for /home/ztlevi/.cache/bazel/_bazel_user/933c2f549343e099e3a6911b282cb71c/execroot/{PROJECT_NAME}/bazel-out/default-opt/bin/core/Log/EventReader/tests/EventReaderTest.runfiles/{PROJECT_NAME}
Creating watch for /home/ztlevi/.cache/bazel/_bazel_user/933c2f549343e099e3a6911b282cb71c/execroot/{PROJECT_NAME}/bazel-out/default-opt/bin/core/Log/EventReader/tests/EventReaderTest.runfiles/{PROJECT_NAME}/_solib_haswell
Creating watch for /home/ztlevi/.cache/bazel/_bazel_user/933c2f549343e099e3a6911b282cb71c/execroot/{PROJECT_NAME}/bazel-out/default-opt/bin/core/Log/EventReader/tests/EventReaderTest.runfiles/{PROJECT_NAME}/_solib_haswell/_U@system_S_S_Caws-cpp-sdk-core___Uexternal_Ssystem_Susr_Slocal_Slib
Creating watch for /home/ztlevi/.cache/bazel/_bazel_user/933c2f549343e099e3a6911b282cb71c/execroot/{PROJECT_NAME}/bazel-out/default-opt/bin/core/Log/EventReader/tests/EventReaderTest.runfiles/{PROJECT_NAME}/_solib_haswell/_U@system_S_S_Caws-cpp-sdk-s3___Uexternal_Ssystem_Susr_Slocal_Slib
Creating watch for /home/ztlevi/.cache/bazel/_bazel_user/933c2f549343e099e3a6911b282cb71c/execroot/{PROJECT_NAME}/bazel-out/default-opt/bin/core/Log/EventReader/tests/EventReaderTest.runfiles/{PROJECT_NAME}/_solib_haswell/_U@system_S_S_Cboost_Ufilesystem___Uexternal_Ssystem_Susr_Slocal_Slib
Creating watch for /home/ztlevi/.cache/bazel/_bazel_user/933c2f549343e099e3a6911b282cb71c/execroot/{PROJECT_NAME}/bazel-out/default-opt/bin/core/Log/EventReader/tests/EventReaderTest.runfiles/{PROJECT_NAME}/_solib_haswell/_U@system_S_S_Cboost_Usystem___Uexternal_Ssystem_Susr_Slocal_Slib
Creating watch for /home/ztlevi/.cache/bazel/_bazel_user/933c2f549343e099e3a6911b282cb71c/execroot/{PROJECT_NAME}/bazel-out/default-opt/bin/core/Log/EventReader/tests/EventReaderTest.runfiles/{PROJECT_NAME}/_solib_haswell/_U@system_S_S_Cdl___Uexternal_Ssystem_Susr_Slib_Sx86_U64-linux-gnu
Creating watch for /home/ztlevi/.cache/bazel/_bazel_user/933c2f549343e099e3a6911b282cb71c/execroot/{PROJECT_NAME}/bazel-out/default-opt/bin/core/Log/EventReader/tests/EventReaderTest.runfiles/{PROJECT_NAME}/_solib_haswell/_U@system_S_S_Cpthread___Uexternal_Ssystem_Susr_Slib_Sx86_U64-linux-gnu
Creating watch for /home/ztlevi/.cache/bazel/_bazel_user/933c2f549343e099e3a6911b282cb71c/execroot/{PROJECT_NAME}/bazel-out/default-opt/bin/core/Log/EventReader/tests/EventReaderTest.runfiles/{PROJECT_NAME}/_solib_haswell/_U@system_S_S_Crt___Uexternal_Ssystem_Susr_Slib_Sx86_U64-linux-gnu
Creating watch for /home/ztlevi/.cache/bazel/_bazel_user/933c2f549343e099e3a6911b282cb71c/execroot/{PROJECT_NAME}/bazel-out/default-opt/bin/core/Log/EventReader/tests/EventReaderTest.runfiles/{PROJECT_NAME}/_solib_haswell/_U@system_S_S_Ctbb___Uexternal_Ssystem_Susr_Slocal_Slib_Sintel64_Sgcc4.4
Creating watch for /home/ztlevi/.cache/bazel/_bazel_user/933c2f549343e099e3a6911b282cb71c/execroot/{PROJECT_NAME}/bazel-out/default-opt/bin/core/Log/EventReader/tests/EventReaderTest.runfiles/{PROJECT_NAME}/core
Creating watch for /home/ztlevi/.cache/bazel/_bazel_user/933c2f549343e099e3a6911b282cb71c/execroot/{PROJECT_NAME}/bazel-out/default-opt/bin/core/Log/EventReader/tests/EventReaderTest.runfiles/{PROJECT_NAME}/core/Log
Creating watch for /home/ztlevi/.cache/bazel/_bazel_user/933c2f549343e099e3a6911b282cb71c/execroot/{PROJECT_NAME}/bazel-out/default-opt/bin/core/Log/EventReader/tests/EventReaderTest.runfiles/{PROJECT_NAME}/core/Log/EventReader
Creating watch for /home/ztlevi/.cache/bazel/_bazel_user/933c2f549343e099e3a6911b282cb71c/execroot/{PROJECT_NAME}/bazel-out/default-opt/bin/core/Log/EventReader/tests/EventReaderTest.runfiles/{PROJECT_NAME}/core/Log/EventReader/tests
Creating watch for /home/ztlevi/.cache/bazel/_bazel_user/933c2f549343e099e3a6911b282cb71c/execroot/{PROJECT_NAME}/bazel-out/default-opt/bin/core/Log/EventReader/tests/EventReaderTest.runfiles/{PROJECT_NAME}/core/resources
Creating watch for /home/ztlevi/.cache/bazel/_bazel_user/933c2f549343e099e3a6911b282cb71c/execroot/{PROJECT_NAME}/bazel-out/default-opt/bin/core/Log/EventReader/tests/EventReaderTest.runfiles/{PROJECT_NAME}/core/resources/configs
Creating watch for /home/ztlevi/.cache/bazel/_bazel_user/933c2f549343e099e3a6911b282cb71c/execroot/{PROJECT_NAME}/bazel-out/default-opt/bin/core/Log/EventReader/tests/EventReaderTest.runfiles/{PROJECT_NAME}/core/resources/configs/feature
Creating watch for /home/ztlevi/.cache/bazel/_bazel_user/933c2f549343e099e3a6911b282cb71c/execroot/{PROJECT_NAME}/bazel-out/default-opt/bin/core/Log/EventReader/tests/_objs
Creating watch for /home/ztlevi/.cache/bazel/_bazel_user/933c2f549343e099e3a6911b282cb71c/execroot/{PROJECT_NAME}/bazel-out/default-opt/bin/core/Log/EventReader/tests/_objs/EventReaderTest

ccls won't start after todays update

After todays update of lsp-mode and ccls, every time I try to start ccls via M-x lsp-ccls-enable I get the following error. Before updates everything worked perfectly.

command-execute: Autoloading file /Users/phil/.emacs.d/elpa/ccls-20181203.843/ccls.elc failed to define function lsp-ccls-enable

Didn't have time too look up if it is lsp or ccls related. So I will this here for now, feel free to close it if it's lsp related.
If it's problem on my part with my emacs config I will post the code from the init.el

Have a nice day!

Changes to header not registering in cpp file

If I have a header file and a cpp file open at the same time and add a function prototype to the header, I would expect to be able to write the function implementation in the cpp buffer without any errors.

However, usually I get the message that the function I'm implementing is not defined. Sometimes saving both files seems to trigger everything to refresh, but otherwise the only way I know how to fix it is by restarting the lsp workspace.

Any idea what's causing this? I'm not sure if it's a problem with emacs-ccls or lsp-mode in general, but I figured I'd ask here first. Thanks

How to reset the project root

I want to change or reset the project root, since the location of compile_commands.json is moved.

I've tried looking at M-x customize-group ccls or removed .ccls-cache from the project root directory, however I couldn't find a way to reset the project root of the file.

How can I set a new project root?

SegFault while edditing commit message on Magit

Expected behaviour: not crash emacs

The behaviour observed:
when opening the commit message buffer if I stay too long (less then a minute) it crashes emacs

Reproduce the issue.: it started happening after I installed CCLS and start to edit commit message

M-x magit-version RET
Magit 20180720.1712, Git 2.13.6, Emacs 25.3.1, gnu/linux

I doubt that it would be of any use but here is the stack trace:
Fatal error 6: Aborted
Backtrace:
emacs[0x50abde]
emacs[0x4f12f9]
emacs[0x50ac83]
emacs[0x4ad2c8]
emacs[0x444ed7]
emacs[0x44458e]
emacs[0x444712]
emacs[0x447c7d]
emacs[0x44248f]
emacs[0x532304]
emacs[0x564173]
emacs[0x59c523]
emacs[0x56649d]
emacs[0x563feb]
emacs[0x59c523]
emacs[0x56649d]
emacs[0x563feb]
emacs[0x5642b8]
emacs[0x563796]
emacs[0x4f1984]
emacs[0x562dad]
emacs[0x4f6567]
emacs[0x4ffcfb]
emacs[0x5635e2]
emacs[0x4f1714]
emacs[0x563561]
emacs[0x4f16ab]
emacs[0x4f5f67]
emacs[0x4f628a]
emacs[0x41a09c]
/lib64/libc.so.6(__libc_start_main+0xea)[0x7fce63cda88a]
emacs[0x41ab8a]
eAborted (core dumped)

I'm also posting the issue on the Magit GitHub

Automating the generation of compile_commands.json

Doing this will help in getting started with LSP easily. A command to do this would be enough. I think this can be done with the help of projectile and/or project.el. By asking the user questions about the command to run to generate the compile_commands.json from project root.

ccls exits instantly (with code 53)

When I try to open a c++ file with lsp-mode enabled I get:

LSP :: Connected to [ccls:10976 status:starting].
LSP :: ccls has exited (exited abnormally with code 53)
Server ccls:10976 status:starting exited with status exit. Do you want to restart it? (y or n) y
LSP :: Restarting LSP in buffer resource_manager.cpp
LSP :: Connected to [ccls:11592 status:starting].
LSP :: ccls has exited (exited abnormally with code 53)
Server ccls:11592 status:starting exited with status exit. Do you want to restart it? (y or n)

and only Process ccls stderr finished is printed to *ccls::stderr*. However, ccls does index the project when run from the command line ../ccls/build/ccls.exe -index=.

System Information:

  • Windows 10
  • Emacs 26.1
  • ccls built with msys2 mingw64
  • g++ version 8.3.0

Comparison to Cquery

What are some of the main highlights of emacs-ccls which seperate it from cquery? What reason is there to switch from cquery to this package?

Preprocess fails

Hi,

When I'm trying to use pre-process, I'm getting this error:

// Generated by: /opt/gcc8/bin/g++ -I/home/user/Workspace/test/src/utils/include -I/home/user/Workspace/test/src/utils/include/utils -I/home/user/Workspace/test/src/core/include -I/home/user/Workspace/test/src/core/include/core -I/home/user/Workspace/test/src/core/include/core/v1 -I/home/user/Workspace/test/src/ttt/include -I/home/user/Workspace/test/include -I/home/user/Workspace/test/src -I/home/user/Workspace/test/vendor/spdlog/include/spdlog/fmt -I/home/user/Workspace/test/vendor/spdlog/include -I/home/user/Workspace/test/vendor/json/. -I/home/user/Workspace/test/vendor/MPMCQueue/include -I/home/user/Workspace/test/build/src/ttt/cboe -I/home/user/Workspace/test/vendor/HashMap/include -I/home/user/Workspace/test/vendor/CharConv/include -g -std=c++1z -fvisibility=hidden -Wall -Wextra -Wpedantic -Wno-unused-parameter -g -Werror -fPIC -c /home/user/Workspace/test/src/ttt/src/CFEBOEGateway.cpp -resource-dir=/home/user/Projects/ccls/Release/clang+llvm-6.0.1-x86_64-linux-gnu-ubuntu-16.04/lib/clang/6.0.1 -working-directory=/home/user/Workspace/test/build/src/ttt -Wno-unknown-warning-optiong++: error: unrecognized command line option ‘-resource-dir=/home/user/Projects/ccls/Release/clang+llvm-6.0.1-x86_64-linux-gnu-ubuntu-16.04/lib/clang/6.0.1’
g++: error: unrecognized command line option ‘-working-directory=/home/user/Workspace/test/build/src/ttt’

I assume that issue is caused by fact, that I use gcc, while ccls convert compile_commands to clang.
I think it might be great to have ability to fetch original compile command and use it to perform preprocessing.

Thank you in advance!

Tutorials for indexing large code bases?

I tried to index chromium using compile_commands.json obtained by:

tools/clang/scripts/generate_compdb.py -p out/Release > out/Release/compile_commands.json

I moved compile_commands.json to the root directory (e.g. chromium/src).

However, while indexing the project, it takes way too long and indexing fails for so many file.

16:47:55 indexer0         pipeline.cc:344 I parse /home/shpark/chromium.googlesource.com/chromium/src/services/tracing/public/mojom/data_source_descriptor_mojom_traits.cc                                                                                    
16:47:55 indexer5         pipeline.cc:344 I parse /home/shpark/chromium.googlesource.com/chromium/src/services/tracing/public/mojom/data_source_config_mojom_traits.cc                                                                                        
16:47:55 indexer6         pipeline.cc:344 I parse /home/shpark/chromium.googlesource.com/chromium/src/services/tracing/public/mojom/chrome_config_mojom_traits.cc                                                                                             
16:47:55 indexer7         pipeline.cc:344 I delete /home/shpark/chromium.googlesource.com/chromium/src/out/Default/gen/services/tracing/public/mojom/traced_process.mojom-blink-test-utils.cc                                                                 
16:47:55 indexer7         pipeline.cc:344 I delete /home/shpark/chromium.googlesource.com/chromium/src/out/Default/gen/services/tracing/public/mojom/traced_process.mojom-blink.cc                                                                            
16:47:55 indexer7         pipeline.cc:344 I delete /home/shpark/chromium.googlesource.com/chromium/src/out/Default/gen/services/tracing/public/mojom/constants.mojom-blink-test-utils.cc                                                                      
16:47:55 indexer7         pipeline.cc:344 I delete /home/shpark/chromium.googlesource.com/chromium/src/out/Default/gen/services/tracing/public/mojom/constants.mojom-blink.cc                                                                                 
16:47:55 indexer7         pipeline.cc:344 I delete /home/shpark/chromium.googlesource.com/chromium/src/out/Default/gen/services/tracing/public/mojom/perfetto_service.mojom-blink-test-utils.cc                                                               
16:47:55 indexer7         pipeline.cc:344 I delete /home/shpark/chromium.googlesource.com/chromium/src/out/Default/gen/services/tracing/public/mojom/perfetto_service.mojom-blink.cc                                                                          
16:47:55 indexer7         pipeline.cc:344 I delete /home/shpark/chromium.googlesource.com/chromium/src/out/Default/gen/services/tracing/public/mojom/tracing.mojom-blink-test-utils.cc                                                                        
16:47:55 indexer7         pipeline.cc:344 I delete /home/shpark/chromium.googlesource.com/chromium/src/out/Default/gen/services/tracing/public/mojom/tracing.mojom-blink.cc                                                                                   
16:47:55 indexer7         pipeline.cc:344 I delete /home/shpark/chromium.googlesource.com/chromium/src/out/Default/gen/services/tracing/public/mojom/traced_process.mojom-shared.cc                                                                           
16:47:55 indexer7         pipeline.cc:344 I delete /home/shpark/chromium.googlesource.com/chromium/src/out/Default/gen/services/tracing/public/mojom/constants.mojom-shared.cc                                                                                
16:47:55 indexer7         pipeline.cc:344 I delete /home/shpark/chromium.googlesource.com/chromium/src/out/Default/gen/services/tracing/public/mojom/perfetto_service.mojom-shared.cc                                                                         
16:47:55 indexer3          indexer.cc:1303 E failed to index /home/shpark/chromium.googlesource.com/chromium/src/services/tracing/public/cpp/traced_process.cc                                                                                                
16:47:55 indexer2         pipeline.cc:344 I parse /home/shpark/chromium.googlesource.com/chromium/src/services/video_capture/broadcasting_receiver.cc                                                                                                         
16:47:55 indexer3         pipeline.cc:344 I parse /home/shpark/chromium.googlesource.com/chromium/src/services/video_capture/device_factory_media_to_mojo_adapter.cc                                                                                          
16:47:55 indexer1          indexer.cc:1303 E failed to index /home/shpark/chromium.googlesource.com/chromium/src/services/tracing/public/mojom/commit_data_request_mojom_traits.cc                                                                            
16:47:55 indexer6          indexer.cc:1303 E failed to index /home/shpark/chromium.googlesource.com/chromium/src/services/tracing/public/mojom/chrome_config_mojom_traits.cc                                                                                  
16:47:55 indexer5          indexer.cc:1303 E failed to index /home/shpark/chromium.googlesource.com/chromium/src/services/tracing/public/mojom/data_source_config_mojom_traits.cc                                                                             
16:47:55 indexer4         pipeline.cc:344 I parse /home/shpark/chromium.googlesource.com/chromium/src/services/tracing/public/mojom/trace_config_mojom_traits.cc                                                                                              
16:47:55 indexer3          indexer.cc:1303 E failed to index /home/shpark/chromium.googlesource.com/chromium/src/services/video_capture/device_factory_media_to_mojo_adapter.cc                                                                               
16:47:55 indexer7         pipeline.cc:344 I delete /home/shpark/chromium.googlesource.com/chromium/src/out/Default/gen/services/tracing/public/mojom/tracing.mojom-shared.cc                                                                                  
16:47:55 indexer2          indexer.cc:1303 E failed to index /home/shpark/chromium.googlesource.com/chromium/src/services/video_capture/broadcasting_receiver.cc                                                                                              
16:47:55 indexer0          indexer.cc:1303 E failed to index /home/shpark/chromium.googlesource.com/chromium/src/services/tracing/public/mojom/data_source_descriptor_mojom_traits.cc                                                                         
16:47:55 indexer4          indexer.cc:1303 E failed to index /home/shpark/chromium.googlesource.com/chromium/src/services/tracing/public/mojom/trace_config_mojom_traits.cc                                                                                   
16:47:55 indexer6         pipeline.cc:344 I parse /home/shpark/chromium.googlesource.com/chromium/src/services/video_capture/device_factory_provider_impl.cc                                                                                                  
16:47:55 indexer2         pipeline.cc:344 I parse /home/shpark/chromium.googlesource.com/chromium/src/services/video_capture/service_impl.cc                                                                                                                  
16:47:55 indexer5         pipeline.cc:344 I parse /home/shpark/chromium.googlesource.com/chromium/src/services/video_capture/push_video_stream_subscription_impl.cc                                                                                           
16:47:55 indexer3         pipeline.cc:344 I parse /home/shpark/chromium.googlesource.com/chromium/src/services/video_capture/receiver_mojo_to_media_adapter.cc                                                                                                
16:47:55 indexer7         pipeline.cc:344 I parse /home/shpark/chromium.googlesource.com/chromium/src/services/video_capture/scoped_access_permission_media_to_mojo_adapter.cc                                                                                
16:47:55 indexer1         pipeline.cc:344 I parse /home/shpark/chromium.googlesource.com/chromium/src/services/video_capture/device_media_to_mojo_adapter.cc                                                                                                  
16:47:55 indexer0         pipeline.cc:344 I parse /home/shpark/chromium.googlesource.com/chromium/src/services/video_capture/shared_memory_virtual_device_mojo_adapter.cc                                                                                     
16:47:55 indexer2          indexer.cc:1303 E failed to index /home/shpark/chromium.googlesource.com/chromium/src/services/video_capture/service_impl.cc                                                                                                       
16:47:55 indexer5          indexer.cc:1303 E failed to index /home/shpark/chromium.googlesource.com/chromium/src/services/video_capture/push_video_stream_subscription_impl.cc                                                                                
16:47:55 indexer4         pipeline.cc:344 I parse /home/shpark/chromium.googlesource.com/chromium/src/services/video_capture/testing_controls_impl.cc                                                                                                         
16:47:55 indexer7          indexer.cc:1303 E failed to index /home/shpark/chromium.googlesource.com/chromium/src/services/video_capture/scoped_access_permission_media_to_mojo_adapter.cc                                                                     
16:47:55 indexer0          indexer.cc:1303 E failed to index /home/shpark/chromium.googlesource.com/chromium/src/services/video_capture/shared_memory_virtual_device_mojo_adapter.cc                                                                          
16:47:55 indexer6          indexer.cc:1303 E failed to index /home/shpark/chromium.googlesource.com/chromium/src/services/video_capture/device_factory_provider_impl.cc                                                                                       
16:47:55 indexer1          indexer.cc:1303 E failed to index /home/shpark/chromium.googlesource.com/chromium/src/services/video_capture/device_media_to_mojo_adapter.cc                                                                                       
16:47:55 indexer3          indexer.cc:1303 E failed to index /home/shpark/chromium.googlesource.com/chromium/src/services/video_capture/receiver_mojo_to_media_adapter.cc                                                                                     
16:47:55 indexer4          indexer.cc:1303 E failed to index /home/shpark/chromium.googlesource.com/chromium/src/services/video_capture/testing_controls_impl.cc                                                                                              
16:47:55 indexer2         pipeline.cc:344 I parse /home/shpark/chromium.googlesource.com/chromium/src/services/video_capture/texture_virtual_device_mojo_adapter.cc 

Maybe this is because chromium makes huge use of generated source codes.

This gets me back from using ccls to browse chromium source code!

I may need to skip some sub-directory? But how?

Could you share your experience of indexing such large code base?

Thanks!

Aggressive-indent-mode incompatibility

When typing a bit after enabling both aggressive-indent-mode and emacs-ccls, the text above and below where you are typing will get deleted. The problem is present with this minimal config

;; Bootstrap straight.el for package management
(defvar bootstrap-version)
(let ((bootstrap-file
       (expand-file-name "straight/repos/straight.el/bootstrap.el" user-emacs-directory))
      (bootstrap-version 5))
  (unless (file-exists-p bootstrap-file)
    (with-current-buffer
        (url-retrieve-synchronously
         "https://raw.githubusercontent.com/raxod502/straight.el/develop/install.el"
         'silent 'inhibit-cookies)
      (goto-char (point-max))
      (eval-print-last-sexp)))
  (load bootstrap-file nil 'nomessage))

(straight-use-package 'aggressive-indent)
(global-aggressive-indent-mode)

(straight-use-package 'lsp-mode)

(straight-use-package 'ccls)
(require 'ccls)
(setq ccls-executable "/bin/ccls")

(add-hook 'c-mode-hook 'lsp)
(add-hook 'c++-mode-hook 'lsp)
(add-hook 'objc-mode-hook 'lsp)

LSP :: invalid params of textDocument/codeAction: expected array for /context/diagnostics[0]/relatedInformation [6 times]

Hi there!

I've tried to use ccls with spacemacs, but everytime I put a cursor on line with error I receive:

LSP :: invalid params of textDocument/codeAction: expected array for /context/diagnostics[0]/relatedInformation [N times] (N is a count of how many times I put a cursor on line with the error).

This is my system env, hope it helps:

#### System Info :computer:
- OS: gnu/linux
- Emacs: 26.1
- Spacemacs: 0.300.0
- Spacemacs branch: develop (rev. 2206095be)
- Graphic display: nil
- Distribution: spacemacs
- Editing style: vim
- Completion: helm
- Layers:
```elisp
(csv systemd ruby multiple-cursors rust helm emacs-lisp neotree graphviz auto-completion syntax-checking version-control spell-checking restclient git github ansible docker nginx sql markdown yaml protobuf shell windows-scripts python erlang elixir
     (c-c++ :variables c-c++-default-mode-for-headers 'c++-mode c-c++-backend 'lsp-ccls c-c++-lsp-executable "/home/szobov/.nix-profile/bin/ccls" c-c++-lsp-sem-highlight-method 'font-lock c-c++-lsp-cache-dir "/home/szobov/.ccls-cache-dir/")
     semantic cmake html javascript typescript react
     (go :variables go-use-gometalinter t go-use-test-args "-race -timeout 30s -v" godoc-at-point-function 'godoc-gogetdoc)
     nixos evernote emoji)
- System configuration features: XPM JPEG TIFF GIF PNG RSVG SOUND DBUS GSETTINGS NOTIFY LIBSELINUX GNUTLS LIBXML2 FREETYPE XFT ZLIB TOOLKIT_SCROLL_BARS GTK3 X11 MODULES THREADS

I can also provide any important information if you need.
Thanks!

Could not find emacs-ccls in melpa

Hey, MaskRay, I want to give ccls a try, switching from cquery to ccls. But when I follow the instruction in ccls wiki, I could not install ccls from melpa. It seems emacs-ccls doesn't host in melpa,right?

xref-find-definitions jums to header file

Hi MaskRay

First of all thank you for the great work you are providing to the community. Second Im having a problem with xref-find-definitions that it is jumping to the '.h' files instead of the '.c' files. I made sure the xref backend functions are lsp-backend-functions and I provided compile_commands.json to the project root directory. To make the command successfully work as it should the '.c' file needs to be opened in a buffer. I don't know why this is happening but I would really like some help.

Thank you.

Note: I faced this problem with cquery as well

lsp-ccls has exited (exited abnormally with code 40)

Hi again, I finally compiled ccls with GCC, and try to use emacs-ccls to start the server. But after I opened a C project, it complained that

lsp-ccls has exited (exited abnormally with code 40)
Error during redisplay: (eval (lsp-mode-line)) signaled (wrong-type-argument lsp--workspace nil) [5 times]

I already have the compile_commands.json and .ccls-root in my dir. What might be the problem?

cpp source file doesn't have syntax highlighting at all

Hi, there,
In my project, some cpp file have syntax highlight but some have not at all. I even have seen a cpp file which half of it have syntax highlight but the other half doesn't (but this case can not be reproduced after revert-buffer).

And if put the cursor on the keyword (like if) of the cpp file doesn't have syntax highlight and call the describe-face gives the Face: Face: ccls-skipped-range-face. Is it caused by some issue in emacs-ccls? How can I get back my syntax highlight? Thanks!

Wrong completion items

Hi, I'm using doom-emacs with (cc +lsp).
The completion items seem mixed as below:
image
or
image

I use a clean doom-emacs without extra configuration on macos.
ccls is installed by brew.

I also try nvim with coc.nvim. Wrong completion items show up and flash into correct ones.
I am new to emacs and have no idea about how to deal with it.

Thanks.

usage question

I install lsp-ui and emacs-ccls, when I call ccls-call-hierarchy, I can see on the right side, but It won't go to the code. It's static, so how to jump when you move line on the right side.

ccls/flymake false error reported

So, I could not manage to make a minimal example.
Do not know if I do something wrong, feel free to ask other information.

Here is how to reproduce, with uptodate package, and master ccls ( MaskRay/ccls@5c5bbb9 ) run with --log-file=/tmp/ccls.log --init='{"cache": {"directory": "/ssd/Builds/ccls-cache/"}}'
git clone --single-branch --branch ccls --recursive https://github.com/dlyr/Radium-Engine/ TEST
cd TEST
mkdir build
cd build
cmake ../ -DCMAKE_EXPORT_COMPILE_COMMANDS=On -DRADIUM_USE_COTIRE=Off
(not sure cotire interacts, but I use to turn it off with ccls)
make -j
(not sure need to compile ... but there are some "installed" include and generated files ...)
cd ../
ln -s build/compile_commands.json .
emacs -Q config.el
evaluate the lines here
open tests/CoreTests/src/algebra.cpp
wait everything loads, no flymake errors
add a blank line, save, and I get 19 flymake erros.

Make ccls-initialization-options safe for local variables

Due to the wide range of projects I work on I've been searching for ways to correctly customize them. It seems the "most approved" way so far is to use the .dir-locals.el facility to create directory-local variables: https://www.gnu.org/software/emacs/manual/html_node/emacs/Directory-Variables.html

However, setting directory-local variables gives a warning unless they're declared to be safe. I've declared this safe in my init.el but it would be nice if ccls.el did this itself, with something like:

(put 'ccls-initialization-options 'safe-local-variable 'listp)

There may be other variables that are also appropriate for this treatment: I didn't check.

Hanging at startup

I got cquery working with emacs and thought I should try ccls to see if there is any performance improvement etc.

At first setup it actually seemed to work, but then after restarting emacs and changing the emacs-ccls configuration it starts hanging with a message that ccls is initializing shown in emacs.
Emacs is frozen as well.
Pressing M-g a few times returns Emacs to normal mode, but lsp/ccls shows symbols as unknown and no lsp functionality working.

The cq.log doesn't show any error. and neither does the ccls buffers in emacs.

I even tried to erase all ccls cache folders and return my configuration to what I had first, but then the problem doesn't go away.

I can run "ccls -index=." in my project without any error.

Any known issue or how can I troubleshoot this?

06_cpp_lsp.el.txt

Find a function's namespace

Hi,

Is there a way to find the namespace in which a function belong ?

For instance:

//C.h
namespace A{namespace B
struct C{void foo();};
}}
//C.cpp
#include "C.h"
using namespace A::B;
void C::foo(){
// cursor is here,
}

With the example above, the namespace command would display A::B (because foo is defined in C, which is in namespace A::B.

Is there a way to it ?

Thanks !
David

How to integrate other project root information into emacs-ccls

I was experimenting with this today but couldn't get it to work. I think the main problem is it assumes projectile to work out the top of the directory tree and I don't use it (I use eproject). What's the best way to hook knowledge of additional project roots into emacs-ccls? Or is this a wider lsp-mode issue?

Wrong type argument: listp, "-Wall -Werror"

First of all, I would like to thank you for your work for the community.

As a GNU Emacs user, until now, I have always used eglot as a client for LSP servers by configuring it like this:

(use-package eglot
  :hook (prog-mode . eglot-ensure)
  :custom
  (company-backends (cons 'company-capf
                          (remove 'company-capf company-backends)))
  (company-clang-modes nil))

It worked perfectly, all that remained to be done was to install ccls using the package manager of my operating system and eglot used ccls each time a .cpp or a .c file was opened.

However, I wanted to try lsp-mode by following the instructions on the wiki page and I couldn't get lsp-mode and ccls to work together.

Here is the configuration I have for them:

(use-package lsp-mode
  :hook (prog-mode . lsp))

(use-package lsp-ui
  :after lsp-mode
  :hook (lsp-mode . lsp-ui-mode))

(use-package company-lsp
  :after company lsp-mode
  :config (push 'company-lsp company-backends))

(use-package ccls
  :after projectile
  :ensure-system-package ccls
  :custom
  (ccls-executable (executable-find "ccls"))
  (ccls-sem-highlight-method 'font-lock)
  (projectile-project-root-files-top-down-recurring
   (append '("compile_commands.json" ".ccls")
           projectile-project-root-files-top-down-recurring))
  :config (push ".ccls-cache" projectile-globally-ignored-directories))

For the test, I created a simple foo folder that includes a main.cpp file and a git repository. This choice, in order to avoid providing any compile_commands.json and/or .ccls files to facilitate debugging.

When the main.cpp file is opened and I run lsp, I get this error:
Wrong type argument: listp, "-Wall -Werror"

If I decide to comment on the use of the ccls package in my GNU Emacs configuration, then lsp-mode will work, but will it use the clang language server instead of ccls. So I conclude that I have a problem in my configuration with ccls.

Do you have any idea how to solve this problem? Do not hesitate if you need various information for debugging.

emacs-ccls好像不能正常注册lsp-client了

最近更新的emacs-ccls以后,C++项目不能正常启动 ccls了,提示
LSP :: No LSP server for c++-mode(check lsp-log).

ccls是可以正常调用的
ccls --version
ccls version
clang version 8.0.0-3~ubuntu18.04.1 (tags/RELEASE_800/final)

emacs-ccls版本信息
ccls 20190513.157 installed ccls client for lsp-mode

emacs信息
GNU Emacs 26.2 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.22.30) of 2019-04-15

Skipped ranges tagging is never removed

If some code is marked as skipped by using the C preprocessor, they will forever be greyed out even if the preprocessor directives are removed. I tried using M-x revert-buffer and M-x ccls-reload as a workaround to no effect. To get correct syntax highlighting back I have to kill the buffer and reopen it again.

Improper printing of the function's prototype

Hi,
Using this package for developing in C, i've found an error in print of funcion prototype at the time of completion using company-lsp.

I post a screenshot that can explain better than words.

schermata 2018-12-20 alle 23 07 16
Here well shown on popup

schermata 2018-12-20 alle 23 07 35
At the completing time (M-x company-complete) prototype printing goes wrong.

I could not understand the problem by myself

Goto to underlying type

Is there a way for ccls/lsp to go to the underlying type definition.

Example

#include <stdio.h>

typedef struct lcore_s lcore_t;

struct lcore_s {
    int a;
    int b;
};

int
main(int argc, char **argv) {
    lcore_t lcore;
    return 0;
}

When at lcore_|t lcore and any of these

  • lsp-goto-type-definition
  • lsp-ui-peek-find-definitions

Would take me to the typedef, is there a way to go to the struct definition directly without hopping around?

Thanks

Best way to run ccls with nice

Thanks for ccls, it's great! I was wondering if there is an easy way run the emacs ccls process with nice (under linux). My workflow involves frequently changing branches of the code I'm using ccls to index. Each branch change kicks off a long-running, CPU heavy re-index of the project, and it would be really nice to have this indexing not slow down the rest of the machine. Any thoughts you have would be appreciated!

Is there a way to reload the compile_commands.json? (Especially if one did not exist previously)

I am trying to reload ccls whenever the compile_commands.json file is changed.

Steps to Reproduce:

In this example, I create a really basic Qt5 project. Feel free to reproduce using a library/framework that you are more familiar with.

Step 1.: Create hello.cpp in empty directory with emacs:

#include <QString>
int main() { }

Result so far: flycheck should display an error on line 1. This is expected.

Step 2.: Generate a compile_commands.json and place it in the project root.

MyProject.pro:

QT += core gui widgets
TARGET = hello
SOURCES += hello.cpp

Commands:

mkdir build
cd build
qmake ../MyProject.pro
bear make # This generates the compile_commands.json
cp compile_commands.json ..

Step 3: Attempt to reload/restart lsp (or ccls) so your new compile_commands.json is picked up.

I have tried the Emacs functions lsp-restart-workspace and ccls-reload. I've even tried killing the ccls process to force a restart.

The only solution I have right now is to completely restart emacs.

My lsp config:

(use-package lsp-mode
  :hook ((c-mode
          c++-mode
          javascript-mode
          vue-mode
          css-mode) . lsp)
  :config
  (require 'lsp-clients) ;; Multiple language configurations out of the box
  (use-package ccls) ;; C/C++ language server

  (use-package lsp-ui
    :hook (lsp-mode . lsp-ui-mode)
    :config
    ;; Don't use flymake; we'll use flycheck.
    (setq lsp-prefer-flymake nil))

  (use-package company-lsp
    :init
    (push 'company-lsp company-backends)))

ccls-inheritance-hierarchy isn't working correctly

This feature is really useful and works sometimes, but in other cases it isn't able to find derived or base classes. I'm using this project on the llvm-project code base and specifically am looking at the MCStreamer hierarchy. If I look at derived classes for the MCStreamer class, nothing is shown. I'm using the HEAD build for ccls and emacs-ccls on OSX.

There are other classes in the code base where the base hierarchy will work, but the derived doesn't and vice versa.

I'm happy to provide any information or use any tips you have to debug why this wouldn't work.

Enable GNU-indentation?

When indenting with a region, it automatically places brackets and indentation length to K&R style (or something like that) instead of whatever c-indent-style is. On my system, c-indent-style is set to gnu.

I.e, it goes from:

if (...) 
  {
....
  }

to

if (...) {
....
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.