[PATCH] D65433: [clangd] DefineInline action availability checks

Kadir Cetinkaya via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Sep 9 00:36:10 PDT 2019


kadircet marked an inline comment as done.
kadircet added a comment.

In D65433#1661865 <https://reviews.llvm.org/D65433#1661865>, @arphaman wrote:

> When fully implemented, will define inline tweak work with C++ methods in classes as well?


Yes you can see an example of it in the tests provided in `TweakTests.cpp`



================
Comment at: clang-tools-extra/clangd/refactor/tweaks/DefineInline.cpp:192
+  Intent intent() const override { return Intent::Refactor; }
+  std::string title() const override { return "Inline function definition"; }
+
----------------
arphaman wrote:
> Sorry, I'm not really familiar with design of tweaks, so this might be a bad question: Is it possible to change the title of the tweak on a per-TU basis. More specifically, some tweaks might want to have different titles for Objective-C actions compared to their C++ siblings.
Current design returns a constant string per tweak, but we can change that behaviour easily by making this a function of language options. You can take a look at `ClangdServer::enumerateTweaks` for details.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D65433





More information about the cfe-commits mailing list