manateelazycat / lsp-bridge

A blazingly fast LSP client for Emacs
GNU General Public License v3.0
1.47k stars 214 forks source link

Lsp-bridge does not recognize project directory #1070

Closed bluzky closed 1 month ago

bluzky commented 1 month ago

Hi, I've just set up lsp-bridge and when I started my elixir project, it used user directory as project directory.

image

Here is my config

(use-package lsp-bridge
  :quelpa (lsp-bridge :fetcher github :repo "manateelazycat/lsp-bridge"
                      :files ("*.el" "*.py" "acm" "core" "langserver" "multiserver" "resources"))
  :init
  (global-lsp-bridge-mode)
  :custom
  (lsp-bridge-elixir-lsp-server 'lexical)
  )

Is there any option that I missing?

Thanks

bluzky commented 1 month ago

Manage to fix this by adding this config

  :custom
  (lsp-bridge-elixir-lsp-server 'lexical)
  (lsp-bridge-get-project-path-by-filepath #'lsp-bridge-get-project-path-by-filepath)
  :config
  (defun lsp-bridge-get-project-path-by-filepath (filename)
    (if-let ((project (project-current filename)))
        (expand-file-name (project-root project))))
manateelazycat commented 1 month ago

You need execute "git init" in your project path.

bluzky commented 1 month ago

You need execute "git init" in your project path.

My project is an existing Github repo, so I think this is not the cause.