Closed Bug 1535149 Opened 6 years ago Closed 2 months ago

[templates] Find references in dependent contexts

Categories

(Webtools :: Searchfox, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: botond, Assigned: nicolas.guichard)

References

(Blocks 1 open bug)

Details

STR:

Search for the callers of the AsyncTransform constructor declared on this line.

Expected results:

The call site on this line is found.

Actual results:

The call site in question is not found.

The omission is understandable, as the call site is dependent. Nonetheless, clang knows about the call sites in the template instantiations, and one could imagine Searchfox offering up the corresponding dependent calls as "potential callers", or something like that.

(To put this in context with bug 1453506: that's a situation where the dependent call is not useful as a search result, but the callers of that particular instantiation are. I think that's orthogonal, though; it would be fine if the dependent call showed up as a "potential result" in the bug 1453506 case as a result of a fix here.)

See Also: → 1453506
See Also: → 1441602
Summary: Find references in dependent contexts → [templates] Find references in dependent contexts
Blocks: 1905434

Your example isn't valid anymore (since you made the calling code non-dependent here).

I'm wondering if that was an instance of bug 1856762? If I search for mozilla::dom::WorkerPrivate::UpdateContextOptions for instance I do find a reference in a dependent context (a templated lambda in that case).

Indeed, it looks like this has significantly improved since the time of filing!

I looked around for some similar examples, and e.g. searching for callers of TestAsyncPanZoomController::ReceiveInputEvent does find dependent call sites like this one.

One case I found that still doesn't work is: a search for callers of DesktopFlingPhysics::Init should ideally find the dependent call site here. (This one doesn't work in the go-to-definition direction either, so it could be an issue specific to this form of call.)

(In reply to Botond Ballo [:botond] from comment #4)

One case I found that still doesn't work is: a search for callers of DesktopFlingPhysics::Init should ideally find the dependent call site here. (This one doesn't work in the go-to-definition direction either, so it could be an issue specific to this form of call.)

I had a quick look at the AST and the node type we have here is DependentScopeDeclRefExpr, so I suspect this would likely be fixed by bug 1835692.

Fixing bug 1835692 apparently wasn't enough, because the search for DesktopFlingPhysics::Init still doesn't return the call from GenericFlingAnimation::GenericFlingAnimation on searchfox.org.

But my other template-related changes seem to have fixed it: it is returned when searching on kdab.searchfox.org. Those changes landed on m-c last night, so are going to make their way to the main searchfox.org soon.

Oh that was probably because GenericFlingAnimation has a forward declaration here. So that was fixed by this commit.

Assignee: nobody → nicolas.guichard
Status: NEW → RESOLVED
Closed: 2 months ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.