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

Fixes FQP root type not found when inside a library. #5832

Merged
merged 4 commits into from
Apr 10, 2024

Conversation

esdrubal
Copy link
Contributor

@esdrubal esdrubal commented Apr 5, 2024

Description

When a fully qualified path was used inside a library using a type within the same file the symbol would not be found.

Fixes #5826

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.

When fully qualified path was used inside a library using a type within
the same file the symbol would not be found.

Fixes #5826
@esdrubal esdrubal self-assigned this Apr 5, 2024
@esdrubal esdrubal added bug Something isn't working compiler: frontend Everything to do with type checking, control flow analysis, and everything between parsing and IRgen labels Apr 5, 2024
Copy link

github-actions bot commented Apr 5, 2024

Benchmark for 8a4af56

Click to view benchmark
Test Base PR %
code_action 5.3±0.13ms 5.4±0.08ms +1.89%
code_lens 288.3±8.85ns 293.9±10.68ns +1.94%
compile 6.1±0.05s 6.2±0.07s +1.64%
completion 4.9±0.10ms 5.0±0.19ms +2.04%
did_change_with_caching 5.7±0.04s 5.7±0.07s 0.00%
document_symbol 976.0±12.63µs 1019.9±25.51µs +4.50%
format 71.6±1.86ms 71.7±1.34ms +0.14%
goto_definition 366.2±9.32µs 373.6±5.82µs +2.02%
highlight 8.8±0.11ms 9.1±0.17ms +3.41%
hover 590.9±8.86µs 596.2±13.84µs +0.90%
idents_at_position 123.3±0.55µs 123.5±1.20µs +0.16%
inlay_hints 650.3±13.07µs 685.9±35.78µs +5.47%
on_enter 491.4±12.59ns 480.7±14.58ns -2.18%
parent_decl_at_position 3.6±0.03ms 3.7±0.03ms +2.78%
prepare_rename 372.0±12.92µs 370.5±11.07µs -0.40%
rename 9.2±0.07ms 9.6±0.09ms +4.35%
semantic_tokens 1076.3±15.03µs 1081.4±38.18µs +0.47%
token_at_position 356.2±2.85µs 361.3±2.91µs +1.43%
tokens_at_position 3.6±0.04ms 3.7±0.05ms +2.78%
tokens_for_file 413.5±2.62µs 421.2±3.15µs +1.86%
traverse 47.0±1.56ms 47.7±2.29ms +1.49%

@esdrubal esdrubal marked this pull request as ready for review April 8, 2024 14:30
@esdrubal esdrubal requested a review from a team April 8, 2024 14:31
@IGI-111 IGI-111 requested a review from a team April 8, 2024 15:11
Copy link

github-actions bot commented Apr 8, 2024

Benchmark for 64d95b1

Click to view benchmark
Test Base PR %
code_action 5.3±0.07ms 5.6±0.17ms +5.66%
code_lens 288.4±6.57ns 297.7±8.15ns +3.22%
compile 6.1±0.09s 5.9±0.06s -3.28%
completion 4.9±0.15ms 5.1±0.12ms +4.08%
did_change_with_caching 5.4±0.07s 5.5±0.08s +1.85%
document_symbol 1022.0±12.39µs 952.0±35.03µs -6.85%
format 72.7±1.75ms 72.2±1.45ms -0.69%
goto_definition 349.5±7.40µs 361.0±7.22µs +3.29%
highlight 8.7±0.17ms 9.0±0.25ms +3.45%
hover 586.2±7.04µs 592.8±16.76µs +1.13%
idents_at_position 122.3±0.76µs 122.7±1.70µs +0.33%
inlay_hints 651.7±18.94µs 657.1±9.27µs +0.83%
on_enter 490.1±15.08ns 477.7±10.98ns -2.53%
parent_decl_at_position 3.6±0.02ms 3.7±0.04ms +2.78%
prepare_rename 351.6±7.12µs 356.3±6.83µs +1.34%
rename 9.3±0.21ms 9.5±0.17ms +2.15%
semantic_tokens 1023.1±35.48µs 1047.9±21.76µs +2.42%
token_at_position 347.8±2.00µs 358.7±1.84µs +3.13%
tokens_at_position 3.6±0.07ms 3.7±0.05ms +2.78%
tokens_for_file 407.8±3.75µs 412.6±1.67µs +1.18%
traverse 45.6±2.75ms 45.1±1.20ms -1.10%

