Skip to content

Commit f308aee

Browse files
committed
fixes
1 parent ce7c7dd commit f308aee

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

server/src/Paths.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ namespace Paths {
110110
fs::path getCCJsonFileFullPath(const string &filename, const fs::path &directory) {
111111
fs::path path1 = fs::path(filename);
112112
fs::path path2 = fs::weakly_canonical(directory / path1);
113-
return fs::exists(path2) ? path2 : path1;
113+
return fs::exists(path2.parent_path()) ? path2 : path1;
114114
}
115115

116116
bool isPath(const string &possibleFilePath) noexcept {

server/src/Server.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -559,8 +559,7 @@ Status Server::TestsGenServiceImpl::ProcessProjectStubsRequest(BaseTestGen *test
559559
}
560560

561561
Status Server::TestsGenServiceImpl::failedToLoadCDbStatus(const CompilationDatabaseException &e) {
562-
return Status(StatusCode::INVALID_ARGUMENT,
563-
"Failed to find compile_commands.json:\n" + string(e.what()));
562+
return {StatusCode::INVALID_ARGUMENT, "Failed to find compile_commands.json:\n" + string(e.what())};
564563
}
565564

566565
Status Server::TestsGenServiceImpl::PrintModulesContent(ServerContext *context,
@@ -655,6 +654,7 @@ Status Server::TestsGenServiceImpl::GetProjectTargets(ServerContext *context,
655654
ProjectTargetsWriter targetsWriter{ response };
656655
targetsWriter.writeResponse(projectContext, targets);
657656
} catch (CompilationDatabaseException const &e) {
657+
LOG_S(ERROR) << "Compilation database error: " << e.what();
658658
return failedToLoadCDbStatus(e);
659659
}
660660
return Status::OK;

0 commit comments

Comments
 (0)