-
Notifications
You must be signed in to change notification settings - Fork 18
Make monikers for struct fields more efficient #77
Conversation
|
which commits contain the logic changes? when i pick the two oldest it shows me 29 files changed, even though the overall PR is 10 files changed |
|
@gbrik Let me make a review order. |
|
The idea here is to walk each file's AST only once and construct the moniker path for every position contained in a typespec or a field. It's then a simple lookup instead of a recalculation. All other changes are a rename of a struct. |
garobrik
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Similar to the way we preload hover text (see c165bff), we can also preload nested container names for moniker paths. This saves us from re-tracing the same AST nodes.
We piggyback on the hover text preload step and keep track of the relevant parent nodes and stash them into a map for later fast retrieval. There's still some small opportunities here for cleaner code which I'll probably tackle later (for example, we keep the entire ast path to the current node but we only look at the last three, and only look at certain node types - we can store fewer things during this traversal).
Reviewers: The logic changes are in the first two commits. The remaining commits are code style changes, a struct rename (HoverLoader to Preloader), and test updates.