Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: Reexport using pub use #6116

Draft
wants to merge 16 commits into
base: master
Choose a base branch
from
Draft

Feature: Reexport using pub use #6116

wants to merge 16 commits into from

Conversation

jjcnn
Copy link
Contributor

@jjcnn jjcnn commented Jun 12, 2024

Description

Fixes #3113 . Check also #2767.

Introduce reexports through pub use.

This feature allows std::prelude and core::prelude to be handled correctly, instead of the special-case handling that we have been using so far.

Current status:

  • Reexport of types and functions imported using *.

TODO list:

  • Tests of star imports
  • Item imports
  • Import of impls
  • Code cleanup

Checklist

  • I have linked to any relevant issues.
  • I have commented my code, particularly in hard-to-understand areas.
  • I have updated the documentation where relevant (API docs, the reference, and the Sway book).
  • I have added tests that prove my fix is effective or that my feature works.
  • I have added (or requested a maintainer to add) the necessary Breaking* or New Feature labels where relevant.
  • I have done my best to ensure that my PR adheres to the Fuel Labs Code Review Standards.
  • I have requested a review from the relevant team or maintainers.

Copy link

Benchmark for ae61abd

Click to view benchmark
Test Base PR %
code_action 5.1±0.25ms 5.2±0.05ms +1.96%
code_lens 343.9±8.06ns 288.0±11.35ns -16.25%
compile 3.5±0.09s 3.4±0.07s -2.86%
completion 4.6±0.06ms 4.8±0.09ms +4.35%
did_change_with_caching 3.2±0.04s 3.2±0.06s 0.00%
document_symbol 988.5±51.98µs 1006.4±35.64µs +1.81%
format 90.1±2.53ms 88.7±2.35ms -1.55%
goto_definition 345.6±7.05µs 375.3±2.68µs +8.59%
highlight 8.6±0.11ms 9.2±0.17ms +6.98%
hover 566.0±7.26µs 594.2±14.30µs +4.98%
idents_at_position 120.9±0.47µs 120.6±1.60µs -0.25%
inlay_hints 645.3±6.26µs 657.7±23.18µs +1.92%
on_enter 467.9±26.65ns 494.9±10.81ns +5.77%
parent_decl_at_position 3.6±0.15ms 3.7±0.05ms +2.78%
prepare_rename 345.6±4.49µs 424.9±3.72µs +22.95%
rename 9.1±0.24ms 9.3±0.02ms +2.20%
semantic_tokens 954.3±20.55µs 971.5±28.12µs +1.80%
token_at_position 344.9±1.96µs 353.8±4.24µs +2.58%
tokens_at_position 3.6±0.02ms 3.7±0.04ms +2.78%
tokens_for_file 411.5±6.88µs 423.5±1.86µs +2.92%
traverse 37.2±0.51ms 36.2±1.43ms -2.69%

Copy link

Benchmark for 2499d36

Click to view benchmark
Test Base PR %
code_action 5.3±0.28ms 5.2±0.03ms -1.89%
code_lens 358.5±12.91ns 305.1±24.65ns -14.90%
compile 3.5±0.08s 3.5±0.07s 0.00%
completion 4.8±0.12ms 5.0±0.19ms +4.17%
did_change_with_caching 3.3±0.11s 3.2±0.08s -3.03%
document_symbol 978.5±30.88µs 1009.2±45.31µs +3.14%
format 89.2±0.99ms 88.8±0.71ms -0.45%
goto_definition 358.7±7.34µs 361.8±4.26µs +0.86%
highlight 9.0±0.16ms 9.1±0.26ms +1.11%
hover 583.0±6.15µs 603.5±13.58µs +3.52%
idents_at_position 119.7±1.22µs 119.7±0.74µs 0.00%
inlay_hints 666.9±21.85µs 661.1±25.38µs -0.87%
on_enter 465.7±9.28ns 452.3±14.14ns -2.88%
parent_decl_at_position 3.7±0.05ms 3.7±0.05ms 0.00%
prepare_rename 358.4±7.16µs 359.4±8.31µs +0.28%
rename 9.2±0.07ms 9.3±0.28ms +1.09%
semantic_tokens 957.4±15.34µs 976.7±17.68µs +2.02%
token_at_position 361.1±2.29µs 350.0±4.81µs -3.07%
tokens_at_position 3.7±0.18ms 3.7±0.06ms 0.00%
tokens_for_file 415.9±4.22µs 418.4±3.52µs +0.60%
traverse 36.6±1.13ms 37.0±1.04ms +1.09%

Copy link