@JoshuaBatty JoshuaBatty enabled auto-merge (squash) April 10, 2024 04:53
Copy link

Benchmark for b2312ea

Click to view benchmark
Test Base PR %
code_action 5.5±0.12ms 5.4±0.14ms -1.82%
code_lens 287.4±6.51ns 290.3±6.15ns +1.01%
compile 6.7±0.07s 6.6±0.14s -1.49%
completion 5.1±0.14ms 4.8±0.06ms -5.88%
did_change_with_caching 6.3±0.04s 6.5±0.05s +3.17%
document_symbol 935.1±20.35µs 990.8±40.27µs +5.96%
format 77.7±1.79ms 79.3±1.28ms +2.06%
goto_definition 364.6±8.07µs 370.2±10.64µs +1.54%
highlight 9.1±0.12ms 8.8±0.21ms -3.30%
hover 609.5±23.00µs 609.9±18.43µs +0.07%
idents_at_position 124.3±0.45µs 124.0±1.64µs -0.24%
inlay_hints 670.3±6.83µs 668.7±24.76µs -0.24%
on_enter 497.6±11.53ns 503.1±24.33ns +1.11%
parent_decl_at_position 3.7±0.03ms 3.6±0.05ms -2.70%
prepare_rename 365.3±8.72µs 365.7±8.64µs +0.11%
rename 9.6±0.13ms 9.3±0.18ms -3.12%
semantic_tokens 1061.5±15.02µs 1035.9±14.72µs -2.41%
token_at_position 367.5±5.95µs 366.2±11.58µs -0.35%
tokens_at_position 3.7±0.02ms 3.6±0.04ms -2.70%
tokens_for_file 412.8±2.97µs 409.4±2.84µs -0.82%
traverse 49.7±0.95ms 50.0±1.03ms +0.60%

@IGI-111 IGI-111 enabled auto-merge (squash) April 10, 2024 23:07
@IGI-111 IGI-111 merged commit b79551a into master Apr 10, 2024
32 of 33 checks passed
@IGI-111 IGI-111 deleted the esdrubal/5826_fqp_in_lib branch April 10, 2024 23:28
Copy link

Benchmark for 0f956f0

Click to view benchmark
Test Base PR %
code_action 5.5±0.07ms 5.6±0.10ms +1.82%
code_lens 287.8±11.24ns 293.2±18.30ns +1.88%
compile 6.2±0.11s 6.2±0.08s 0.00%
completion 5.1±0.15ms 5.1±0.18ms 0.00%
did_change_with_caching 6.0±0.04s 6.1±0.07s +1.67%
document_symbol 982.8±38.66µs 950.3±20.57µs -3.31%
format 75.8±0.55ms 77.6±1.47ms +2.37%
goto_definition 364.9±6.57µs 363.2±6.84µs -0.47%
highlight 9.1±0.07ms 9.1±0.13ms 0.00%
hover 590.9±11.73µs 603.2±10.01µs +2.08%
idents_at_position 122.4±0.32µs 123.4±1.48µs +0.82%
inlay_hints 708.9±24.70µs 675.5±9.06µs -4.71%
on_enter 498.5±18.45ns 477.8±15.47ns -4.15%
parent_decl_at_position 3.8±0.03ms 3.8±0.03ms 0.00%
prepare_rename 364.9±16.00µs 364.7±6.69µs -0.05%
rename 9.7±0.17ms 9.8±0.18ms +1.03%
semantic_tokens 1015.6±12.62µs 1054.6±17.07µs +3.84%
token_at_position 357.8±5.67µs 360.9±2.47µs +0.87%
tokens_at_position 3.8±0.03ms 3.8±0.05ms 0.00%
tokens_for_file 411.0±8.04µs 409.4±1.94µs -0.39%
traverse 50.2±1.52ms 50.6±2.44ms +0.80%

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working compiler: frontend Everything to do with type checking, control flow analysis, and everything between parsing and IRgen
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Struct symbol not found when used in FQP in library.
4 participants