[clang-tools-extra] r323149 - [clangd] Drop ~destructor completions - rarely helpful and work inconsistently

David Blaikie via cfe-commits cfe-commits at lists.llvm.org
Mon Jan 29 08:31:43 PST 2018


Any chance of making this a really low priority completion? (maybe just
leaving in a FIXME or expected-fail check of some kind if it's not
practical to implement it right now) For those handful of times when you
actually want to do this.

On Mon, Jan 22, 2018 at 1:06 PM Sam McCall via cfe-commits <
cfe-commits at lists.llvm.org> wrote:

> Author: sammccall
> Date: Mon Jan 22 13:05:00 2018
> New Revision: 323149
>
> URL: http://llvm.org/viewvc/llvm-project?rev=323149&view=rev
> Log:
> [clangd] Drop ~destructor completions - rarely helpful and work
> inconsistently
>
> Modified:
>     clang-tools-extra/trunk/clangd/CodeComplete.cpp
>     clang-tools-extra/trunk/unittests/clangd/CodeCompleteTests.cpp
>
> Modified: clang-tools-extra/trunk/clangd/CodeComplete.cpp
> URL:
> http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clangd/CodeComplete.cpp?rev=323149&r1=323148&r2=323149&view=diff
>
> ==============================================================================
> --- clang-tools-extra/trunk/clangd/CodeComplete.cpp (original)
> +++ clang-tools-extra/trunk/clangd/CodeComplete.cpp Mon Jan 22 13:05:00
> 2018
> @@ -361,6 +361,10 @@ struct CompletionRecorder : public CodeC
>            (Result.Availability == CXAvailability_NotAvailable ||
>             Result.Availability == CXAvailability_NotAccessible))
>          continue;
> +      // Destructor completion is rarely useful, and works inconsistently.
> +      // (s.^ completes ~string, but s.~st^ is an error).
> +      if (dyn_cast_or_null<CXXDestructorDecl>(Result.Declaration))
> +        continue;
>        Results.push_back(Result);
>      }
>    }
>
> Modified: clang-tools-extra/trunk/unittests/clangd/CodeCompleteTests.cpp
> URL:
> http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/unittests/clangd/CodeCompleteTests.cpp?rev=323149&r1=323148&r2=323149&view=diff
>
> ==============================================================================
> --- clang-tools-extra/trunk/unittests/clangd/CodeCompleteTests.cpp
> (original)
> +++ clang-tools-extra/trunk/unittests/clangd/CodeCompleteTests.cpp Mon Jan
> 22 13:05:00 2018
> @@ -461,7 +461,7 @@ TEST(CompletionTest, NoDuplicates) {
>        {cls("Adapter")});
>
>    // Make sure there are no duplicate entries of 'Adapter'.
> -  EXPECT_THAT(Results.items, ElementsAre(Named("Adapter"),
> Named("~Adapter")));
> +  EXPECT_THAT(Results.items, ElementsAre(Named("Adapter")));
>  }
>
>  TEST(CompletionTest, ScopedNoIndex) {
>
>
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20180129/833c2a68/attachment.html>


More information about the cfe-commits mailing list