Completion replies contains textEdits as well. Note that this change
relies on https://reviews.llvm.org/D50443.
Details
Diff Detail
- Repository
- rCTE Clang Tools Extra
- Build Status
Buildable 21320 Build 21320: arc lint + arc unit
Event Timeline
clangd/CodeComplete.cpp | ||
---|---|---|
289 | We shouldn't have duplicate/overlapping fix-its, right? Maybe use std::sort? | |
291 | use built-in tuples comparison std::tie(X.line, X.column) < std::tie(Y.line, Y.column)? | |
1056 | Maybe add a comment describing the cases where isValid() is false? | |
1314 | Maybe keep the reserve call? (we could reserve one extra element, but that's fine) | |
clangd/CodeComplete.h | ||
126 | Could we avoid adding textEdit here? | |
unittests/clangd/SourceCodeTests.cpp | ||
40 | we convert those uint64_t into int when setting the positions anyway. |
clangd/CodeComplete.cpp | ||
---|---|---|
1314 | 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 | ||
---|---|---|
1314 | 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. |
Could we avoid adding textEdit here?
It's an intermediate representation that is only used in clangd, and we should be able materialize the actual textEdit when converting to LSP.