Open
Bug 1491719
Opened 7 years ago
Updated 1 year ago
"Go to definition" option is missing for uses of IAPZCTreeManager::InputBridge()
Categories
(Webtools :: Searchfox, defect)
Webtools
Searchfox
Tracking
(Not tracked)
NEW
People
(Reporter: botond, Unassigned)
Details
STR:
1. Go to a use of IAPZCTreeManager::InputBridge(), such as
[1] or [2].
2. Click on "InputBridge".
Expected results:
There is a "Go to definition" entry in the menu that comes up.
Actual results:
The entry is missing.
[1] https://searchfox.org/mozilla-central/rev/bdc89dfd7869e418d788b28eb60ab8d94e708a15/widget/nsBaseWidget.cpp#1169
[2] https://searchfox.org/mozilla-central/rev/bdc89dfd7869e418d788b28eb60ab8d94e708a15/gfx/layers/ipc/APZInputBridgeParent.cpp#39
| Reporter | ||
Comment 1•7 years ago
|
||
(In reply to Botond Ballo [:botond] from comment #0)
> [1]
> https://searchfox.org/mozilla-central/rev/
> bdc89dfd7869e418d788b28eb60ab8d94e708a15/widget/nsBaseWidget.cpp#1169
> [2]
> https://searchfox.org/mozilla-central/rev/
> bdc89dfd7869e418d788b28eb60ab8d94e708a15/gfx/layers/ipc/APZInputBridgeParent.
> cpp#39
Whoops, I didn't mean to make those permalinks, since the permalink version of the page doesn't have cross-references.
[1] https://searchfox.org/mozilla-central/source/widget/nsBaseWidget.cpp#1169
[2] https://searchfox.org/mozilla-central/source/gfx/layers/ipc/APZInputBridgeParent.cpp#39
Comment 2•7 years ago
|
||
Which line of code should the "go to definition" take you to?
| Reporter | ||
Comment 3•7 years ago
|
||
I was thinking of [1].
I do realize, now that you mention it, that that's not actually a definition.
My expectation stems mostly from my experience with other tools that provide a "go to definition" or similar feature for C++, such as Eclipse CDT, and CQuery's implementation of the Language Server Protocol, where the behaviour is the following:
- If an entity has a separate declaration and definition:
- invoking the command at a use navigates to the
definition
- invoking the command at the declaration or definition
navigates to the other
- If an entity has only a declaration (like this case),
invoking the command at a use navigates to it.
Navigation to a non-defining declaration is useful because that's typically the location of the comment describing the entity's interface.
It would be useful if Searchfox behaved in this way too, but I realize now that that's more of a feature request than a sepcific bug about this function, so please feel free to re-title or close this bug, as you prefer.
[1] https://searchfox.org/mozilla-central/rev/0b8ed772d24605d7cb44c1af6d59e4ca023bd5f5/gfx/layers/apz/public/IAPZCTreeManager.h#137
| Reporter | ||
Comment 4•7 years ago
|
||
(In reply to Botond Ballo [:botond] from comment #3)
> Navigation to a non-defining declaration is useful because that's typically
> the location of the comment describing the entity's interface.
And the values of default arguments, if any.
Comment 5•7 years ago
|
||
Right now the searchfox logic for generating "Go to definition" entries is described at https://github.com/mozsearch/mozsearch/blob/master/docs/crossref.md#jumps-file - if there were a single definition the entry would appear. However in this case there are two definitions and one declaration. So maybe we can augment the logic to cover that case - if there isn't exactly one definition, but there is exactly one declaration, we can have a "Go to declaration" entry in the context menu that jumps to it.
You need to log in
before you can comment on or make changes to this bug.
Description
•