File tree Expand file tree Collapse file tree 2 files changed +33
-0
lines changed
test/PowerShellEditorServices.Test.Host Expand file tree Collapse file tree 2 files changed +33
-0
lines changed Original file line number Diff line number Diff line change @@ -485,6 +485,36 @@ await this.SendRequest(
485
485
Assert . Equal ( 20 , locations [ 0 ] . Range . End . Character ) ;
486
486
}
487
487
488
+ [ Fact ]
489
+ public async Task FindDefinitionOfVariableWithSpecialChars ( )
490
+ {
491
+ await this . SendOpenFileEvent ( "TestFiles\\ FindReferences.ps1" ) ;
492
+
493
+ Location [ ] locations =
494
+ await this . SendRequest (
495
+ DefinitionRequest . Type ,
496
+ new TextDocumentPositionParams
497
+ {
498
+ TextDocument = new TextDocumentIdentifier
499
+ {
500
+ Uri = "TestFiles\\ FindReferences.ps1"
501
+ } ,
502
+ Position = new Position
503
+ {
504
+ Line = 18 ,
505
+ Character = 24 ,
506
+ }
507
+ } ) ;
508
+
509
+ Assert . NotNull ( locations ) ;
510
+ Assert . Equal ( 1 , locations . Length ) ;
511
+ Assert . EndsWith ( "FindReferences.ps1" , locations [ 0 ] . Uri ) ;
512
+ Assert . Equal ( 17 , locations [ 0 ] . Range . Start . Line ) ;
513
+ Assert . Equal ( 0 , locations [ 0 ] . Range . Start . Character ) ;
514
+ Assert . Equal ( 17 , locations [ 0 ] . Range . End . Line ) ;
515
+ Assert . Equal ( 27 , locations [ 0 ] . Range . End . Character ) ;
516
+ }
517
+
488
518
[ Fact ]
489
519
public async Task FindsOccurencesOnFunctionDefinition ( )
490
520
{
Original file line number Diff line number Diff line change @@ -14,3 +14,6 @@ Write-Output ""
14
14
15
15
. .\VariableDefinition.ps1
16
16
Write-Output $variableInOtherFile
17
+
18
+ ${variable-with-weird-name} = " this variable has special characters"
19
+ Write-Output ${variable-with-weird-name}
You can’t perform that action at this time.
0 commit comments