Completion replies contains textEdits as well. Note that this change
relies on https://reviews.llvm.org/D50443.
Details
Diff Detail
- Repository
- rL LLVM
Event Timeline
clangd/CodeComplete.cpp | ||
---|---|---|
289 ↗ | (On Diff #159712) | We shouldn't have duplicate/overlapping fix-its, right? Maybe use std::sort? |
291 ↗ | (On Diff #159712) | use built-in tuples comparison std::tie(X.line, X.column) < std::tie(Y.line, Y.column)? |
1057 ↗ | (On Diff #159712) | Maybe add a comment describing the cases where isValid() is false? |
1310 ↗ | (On Diff #159712) | Maybe keep the reserve call? (we could reserve one extra element, but that's fine) |
clangd/CodeComplete.h | ||
126 ↗ | (On Diff #159712) | Could we avoid adding textEdit here? |
unittests/clangd/SourceCodeTests.cpp | ||
40 ↗ | (On Diff #159712) | we convert those uint64_t into int when setting the positions anyway. |
clangd/CodeComplete.cpp | ||
---|---|---|
1310 ↗ | (On Diff #159712) | Actually we could have much more than one extra element, not for the current situation but may be in the future when we have more fixit completions. |
LGTM. Thanks for the change!
Could we add an option to clangd to switch it on? (VSCode does not work, but our hacked-up ycm integration seems to work, right?)
clangd/CodeComplete.cpp | ||
---|---|---|
1310 ↗ | (On Diff #159712) | We can't have more than one edit adjacent to the completion identifier, right? Otherwise they'll conflict. But I'm not too worried about leaving out the reserve call either. At the very worst we could waste some memory on a single completion item, but we shouldn't keep too many around at the same time anyway, so feel free to ignore this one. |