Skip to content

Commit 5d8d896

Browse files
authored
feat(lsp): add rust-analyzer (sst#1972)
1 parent 85c6301 commit 5d8d896

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

packages/opencode/src/lsp/server.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -500,6 +500,24 @@ export namespace LSPServer {
500500
},
501501
}
502502

503+
export const RustAnalyzer: Info = {
504+
id: "rust",
505+
root: NearestRoot(["Cargo.toml", "Cargo.lock"]),
506+
extensions: [".rs"],
507+
async spawn(_, root) {
508+
const bin = Bun.which("rust-analyzer")
509+
if (!bin) {
510+
log.info("rust-analyzer not found in path, please install it")
511+
return
512+
}
513+
return {
514+
process: spawn(bin, {
515+
cwd: root,
516+
}),
517+
}
518+
},
519+
}
520+
503521
export const Clangd: Info = {
504522
id: "clangd",
505523
root: NearestRoot(["compile_commands.json", "compile_flags.txt", ".clangd", "CMakeLists.txt", "Makefile"]),

0 commit comments

Comments
 (0)