Avatar for the FuelLabs user
FuelLabs
sway
BlogDocsChangelog

Add `#[abi_name(name = "foo")]` attribute to rename ABI items.

#7057
Comparing
tritao:annotation-abi-name
(
ec8d86b
) with
master
(
804d6df
)
CodSpeed Performance Gauge
0%
Improvements
0
Regressions
0
Untouched
22
New
0
Dropped
0
Ignored
0

Benchmarks

Passed

format
sway-lsp/benches/lsp_benchmarks/requests.rs::benches::benchmarks::format
CodSpeed Performance Gauge
+2%
480.2 ms
472.8 ms
code_lens
sway-lsp/benches/lsp_benchmarks/requests.rs::benches::benchmarks::code_lens
CodSpeed Performance Gauge
+1%
5.5 µs
5.4 µs
hover
sway-lsp/benches/lsp_benchmarks/requests.rs::benches::benchmarks::hover
CodSpeed Performance Gauge
+1%
4.9 ms
4.9 ms
compile
sway-lsp/benches/lsp_benchmarks/compile.rs::benches::benchmarks::compile
CodSpeed Performance Gauge
0%
5.5 s
5.5 s
code_action
sway-lsp/benches/lsp_benchmarks/requests.rs::benches::benchmarks::code_action
CodSpeed Performance Gauge
0%
8.4 ms
8.4 ms
did_change_with_caching
sway-lsp/benches/lsp_benchmarks/compile.rs::benches::benchmarks::did_change_with_caching
CodSpeed Performance Gauge
0%
3.8 ms
3.8 ms
inlay_hints
sway-lsp/benches/lsp_benchmarks/requests.rs::benches::benchmarks::inlay_hints
CodSpeed Performance Gauge
0%
2.2 ms
2.2 ms
idents_at_position
sway-lsp/benches/lsp_benchmarks/token_map.rs::benches::benchmarks::idents_at_position
CodSpeed Performance Gauge
0%
466.5 µs
466.5 µs
parent_decl_at_position
sway-lsp/benches/lsp_benchmarks/token_map.rs::benches::benchmarks::parent_decl_at_position
CodSpeed Performance Gauge
0%
3.1 ms
3.1 ms
tokens_at_position
sway-lsp/benches/lsp_benchmarks/token_map.rs::benches::benchmarks::tokens_at_position
CodSpeed Performance Gauge
0%
3.1 ms
3.1 ms
completion
sway-lsp/benches/lsp_benchmarks/requests.rs::benches::benchmarks::completion
CodSpeed Performance Gauge
0%
5.3 ms
5.3 ms
goto_definition
sway-lsp/benches/lsp_benchmarks/requests.rs::benches::benchmarks::goto_definition
CodSpeed Performance Gauge
0%
1.7 ms
1.7 ms
prepare_rename
sway-lsp/benches/lsp_benchmarks/requests.rs::benches::benchmarks::prepare_rename
CodSpeed Performance Gauge
0%
1.7 ms
1.7 ms
token_at_position
sway-lsp/benches/lsp_benchmarks/token_map.rs::benches::benchmarks::token_at_position
CodSpeed Performance Gauge
0%
1.7 ms
1.7 ms
tokens_for_file
sway-lsp/benches/lsp_benchmarks/token_map.rs::benches::benchmarks::tokens_for_file
CodSpeed Performance Gauge
0%
1.7 ms
1.7 ms
highlight
sway-lsp/benches/lsp_benchmarks/requests.rs::benches::benchmarks::highlight
CodSpeed Performance Gauge
0%
5.8 ms
5.9 ms
find_all_references
sway-lsp/benches/lsp_benchmarks/requests.rs::benches::benchmarks::find_all_references
CodSpeed Performance Gauge
0%
5.2 ms
5.2 ms
rename
sway-lsp/benches/lsp_benchmarks/requests.rs::benches::benchmarks::rename
CodSpeed Performance Gauge
0%
5.2 ms
5.2 ms
traverse
sway-lsp/benches/lsp_benchmarks/compile.rs::benches::benchmarks::traverse
CodSpeed Performance Gauge
0%
117.6 ms
118.1 ms
semantic_tokens
sway-lsp/benches/lsp_benchmarks/requests.rs::benches::benchmarks::semantic_tokens
CodSpeed Performance Gauge
-1%
3.3 ms
3.4 ms
document_symbol
sway-lsp/benches/lsp_benchmarks/requests.rs::benches::benchmarks::document_symbol
CodSpeed Performance Gauge
-1%
3.3 ms
3.4 ms
on_enter
sway-lsp/benches/lsp_benchmarks/requests.rs::benches::benchmarks::on_enter
CodSpeed Performance Gauge
-2%
127.6 µs
129.6 µs

Commits

Click on a commit to change the comparison range
Base
master
804d6df
0%
Add `#[abi_name(name = "foo")` attribute to rename ABI items. Add `#[abi_name(name = "foo")` attribute to rename enum and struct ABI items. Here is example of how it can be used: ```sway contract; struct MyStruct {} enum MyEnum { A: () } abi MyAbi { fn my_struct() -> MyStruct; fn my_enum() -> MyEnum; } impl MyAbi for Contract { fn my_struct() -> MyStruct { MyStruct{} } fn my_enum() -> MyEnum { MyEnum::A } } ``` Closes https://github.com/FuelLabs/sway/issues/5955.
ec8d86b
17 days ago
by tritao
© 2025 CodSpeed Technology
Home Terms PrivacyDocs