Benchmark for d22314f

Click to view benchmark
Test Base PR %
code_action 5.2±0.09ms 5.1±0.16ms -1.92%
code_lens 291.6±8.95ns 285.5±9.11ns -2.09%
compile 3.3±0.10s 3.4±0.09s +3.03%
completion 4.7±0.06ms 4.6±0.12ms -2.13%
did_change_with_caching 3.1±0.09s 3.1±0.08s 0.00%
document_symbol 984.3±47.68µs 1012.7±21.43µs +2.89%
format 75.6±1.05ms 73.9±0.52ms -2.25%
goto_definition 336.6±5.32µs 339.5±7.35µs +0.86%
highlight 9.0±0.16ms 8.6±0.05ms -4.44%
hover 561.3±7.64µs 566.8±4.31µs +0.98%
idents_at_position 116.5±0.20µs 117.5±0.51µs +0.86%
inlay_hints 633.1±16.58µs 631.9±25.60µs -0.19%
on_enter 486.8±11.55ns 468.0±8.30ns -3.86%
parent_decl_at_position 3.7±0.03ms 3.6±0.08ms -2.70%
prepare_rename 336.7±6.93µs 340.1±18.52µs +1.01%
rename 9.2±0.12ms 9.0±0.45ms -2.17%
semantic_tokens 978.1±8.80µs 961.9±8.05µs -1.66%
token_at_position 329.0±2.09µs 335.8±1.64µs +2.07%
tokens_at_position 3.7±0.03ms 3.6±0.05ms -2.70%
tokens_for_file 394.6±1.73µs 403.6±2.40µs +2.28%
traverse 35.6±1.04ms 35.9±1.16ms +0.84%

Copy link

Benchmark for 55741d5

Click to view benchmark
Test Base PR %
code_action 5.0±0.13ms 5.2±0.14ms +4.00%
code_lens 291.1±9.05ns 308.0±11.74ns +5.81%
compile 3.4±0.10s 3.4±0.07s 0.00%
completion 4.6±0.07ms 4.7±0.12ms +2.17%
did_change_with_caching 3.2±0.07s 3.2±0.08s 0.00%
document_symbol 876.0±34.32µs 855.5±17.95µs -2.34%
format 87.4±0.49ms 87.6±1.71ms +0.23%
goto_definition 339.6±7.07µs 344.5±6.09µs +1.44%
highlight 8.6±0.15ms 9.0±0.40ms +4.65%
hover 560.9±10.12µs 579.1±7.45µs +3.24%
idents_at_position 168.8±0.72µs 121.2±1.06µs -28.20%
inlay_hints 631.3±36.70µs 646.8±18.36µs +2.46%
on_enter 457.4±8.18ns 478.7±15.07ns +4.66%
parent_decl_at_position 3.6±0.03ms 3.7±0.09ms +2.78%
prepare_rename 330.7±6.07µs 349.3±6.00µs +5.62%
rename 8.9±0.17ms 9.2±0.04ms +3.37%
semantic_tokens 1269.6±18.60µs 1235.6±21.02µs -2.68%
token_at_position 394.2±15.94µs 341.9±2.65µs -13.27%
tokens_at_position 3.6±0.03ms 3.7±0.03ms +2.78%
tokens_for_file 431.2±1.86µs 396.8±2.58µs -7.98%
traverse 36.9±0.82ms 37.3±0.89ms +1.08%

Copy link

Benchmark for f10251a

Click to view benchmark
Test Base PR %
code_action 5.3±0.04ms 5.0±0.06ms -5.66%
code_lens 295.7±8.32ns 313.4±9.94ns +5.99%
compile 3.5±0.07s 3.5±0.08s 0.00%
completion 4.7±0.02ms 4.9±0.16ms +4.26%
did_change_with_caching 3.3±0.09s 3.2±0.06s -3.03%
document_symbol 879.0±25.14µs 883.7±53.60µs +0.53%
format 87.9±1.61ms 91.1±9.64ms +3.64%
goto_definition 342.2±7.72µs 337.8±8.41µs -1.29%
highlight 9.0±0.12ms 8.7±0.02ms -3.33%
hover 565.8±7.66µs 569.9±12.11µs +0.72%
idents_at_position 118.7±0.32µs 120.7±0.43µs +1.68%
inlay_hints 648.4±23.26µs 632.1±8.93µs -2.51%
on_enter 479.9±18.56ns 474.3±28.02ns -1.17%
parent_decl_at_position 3.7±0.04ms 3.6±0.03ms -2.70%
prepare_rename 339.2±11.32µs 352.6±10.67µs +3.95%
rename 9.3±0.37ms 9.0±0.43ms -3.23%
semantic_tokens 1235.7±22.70µs 1292.7±12.31µs +4.61%
token_at_position 338.5±2.26µs 334.3±4.89µs -1.24%
tokens_at_position 3.7±0.10ms 3.6±0.08ms -2.70%
tokens_for_file 399.9±2.11µs 402.8±2.85µs +0.73%
traverse 38.1±1.27ms 37.2±2.07ms -2.36%

