[clang-tools-extra] [clangd] Fix crash on completion with out-of-range position (PR #196112)

Krzysztof Jędruczyk via cfe-commits cfe-commits at lists.llvm.org
Thu May 7 05:45:56 PDT 2026


kjedruczyk wrote:

One side effect of this will be diagnostics claiming the reason for empty results:

```
I[13:39:49.018] <-- textDocument/completion(1)
E[13:39:49.018] could not convert position '97:0' to offset for file '/tmp/test.cpp': Line value is out of range (97)
V[13:39:49.018] ignored auto-triggered completion, preceding char did not match
I[13:39:49.018] --> reply:textDocument/completion(1) 0 ms
```

I assume we are fine with 'ignored auto-triggered completion, preceding char did not match' line - with the error logged it should be clear what happened.

https://github.com/llvm/llvm-project/pull/196112


More information about the cfe-commits mailing list