mirror of
https://github.com/sst/opencode.git
synced 2025-08-31 10:17:26 +00:00
feat(lsp): add rust-analyzer (#1972)
This commit is contained in:
parent
85c6301ac5
commit
5d8d896fa2
1 changed files with 18 additions and 0 deletions
|
@ -500,6 +500,24 @@ export namespace LSPServer {
|
|||
},
|
||||
}
|
||||
|
||||
export const RustAnalyzer: Info = {
|
||||
id: "rust",
|
||||
root: NearestRoot(["Cargo.toml", "Cargo.lock"]),
|
||||
extensions: [".rs"],
|
||||
async spawn(_, root) {
|
||||
const bin = Bun.which("rust-analyzer")
|
||||
if (!bin) {
|
||||
log.info("rust-analyzer not found in path, please install it")
|
||||
return
|
||||
}
|
||||
return {
|
||||
process: spawn(bin, {
|
||||
cwd: root,
|
||||
}),
|
||||
}
|
||||
},
|
||||
}
|
||||
|
||||
export const Clangd: Info = {
|
||||
id: "clangd",
|
||||
root: NearestRoot(["compile_commands.json", "compile_flags.txt", ".clangd", "CMakeLists.txt", "Makefile"]),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue