This commit is contained in:
Dax Raad
2025-08-30 15:23:42 -04:00
parent 11afe56f63
commit 46af0aca8e

View File

@@ -515,8 +515,8 @@ export namespace LSPServer {
export const RustAnalyzer: Info = {
id: "rust",
root: async (file, app) => {
const crateRoot = await NearestRoot(["Cargo.toml", "Cargo.lock"])(file, app)
root: async (root) => {
const crateRoot = await NearestRoot(["Cargo.toml", "Cargo.lock"])(root)
if (crateRoot === undefined) {
return undefined
}
@@ -539,7 +539,7 @@ export namespace LSPServer {
currentDir = parentDir
// Stop if we've gone above the app root
if (!currentDir.startsWith(app.path.root)) break
if (!currentDir.startsWith(Instance.worktree)) break
}
return crateRoot