Skip to content

Commit

Permalink
fix dir-locals-find-file returning directory with trailing /
Browse files Browse the repository at this point in the history
by using directory-file-name
  • Loading branch information
fuyu0425 committed Oct 4, 2024
1 parent 2d0cd0b commit e596822
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions lsp-bridge.el
Original file line number Diff line number Diff line change
Expand Up @@ -981,10 +981,9 @@ So we build this macro to restore postion after code format."
;; Fetch project root path by `lsp-bridge-get-project-path-by-filepath' if it set by user.
(funcall lsp-bridge-get-project-path-by-filepath filename)
;; Otherwise try to search up `.dir-locals.el' file
(let ((result (dir-locals-find-file filename)))
(if (consp result)
(car result)
result))))
(let* ((result (dir-locals-find-file filename))
(dir (if (consp result) (car result) result)))
(when dir (directory-file-name dir)))))

(defun lsp-bridge--get-language-id-func (project-path file-path server-name extension-name)
(if lsp-bridge-get-language-id
Expand Down

0 comments on commit e596822

Please sign in to comment.