Copy link

Benchmark for 9d1c827

Click to view benchmark
Test Base PR %
code_action 5.2±0.12ms 5.1±0.13ms -1.92%
code_lens 287.7±7.92ns 312.0±8.77ns +8.45%
compile 3.4±0.07s 3.5±0.08s +2.94%
completion 4.8±0.08ms 4.6±0.10ms -4.17%
did_change_with_caching 3.2±0.06s 3.2±0.07s 0.00%
document_symbol 902.3±54.71µs 912.7±40.86µs +1.15%
format 88.0±1.59ms 89.1±1.06ms +1.25%
goto_definition 337.6±4.84µs 345.5±7.48µs +2.34%
highlight 9.0±0.14ms 8.6±0.14ms -4.44%
hover 565.0±7.02µs 569.7±6.26µs +0.83%
idents_at_position 120.0±0.60µs 121.2±0.95µs +1.00%
inlay_hints 639.8±8.94µs 631.6±25.09µs -1.28%
on_enter 469.9±17.11ns 460.1±9.20ns -2.09%
parent_decl_at_position 3.7±0.01ms 3.6±0.05ms -2.70%
prepare_rename 338.6±5.82µs 344.1±3.06µs +1.62%
rename 9.3±0.20ms 8.9±0.21ms -4.30%
semantic_tokens 1247.0±9.85µs 1315.8±20.61µs +5.52%
token_at_position 345.9±1.67µs 338.9±2.37µs -2.02%
tokens_at_position 3.7±0.02ms 3.6±0.02ms -2.70%
tokens_for_file 396.9±1.37µs 402.3±14.36µs +1.36%
traverse 35.9±0.77ms 36.9±0.86ms +2.79%

Copy link

Benchmark for d731eea

Click to view benchmark
Test Base PR %
code_action 5.3±0.07ms 5.0±0.10ms -5.66%
code_lens 289.4±6.63ns 317.9±9.27ns +9.85%
compile 3.4±0.06s 3.4±0.08s 0.00%
completion 4.8±0.04ms 4.6±0.08ms -4.17%
did_change_with_caching 3.2±0.06s 3.2±0.07s 0.00%
document_symbol 918.5±54.18µs 860.4±18.05µs -6.33%
format 88.7±1.42ms 87.7±1.42ms -1.13%
goto_definition 344.5±5.15µs 336.8±5.23µs -2.24%
highlight 9.1±0.10ms 8.6±0.07ms -5.49%
hover 570.1±5.46µs 558.3±6.53µs -2.07%
idents_at_position 119.1±0.41µs 119.6±0.73µs +0.42%
inlay_hints 645.0±11.11µs 628.7±21.25µs -2.53%
on_enter 478.3±8.63ns 486.3±12.99ns +1.67%
parent_decl_at_position 3.7±0.03ms 3.6±0.03ms -2.70%
prepare_rename 344.8±6.69µs 334.3±8.81µs -3.05%
rename 9.3±0.02ms 8.9±0.20ms -4.30%
semantic_tokens 1266.2±18.42µs 1221.5±14.47µs -3.53%
token_at_position 333.6±2.01µs 338.6±2.72µs +1.50%
tokens_at_position 3.7±0.03ms 3.6±0.13ms -2.70%
tokens_for_file 398.5±1.34µs 398.9±12.38µs +0.10%
traverse 36.9±1.25ms 37.5±0.99ms +1.63%

Copy link

Benchmark for e6803f8

