Closed hotpxl closed 7 years ago
Should be fixed, let me know if that's ok for you.
Just a thought,
it would be nice if this information could be shown on mouse over with C-h f tooltip-show RET
.
Great. It works now! I wonder that's doable. Since getting type information still takes around one second on my computer. I wonder if that's going to freeze the GUI.
Agreed, but out of curiosity, do you use flycheck?
I assume when the mouse is in use, it's because the keyboard is less so. Flycheck would already have reparsed the file eventually. In any way this would not be done automatically by default.
Yes. But in flycheck, the tooltip show if you put "keyboard caret" on the location. I think you want a mouse hover over behavior. I wonder if that is the same. Also flycheck parse the file ones and reuse that information to display everything. But in our case, we cannot simply calculate every type of every symbol in the file. We need to use a "incremental compiler" or a compilation database, instead of clang I think. I don't know if clang does any level of caching. Otherwise it would take too long.
For flycheck there are actually 2 operations going on:
For get-type, there are also 2 operations:
So with something like flycheck it will be quite cheap already, and without flycheck one can just do it asynchronously.
I know gdb gives a tooltip information about the value of variables when hovering, I find this useful, that's why I was thinking about this.
I guess this is doable then. Another possible improvement I can think of right now, is that the type returned by clang is not always friendly. On one hand, templates often have many more default parameters that eventually show up in get-type. On the other, implementation types also leak out to get-type. I wonder if it could be simplified somehow.
Looks like the merge with iotask-engine is the cause. I don't have time yet to find the source of the problem and wonder if you knew anything about it