Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Find all references" on a file scope symbol returns extra results #7702

Closed
michelleangela opened this issue Jun 16, 2021 · 3 comments
Closed
Assignees
Labels
bug Feature: Find All References Find All References, Peek References, Rename fixed Check the Milestone for the release in which the fix is or will be available. Language Service quick fix

Comments

@michelleangela
Copy link
Contributor

Bug type: Language Service

Describe the bug

  • OS and Version: Windows 10
  • VS Code Version: 1.57.0
  • C/C++ Extension Version: 1.4.0 and 1.5.0-insiders
  • A clear and concise description of what the bug is, including information about the workspace (i.e. is the workspace a single project or multiple projects, size of the project, etc).

Code sample
main.cpp

int var1;

int func1()
{
    if (var1 == 0)
        return 0;
    return 1;
}

test.cpp

void myfunction(int var1, int var2, int var3)
{
}

Steps to reproduce

  1. Create the two provided sample files.
  2. Do a "find all references" on symbol var1 in file main.cpp.
  3. Observe results also includes symbol from test.cpp that is not true reference of var1.

Does not reproduce on Visual Studio.

@michelleangela michelleangela added Language Service Feature: Find All References Find All References, Peek References, Rename bug labels Jun 16, 2021
@michelleangela michelleangela added this to the 1.6.0 milestone Jun 16, 2021
@sean-mcmanus sean-mcmanus self-assigned this Jun 16, 2021
@sean-mcmanus
Copy link
Collaborator

sean-mcmanus commented Jun 16, 2021

There's a similar bug on VS at https://developercommunity.visualstudio.com/t/c-intellisense-find-all-references-confirms-refere/1014321, but the difference is that VS is differentiating between the references that are local to the function and global, e.g. a simpler repro with one file is:

int test;
int func(int test){}

@michelleangela
Copy link
Contributor Author

Is this bug on VS then?

@sean-mcmanus
Copy link
Collaborator

No. I may have a fix soon...

@sean-mcmanus sean-mcmanus modified the milestones: 1.6.0, 1.5.0-insiders2 Jun 16, 2021
@sean-mcmanus sean-mcmanus added the fixed Check the Milestone for the release in which the fix is or will be available. label Jun 17, 2021
@github-actions github-actions bot locked and limited conversation to collaborators Aug 6, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Feature: Find All References Find All References, Peek References, Rename fixed Check the Milestone for the release in which the fix is or will be available. Language Service quick fix
Projects
None yet
Development

No branches or pull requests

2 participants