mirror of
				https://github.com/MaskRay/ccls.git
				synced 2025-11-03 22:04:24 +00:00 
			
		
		
		
	Rename Maybe::has_value to Maybe::HasValue to follow naming conventions
This commit is contained in:
		
							parent
							
								
									95f6460e6e
								
							
						
					
					
						commit
						593ecd8f53
					
				@ -28,12 +28,12 @@ public:
 | 
				
			|||||||
  const T& operator*() const { return storage; }
 | 
					  const T& operator*() const { return storage; }
 | 
				
			||||||
  T& operator*() { return storage; }
 | 
					  T& operator*() { return storage; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  bool has_value() const {
 | 
					  bool HasValue() const {
 | 
				
			||||||
    return storage.HasValueForMaybe_();
 | 
					    return storage.HasValueForMaybe_();
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
  explicit operator bool() const { return has_value(); }
 | 
					  explicit operator bool() const { return HasValue(); }
 | 
				
			||||||
  operator optional<T>() const {
 | 
					  operator optional<T>() const {
 | 
				
			||||||
    if (has_value())
 | 
					    if (HasValue())
 | 
				
			||||||
      return storage;
 | 
					      return storage;
 | 
				
			||||||
    return nullopt;
 | 
					    return nullopt;
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
				
			|||||||
@ -114,7 +114,7 @@ struct CqueryMemberHierarchyExpandHandler
 | 
				
			|||||||
    Out_CqueryMemberHierarchy out;
 | 
					    Out_CqueryMemberHierarchy out;
 | 
				
			||||||
    out.id = request->id;
 | 
					    out.id = request->id;
 | 
				
			||||||
    // |ExpandNode| uses -1 to indicate invalid |type_id|.
 | 
					    // |ExpandNode| uses -1 to indicate invalid |type_id|.
 | 
				
			||||||
    if (request->params.type_id.has_value())
 | 
					    if (request->params.type_id)
 | 
				
			||||||
      out.result = ExpandNode(db, working_files, *request->params.type_id);
 | 
					      out.result = ExpandNode(db, working_files, *request->params.type_id);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    QueueManager::WriteStdout(IpcId::CqueryMemberHierarchyExpand, out);
 | 
					    QueueManager::WriteStdout(IpcId::CqueryMemberHierarchyExpand, out);
 | 
				
			||||||
 | 
				
			|||||||
@ -17,7 +17,7 @@ lsWorkspaceEdit BuildWorkspaceEdit(QueryDatabase* db,
 | 
				
			|||||||
      continue;
 | 
					      continue;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    Maybe<QueryFileId> file_id = db->GetFileId(use);
 | 
					    Maybe<QueryFileId> file_id = db->GetFileId(use);
 | 
				
			||||||
    if (!file_id.has_value())
 | 
					    if (!file_id)
 | 
				
			||||||
      continue;
 | 
					      continue;
 | 
				
			||||||
    if (path_to_edit.find(*file_id) == path_to_edit.end()) {
 | 
					    if (path_to_edit.find(*file_id) == path_to_edit.end()) {
 | 
				
			||||||
      path_to_edit[*file_id] = lsTextDocumentEdit();
 | 
					      path_to_edit[*file_id] = lsTextDocumentEdit();
 | 
				
			||||||
 | 
				
			|||||||
@ -255,9 +255,9 @@ QueryFile::DefUpdate BuildFileDefUpdate(const IdMap& id_map, const IndexFile& in
 | 
				
			|||||||
  }
 | 
					  }
 | 
				
			||||||
  for (const IndexFunc& func : indexed.funcs) {
 | 
					  for (const IndexFunc& func : indexed.funcs) {
 | 
				
			||||||
    QueryFuncId id = id_map.ToQuery(func.id);
 | 
					    QueryFuncId id = id_map.ToQuery(func.id);
 | 
				
			||||||
    if (func.def.spell.has_value())
 | 
					    if (func.def.spell)
 | 
				
			||||||
      add_all_symbols_use(*func.def.spell, id, SymbolKind::Func);
 | 
					      add_all_symbols_use(*func.def.spell, id, SymbolKind::Func);
 | 
				
			||||||
    if (func.def.extent.has_value())
 | 
					    if (func.def.extent)
 | 
				
			||||||
      add_outline_use(*func.def.extent, id, SymbolKind::Func);
 | 
					      add_outline_use(*func.def.extent, id, SymbolKind::Func);
 | 
				
			||||||
    for (const IndexFunc::Declaration& decl : func.declarations) {
 | 
					    for (const IndexFunc::Declaration& decl : func.declarations) {
 | 
				
			||||||
      add_all_symbols(decl.spelling, id, SymbolKind::Func,
 | 
					      add_all_symbols(decl.spelling, id, SymbolKind::Func,
 | 
				
			||||||
@ -926,7 +926,7 @@ void QueryDatabase::ImportOrUpdate(std::vector<QueryVar::DefUpdate>&& updates) {
 | 
				
			|||||||
void QueryDatabase::UpdateSymbols(Maybe<Id<void>>* symbol_idx,
 | 
					void QueryDatabase::UpdateSymbols(Maybe<Id<void>>* symbol_idx,
 | 
				
			||||||
                                  SymbolKind kind,
 | 
					                                  SymbolKind kind,
 | 
				
			||||||
                                  Id<void> idx) {
 | 
					                                  Id<void> idx) {
 | 
				
			||||||
  if (!symbol_idx->has_value()) {
 | 
					  if (!symbol_idx->HasValue()) {
 | 
				
			||||||
    *symbol_idx = Id<void>(symbols.size());
 | 
					    *symbol_idx = Id<void>(symbols.size());
 | 
				
			||||||
    symbols.push_back(SymbolIdx{idx, kind});
 | 
					    symbols.push_back(SymbolIdx{idx, kind});
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
				
			|||||||
@ -380,7 +380,7 @@ optional<lsLocation> GetLsLocation(QueryDatabase* db,
 | 
				
			|||||||
                                   Reference ref) {
 | 
					                                   Reference ref) {
 | 
				
			||||||
  std::string path;
 | 
					  std::string path;
 | 
				
			||||||
  Maybe<QueryFileId> file_id = db->GetFileId(ref);
 | 
					  Maybe<QueryFileId> file_id = db->GetFileId(ref);
 | 
				
			||||||
  if (!file_id.has_value())
 | 
					  if (!file_id)
 | 
				
			||||||
    return nullopt;
 | 
					    return nullopt;
 | 
				
			||||||
  lsDocumentUri uri = GetLsDocumentUri(db, *file_id, &path);
 | 
					  lsDocumentUri uri = GetLsDocumentUri(db, *file_id, &path);
 | 
				
			||||||
  optional<lsRange> range =
 | 
					  optional<lsRange> range =
 | 
				
			||||||
@ -496,7 +496,7 @@ optional<lsSymbolInformation> GetSymbolInfo(QueryDatabase* db,
 | 
				
			|||||||
      info.containerName = func.def->detailed_name;
 | 
					      info.containerName = func.def->detailed_name;
 | 
				
			||||||
      info.kind = lsSymbolKind::Function;
 | 
					      info.kind = lsSymbolKind::Function;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
      if (func.def->declaring_type.has_value()) {
 | 
					      if (func.def->declaring_type) {
 | 
				
			||||||
        QueryType& container = db->types[func.def->declaring_type->id];
 | 
					        QueryType& container = db->types[func.def->declaring_type->id];
 | 
				
			||||||
        if (container.def)
 | 
					        if (container.def)
 | 
				
			||||||
          info.kind = lsSymbolKind::Method;
 | 
					          info.kind = lsSymbolKind::Method;
 | 
				
			||||||
 | 
				
			|||||||
@ -229,7 +229,7 @@ void ReflectMember(Writer& visitor, const char* name, optional<T>& value) {
 | 
				
			|||||||
// The same as std::optional
 | 
					// The same as std::optional
 | 
				
			||||||
template <typename T>
 | 
					template <typename T>
 | 
				
			||||||
void ReflectMember(Writer& visitor, const char* name, Maybe<T>& value) {
 | 
					void ReflectMember(Writer& visitor, const char* name, Maybe<T>& value) {
 | 
				
			||||||
  if (value.has_value() || visitor.Format() != SerializeFormat::Json) {
 | 
					  if (value.HasValue() || visitor.Format() != SerializeFormat::Json) {
 | 
				
			||||||
    visitor.Key(name);
 | 
					    visitor.Key(name);
 | 
				
			||||||
    Reflect(visitor, value);
 | 
					    Reflect(visitor, value);
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
		Reference in New Issue
	
	Block a user