template <typename... Ts> void elog(const char *Fmt, Ts &&... Vals) {
detail::log(Logger::Error, Fmt, std::forward<Ts>(Vals)...);
}
-// log() is used for information important to understanding a clangd session.
+// log() is used for information important to understand a clangd session.
// e.g. the names of LSP messages sent are logged at this level.
// This level could be enabled in production builds to allow later inspection.
template <typename... Ts> void log(const char *Fmt, Ts &&... Vals) {
/// the snapshot, either this class or the symbol index.
///
/// The snapshot semantics keeps critical sections minimal since we only need
-/// locking when we swap or obtain refereces to snapshots.
+/// locking when we swap or obtain references to snapshots.
class FileSymbols {
public:
/// \brief Updates all symbols and occurrences in a file.
llvm::StringMap<std::shared_ptr<SymbolOccurrenceSlab>> FileToOccurrenceSlabs;
};
-/// \brief This manages symbls from files and an in-memory index on all symbols.
+/// \brief This manages symbols from files and an in-memory index on all symbols.
class FileIndex : public SymbolIndex {
public:
/// If URISchemes is empty, the default schemes in SymbolCollector will be
}
void SymbolOccurrenceSlab::freeze() {
- // Deduplicate symbol occurrenes.
+ // Deduplicate symbol occurrences.
for (auto &IDAndOccurrence : Occurrences) {
auto &Occurrence = IDAndOccurrence.getSecond();
std::sort(Occurrence.begin(), Occurrence.end());
/// CrossReference finds all symbol occurrences (e.g. references,
/// declarations, definitions) and applies \p Callback on each result.
///
- /// Resutls are returned in arbitrary order.
+ /// Results are returned in arbitrary order.
///
/// The returned result must be deep-copied if it's used outside Callback.
virtual void findOccurrences(
{
std::lock_guard<std::mutex> Lock(Mutex);
Index = std::move(TempIndex);
- Symbols = std::move(Syms); // Relase old symbols.
+ Symbols = std::move(Syms); // Release old symbols.
Occurrences = std::move(AllOccurrences);
}
// We consider the dynamic index authoritative and report all its
// occurrences, and only report static index occurrences from other files.
//
- // FIXME: The heuristic fails if the dynamic index containts a file, but all
+ // FIXME: The heuristic fails if the dynamic index contains a file, but all
// occurrences were removed (we will report stale ones from the static
// index). Ultimately we should explicit check which index has the file
// instead.
// Returned symbol may contain data owned by either source.
Symbol mergeSymbol(const Symbol &L, const Symbol &R);
-// mergedIndex returns a composite index based on two provided Indexes:
+// mergeIndex returns a composite index based on two provided Indexes:
// - the Dynamic index covers few files, but is relatively up-to-date.
// - the Static index covers a bigger set of files, but is relatively stale.
// The returned index attempts to combine results, and avoid duplicates.
// All Symbols collected from the AST.
SymbolSlab::Builder Symbols;
// All symbol occurrences collected from the AST.
- // Only symbols declared in preamble (from #inclues) and references from the
+ // Only symbols declared in preamble (from #include) and references from the
// main file will be included.
SymbolOccurrenceSlab SymbolOccurrences;
ASTContext *ASTCtx;
///
/// For short queries (less than 3 characters with Head or Tail roles in Fuzzy
/// Matching segmentation) this returns a single trigram with the first
-/// characters (up to 3) to perfrom prefix match.
+/// characters (up to 3) to perform prefix match.
std::vector<Token> generateQueryTrigrams(llvm::StringRef Query);
} // namespace dex