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

Implements fully working hierarchical lexical scopes. #6784

Merged
merged 31 commits into from
Jan 13, 2025

Conversation

esdrubal
Copy link
Contributor

@esdrubal esdrubal commented Dec 11, 2024

Description

This PR implements the missing elements for the hierarchical lexical scopes.
TypeCheckContext no longer uses cloned namespaces. Instead, we push and pop lexical scopes.
For this to work multiple places that used current_items now either use root_items or traverse the lexical scopes.

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.

@esdrubal esdrubal added code quality compiler: frontend Everything to do with type checking, control flow analysis, and everything between parsing and IRgen labels Dec 11, 2024
@esdrubal esdrubal self-assigned this Dec 11, 2024
@esdrubal esdrubal force-pushed the esdrubal/hierarchical_lexical_scopes branch from 920ca89 to aaed7cc Compare December 12, 2024 15:09
Copy link

codspeed-hq bot commented Dec 12, 2024

CodSpeed Performance Report

Merging #6784 will degrade performances by 58.87%

Comparing esdrubal/hierarchical_lexical_scopes (cdef5b5) with master (1192b3f)

Summary

❌ 2 regressions
✅ 20 untouched benchmarks

⚠️ Please fix the performance issues or acknowledge them on CodSpeed.

Benchmarks breakdown

Benchmark master esdrubal/hierarchical_lexical_scopes Change
completion 21 ms 23.6 ms -11.35%
hover 1.8 ms 4.3 ms -58.87%

@esdrubal esdrubal force-pushed the esdrubal/hierarchical_lexical_scopes branch 2 times, most recently from c5f0f07 to 62fd6dd Compare December 12, 2024 15:47
@esdrubal esdrubal marked this pull request as ready for review December 13, 2024 09:22
@esdrubal esdrubal requested review from a team as code owners December 13, 2024 09:22
@esdrubal esdrubal force-pushed the esdrubal/hierarchical_lexical_scopes branch 2 times, most recently from 792e419 to 8d57419 Compare January 7, 2025 10:46
@esdrubal esdrubal requested review from a team as code owners January 7, 2025 17:09
@esdrubal esdrubal force-pushed the esdrubal/hierarchical_lexical_scopes branch 2 times, most recently from 90c1d89 to f2f0b31 Compare January 8, 2025 10:05
tritao
tritao previously approved these changes Jan 8, 2025
@esdrubal esdrubal force-pushed the esdrubal/hierarchical_lexical_scopes branch from b18daec to c47a31f Compare January 9, 2025 13:43
@esdrubal esdrubal force-pushed the esdrubal/hierarchical_lexical_scopes branch from 15c81e4 to 4db723d Compare January 9, 2025 17:31
@tritao
Copy link
Contributor

tritao commented Jan 10, 2025

@FuelLabs/tooling, can you take a look?

Copy link
Member

@JoshuaBatty JoshuaBatty left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work

@JoshuaBatty JoshuaBatty merged commit e40ebf4 into master Jan 13, 2025
45 checks passed
@JoshuaBatty JoshuaBatty deleted the esdrubal/hierarchical_lexical_scopes branch January 13, 2025 00:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
code quality 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.

5 participants