feature: Add logical package parsing for sourcepath#25446
Draft
tgodzik wants to merge 1 commit intoscala:mainfrom
Draft
feature: Add logical package parsing for sourcepath#25446tgodzik wants to merge 1 commit intoscala:mainfrom
tgodzik wants to merge 1 commit intoscala:mainfrom
Conversation
Contributor
|
It would be good to have a high-level description how this works, and also a breakdown of the costs. |
Contributor
Author
It's not terribly complex, we get all the sources from sourcepath, parse them to extract packages, save that in a tree like structure, use it to load specific packages and symbols on demand. Main difference with the current approach (as I understand it) is that we don't rely on directory structure and we also check the packages eagerly (which is a consequence of not relying on the structure) I plan to run some benchmarks anyway on this and see if maybe there is a clear performance difference. |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The idea is that not all files follow the directory structure, which would make the current directory parsing (probably) inefficient. By creating the full package structure we also make sure that only relevant files are always loaded and no recalculation is needed.
I might be totally wrong here, so would love some feedback if it's even necessary. I've put it behind a flag just in case.
How much have your relied on LLM-based tools in this contribution?
Moderately -> LLM helped rewrite the code from the Scala 2 implementation.
How was the solution tested?
Automatic test added to the presentation compiler tests
Additional notes
I started porting changes that Julian Dragos did in Metals v2 and I realized that Scala 3 compiler is already quite efficient with loading symbols from source path, so I ported the other change used for determining package structure to use it efficiently in loading correct files from the source path