Changeset View
Changeset View
Standalone View
Standalone View
clang-tools-extra/clangd/Headers.h
Show First 20 Lines • Show All 240 Lines • ▼ Show 20 Lines | public: | ||||
/// \return A quoted "path" or <path> to be included, or None if it couldn't | /// \return A quoted "path" or <path> to be included, or None if it couldn't | ||||
/// be shortened. | /// be shortened. | ||||
llvm::Optional<std::string> | llvm::Optional<std::string> | ||||
calculateIncludePath(const HeaderFile &InsertedHeader, | calculateIncludePath(const HeaderFile &InsertedHeader, | ||||
llvm::StringRef IncludingFile) const; | llvm::StringRef IncludingFile) const; | ||||
/// Calculates an edit that inserts \p VerbatimHeader into code. If the header | /// Calculates an edit that inserts \p VerbatimHeader into code. If the header | ||||
/// is already included, this returns None. | /// is already included, this returns None. | ||||
llvm::Optional<TextEdit> insert(llvm::StringRef VerbatimHeader) const; | llvm::Optional<TextEdit> insert(llvm::StringRef VerbatimHeader, | ||||
bool ViaImport) const; | |||||
kadircet: again it's better to have an enum here. | |||||
private: | private: | ||||
StringRef FileName; | StringRef FileName; | ||||
StringRef Code; | StringRef Code; | ||||
StringRef BuildDir; | StringRef BuildDir; | ||||
HeaderSearch *HeaderSearchInfo = nullptr; | HeaderSearch *HeaderSearchInfo = nullptr; | ||||
llvm::StringSet<> IncludedHeaders; // Both written and resolved. | llvm::StringSet<> IncludedHeaders; // Both written and resolved. | ||||
tooling::HeaderIncludes Inserter; // Computers insertion replacement. | tooling::HeaderIncludes Inserter; // Computers insertion replacement. | ||||
Show All 31 Lines |
again it's better to have an enum here.