zed-industries / zed

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
https://zed.dev
Other
41.65k stars 2.17k forks source link

Load the LSP from workspace in language extension #10760

Open chungweileong94 opened 2 months ago

chungweileong94 commented 2 months ago

Check for existing issues

Describe the feature

Some extension needs to load the LSP installed in the workspace, if not fallback to the global installed LSP.

For example: The biome extension needs to be able to load the LSP binary installed in the workspace, if not install and fallback to a global LSP binary.

However, it doesn't seem like we are able to check if an LSP binary exists in the workspace, as things like Path::exists don't really work (probably because of wasm?).

I also tried to use worktree.read_text_file() to see if the node_modules/@biomejs/biome/package.json exists in the workspace, it works sometimes but mostly doesn't work. https://github.com/biomejs/biome-zed/pull/9

If applicable, add mockups / screenshots to help present your vision of the feature

No response

jansol commented 2 months ago

AIUI this is also necessary for Android development where you need a project-specific version of gradle.