mirror of
				https://github.com/MaskRay/ccls.git
				synced 2025-10-31 20:53:01 +00:00 
			
		
		
		
	limit workspace result to 1000, fix workspace file search
This commit is contained in:
		
							parent
							
								
									5d451e020a
								
							
						
					
					
						commit
						443ccd24b9
					
				| @ -27,6 +27,7 @@ const char* kIpcLanguageClientName = "language_client"; | ||||
| 
 | ||||
| const int kNumIndexers = 8 - 1; | ||||
| const int kQueueSizeBytes = 1024 * 8; | ||||
| const int kMaxWorkspaceSearchResults = 1000; | ||||
| } | ||||
| 
 | ||||
| struct IndexTranslationUnitRequest { | ||||
| @ -670,6 +671,11 @@ void QueryDbMainLoop( | ||||
| 
 | ||||
|       std::string query = msg->params.query; | ||||
|       for (int i = 0; i < db->qualified_names.size(); ++i) { | ||||
|         if (response.result.size() > kMaxWorkspaceSearchResults) { | ||||
|           std::cerr << "Query exceeded maximum number of responses (" << kMaxWorkspaceSearchResults << "), output may not contain all results"; | ||||
|           break; | ||||
|         } | ||||
| 
 | ||||
|         const std::string& name = db->qualified_names[i]; | ||||
|         // std::cerr << "- Considering " << name << std::endl;
 | ||||
| 
 | ||||
| @ -682,6 +688,11 @@ void QueryDbMainLoop( | ||||
|           // TODO: dedup this code w/ above (ie, add ctor to convert symbol to
 | ||||
|           // SymbolInformation)
 | ||||
|           switch (symbol.kind) { | ||||
|           case SymbolKind::File: { | ||||
|             QueryableFile& def = db->files[symbol.idx]; | ||||
|             info.location.uri.SetPath(def.def.usr); | ||||
|             break; | ||||
|           } | ||||
|             // TODO: file
 | ||||
|           case SymbolKind::Type: { | ||||
|             QueryableTypeDef& def = db->types[symbol.idx]; | ||||
| @ -948,7 +959,7 @@ int main(int argc, char** argv) { | ||||
|   //bool loop = true;
 | ||||
|   //while (loop)
 | ||||
|   //  std::this_thread::sleep_for(std::chrono::milliseconds(10));
 | ||||
|   std::this_thread::sleep_for(std::chrono::seconds(3)); | ||||
|   //std::this_thread::sleep_for(std::chrono::seconds(3));
 | ||||
| 
 | ||||
|   PlatformInit(); | ||||
|   RegisterMessageTypes(); | ||||
|  | ||||
| @ -86,9 +86,6 @@ IndexedTypeDef::IndexedTypeDef(TypeId id, const std::string& usr) | ||||
| void AddUsage(std::vector<Range>& uses, | ||||
|               Range loc, | ||||
|               bool insert_if_not_present = true) { | ||||
|   if (loc.start.column == 7 && loc.start.line == 7) | ||||
|     std::cerr << "break;"; | ||||
| 
 | ||||
|   // TODO: think about if we need to also consider |uses[i].end|
 | ||||
|   // First thought makes me think no, we don't.
 | ||||
|   for (int i = uses.size() - 1; i >= 0; --i) { | ||||
|  | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user