-
-
Notifications
You must be signed in to change notification settings - Fork 787
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow renaming of variables inside bit array segments
- Loading branch information
1 parent
ab1abe1
commit 33ef3d7
Showing
7 changed files
with
230 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
...m_core__language_server__tests__rename__rename_local_variable_from_bit_array_pattern.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
--- | ||
source: compiler-core/src/language_server/tests/rename.rs | ||
expression: "\npub fn starts_with(bits: BitArray, prefix: BitArray) -> Bool {\n let prefix_size = bit_size(prefix)\n\n case bits {\n <<pref:bits-size(prefix_size), _:bits>> if pref == prefix -> True\n _ -> False\n }\n}\n" | ||
--- | ||
----- BEFORE RENAME | ||
|
||
pub fn starts_with(bits: BitArray, prefix: BitArray) -> Bool { | ||
let prefix_size = bit_size(prefix) | ||
|
||
case bits { | ||
<<pref:bits-size(prefix_size), _:bits>> if pref == prefix -> True | ||
↑ | ||
_ -> False | ||
} | ||
} | ||
|
||
|
||
----- AFTER RENAME | ||
|
||
pub fn starts_with(bits: BitArray, prefix: BitArray) -> Bool { | ||
let size_of_prefix = bit_size(prefix) | ||
|
||
case bits { | ||
<<pref:bits-size(size_of_prefix), _:bits>> if pref == prefix -> True | ||
_ -> False | ||
} | ||
} |
27 changes: 27 additions & 0 deletions
27
...eam_core__language_server__tests__rename__rename_local_variable_in_bit_array_pattern.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
--- | ||
source: compiler-core/src/language_server/tests/rename.rs | ||
expression: "\npub fn starts_with(bits: BitArray, prefix: BitArray) -> Bool {\n let prefix_size = bit_size(prefix)\n\n case bits {\n <<pref:bits-size(prefix_size), _:bits>> if pref == prefix -> True\n _ -> False\n }\n}\n" | ||
--- | ||
----- BEFORE RENAME | ||
|
||
pub fn starts_with(bits: BitArray, prefix: BitArray) -> Bool { | ||
let prefix_size = bit_size(prefix) | ||
↑ | ||
|
||
case bits { | ||
<<pref:bits-size(prefix_size), _:bits>> if pref == prefix -> True | ||
_ -> False | ||
} | ||
} | ||
|
||
|
||
----- AFTER RENAME | ||
|
||
pub fn starts_with(bits: BitArray, prefix: BitArray) -> Bool { | ||
let size_of_prefix = bit_size(prefix) | ||
|
||
case bits { | ||
<<pref:bits-size(size_of_prefix), _:bits>> if pref == prefix -> True | ||
_ -> False | ||
} | ||
} |