Skip to content

Commit

Permalink
chore: move path.dirname out of considerAdditionalPath
Browse files Browse the repository at this point in the history
  • Loading branch information
aminya committed Jun 10, 2021
1 parent 63f7de8 commit dba8dc1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/auto-languageclient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<string> }, def.path)
considerAdditionalPath(server as ActiveServer & { additionalPaths: Set<string> }, path.dirname(def.path))
}
}

Expand Down
7 changes: 5 additions & 2 deletions lib/server-manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -347,8 +347,11 @@ export function normalizePath(projectPath: string): string {
}

/** Considers a path for inclusion in `additionalPaths`. */
export function considerAdditionalPath(server: ActiveServer & { additionalPaths: Set<string> }, additionalPath: string): void {
export function considerAdditionalPath(
server: ActiveServer & { additionalPaths: Set<string> },
additionalPath: string
): void {
if (!additionalPath.startsWith(server.projectPath)) {
server.additionalPaths.add(path.dirname(additionalPath))
server.additionalPaths.add(additionalPath)
}
}

0 comments on commit dba8dc1

Please sign in to comment.