diff --git a/lib/auto-languageclient.ts b/lib/auto-languageclient.ts index bb39d757..cc339661 100644 --- a/lib/auto-languageclient.ts +++ b/lib/auto-languageclient.ts @@ -707,7 +707,7 @@ export default class AutoLanguageClient { if (query !== null && this.serversSupportDefinitionDestinations() && server.additionalPaths !== undefined) { for (const def of query.definitions) { - considerAdditionalPath(server as ActiveServer & { additionalPaths: Set }, def.path) + considerAdditionalPath(server as ActiveServer & { additionalPaths: Set }, path.dirname(def.path)) } } diff --git a/lib/server-manager.ts b/lib/server-manager.ts index 357de66f..289f92d2 100644 --- a/lib/server-manager.ts +++ b/lib/server-manager.ts @@ -347,8 +347,11 @@ export function normalizePath(projectPath: string): string { } /** Considers a path for inclusion in `additionalPaths`. */ -export function considerAdditionalPath(server: ActiveServer & { additionalPaths: Set }, additionalPath: string): void { +export function considerAdditionalPath( + server: ActiveServer & { additionalPaths: Set }, + additionalPath: string +): void { if (!additionalPath.startsWith(server.projectPath)) { - server.additionalPaths.add(path.dirname(additionalPath)) + server.additionalPaths.add(additionalPath) } }