Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dynamically set up lsp-bridge-get-single-lang-server-by-project #943

Open
rezaamashi opened this issue May 14, 2024 · 3 comments
Open

Dynamically set up lsp-bridge-get-single-lang-server-by-project #943

rezaamashi opened this issue May 14, 2024 · 3 comments

Comments

@rezaamashi
Copy link

As exampled in #471, I reckon the way to set up lsp-bridge-get-single-lang-server-by-project is by statically setting it in init.el. I personally use .dir-locals.el for my project specific set up. Is there a way to dynamically set it specifically per project through .dir-locals.el? perhaps like:

((nil . ((eval . (setq lsp-bridge-get-single-lang-server-by-project
                              (lambda (project-path filepath)
                                (when (string-equal project-path (file-name-directory buffer-file-name)) 
								;; instead of having it statically set up like "~/.local/ansible/"
                                  (ansible-language-server))))))))

Thanks

PS: Also to note I am still currently unable to set up lsp-bridge-get-single-lang-server-by-project properly. Even if I statically set project-path manually. In above case any yaml file still calls yaml-language-server instead of ansible-language-server

@manateelazycat
Copy link
Owner

lsp-bridge support git or .dir-locals.el, I can't understand what your mean.

@rezaamashi
Copy link
Author

Hello.

From what I understand lsp-bridge-get-single-lang-server-by-project is set up through the user's init.el. My questions were:

  1. Is there a way to set up lsp-bridge-get-single-lang-server-by-project in project-by-project basis through .dir-locals.el? Instead of having it set up in user's init.el.
  2. Furthermore, by "dynamically" I meant that instead of having the directory or a file location being pointed out statically ( by writing the string for the file or project directory ), just pick the current directory for the project.

@manateelazycat
Copy link
Owner

I see, but I haven't use .dir-locals.el

You can try to change code of lsp-bridge--get-project-path-func, PR are welcome

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants