Skip to content

Find All References doesn't find references to function overrides in derived classes #4078

@rajabala

Description

@rajabala

If I use 'FindAllReferences' on the (pure) virtual Sync below, I don't get references to the usage in the derived classes. Make it virtual (i.e., not pure) doesn't help either.
It's really helpful to find all references to overrides of a base class method, and I'm not sure if FindAllReferences is the tool for this or not. If this is possible in vscode today, I'd love to know how!

#include <iostream>
#include <memory>
using namespace std;

class Task {
public:
    virtual void Sync() = 0;
};
class FooTask : public Task {
    void Sync() override {
        cout << "Foo:Sync" << endl;
    }
};
class BarTask : public Task {
    void Sync() override {
        cout << "Bar:Sync" << endl;
    }
};

int main()
{
    typedef std::shared_ptr<class Task> TaskSharedPtr;

    TaskSharedPtr tasks[2] = {make_shared<FooTask>(), make_shared<BarTask>()};
    tasks[0]->Sync();
    tasks[1]->Sync();

    return 0;
}

image

  • OS and Version: RHEL 3.10.0-957.21.3.el7.x86_64
  • VS Code Version: 1.34.0
  • C/C++ Extension Version: 0.25.0-insiders

Metadata

Metadata

Assignees

No one assigned

    Labels

    Feature: Find All ReferencesFind All References, Peek References, RenameLanguage ServiceWorks in VSSo we'd need to fix it for VS Code to reach parity.bugfixedCheck the Milestone for the release in which the fix is or will be available.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions