vscode-cpptools icon indicating copy to clipboard operation
vscode-cpptools copied to clipboard

Find references doesn't find struct member initializers

Open smoofra opened this issue 5 years ago • 5 comments

Type: LanguageService

Describe the bug

  • OS and Version: Mac OS Catalina
  • VS Code Version: 1.37.1
  • C/C++ Extension Version: 0.25.1

To Reproduce

struct foo { 
    int some_field;
};

void bar() { 
    struct foo x = {
        .some_field = 1
    };
    x.some_field = 2;
}
  1. Invoke "Find All References" on some_field in line 2
  2. It will find the assignment (line 9), but not the initializer (line 7)

Expected behavior Find references should have found both references to some_field

It should also be able to find

struct foo x = {1};

smoofra avatar Aug 30 '19 20:08 smoofra