@@ -1739,42 +1739,47 @@ describe('server', () => {
17391739 // These may fail in the future when tree-sitter-bash's parsing gets better
17401740 // or when the rename symbol implementation is improved.
17411741 describe ( 'Edge or not covered cases' , ( ) => {
1742- it ( 'does not include variables inside let and arithmetic expressions ' , async ( ) => {
1742+ it ( 'only includes variables typed as variable_name ' , async ( ) => {
17431743 const iRanges = await getFirstChangeRanges ( getRenameRequestResult ( 106 , 4 ) )
1744- // This should be 6 if all instances are included.
1744+ // This should be 6 if all instances within let and arithmetic
1745+ // expressions are included.
17451746 expect ( iRanges . length ) . toBe ( 2 )
1747+
1748+ const lineRanges = await getFirstChangeRanges ( getRenameRequestResult ( 118 , 10 ) )
1749+ // This should be 2 if the declaration of `line` is included.
1750+ expect ( lineRanges . length ) . toBe ( 1 )
17461751 } )
17471752
17481753 it ( 'includes incorrect number of symbols for complex scopes and nesting' , async ( ) => {
1749- const varRanges = await getFirstChangeRanges ( getRenameRequestResult ( 118 , 8 ) )
1754+ const varRanges = await getFirstChangeRanges ( getRenameRequestResult ( 124 , 8 ) )
17501755 // This should only be 2 if `$var` from `3` is not included.
17511756 expect ( varRanges . length ) . toBe ( 3 )
17521757
1753- const localFuncRanges = await getFirstChangeRanges ( getRenameRequestResult ( 138 , 5 ) )
1758+ const localFuncRanges = await getFirstChangeRanges ( getRenameRequestResult ( 144 , 5 ) )
17541759 // This should be 2 if the instance of `localFunc` in `callerFunc` is
17551760 // also included.
17561761 expect ( localFuncRanges . length ) . toBe ( 1 )
17571762 } )
17581763
17591764 it ( 'only takes into account subshells created with ( and )' , async ( ) => {
17601765 const pipelinevarRanges = await getFirstChangeRanges (
1761- getRenameRequestResult ( 144 , 7 ) ,
1766+ getRenameRequestResult ( 150 , 7 ) ,
17621767 )
17631768 // This should only be 1 if pipeline subshell scoping is recognized.
17641769 expect ( pipelinevarRanges . length ) . toBe ( 2 )
17651770 } )
17661771
17671772 it ( 'does not take into account sourcing location and scope' , async ( ) => {
1768- const FOOUris = await getChangeUris ( getRenameRequestResult ( 148 , 8 ) )
1773+ const FOOUris = await getChangeUris ( getRenameRequestResult ( 154 , 8 ) )
17691774 // This should only be 1 if sourcing after a symbol does not affect it.
17701775 expect ( FOOUris . length ) . toBe ( 2 )
17711776
1772- const hello_worldUris = await getChangeUris ( getRenameRequestResult ( 154 , 6 ) )
1777+ const hello_worldUris = await getChangeUris ( getRenameRequestResult ( 160 , 6 ) )
17731778 // This should only be 1 if sourcing inside an uncalled function does
17741779 // not affect symbols outside of it.
17751780 expect ( hello_worldUris . length ) . toBe ( 2 )
17761781
1777- const PATH_INPUTUris = await getChangeUris ( getRenameRequestResult ( 157 , 9 ) )
1782+ const PATH_INPUTUris = await getChangeUris ( getRenameRequestResult ( 163 , 9 ) )
17781783 // This should only be 1 if sourcing inside a subshell does not affect
17791784 // symbols outside of it.
17801785 expect ( PATH_INPUTUris . length ) . toBe ( 2 )
0 commit comments