Click to view benchmark
Test Base PR %
code_action 5.3±0.12ms 5.1±0.09ms -3.77%
code_lens 288.0±5.22ns 310.4±8.87ns +7.78%
compile 3.5±0.07s 3.5±0.08s 0.00%
completion 4.7±0.18ms 4.7±0.15ms 0.00%
did_change_with_caching 3.3±0.08s 3.3±0.06s 0.00%
document_symbol 852.3±17.33µs 909.4±40.38µs +6.70%
format 88.0±1.23ms 87.6±0.62ms -0.45%
goto_definition 340.5±4.09µs 344.1±6.28µs +1.06%
highlight 8.8±0.18ms 8.7±0.17ms -1.14%
hover 564.6±5.68µs 562.9±9.30µs -0.30%
idents_at_position 119.8±0.43µs 119.0±0.39µs -0.67%
inlay_hints 632.2±22.51µs 628.8±26.50µs -0.54%
on_enter 462.8±32.85ns 465.8±17.04ns +0.65%
parent_decl_at_position 3.6±0.04ms 3.6±0.06ms 0.00%
prepare_rename 340.2±12.88µs 337.7±5.27µs -0.73%
rename 9.2±0.19ms 9.0±0.23ms -2.17%
semantic_tokens 1278.5±15.27µs 1281.9±8.91µs +0.27%
token_at_position 337.0±1.23µs 332.1±6.12µs -1.45%
tokens_at_position 3.6±0.04ms 3.6±0.06ms 0.00%
tokens_for_file 397.9±3.48µs 403.7±3.24µs +1.46%
traverse 37.7±0.87ms 37.6±0.72ms -0.27%

Copy link

Benchmark for 43f8acc

Click to view benchmark
Test Base PR %
code_action 5.0±0.09ms 5.2±0.08ms +4.00%
code_lens 292.8±8.92ns 310.1±7.51ns +5.91%
compile 3.4±0.06s 3.4±0.08s 0.00%
completion 4.6±0.09ms 4.7±0.06ms +2.17%
did_change_with_caching 3.2±0.09s 3.2±0.08s 0.00%
document_symbol 867.8±15.32µs 922.2±48.33µs +6.27%
format 87.2±0.85ms 87.1±1.27ms -0.11%
goto_definition 339.2±6.43µs 357.3±3.81µs +5.34%
highlight 8.8±0.19ms 9.0±0.03ms +2.27%
hover 560.0±4.97µs 576.4±8.85µs +2.93%
idents_at_position 118.9±0.33µs 120.1±0.65µs +1.01%
inlay_hints 625.4±28.32µs 645.9±29.41µs +3.28%
on_enter 466.9±12.45ns 460.1±19.90ns -1.46%
parent_decl_at_position 3.5±0.04ms 3.7±0.02ms +5.71%
prepare_rename 333.1±6.91µs 356.7±7.23µs +7.08%
rename 8.9±0.02ms 9.2±0.13ms +3.37%
semantic_tokens 1231.1±8.99µs 1241.0±16.17µs +0.80%
token_at_position 329.7±2.76µs 350.4±3.24µs +6.28%
tokens_at_position 3.6±0.03ms 3.7±0.09ms +2.78%
tokens_for_file 396.2±2.07µs 403.5±8.56µs +1.84%
traverse 36.6±0.47ms 36.4±0.68ms -0.55%

Copy link

Benchmark for 9397563

Click to view benchmark
Test Base PR %
code_action 5.5±0.31ms 5.5±0.21ms 0.00%
code_lens 331.3±76.01ns 306.5±9.05ns -7.49%
compile 3.6±0.07s 3.6±0.06s 0.00%
completion 5.0±0.43ms 5.1±0.36ms +2.00%
did_change_with_caching 3.4±0.10s 3.3±0.08s -2.94%
document_symbol 862.2±14.52µs 919.3±39.09µs +6.62%
format 88.5±1.21ms 88.9±1.96ms +0.45%
goto_definition 347.8±16.64µs 351.5±8.99µs +1.06%
highlight 8.9±0.29ms 9.2±0.25ms +3.37%
hover 572.0±15.55µs 580.1±15.14µs +1.42%
idents_at_position 119.5±0.47µs 122.7±0.58µs +2.68%
inlay_hints 655.1±36.92µs 643.3±30.37µs -1.80%
on_enter 463.4±13.37ns 474.0±21.55ns +2.29%
parent_decl_at_position 3.7±0.10ms 3.8±0.07ms +2.70%
prepare_rename 346.0±8.06µs 348.3±5.38µs +0.66%
rename 9.5±0.36ms 9.6±0.37ms +1.05%
semantic_tokens 1293.3±113.81µs 1310.9±21.19µs +1.36%
token_at_position 379.3±3.04µs 355.9±3.48µs -6.17%
tokens_at_position 3.6±0.05ms 3.8±0.08ms +5.56%
tokens_for_file 406.0±5.11µs 408.5±3.39µs +0.62%
traverse 38.2±0.85ms 37.8±0.50ms -1.05%

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow re-export of sway modules via pub use.
1 participant