Index: clang-tools-extra/clangd/AST.cpp =================================================================== --- clang-tools-extra/clangd/AST.cpp +++ clang-tools-extra/clangd/AST.cpp @@ -377,7 +377,7 @@ // Loc of "auto" in operator auto() if (CurLoc.isInvalid() && dyn_cast(D)) CurLoc = D->getTypeSourceInfo()->getTypeLoc().getBeginLoc(); - // Loc of "auto" in function with traling return type (c++11). + // Loc of "auto" in function with trailing return type (c++11). if (CurLoc.isInvalid()) CurLoc = D->getSourceRange().getBegin(); if (CurLoc != SearchedLocation) Index: clang-tools-extra/clangd/ClangdServer.cpp =================================================================== --- clang-tools-extra/clangd/ClangdServer.cpp +++ clang-tools-extra/clangd/ClangdServer.cpp @@ -466,7 +466,7 @@ void ClangdServer::switchSourceHeader( PathRef Path, Callback> CB) { - // We want to return the result as fast as possible, stragety is: + // We want to return the result as fast as possible, strategy is: // 1) use the file-only heuristic, it requires some IO but it is much // faster than building AST, but it only works when .h/.cc files are in // the same directory. Index: clang-tools-extra/clangd/CodeComplete.cpp =================================================================== --- clang-tools-extra/clangd/CodeComplete.cpp +++ clang-tools-extra/clangd/CodeComplete.cpp @@ -395,7 +395,7 @@ std::string ReturnType; }; - // If all BundledEntrys have the same value for a property, return it. + // If all BundledEntries have the same value for a property, return it. template const std::string *onlyValue() const { auto B = Bundled.begin(), E = Bundled.end(); @@ -499,7 +499,7 @@ llvm_unreachable("unknown CodeCompletionResult kind"); } -// Scopes of the paritial identifier we're trying to complete. +// Scopes of the partial identifier we're trying to complete. // It is used when we query the index for more completion results. struct SpecifiedScope { // The scopes we should look in, determined by Sema. @@ -874,7 +874,7 @@ // Function Template. // - High score is better. // - Shorter signature is better. - // - Alphebatically smaller is better. + // - Alphabetically smaller is better. if (L.Quality.NumberOfParameters != R.Quality.NumberOfParameters) return L.Quality.NumberOfParameters < R.Quality.NumberOfParameters; if (L.Quality.NumberOfOptionalParameters != @@ -1510,7 +1510,7 @@ } // Merges Sema and Index results where possible, to form CompletionCandidates. - // \p Identifiers is raw idenfiers that can also be completion condidates. + // \p Identifiers is raw idenfiers that can also be completion candidates. // Identifiers are not merged with results from index or sema. // Groups overloads if desired, to form CompletionCandidate::Bundles. The // bundles are scored and top results are returned, best to worst. Index: clang-tools-extra/clangd/Diagnostics.h =================================================================== --- clang-tools-extra/clangd/Diagnostics.h +++ clang-tools-extra/clangd/Diagnostics.h @@ -53,7 +53,7 @@ struct DiagBase { std::string Message; // Intended to be used only in error messages. - // May be relative, absolute or even artifically constructed. + // May be relative, absolute or even artificially constructed. std::string File; // Absolute path to containing file, if available. llvm::Optional AbsFile; Index: clang-tools-extra/clangd/Diagnostics.cpp =================================================================== --- clang-tools-extra/clangd/Diagnostics.cpp +++ clang-tools-extra/clangd/Diagnostics.cpp @@ -232,7 +232,7 @@ } /// Returns a message sent to LSP for the main diagnostic in \p D. -/// This message may include notes, if they're not emited in some other way. +/// This message may include notes, if they're not emitted in some other way. /// Example output: /// /// no matching function for call to 'foo' Index: clang-tools-extra/clangd/FindTarget.cpp =================================================================== --- clang-tools-extra/clangd/FindTarget.cpp +++ clang-tools-extra/clangd/FindTarget.cpp @@ -589,10 +589,10 @@ return {*V.Ref}; } -class ExplicitReferenceColletor - : public RecursiveASTVisitor { +class ExplicitReferenceCollector + : public RecursiveASTVisitor { public: - ExplicitReferenceColletor(llvm::function_ref Out) + ExplicitReferenceCollector(llvm::function_ref Out) : Out(Out) { assert(Out); } @@ -738,16 +738,16 @@ void findExplicitReferences(const Stmt *S, llvm::function_ref Out) { assert(S); - ExplicitReferenceColletor(Out).TraverseStmt(const_cast(S)); + ExplicitReferenceCollector(Out).TraverseStmt(const_cast(S)); } void findExplicitReferences(const Decl *D, llvm::function_ref Out) { assert(D); - ExplicitReferenceColletor(Out).TraverseDecl(const_cast(D)); + ExplicitReferenceCollector(Out).TraverseDecl(const_cast(D)); } void findExplicitReferences(const ASTContext &AST, llvm::function_ref Out) { - ExplicitReferenceColletor(Out).TraverseAST(const_cast(AST)); + ExplicitReferenceCollector(Out).TraverseAST(const_cast(AST)); } llvm::raw_ostream &operator<<(llvm::raw_ostream &OS, DeclRelation R) { Index: clang-tools-extra/clangd/FormattedString.h =================================================================== --- clang-tools-extra/clangd/FormattedString.h +++ clang-tools-extra/clangd/FormattedString.h @@ -20,7 +20,7 @@ namespace clangd { /// A structured string representation that could be converted to markdown or -/// plaintext upon requrest. +/// plaintext upon request. class FormattedString { public: /// Append plain text to the end of the string. Index: clang-tools-extra/clangd/FormattedString.cpp =================================================================== --- clang-tools-extra/clangd/FormattedString.cpp +++ clang-tools-extra/clangd/FormattedString.cpp @@ -20,7 +20,7 @@ /// Escape a markdown text block. Ensures the punctuation will not introduce /// any of the markdown constructs. static std::string renderText(llvm::StringRef Input) { - // Escaping ASCII punctiation ensures we can't start a markdown construct. + // Escaping ASCII punctuation ensures we can't start a markdown construct. constexpr llvm::StringLiteral Punctuation = R"txt(!"#$%&'()*+,-./:;<=>?@[\]^_`{|}~)txt"; @@ -135,7 +135,7 @@ R += "\n"; continue; } - llvm_unreachable("unhanlded ChunkKind"); + llvm_unreachable("unhandled ChunkKind"); } return R; } Index: clang-tools-extra/clangd/TUScheduler.cpp =================================================================== --- clang-tools-extra/clangd/TUScheduler.cpp +++ clang-tools-extra/clangd/TUScheduler.cpp @@ -480,7 +480,7 @@ { std::lock_guard Lock(PublishMu); - // No need to rebuild the AST if we won't send the diagnotics. However, + // No need to rebuild the AST if we won't send the diagnostics. However, // note that we don't prevent preamble rebuilds. if (!CanPublishResults) return; Index: clang-tools-extra/clangd/Transport.h =================================================================== --- clang-tools-extra/clangd/Transport.h +++ clang-tools-extra/clangd/Transport.h @@ -55,7 +55,7 @@ }; // Called by Clangd to receive messages from the client. // The transport should in turn invoke the handler to process messages. - // If handler returns false, the transport should immedately exit the loop. + // If handler returns false, the transport should immediately exit the loop. // (This is used to implement the `exit` notification). // Otherwise, it returns an error when the transport becomes unusable. virtual llvm::Error loop(MessageHandler &) = 0; Index: clang-tools-extra/clangd/XRefs.cpp =================================================================== --- clang-tools-extra/clangd/XRefs.cpp +++ clang-tools-extra/clangd/XRefs.cpp @@ -120,7 +120,7 @@ const SymbolLocation &IdxLoc, std::string &Scratch) { // Also use a dummy symbol for the index location so that other fields (e.g. - // definition) are not factored into the preferrence. + // definition) are not factored into the preference. Symbol ASTSym, IdxSym; ASTSym.ID = IdxSym.ID = SymbolID("dummy_id"); ASTSym.CanonicalDeclaration = toIndexLocation(ASTLoc, Scratch); @@ -353,7 +353,7 @@ } bool - handleDeclOccurence(const Decl *D, index::SymbolRoleSet Roles, + handleDeclOccurrence(const Decl *D, index::SymbolRoleSet Roles, llvm::ArrayRef Relations, SourceLocation Loc, index::IndexDataConsumer::ASTNodeInfo ASTNode) override { Index: clang-tools-extra/clangd/index/SymbolCollector.h =================================================================== --- clang-tools-extra/clangd/index/SymbolCollector.h +++ clang-tools-extra/clangd/index/SymbolCollector.h @@ -99,12 +99,12 @@ } bool - handleDeclOccurence(const Decl *D, index::SymbolRoleSet Roles, + handleDeclOccurrence(const Decl *D, index::SymbolRoleSet Roles, ArrayRef Relations, SourceLocation Loc, index::IndexDataConsumer::ASTNodeInfo ASTNode) override; - bool handleMacroOccurence(const IdentifierInfo *Name, const MacroInfo *MI, + bool handleMacroOccurrence(const IdentifierInfo *Name, const MacroInfo *MI, index::SymbolRoleSet Roles, SourceLocation Loc) override; Index: clang-tools-extra/clangd/index/SymbolCollector.cpp =================================================================== --- clang-tools-extra/clangd/index/SymbolCollector.cpp +++ clang-tools-extra/clangd/index/SymbolCollector.cpp @@ -245,14 +245,14 @@ } // Always return true to continue indexing. -bool SymbolCollector::handleDeclOccurence( +bool SymbolCollector::handleDeclOccurrence( const Decl *D, index::SymbolRoleSet Roles, llvm::ArrayRef Relations, SourceLocation Loc, index::IndexDataConsumer::ASTNodeInfo ASTNode) { assert(ASTCtx && PP.get() && "ASTContext and Preprocessor must be set."); assert(CompletionAllocator && CompletionTUInfo); assert(ASTNode.OrigD); - // Indexing API puts cannonical decl into D, which might not have a valid + // Indexing API puts canonical decl into D, which might not have a valid // source location for implicit/built-in decls. Fallback to original decl in // such cases. if (D->getLocation().isInvalid()) @@ -346,7 +346,7 @@ return true; } -bool SymbolCollector::handleMacroOccurence(const IdentifierInfo *Name, +bool SymbolCollector::handleMacroOccurrence(const IdentifierInfo *Name, const MacroInfo *MI, index::SymbolRoleSet Roles, SourceLocation Loc) { @@ -524,9 +524,8 @@ auto FileURI = toURI(SM, FileEntry->getName(), Opts); Found = URICache.insert({FID, FileURI}).first; } else { - // Ignore cases where we can not find a corresponding file entry - // for the loc, thoses are not interesting, e.g. symbols formed - // via macro concatenation. + // Ignore cases where we can not find a corresponding file entry for + // given location, e.g. symbols formed via macro concatenation. return None; } } Index: clang-tools-extra/clangd/refactor/Rename.cpp =================================================================== --- clang-tools-extra/clangd/refactor/Rename.cpp +++ clang-tools-extra/clangd/refactor/Rename.cpp @@ -364,7 +364,7 @@ std::move(FileAndOccurrences.second), RenameDecl.getASTContext().getLangOpts()); if (!RenameRanges) { - // Our heuristice fails to adjust rename ranges to the current state of + // Our heuristics fails to adjust rename ranges to the current state of // the file, it is most likely the index is stale, so we give up the // entire rename. return llvm::make_error( @@ -387,7 +387,7 @@ return Results; } -// A simple edit is eithor changing line or column, but not both. +// A simple edit is either changing line or column, but not both. bool impliesSimpleEdit(const Position &LHS, const Position &RHS) { return LHS.line == RHS.line || LHS.character == RHS.character; } Index: clang/include/clang/Index/IndexDataConsumer.h =================================================================== --- clang/include/clang/Index/IndexDataConsumer.h +++ clang/include/clang/Index/IndexDataConsumer.h @@ -39,14 +39,14 @@ virtual void setPreprocessor(std::shared_ptr PP) {} /// \returns true to continue indexing, or false to abort. - virtual bool handleDeclOccurence(const Decl *D, SymbolRoleSet Roles, + virtual bool handleDeclOccurrence(const Decl *D, SymbolRoleSet Roles, ArrayRef Relations, SourceLocation Loc, ASTNodeInfo ASTNode) { return true; } /// \returns true to continue indexing, or false to abort. - virtual bool handleMacroOccurence(const IdentifierInfo *Name, + virtual bool handleMacroOccurrence(const IdentifierInfo *Name, const MacroInfo *MI, SymbolRoleSet Roles, SourceLocation Loc) { return true; @@ -57,7 +57,7 @@ /// This will be called for each module reference in an import decl. /// For "@import MyMod.SubMod", there will be a call for 'MyMod' with the /// 'reference' role, and a call for 'SubMod' with the 'declaration' role. - virtual bool handleModuleOccurence(const ImportDecl *ImportD, + virtual bool handleModuleOccurrence(const ImportDecl *ImportD, const Module *Mod, SymbolRoleSet Roles, SourceLocation Loc) { return true; Index: clang/lib/Index/IndexingContext.cpp =================================================================== --- clang/lib/Index/IndexingContext.cpp +++ clang/lib/Index/IndexingContext.cpp @@ -99,7 +99,7 @@ return; reportModuleReferences(Mod->Parent, IdLocs.drop_back(), ImportD, DataConsumer); - DataConsumer.handleModuleOccurence(ImportD, Mod, + DataConsumer.handleModuleOccurrence(ImportD, Mod, (SymbolRoleSet)SymbolRole::Reference, IdLocs.back()); } @@ -145,7 +145,7 @@ if (ImportD->isImplicit()) Roles |= (unsigned)SymbolRole::Implicit; - return DataConsumer.handleModuleOccurence(ImportD, Mod, Roles, Loc); + return DataConsumer.handleModuleOccurrence(ImportD, Mod, Roles, Loc); } bool IndexingContext::isTemplateImplicitInstantiation(const Decl *D) { @@ -443,26 +443,26 @@ } IndexDataConsumer::ASTNodeInfo Node{OrigE, OrigD, Parent, ContainerDC}; - return DataConsumer.handleDeclOccurence(D, Roles, FinalRelations, Loc, Node); + return DataConsumer.handleDeclOccurrence(D, Roles, FinalRelations, Loc, Node); } void IndexingContext::handleMacroDefined(const IdentifierInfo &Name, SourceLocation Loc, const MacroInfo &MI) { SymbolRoleSet Roles = (unsigned)SymbolRole::Definition; - DataConsumer.handleMacroOccurence(&Name, &MI, Roles, Loc); + DataConsumer.handleMacroOccurrence(&Name, &MI, Roles, Loc); } void IndexingContext::handleMacroUndefined(const IdentifierInfo &Name, SourceLocation Loc, const MacroInfo &MI) { SymbolRoleSet Roles = (unsigned)SymbolRole::Undefinition; - DataConsumer.handleMacroOccurence(&Name, &MI, Roles, Loc); + DataConsumer.handleMacroOccurrence(&Name, &MI, Roles, Loc); } void IndexingContext::handleMacroReference(const IdentifierInfo &Name, SourceLocation Loc, const MacroInfo &MI) { SymbolRoleSet Roles = (unsigned)SymbolRole::Reference; - DataConsumer.handleMacroOccurence(&Name, &MI, Roles, Loc); + DataConsumer.handleMacroOccurrence(&Name, &MI, Roles, Loc); }