diff --git a/src/command_line.cc b/src/command_line.cc index a02e5535..6029c162 100644 --- a/src/command_line.cc +++ b/src/command_line.cc @@ -967,7 +967,7 @@ void ParseFile(IndexerConfig* config, std::vector> indexes = Parse( config, file_consumer_shared, tu_path, tu_args); - time.ResetAndPrint("Parsing/indexing " + tu_path + " with args " + StringJoin(tu_args)); + time.ResetAndPrint("Parsing/indexing " + tu_path); for (std::unique_ptr& new_index : indexes) { std::cerr << "Got index for " << new_index->path << std::endl; @@ -1240,6 +1240,13 @@ bool QueryDbMainLoop( switch (message->method_id) { case IpcId::Initialize: { auto request = static_cast(message.get()); + + // Log initialization parameters. + rapidjson::StringBuffer output; + Writer writer(output); + Reflect(writer, request->params.initializationOptions); + std::cerr << output.GetString() << std::endl; + if (request->params.rootUri) { std::string project_path = request->params.rootUri->GetPath(); std::cerr << "[querydb] Initialize in directory " << project_path diff --git a/src/working_files.cc b/src/working_files.cc index 8f19b626..93354640 100644 --- a/src/working_files.cc +++ b/src/working_files.cc @@ -74,9 +74,9 @@ optional WorkingFile::GetBufferLineFromIndexLine(int index_line) const { // Note: |index_line| and |buffer_line| are 1-based. // TODO: reenable this assert once we are using the real indexed file. - //assert(index_line >= 1 && index_line <= index_lines.size()); - if (index_line < 1 || index_line > index_lines.size()) - return nullopt; + assert(index_line >= 1 && index_line <= index_lines.size()); + //if (index_line < 1 || index_line > index_lines.size()) + // return nullopt; // Find the line in the cached index file. We'll try to find the most similar line // in the buffer and return the index for that. @@ -108,10 +108,9 @@ optional WorkingFile::GetIndexLineFromBufferLine(int buffer_line) const { // See GetBufferLineFromIndexLine for additional comments. // Note: |index_line| and |buffer_line| are 1-based. - - // TODO: Consider making this an assert. - if (buffer_line < 1 || buffer_line > all_buffer_lines.size()) - return nullopt; + assert(buffer_line >= 1 && buffer_line < all_buffer_lines.size()); + //if (buffer_line < 1 || buffer_line > all_buffer_lines.size()) + // return nullopt; // Find the line in the index file. We'll try to find the most similar line // in the index file and return the index for that.