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

Generalize scope so that it can be used with any locals #2603

Merged
merged 3 commits into from
Sep 24, 2024

Conversation

vinistock
Copy link
Member

Motivation

There will be other cases where we want to track proper scope of locals. We can currently only track parameters, which is only used for semantic highlighting, but we can use this to provide renaming and references for locals too.

This PR turns our ParameterScope into a more general Scope implementation, so that we can use it in other places.

Implementation

I recommend reviewing by commit:

  1. Renamed the class
  2. Renamed the << method to add, so that we can pass more parameters
  3. Generalized the scope

Automated Tests

Adapted existing tests.

@vinistock vinistock added server This pull request should be included in the server gem's release notes other Changes that aren't bugfixes, enhancements or breaking changes labels Sep 23, 2024
@vinistock vinistock self-assigned this Sep 23, 2024
@vinistock vinistock requested a review from a team as a code owner September 23, 2024 20:20
Copy link
Contributor

@alexcrocha alexcrocha left a comment

Choose a reason for hiding this comment

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

Looks good to me 👍 Are there any potential pitfalls or edge cases we should be aware of with this change?

@vinistock
Copy link
Member Author

Not for now. It's mostly just renaming and refactoring things. When we add the ability to track location of locals then it might become more complicated.

@vinistock vinistock merged commit 00e95a9 into main Sep 24, 2024
37 checks passed
@vinistock vinistock deleted the vs-generalize-scope branch September 24, 2024 18:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
other Changes that aren't bugfixes, enhancements or breaking changes server This pull request should be included in the server gem's release notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants