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

feat(compiler): Allow renaming imports with qualified names [LNG-361] #1136

Merged
merged 46 commits into from
Jul 3, 2024

Conversation

InversionSpaces
Copy link
Contributor

@InversionSpaces InversionSpaces commented May 9, 2024

Description

Refactor internal aqua module management.
Allow users redeclare whole modules, e.g.

aqua Lib declares SubLib
use "sublibA" -- brings SubLib.A.* symbols into scope
use "sublibB" -- brings Sublib.B.* symbols into scope

declares all Lib.SubLib.* symbols.
Allow renaming nested symbols when importing, e.g.

aqua Module
-- Brings `Lib.A.Sub.f` into scope as `Lib.B.Another.g`
use A.Sub.f as B.Another.g from "lib"

Allow exporting nested imported symbols, e.g.

aqua Module
-- exports `Lib.Sub.f` as `g`
export Lib.Sub.f as g
-- brings `Lib.Sub.f` into scope
use "lib"

Proposed Changes

  • Refactor RawContext handling. Now abilities are "linearized" meaning that ability A.B.C is stored in nested abilities A, B and C. Previously it was stored just under key "A.B.C"
  • Accommodate parser to necessary changes

Implementation Details

  • SName (simple name, without dots) and PName (path name that may contain dots) are introduced to substitute Strings and tighten typing

Checklist

  • Corresponding issue has been created and linked in PR title.
  • Proposed changes are covered by tests.
  • Documentation has been updated to reflect the changes (if applicable).
  • I have self-reviewed my code and ensured its quality.
  • I have added/updated necessary comments to aid understanding.

Reviewer Checklist

  • Tests have been reviewed and are sufficient to validate the changes.
  • Documentation has been reviewed and is up to date.
  • Any questions or concerns have been addressed.

Copy link

linear bot commented May 9, 2024

@InversionSpaces InversionSpaces added the e2e Run e2e workflow label May 10, 2024
@InversionSpaces InversionSpaces removed e2e Run e2e workflow labels May 14, 2024
@InversionSpaces InversionSpaces force-pushed the feat/LNG-361-imports-renaming branch from 9a3a259 to 66f0699 Compare May 15, 2024 06:41
@InversionSpaces InversionSpaces added the e2e Run e2e workflow label May 15, 2024
@InversionSpaces InversionSpaces force-pushed the feat/LNG-361-imports-renaming branch from b39dd68 to b9cf0f5 Compare May 20, 2024 09:24
@InversionSpaces InversionSpaces marked this pull request as ready for review July 2, 2024 15:38
@InversionSpaces InversionSpaces requested a review from DieMyst July 2, 2024 15:38
@DieMyst
Copy link
Member

DieMyst commented Jul 3, 2024

  • will be great to add integration test on feature
  • tests that this feature is supported by LSP (or just create task)

@InversionSpaces InversionSpaces requested a review from DieMyst July 3, 2024 11:47
@InversionSpaces InversionSpaces enabled auto-merge (squash) July 3, 2024 11:47
@InversionSpaces InversionSpaces merged commit 1c76f75 into main Jul 3, 2024
9 checks passed
@InversionSpaces InversionSpaces deleted the feat/LNG-361-imports-renaming branch July 3, 2024 13:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
e2e Run e2e workflow
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants