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
Function reference not counted in codelens when on same line as definition #1889
Make sure you are able to repro it on the latest version
Search the existing issues.
Steps to reproduce
Create a function and invoke it on the same line. See image.
Expected behavior
Invocation is counted in codelens
Actual behavior
Invocation isn't counted in codelense.Go to reference detects the invocation as expected.
Error details
No response
Environment data
Name Value
---------
PSVersion 7.2.6
PSEdition Core
GitCommitId 7.2.6
OS Microsoft Windows 10.0.22000
Platform Win32NT
PSCompatibleVersions {1.0,2.0,3.0,4.0…}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0
Version
2022.8.2 preview
Visuals
This issue also means this will show 2 references in code lense because it counts the function-name in definition itself:
Add SymbolType.Command for CommandAst or more generic, extend SymbolReference with something like IsDefinition. The new prop or type would be applied here to identify that the commandsAst are references only. FindReferencesVisitor.VisitCommand(CommandAst)?
Activity
fflaten commentedon Aug 15, 2022
Problem is here where it only compares file and startline.
PowerShellEditorServices/src/PowerShellEditorServices/Services/CodeLens/ReferencesCodeLensProvider.cs
Lines 170 to 183 in 948dffe
Suggestions
Compare reference startcolumn not equalAdd
SymbolType.CommandforCommandAstor more generic, extendSymbolReferencewith something likeIsDefinition. The new prop or type would be applied here to identify that the commandsAst are references only. FindReferencesVisitor.VisitCommand(CommandAst)?andyleejordan commentedon Feb 2, 2023
I think fixed by #1984