Closed 0xb0b closed 4 years ago
From the log, I can see that the request to the server is sent upon expansion. But there is no answer.
Additional debug logs show the root cause. The filetype field in the provider dictionary is empty.
The filetype is "cpp" when the CclsCallHierarchy initial call is made. However, &filetype
becomes empty in handle_tree
when the first response is handled. So all the subsequent requests fail. Apparently, as it is stated in the comment:
" Send an LSP request. Mock a source file if necessary, since
" some LSP clients accept calls only from within a source file.
I do not know the reason why the filetype is empty in the handler.
I could resolve the issue by adding the additional filetype parameter to handle_tree
and passing filetype in ccls#messages#call_hierarchy
. Then in handle_tree
, it is saved in the dictionary instead of &filetype
.
Hi @0xb0b, thanks for the detailed report and the analysis. I was able to reproduce the issue, and I think your conclusions are correct. The handler is vulnerable to timing issues.
You could please try #25 and check if it fixes the problem for you.
Yes, #25 resolves the problem. Thanks for the fix.
Steps to reproduce
Expected behavior
the node is expanded on the next level
Actual behavior
node is not expanded
Environment