@@ -3489,6 +3489,52 @@ namespace ts.projectSystem {
3489
3489
} ) ;
3490
3490
} ) ;
3491
3491
3492
+ describe ( "occurence highlight on string" , ( ) => {
3493
+ it ( "should be marked if only on string values" , ( ) => {
3494
+ const file1 : FileOrFolder = {
3495
+ path : "/a/b/file1.ts" ,
3496
+ content : `let t1 = "div";\nlet t2 = "div";\nlet t3 = { "div": 123 };\nlet t4 = t3["div"];`
3497
+ } ;
3498
+
3499
+ const host = createServerHost ( [ file1 ] ) ;
3500
+ const session = createSession ( host ) ;
3501
+ const projectService = session . getProjectService ( ) ;
3502
+
3503
+ projectService . openClientFile ( file1 . path ) ;
3504
+ {
3505
+ const highlightRequest = makeSessionRequest < protocol . FileLocationRequestArgs > (
3506
+ CommandNames . Occurrences ,
3507
+ { file : file1 . path , line : 1 , offset : 11 }
3508
+ ) ;
3509
+ const highlightResponse = session . executeCommand ( highlightRequest ) . response as protocol . OccurrencesResponseItem [ ] ;
3510
+ const firstOccurence = highlightResponse [ 0 ] ;
3511
+ assert . isTrue ( firstOccurence . isInString , "Highlights should be marked with isInString" ) ;
3512
+ }
3513
+
3514
+ {
3515
+ const highlightRequest = makeSessionRequest < protocol . FileLocationRequestArgs > (
3516
+ CommandNames . Occurrences ,
3517
+ { file : file1 . path , line : 3 , offset : 13 }
3518
+ ) ;
3519
+ const highlightResponse = session . executeCommand ( highlightRequest ) . response as protocol . OccurrencesResponseItem [ ] ;
3520
+ assert . isTrue ( highlightResponse . length === 2 ) ;
3521
+ const firstOccurence = highlightResponse [ 0 ] ;
3522
+ assert . isUndefined ( firstOccurence . isInString , "Highlights should not be marked with isInString if on property name" ) ;
3523
+ }
3524
+
3525
+ {
3526
+ const highlightRequest = makeSessionRequest < protocol . FileLocationRequestArgs > (
3527
+ CommandNames . Occurrences ,
3528
+ { file : file1 . path , line : 4 , offset : 14 }
3529
+ ) ;
3530
+ const highlightResponse = session . executeCommand ( highlightRequest ) . response as protocol . OccurrencesResponseItem [ ] ;
3531
+ assert . isTrue ( highlightResponse . length === 2 ) ;
3532
+ const firstOccurence = highlightResponse [ 0 ] ;
3533
+ assert . isUndefined ( firstOccurence . isInString , "Highlights should not be marked with isInString if on indexer" ) ;
3534
+ }
3535
+ } ) ;
3536
+ } ) ;
3537
+
3492
3538
describe ( "maxNodeModuleJsDepth for inferred projects" , ( ) => {
3493
3539
it ( "should be set to 2 if the project has js root files" , ( ) => {
3494
3540
const file1 : FileOrFolder = {
0 commit comments