mirror of
				https://github.com/MaskRay/ccls.git
				synced 2025-11-04 06:15:20 +00:00 
			
		
		
		
	Disable logging of filtered project paths, but let user enable it in config.
This commit is contained in:
		
							parent
							
								
									da6a8f335f
								
							
						
					
					
						commit
						8d9374ee59
					
				
							
								
								
									
										13
									
								
								src/config.h
									
									
									
									
									
								
							
							
						
						
									
										13
									
								
								src/config.h
									
									
									
									
									
								
							@ -7,11 +7,15 @@
 | 
				
			|||||||
struct Config {
 | 
					struct Config {
 | 
				
			||||||
  // Root directory of the project. **Not serialized**
 | 
					  // Root directory of the project. **Not serialized**
 | 
				
			||||||
  std::string projectRoot;
 | 
					  std::string projectRoot;
 | 
				
			||||||
 | 
					 | 
				
			||||||
  std::string cacheDirectory;
 | 
					  std::string cacheDirectory;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  std::vector<std::string> extraClangArguments;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  std::vector<std::string> indexWhitelist;
 | 
					  std::vector<std::string> indexWhitelist;
 | 
				
			||||||
  std::vector<std::string> indexBlacklist;
 | 
					  std::vector<std::string> indexBlacklist;
 | 
				
			||||||
  std::vector<std::string> extraClangArguments;
 | 
					  // If true, project paths that were skipped by the whitelist/blacklist will
 | 
				
			||||||
 | 
					  // be logged.
 | 
				
			||||||
 | 
					  bool logSkippedPathsForIndex = false;
 | 
				
			||||||
 
 | 
					 
 | 
				
			||||||
  // Maximum workspace search results.
 | 
					  // Maximum workspace search results.
 | 
				
			||||||
  int maxWorkspaceSearchResults = 1000;
 | 
					  int maxWorkspaceSearchResults = 1000;
 | 
				
			||||||
@ -54,9 +58,12 @@ struct Config {
 | 
				
			|||||||
};
 | 
					};
 | 
				
			||||||
MAKE_REFLECT_STRUCT(Config,
 | 
					MAKE_REFLECT_STRUCT(Config,
 | 
				
			||||||
  cacheDirectory,
 | 
					  cacheDirectory,
 | 
				
			||||||
  indexWhitelist, indexBlacklist,
 | 
					
 | 
				
			||||||
  extraClangArguments,
 | 
					  extraClangArguments,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  indexWhitelist, indexBlacklist,
 | 
				
			||||||
 | 
					  logSkippedPathsForIndex,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  maxWorkspaceSearchResults,
 | 
					  maxWorkspaceSearchResults,
 | 
				
			||||||
  indexerCount,
 | 
					  indexerCount,
 | 
				
			||||||
  enableIndexing, enableCacheWrite, enableCacheRead,
 | 
					  enableIndexing, enableCacheWrite, enableCacheRead,
 | 
				
			||||||
 | 
				
			|||||||
@ -395,11 +395,13 @@ void Project::ForAllFilteredFiles(Config* config, std::function<void(int i, cons
 | 
				
			|||||||
    if (matcher.IsMatch(entry.filename, &failure_reason))
 | 
					    if (matcher.IsMatch(entry.filename, &failure_reason))
 | 
				
			||||||
      action(i, entries[i]);
 | 
					      action(i, entries[i]);
 | 
				
			||||||
    else {
 | 
					    else {
 | 
				
			||||||
 | 
					      if (config->logSkippedPathsForIndex) {
 | 
				
			||||||
        std::stringstream output;
 | 
					        std::stringstream output;
 | 
				
			||||||
        output << '[' << (i + 1) << '/' << entries.size() << "] Failed " << failure_reason << "; skipping " << entry.filename << std::endl;
 | 
					        output << '[' << (i + 1) << '/' << entries.size() << "] Failed " << failure_reason << "; skipping " << entry.filename << std::endl;
 | 
				
			||||||
        std::cerr << output.str();
 | 
					        std::cerr << output.str();
 | 
				
			||||||
      }
 | 
					      }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
TEST_SUITE("Project");
 | 
					TEST_SUITE("Project");
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
		Reference in New Issue
	
	Block a user