-
Notifications
You must be signed in to change notification settings - Fork 198
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: internal access modifier (#6980)
Closes #4156 It's been a while since I've worked with the symbol lookup subsystem. This area is in dire need of refactoring, unfortunately the system is a little too broad to take on in this PR (I'm also not sure what the immediate fix is off the top of my head). Some of the issues: - It's a bit confusing which `lookup_xxx` method should be called in different scenarios - The logic for handling on access modifiers errors is split between two places (once inside `type_check.rs` for determining if field/method accesses are valid, and once inside `symbol_env.rs` for determining if looking up types within environments are valid) - The logic also needs to be added/maintained separately for the LSP. There are also some edge cases I intentionally avoided getting side tracked with to focus on just getting the initial feature working. For example, there might be cases we should look towards other languages for how to handle, like in what situations is it okay to subclass a method as internal. I did some manual QA to validate that autocompletions work as expected with the language server. ## Checklist - [x] Title matches [Winglang's style guide](https://www.winglang.io/contributing/start-here/pull_requests#how-are-pull-request-titles-formatted) - [x] Description explains motivation and solution - [x] Tests added (always) - [ ] Docs updated (only required for features) - [ ] Added `pr/e2e-full` label if this feature requires end-to-end testing *By submitting this pull request, I confirm that my contribution is made under the terms of the [Wing Cloud Contribution License](https://github.com/winglang/wing/blob/main/CONTRIBUTION_LICENSE.md)*.
- Loading branch information
Showing
21 changed files
with
607 additions
and
378 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.