@@ -1739,42 +1739,47 @@ describe('server', () => {
1739
1739
// These may fail in the future when tree-sitter-bash's parsing gets better
1740
1740
// or when the rename symbol implementation is improved.
1741
1741
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 ( ) => {
1743
1743
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.
1745
1746
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 )
1746
1751
} )
1747
1752
1748
1753
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 ) )
1750
1755
// This should only be 2 if `$var` from `3` is not included.
1751
1756
expect ( varRanges . length ) . toBe ( 3 )
1752
1757
1753
- const localFuncRanges = await getFirstChangeRanges ( getRenameRequestResult ( 138 , 5 ) )
1758
+ const localFuncRanges = await getFirstChangeRanges ( getRenameRequestResult ( 144 , 5 ) )
1754
1759
// This should be 2 if the instance of `localFunc` in `callerFunc` is
1755
1760
// also included.
1756
1761
expect ( localFuncRanges . length ) . toBe ( 1 )
1757
1762
} )
1758
1763
1759
1764
it ( 'only takes into account subshells created with ( and )' , async ( ) => {
1760
1765
const pipelinevarRanges = await getFirstChangeRanges (
1761
- getRenameRequestResult ( 144 , 7 ) ,
1766
+ getRenameRequestResult ( 150 , 7 ) ,
1762
1767
)
1763
1768
// This should only be 1 if pipeline subshell scoping is recognized.
1764
1769
expect ( pipelinevarRanges . length ) . toBe ( 2 )
1765
1770
} )
1766
1771
1767
1772
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 ) )
1769
1774
// This should only be 1 if sourcing after a symbol does not affect it.
1770
1775
expect ( FOOUris . length ) . toBe ( 2 )
1771
1776
1772
- const hello_worldUris = await getChangeUris ( getRenameRequestResult ( 154 , 6 ) )
1777
+ const hello_worldUris = await getChangeUris ( getRenameRequestResult ( 160 , 6 ) )
1773
1778
// This should only be 1 if sourcing inside an uncalled function does
1774
1779
// not affect symbols outside of it.
1775
1780
expect ( hello_worldUris . length ) . toBe ( 2 )
1776
1781
1777
- const PATH_INPUTUris = await getChangeUris ( getRenameRequestResult ( 157 , 9 ) )
1782
+ const PATH_INPUTUris = await getChangeUris ( getRenameRequestResult ( 163 , 9 ) )
1778
1783
// This should only be 1 if sourcing inside a subshell does not affect
1779
1784
// symbols outside of it.
1780
1785
expect ( PATH_INPUTUris . length ) . toBe ( 2 )
0 commit comments