ArcsinX wrote:

> It does get printed later at E level (we let it get re-checked
> 
> https://github.com/llvm/llvm-project/blob/0e6d57648584c3895abd3021fb8fa2a767146d5a/clang-tools-extra/clangd/CodeComplete.cpp#L2307-L2311
> 
> )
> Here's the output of the patched version when this issue is triggered:
> 
> ```
> I[17:38:38.534] <-- textDocument/completion(1)
> V[17:38:38.534] could not convert position '97:0' to offset for file 
> '/tmp/test.cpp'
> E[17:38:38.534] Code completion position was invalid Line value is out of 
> range (97)
> I[17:38:38.534] --> reply:textDocument/completion(1) 0 ms
> ```

Oh, got it.
I haven't looked at this in detail, but does it make sense to return true in 
shouldRunCompletion() if the offset is incorrect? If we return `false` in 
`shouldRunCompletion()`, we can return an empty result for completion earlier. 
But in that case, the `vlog` will have to be replaced with `elog`.

https://github.com/llvm/llvm-project/pull/196112
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to