Commit 077e9828 authored by Fangrui Song's avatar Fangrui Song

Use .ccls-root as project root marker and remove ccls-project-roots-matcher

parent 2926fab2
......@@ -52,11 +52,6 @@
(defsubst ccls--root-from-func (func)
(and (fboundp func) (ignore-errors (funcall func))))
(cl-defun ccls-project-roots-matcher ()
(cl-loop for root in ccls-project-roots do
(when (string-prefix-p (expand-file-name root) buffer-file-name)
(cl-return-from ccls--get-root root))))
(cl-defun ccls--get-root ()
"Return the root directory of a ccls project."
(cl-loop for matcher in ccls-project-root-matchers do
......@@ -99,7 +94,7 @@
(defvar ccls--handlers
'(("$ccls/progress" . (lambda (_w _p))))
"List of cons-cells of (METHOD . HANDLER) pairs, where METHOD is the lsp method to handle,
"List of cons-cells of (METHOD . HANDLER) pairs, where METHOD is the lsp method to handle,
and handler is a function invoked as (handler WORKSPACE PARAMS), where WORKSPACE is the current
lsp-workspace, and PARAMS is a hashmap of the params recieved with the notification.")
......
......@@ -259,7 +259,7 @@
(when (setq ccls-tree-calling (not ccls-tree-calling))
(ccls-tree-press)))
(defun ccls-tree-press (&optional _split)
(defun ccls-tree-press (&optional split-fn)
"Jump to the location."
(interactive)
(-when-let* ((workspace lsp--cur-workspace)
......
......@@ -98,7 +98,7 @@ in a subproject and thus does not belong to the current workspace.
:group 'ccls)
(defcustom ccls-project-root-matchers
'(ccls-project-roots-matcher projectile-project-root "compile_commands.json" ".ccls")
'(".ccls-root" projectile-project-root ".ccls")
"List of matchers that are used to locate the ccls project roots.
Each matcher is run in order, and the first successful (non-nil) matcher
determines the project root.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment