MaskRay / ccls

C/C++/ObjC language server supporting cross references, hierarchies, completion and semantic highlighting
Apache License 2.0
3.72k stars 254 forks source link

ccls complains no matching member function errors #959

Open erusyd opened 6 months ago

erusyd commented 6 months ago

After I've setup environment for platformio core in emacs, ccls shows following errors Screenshot from 2024-01-30 15-30-17

The project can be compiled without error Screenshot from 2024-01-30 15-36-34

Steps to reproduce

  1. Install platformio core
  2. Install PlatformIO-Mode for emacs
  3. Compile ccls
  4. Install emacs-ccls
  5. Use sample Temp_Humidity.zip pio project.

My emacs related configuration snippet:

;; ccls
(straight-use-package 'ccls)
(require 'ccls)
(setq ccls-executable (concat (getenv "HOME") "/opt/ccls"))
(setq ccls-args '("--log-file=/tmp/ccls.log"))
(setq ccls-initialization-options
      '(:cache (:directory "/tmp/ccls_cache")))

;; C/C++
(add-hook 'c-mode-hook 'lsp)
(add-hook 'c++-mode-hook 'lsp)

;; platformio-mode
(straight-use-package 'platformio-mode)
(require 'platformio-mode)
(add-hook 'c++-mode-hook (lambda ()
                           (lsp-deferred)
                           (platformio-conditionally-enable)))

System information