[PATCH] D89579: [clangd][ObjC] Support nullability annotations

David Goldman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Oct 16 14:26:44 PDT 2020


dgoldman updated this revision to Diff 298757.
dgoldman added a comment.

Lint fixes


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D89579/new/

https://reviews.llvm.org/D89579

Files:
  clang-tools-extra/clangd/Selection.cpp
  clang-tools-extra/clangd/unittests/FindTargetTests.cpp
  clang-tools-extra/clangd/unittests/HoverTests.cpp


Index: clang-tools-extra/clangd/unittests/HoverTests.cpp
===================================================================
--- clang-tools-extra/clangd/unittests/HoverTests.cpp
+++ clang-tools-extra/clangd/unittests/HoverTests.cpp
@@ -2005,8 +2005,8 @@
             HI.NamespaceScope = "";
             HI.Definition = "@interface MYObject\n at end";
           }},
+      // Should work even with nullability attribute.
       {
-          // Should work even with nullability attribute.
           R"cpp(
           @interface MYObject
           @end
Index: clang-tools-extra/clangd/unittests/FindTargetTests.cpp
===================================================================
--- clang-tools-extra/clangd/unittests/FindTargetTests.cpp
+++ clang-tools-extra/clangd/unittests/FindTargetTests.cpp
@@ -827,8 +827,7 @@
     @property(retain) [[MYObject]] *x;
     @end
   )cpp";
-  EXPECT_DECLS("ObjCInterfaceTypeLoc",
-               "@interface MYObject");
+  EXPECT_DECLS("ObjCInterfaceTypeLoc", "@interface MYObject");
 
   Code = R"cpp(
     @interface MYObject2
@@ -837,8 +836,7 @@
     @property(retain, nonnull) [[MYObject2]] *x;
     @end
   )cpp";
-  EXPECT_DECLS("ObjCInterfaceTypeLoc",
-               "@interface MYObject2");
+  EXPECT_DECLS("ObjCInterfaceTypeLoc", "@interface MYObject2");
 
   Code = R"cpp(
     @protocol Foo
Index: clang-tools-extra/clangd/Selection.cpp
===================================================================
--- clang-tools-extra/clangd/Selection.cpp
+++ clang-tools-extra/clangd/Selection.cpp
@@ -619,7 +619,8 @@
       // AttributeTypeLoc points to the attribute's range, NOT the modified
       // type's range.
       if (auto AT = TL->getAs<AttributedTypeLoc>())
-        S = AT.getModifiedLoc().getSourceRange();
+        S = AT.getModifiedLoc()
+                .getSourceRange(); // should we just return false?
     }
     if (!SelChecker.mayHit(S)) {
       dlog("{1}skip: {0}", printNodeToString(N, PrintPolicy), indent());


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D89579.298757.patch
Type: text/x-patch
Size: 1985 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20201016/72132f55/attachment.bin>


More information about the cfe-commits mailing list