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

Codelens showing number of references twice! #90396

Closed
techsin opened this issue Feb 10, 2020 · 5 comments
Closed

Codelens showing number of references twice! #90396

techsin opened this issue Feb 10, 2020 · 5 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug typescript Typescript support issues verified Verification succeeded
Milestone

Comments

@techsin
Copy link

techsin commented Feb 10, 2020

  • VSCode Version: 1.42.0
  • OS Version: 10.15.2 Mac

Steps to Reproduce:

  1. Go to existing project with lot of dependencies.
  2. look at the class/func being declared. There will be small snippet at top telling you number of references you have.
  3. Need to have jsconfig.json and have codelens for js enabled.

Screen Shot 2020-02-10 at 4 54 25 PM

Is it normal behavior? do they tell two different things?

Does this issue occur when all extensions are disabled?: Yes

Tried with Insider as well

settings.json


 {
    "javascript.referencesCodeLens.showOnAllFunctions": true,
    "javascript.referencesCodeLens.enabled": true,
    "editor.formatOnSave": true
}

Left one is wrong since it counts the declaration as a reference too, maybe subjective but annoying for sure. It's not a new problem, I think I first noticed it in Sep 2019.

For Example:
Left one (wrong)
image

Right one (correct)
image

@mjbvz mjbvz self-assigned this Feb 10, 2020
@mjbvz
Copy link
Contributor

mjbvz commented Feb 11, 2020

Please share a complete, self contained code example (as text!)

@mjbvz mjbvz added the info-needed Issue requires more information from poster label Feb 11, 2020
@vscodebot vscodebot bot removed the new release label Feb 11, 2020
@techsin
Copy link
Author

techsin commented Feb 13, 2020

@techsin
Copy link
Author

techsin commented Feb 13, 2020

I've created the repo. Minimal. Turns out adding PropTypes to a function being exported is what triggers it. Hopefully that is of some importance.

@mjbvz mjbvz added this to the February 2020 milestone Feb 14, 2020
@mjbvz mjbvz added typescript Typescript support issues bug Issue identified by VS Code Team member as probable bug and removed info-needed Issue requires more information from poster labels Feb 14, 2020
@mjbvz
Copy link
Contributor

mjbvz commented Feb 15, 2020

Thanks @techsin! Very simple repo:

function A() {
  console.log("hi");
}

A.x = {};

@mjbvz mjbvz closed this as completed in 8503705 Feb 15, 2020
@techsin
Copy link
Author

techsin commented Feb 15, 2020

Thanks for quick action

@alexr00 alexr00 added the verified Verification succeeded label Feb 27, 2020
@github-actions github-actions bot locked and limited conversation to collaborators Mar 31, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug typescript Typescript support issues verified Verification succeeded
Projects
None yet
Development

No branches or pull requests

3 participants