mirror of
				https://github.com/MaskRay/ccls.git
				synced 2025-11-04 06:15:20 +00:00 
			
		
		
		
	Log initialization options, reactivate working file asserts.
This commit is contained in:
		
							parent
							
								
									f3719de08c
								
							
						
					
					
						commit
						c77531a432
					
				@ -967,7 +967,7 @@ void ParseFile(IndexerConfig* config,
 | 
			
		||||
  std::vector<std::unique_ptr<IndexedFile>> 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<IndexedFile>& 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<Ipc_InitializeRequest*>(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
 | 
			
		||||
 | 
			
		||||
@ -74,9 +74,9 @@ optional<int> 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<int> 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.
 | 
			
		||||
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user