-
Notifications
You must be signed in to change notification settings - Fork 230
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
References CodeLens provider does not show indicators in Untitled files #507
Comments
Thanks man! This is because we're checking the file extension to see if it ends with .tests.ps1 before returning symbols, but maybe we should support authoring in untitled files too. However, now that I think about it, you can't run a Pester test without it being saved to a file... This does actually affect the References CodeLens provider though, so I'll make a fix for that. |
You can F5 the file before saving and it runs the tests. |
@daviwil do you think you could elaborate on how it affects the References CodeLens provider? |
@tylerl0706 This if statement needs to support untitled tabs that contain PowerShell. The main difficulty would be determining that it's definitely PowerShell. Trying to run that on untitled tabs with different languages could cause some nasty unexpected issues. |
This change adds support for CodeLenses that display the number of references of a given function or cmdlet defined in a script file. The actual implementation of this behavior is on the server side but we had to write a LanguageClient middleware to translate the arguments of the references command when it was sent from the server. Resolves PowerShell#507 Resolves PowerShell#827 (unrelated to CodeLenses but related to LanguageClient output)
Status: Ready to close? Code lens appears after #1098. Command references in untitled documents (with PowerShell language set) are counted since #1917 (included in vscode-powershell v2022.9.0) Pester code lens ( $c = New-PesterConfiguration
$containers = (New-PesterContainer -Data @{ abc = 'def' } -ScriptBlock {
Describe 'd1' {
Context '123' {
It 'a' -Tag 'a.d' { 1 | should -be 1 }
It 'b' -Tag 'a.d' { 1 | should -be 1 } -Skip
}
}
})
$c.Run.Container = $containers
$r = Invoke-Pester -Configuration $c |
You need to save the file and then the indicators appear above the
Describe
statement.The text was updated successfully, but these errors were encountered: