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

red-knot: Cache symbol tables #11106

Merged
merged 1 commit into from
Apr 24, 2024
Merged

Conversation

MichaReiser
Copy link
Member

Summary

This PR adds a new db.symbol_table(file_id) method that allows querying the symbol table for a file (that gets cached).

Test Plan

cargo build

@MichaReiser MichaReiser added the internal An internal refactor or improvement label Apr 23, 2024
@MichaReiser MichaReiser requested a review from carljm April 23, 2024 16:11
@MichaReiser MichaReiser changed the title Cache symbol tables red-knot: Cache symbol tables Apr 23, 2024
where
Db: SemanticDb + HasJar<SemanticJar>,
{
let jar = db.jar();
Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Member Author

@MichaReiser MichaReiser Apr 23, 2024

Choose a reason for hiding this comment

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

No, that's not it 😅 . It's a jar in which you store your salsa... And each jar contains multiple ingredients.

crates/red_knot/src/symbols.rs Outdated Show resolved Hide resolved
crates/red_knot/src/db.rs Outdated Show resolved Hide resolved
@MichaReiser
Copy link
Member Author

I'll update this PR to cache Symbols once @carljm's PR that removes the lifetime from it is merged.

@MichaReiser MichaReiser force-pushed the red-knot-cache-symbol-table branch 2 times, most recently from 0634caf to a4da71a Compare April 24, 2024 16:18
crates/red_knot/src/symbols.rs Outdated Show resolved Hide resolved
Copy link
Contributor

github-actions bot commented Apr 24, 2024

ruff-ecosystem results

Linter (stable)

✅ ecosystem check detected no linter changes.

Linter (preview)

✅ ecosystem check detected no linter changes.

@MichaReiser MichaReiser force-pushed the red-knot-cache-symbol-table branch from a4da71a to 9837844 Compare April 24, 2024 16:34
@MichaReiser MichaReiser merged commit a53269b into red-knot Apr 24, 2024
18 checks passed
@MichaReiser MichaReiser deleted the red-knot-cache-symbol-table branch April 24, 2024 17:06
MichaReiser added a commit that referenced this pull request Apr 25, 2024
MichaReiser added a commit that referenced this pull request Apr 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
internal An internal refactor or improvement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants