Details
- Reviewers
ilya-biryukov
Diff Detail
- Build Status
Buildable 27056 Build 27055: arc lint + arc unit
Event Timeline
This is a somewhat simple action to illustrate the use of code action APIs.
Still missing tests and trying to figure out what information we want to expose in order to avoid walking over ASTs in each of the actions, so this is not final. Should be a good reference point for how the code of the action would look like, though.
Hi Ilya, I got here from reading your other patch (https://reviews.llvm.org/D56611). I'm wondering if we could make those range utility functions more understandable.
clangd/SourceCode.h | ||
---|---|---|
64 ↗ | (On Diff #181312) | It seems to me the range is actually closed on both sides. [begin of first token : end of last token] Wouldn't some name like toWholeTokenRange be easier to understand? |
81 ↗ | (On Diff #181312) | I'd find it helpful to mention that the range is actually interpreted as closed-open (knowing which half is which). |
clangd/SourceCode.h | ||
---|---|---|
64 ↗ | (On Diff #181312) | The range is supposed to be half-open to allow representing points as empty range starting at the specified position. My plan is to introduce a class to capture this abstraction, but let me see how the review goes. |
81 ↗ | (On Diff #181312) | Good point, will do. |
- Move to the monorepo
- Move out the source code helpers (they're now in swap-if-branches)
Is this for something like add const?
If yes, there is clang-tidy effort on that, see https://reviews.llvm.org/D54943 and https://reviews.llvm.org/D54395 for a similar effort. Would be best to share the code instead of reinventing it :)
No, this action is not about adding a type qualifier (like const or volatile), it adds a namespace qualifier, e.g.
using namespace std; vector<int> foo; // --> std::vector<int> foo;
Moreover, it's just an example to illustrate how one could write a simple action like that in clangd.
Update matching to use Inputs.ASTSelection.
Cover some more cases of names (I think?)
Handle under-qualified names as well as unqualified ones.
The main benefit of this is it's a step closer to extracting all references to
qualified/unqualified names from the selection.