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

Fix references on Windows due to slashes #1348

Conversation

TylerLeonhardt
Copy link
Member

@TylerLeonhardt TylerLeonhardt commented Aug 10, 2020

Fixes PowerShell/vscode-powershell#2810

So item.Path always contains forward slashes... this means that the paths returned on Windows will be mixed:

C:\Foo/Bar/baz.ps1

This result is used in counting references in CodeLens and C:\\Foo/Bar/baz.ps1 was being treated differently from C:\\Foo\\Bar\\baz.ps1 because they're just strings... https://github.com/PowerShell/PowerShellEditorServices/blob/master/src/PowerShellEditorServices/Services/Symbols/SymbolsService.cs#L200

this fixes the issue by fixing the directory separator...

... though in the future, it might be worth using FileInfo or something else in that ordered dictionary...

@TylerLeonhardt TylerLeonhardt merged commit 5463483 into PowerShell:master Aug 11, 2020
@TylerLeonhardt TylerLeonhardt deleted the fix-references-on-windows-due-to-slashes branch August 11, 2020 01:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

References are counted multiple times for similar named functions
2 participants