[clangd] Make an include always refer to itself. Background: clang-review expects...
authorViktoriia Bakalova <bakalova@google.com>
Tue, 18 Jul 2023 15:48:24 +0000 (15:48 +0000)
committerViktoriia Bakalova <bakalova@google.com>
Wed, 19 Jul 2023 08:32:53 +0000 (08:32 +0000)
Differential Revision: https://reviews.llvm.org/D155614

clang-tools-extra/clangd/XRefs.cpp

index 29ce1f3..80a7d02 100644 (file)
@@ -1367,9 +1367,6 @@ maybeFindIncludeReferences(ParsedAST &AST, Position Pos,
       rangeTillEOL(SM.getBufferData(SM.getMainFileID()), Inc.HashOffset);
   Result.Loc.uri = URIMainFile;
   Results.References.push_back(std::move(Result));
-
-  if (Results.References.empty())
-    return std::nullopt;
   return Results;
 }
 } // namespace