This revision was automatically updated to reflect the committed changes. Closed by commit rGbc498198b555: [clangd] Allow renaming class templates in cross-file rename. (authored by hokein).
Changed prior to commit: https://reviews.llvm.org/D74709?vs=244953&id=245802#toc Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D74709/new/ https://reviews.llvm.org/D74709 Files: clang-tools-extra/clangd/refactor/Rename.cpp clang-tools-extra/clangd/unittests/RenameTests.cpp Index: clang-tools-extra/clangd/unittests/RenameTests.cpp =================================================================== --- clang-tools-extra/clangd/unittests/RenameTests.cpp +++ clang-tools-extra/clangd/unittests/RenameTests.cpp @@ -888,6 +888,23 @@ )cpp", }, { + // class templates. + R"cpp( + template <typename T> + class [[Foo]] {}; + // FIXME: explicit template specilizations are not supported due the + // clangd index limitations. + template <> + class Foo<double> {}; + )cpp", + R"cpp( + #include "foo.h" + void func() { + [[F^oo]]<int> foo; + } + )cpp", + }, + { // class methods. R"cpp( class Foo { Index: clang-tools-extra/clangd/refactor/Rename.cpp =================================================================== --- clang-tools-extra/clangd/refactor/Rename.cpp +++ clang-tools-extra/clangd/refactor/Rename.cpp @@ -184,13 +184,6 @@ if (!Index) return ReasonToReject::NoIndexProvided; - // Blacklist symbols that are not supported yet in cross-file mode due to the - // limitations of our index. - // FIXME: Renaming templates requires to rename all related specializations, - // our index doesn't have this information. - if (RenameDecl.getDescribedTemplate()) - return ReasonToReject::UnsupportedSymbol; - // FIXME: Renaming virtual methods requires to rename all overridens in // subclasses, our index doesn't have this information. // Note: Within-file rename does support this through the AST.
Index: clang-tools-extra/clangd/unittests/RenameTests.cpp =================================================================== --- clang-tools-extra/clangd/unittests/RenameTests.cpp +++ clang-tools-extra/clangd/unittests/RenameTests.cpp @@ -888,6 +888,23 @@ )cpp", }, { + // class templates. + R"cpp( + template <typename T> + class [[Foo]] {}; + // FIXME: explicit template specilizations are not supported due the + // clangd index limitations. + template <> + class Foo<double> {}; + )cpp", + R"cpp( + #include "foo.h" + void func() { + [[F^oo]]<int> foo; + } + )cpp", + }, + { // class methods. R"cpp( class Foo { Index: clang-tools-extra/clangd/refactor/Rename.cpp =================================================================== --- clang-tools-extra/clangd/refactor/Rename.cpp +++ clang-tools-extra/clangd/refactor/Rename.cpp @@ -184,13 +184,6 @@ if (!Index) return ReasonToReject::NoIndexProvided; - // Blacklist symbols that are not supported yet in cross-file mode due to the - // limitations of our index. - // FIXME: Renaming templates requires to rename all related specializations, - // our index doesn't have this information. - if (RenameDecl.getDescribedTemplate()) - return ReasonToReject::UnsupportedSymbol; - // FIXME: Renaming virtual methods requires to rename all overridens in // subclasses, our index doesn't have this information. // Note: Within-file rename does support this through the AST.
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits