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

create turbo-static for compile time graph analysis #8037

Open
wants to merge 2 commits into
base: 03-08-add_ability_to_filter_by_value_and_occurences
Choose a base branch
from

Conversation

arlyon
Copy link
Contributor

@arlyon arlyon commented Apr 24, 2024

Description

Testing Instructions

Closes TURBO-2877

Copy link

vercel bot commented Apr 24, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
examples-nonmonorepo ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 30, 2024 11:03am
rust-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 30, 2024 11:03am
8 Ignored Deployments
Name Status Preview Comments Updated (UTC)
examples-basic-web ⬜️ Ignored (Inspect) Visit Preview May 30, 2024 11:03am
examples-designsystem-docs ⬜️ Ignored (Inspect) Visit Preview May 30, 2024 11:03am
examples-gatsby-web ⬜️ Ignored (Inspect) Visit Preview May 30, 2024 11:03am
examples-kitchensink-blog ⬜️ Ignored (Inspect) Visit Preview May 30, 2024 11:03am
examples-native-web ⬜️ Ignored (Inspect) Visit Preview May 30, 2024 11:03am
examples-svelte-web ⬜️ Ignored (Inspect) Visit Preview May 30, 2024 11:03am
examples-tailwind-web ⬜️ Ignored (Inspect) Visit Preview May 30, 2024 11:03am
examples-vite-web ⬜️ Ignored (Inspect) Visit Preview May 30, 2024 11:03am

Copy link
Contributor Author

arlyon commented Apr 24, 2024

Warning

This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
Learn more

This stack of pull requests is managed by Graphite. Learn more about stacking.

Join @arlyon and the rest of your teammates on Graphite Graphite

Copy link
Contributor

github-actions bot commented Apr 24, 2024

🟢 Turbopack Benchmark CI successful 🟢

Thanks

Copy link
Contributor

github-actions bot commented Apr 24, 2024

⚠️ CI failed ⚠️

The following steps have failed in CI:

  • Turbopack Rust tests (mac/win, non-blocking)

See workflow summary for details

Copy link
Contributor

github-actions bot commented Apr 24, 2024

✅ This change can build next-swc

@arlyon arlyon force-pushed the 03-08-feat_add_mechanism_to_bypass_turbo_engine_for_annotated_methods branch from 9f50dd4 to d49e885 Compare May 15, 2024 11:25
@arlyon arlyon force-pushed the 03-08-feat_add_mechanism_to_bypass_turbo_engine_for_annotated_methods branch from d49e885 to fbab81c Compare May 15, 2024 15:25
@arlyon arlyon force-pushed the 03-08-feat_add_mechanism_to_bypass_turbo_engine_for_annotated_methods branch from fbab81c to 739c4e3 Compare May 15, 2024 15:27
@arlyon arlyon force-pushed the 03-08-feat_add_mechanism_to_bypass_turbo_engine_for_annotated_methods branch from 739c4e3 to 2671771 Compare May 16, 2024 08:06
@arlyon arlyon marked this pull request as ready for review May 16, 2024 08:08
@arlyon arlyon requested review from a team as code owners May 16, 2024 08:08
@arlyon arlyon requested review from gsoltis and paulogdm and removed request for a team May 16, 2024 08:08
@arlyon arlyon force-pushed the 03-08-feat_add_mechanism_to_bypass_turbo_engine_for_annotated_methods branch from 2671771 to 3fb2eb1 Compare May 16, 2024 11:00
@arlyon arlyon requested a review from anthonyshew as a code owner May 22, 2024 07:37
@arlyon arlyon changed the base branch from 03-08-feat_add_mechanism_to_bypass_turbo_engine_for_annotated_methods to 03-08-add_ability_to_filter_by_value_and_occurences May 22, 2024 07:37
Copy link
Member

@bgw bgw left a comment

Choose a reason for hiding this comment

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

A couple quick comments about fjall and neo4j as I skimmed over this.

crates/turbo-static/readme.md Outdated Show resolved Hide resolved
crates/turbo-static/src/call_resolver.rs Outdated Show resolved Hide resolved
@arlyon arlyon force-pushed the 03-08-add_ability_to_filter_by_value_and_occurences branch from 003b9b0 to f0c3166 Compare May 29, 2024 16:50
Comment on lines +34 to +46
fn get_name(item: &CallHierarchyItem) -> String {
// open file, find range inside, extract text
let file = fs::read_to_string(item.uri.path()).unwrap();
let start = item.selection_range.start;
let end = item.selection_range.end;
file.lines()
.nth(start.line as usize)
.unwrap()
.chars()
.skip(start.character as usize)
.take(end.character as usize - start.character as usize)
.collect()
}
Copy link
Member

Choose a reason for hiding this comment

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

I'm assuming the name field of CallHierarchyItem isn't the thing you want? https://docs.rs/lsp-types/latest/lsp_types/struct.CallHierarchyItem.html#structfield.name

Comment on lines +10 to +11
sender: Option<crossbeam_channel::Sender<Message>>,
receiver: Option<crossbeam_channel::Receiver<Message>>,
Copy link
Member

Choose a reason for hiding this comment

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

Minor/FYI, std::sync::mpsc uses crossbeam as of rust 1.67.0: https://blog.rust-lang.org/2023/01/26/Rust-1.67.0.html#stdsyncmpsc-implementation-updated

There used to be some general advice to avoid std::sync::mpsc because the implementation was bad, but now I feel like you don't need to use crossbeam_channel unless you need some features from it.

Comment on lines +78 to +97
pub enum CallingStyle {
Once,
#[allow(dead_code)]
ZeroOrOnce,
#[allow(dead_code)]
ZeroOrMore,
#[allow(dead_code)]
OneOrMore,
}

impl CallingStyle {
fn bitset(self) -> u8 {
match self {
CallingStyle::Once => 0b0010,
CallingStyle::ZeroOrOnce => 0b011,
CallingStyle::ZeroOrMore => 0b0111,
CallingStyle::OneOrMore => 0b0110,
}
}
}
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
pub enum CallingStyle {
Once,
#[allow(dead_code)]
ZeroOrOnce,
#[allow(dead_code)]
ZeroOrMore,
#[allow(dead_code)]
OneOrMore,
}
impl CallingStyle {
fn bitset(self) -> u8 {
match self {
CallingStyle::Once => 0b0010,
CallingStyle::ZeroOrOnce => 0b011,
CallingStyle::ZeroOrMore => 0b0111,
CallingStyle::OneOrMore => 0b0110,
}
}
}
pub enum CallingStyle {
Once = 0b0010,
#[allow(dead_code)]
ZeroOrOnce = 0b0011,
#[allow(dead_code)]
ZeroOrMore = 0b0111,
#[allow(dead_code)]
OneOrMore = 0b0110,
}
impl CallingStyle {
fn bitset(self) -> u8 {
self as u8
}
}

You also might not need the #[allow(dead_code)] since fn add should use the enum variants?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants