Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions core/GlobalState.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1658,6 +1658,9 @@ FileRef GlobalState::enterFile(const shared_ptr<File> &file) {
}
}
})
if (this->logRecordedFilepaths) {
this->errorQueue->logger.debug("recording file with path: {}", file->path());
}

files.emplace_back(file);
auto ret = FileRef(filesUsed() - 1);
Expand Down Expand Up @@ -1961,6 +1964,7 @@ unique_ptr<GlobalState> GlobalState::deepCopy(bool keepId) const {

result->silenceErrors = this->silenceErrors;
result->unsilenceErrors = this->unsilenceErrors;
result->logRecordedFilepaths = this->logRecordedFilepaths;
result->autocorrect = this->autocorrect;
result->ensureCleanStrings = this->ensureCleanStrings;
result->runningUnderAutogen = this->runningUnderAutogen;
Expand Down Expand Up @@ -2059,6 +2063,7 @@ unique_ptr<GlobalState> GlobalState::copyForIndex() const {
result->fileRefByPath = this->fileRefByPath;
result->silenceErrors = this->silenceErrors;
result->unsilenceErrors = this->unsilenceErrors;
result->logRecordedFilepaths = this->logRecordedFilepaths;
result->autocorrect = this->autocorrect;
result->ensureCleanStrings = this->ensureCleanStrings;
result->runningUnderAutogen = this->runningUnderAutogen;
Expand Down
1 change: 1 addition & 0 deletions core/GlobalState.h
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,7 @@ class GlobalState final {
int globalStateId;
bool silenceErrors = false;
bool unsilenceErrors = false;
bool logRecordedFilepaths = false;
bool autocorrect = false;

// We have a lot of internal names of form `<something>` that's chosen with `<` and `>` as you can't make
Expand Down
2 changes: 2 additions & 0 deletions main/options/options.cc
Original file line number Diff line number Diff line change
Expand Up @@ -442,6 +442,7 @@ buildOptions(const vector<pipeline::semantic_extension::SemanticExtensionProvide
options.add_options("dev")("p,print", to_string(all_prints), cxxopts::value<vector<string>>(), "type");
options.add_options("dev")("trace-lexer", "Emit the lexer's token stream in a debug format");
options.add_options("dev")("trace-parser", "Enable bison's parser trace functionality");
options.add_options("dev")("log-recorded-filepaths", "Emit paths recorded for different files");
options.add_options("dev")("autogen-subclasses-parent",
"Parent classes for which generate a list of subclasses. "
"This option must be used in conjunction with -p autogen-subclasses",
Expand Down Expand Up @@ -817,6 +818,7 @@ void readOptions(Options &opts,
logger->error("You can't pass both `{}` and `{}`", "--unquiet", "--quiet");
throw EarlyReturnWithCode(1);
}
opts.logRecordedFilepaths = raw["log-recorded-filepaths"].as<bool>();
opts.autocorrect = raw["autocorrect"].as<bool>();
opts.inlineInput = raw["e"].as<string>();
if (opts.autocorrect && opts.silenceErrors && !opts.unsilenceErrors) {
Expand Down
1 change: 1 addition & 0 deletions main/options/options.h
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@ struct Options {
std::optional<std::string> suggestUnsafe = std::nullopt;
bool silenceErrors = false;
bool unsilenceErrors = false;
bool logRecordedFilepaths = false;
bool silenceDevMessage = false;
bool suggestSig = false;
bool suppressNonCriticalErrors = false;
Expand Down
1 change: 1 addition & 0 deletions main/options/test/options_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ TEST_CASE("DefaultConstructorMatchesReadOptions") {
CHECK_EQ(empty.suggestTyped, opts.suggestTyped);
CHECK_EQ(empty.silenceErrors, opts.silenceErrors);
CHECK_EQ(empty.unsilenceErrors, opts.unsilenceErrors);
CHECK_EQ(empty.logRecordedFilepaths, opts.logRecordedFilepaths);
CHECK_EQ(empty.silenceDevMessage, opts.silenceDevMessage);
CHECK_EQ(empty.suggestSig, opts.suggestSig);
CHECK_EQ(empty.suppressNonCriticalErrors, opts.suppressNonCriticalErrors);
Expand Down
1 change: 1 addition & 0 deletions main/realmain.cc
Original file line number Diff line number Diff line change
Expand Up @@ -492,6 +492,7 @@ int realmain(int argc, char *argv[]) {
gs->silenceErrors = true;
}
gs->unsilenceErrors = opts.unsilenceErrors;
gs->logRecordedFilepaths = opts.logRecordedFilepaths;
if (opts.autocorrect) {
gs->autocorrect = true;
}
Expand Down