You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Show JS/TS References Code Lens for Inner Functions #22981
createTypeChecker is our main container function in this file, I would expect inner functions in it to have reference counts, e.g. function getJsxNamesace; it is worth noting that enums inside this function are marked, e.g. const enum TypeSystemPropertyName.
For locals, I am not so sure, but for example, const emptyArray = [] this is more of a global/static variable for this function.
Reacted by Roman Dibikhin, Brian LaLonde, LGFN and Hooponopono
We want a new setting that lets you see references on non-exported functions too. You should also see if there's a way for us to be smarted about knowing which functions to show references on and which not to
You can verify by looking at some real world code and confirming the code lens shows up when expected. The TypeScript project for example uses nested functions pretty heavily
Activity
dhairyanadapara commentedon Oct 27, 2019
Matt Bierner (@mjbvz) I want to work on this issue. Can you please give me a few tips for the solution?
mjbvz commentedon Oct 31, 2019
Here's the file that implements the references code lens
The main point of interest is where it decides if a symbol should show references or not (note the check for
export):vscode/extensions/typescript-language-features/src/features/referencesCodeLens.ts
Line 67 in f452455
We want a new setting that lets you see references on non-exported functions too. You should also see if there's a way for us to be smarted about knowing which functions to show references on and which not to
dhairyanadapara commentedon Nov 2, 2019
Matt Bierner (@mjbvz) can you please provide how I can verify the change? Any way I can get the
navtree?mjbvz commentedon Nov 2, 2019
You can verify by looking at some real world code and confirming the code lens shows up when expected. The TypeScript project for example uses nested functions pretty heavily
alexr00 commentedon Dec 4, 2019
Verified that inner functions get a reference code lens when
typescript.referencesCodeLens.showOnAllFunctionsis true.