-
Notifications
You must be signed in to change notification settings - Fork 575
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
Introduced default plugin suites to the RootDatabaseBuilder #6852
Conversation
d7c12d5
to
fc37389
Compare
bf4655b
to
79ec121
Compare
fc37389
to
d0e9571
Compare
d0e9571
to
46919f1
Compare
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.
Reviewed 12 of 12 files at r1, all commit messages.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @integraledelebesgue, @orizi, and @piotmag769)
crates/cairo-lang-semantic/src/db.rs
line 1881 at r1 (raw file):
/// Sets macro, inline macro and analyzer plugins specified in the [`PluginSuite`] as default /// for all crates. /// ***
this hr was not idiomatic
Suggestion:
///
crates/cairo-lang-semantic/src/db.rs
line 1917 at r1 (raw file):
/// Sets macro, inline macro and analyzer plugins present in the [`PluginSuite`] for a crate /// pointed to by the [`CrateId`], overriding the defaults for that crate. /// ***
Suggestion:
///
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.
Reviewable status: all files reviewed, 3 unresolved discussions (waiting on @integraledelebesgue, @orizi, and @piotmag769)
crates/cairo-lang-semantic/src/db.rs
line 1939 at r1 (raw file):
.into_iter() .map(|plugin| self.intern_analyzer_plugin(AnalyzerPluginLongId(plugin))) .collect();
Can we deduplicate this logic? Also, make it a public api; it will be useful in LS, too.
Code quote:
let PluginSuite { plugins, inline_macro_plugins, analyzer_plugins } = suite;
let macro_plugins = plugins
.into_iter()
.map(|plugin| self.intern_macro_plugin(MacroPluginLongId(plugin)))
.collect();
let inline_macro_plugins = inline_macro_plugins
.into_iter()
.map(|(name, plugin)| {
(name, self.intern_inline_macro_plugin(InlineMacroExprPluginLongId(plugin)))
})
.collect();
let analyzer_plugins = analyzer_plugins
.into_iter()
.map(|plugin| self.intern_analyzer_plugin(AnalyzerPluginLongId(plugin)))
.collect();
46919f1
to
629a86e
Compare
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.
Reviewable status: 11 of 12 files reviewed, 3 unresolved discussions (waiting on @Draggu, @mkaput, @orizi, and @piotmag769)
crates/cairo-lang-semantic/src/db.rs
line 1939 at r1 (raw file):
Previously, Draggu (Piotr Figiela) wrote…
Can we deduplicate this logic? Also, make it a public api; it will be useful in LS, too.
I extracted it as another helper.
These helpers should already be public since they belong to a pub trait, mutually implemented on every type that is a SemanticGroup
.
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.
Reviewable status: 11 of 12 files reviewed, 3 unresolved discussions (waiting on @integraledelebesgue, @mkaput, @orizi, and @piotmag769)
crates/cairo-lang-semantic/src/db.rs
line 1883 at r2 (raw file):
&mut self, suite: PluginSuite, ) -> (Vec<MacroPluginId>, OrderedHashMap<String, InlineMacroExprPluginId>, Vec<AnalyzerPluginId>)
Make struct for these.
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.
Reviewed 1 of 1 files at r2, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @integraledelebesgue, @orizi, and @piotmag769)
5d50783
to
69ac9d9
Compare
629a86e
to
98416ed
Compare
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.
Reviewable status: 11 of 13 files reviewed, 1 unresolved discussion (waiting on @Draggu, @mkaput, @orizi, and @piotmag769)
crates/cairo-lang-semantic/src/db.rs
line 1883 at r2 (raw file):
Previously, Draggu (Piotr Figiela) wrote…
Make struct for these.
Done
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.
Reviewed 11 of 12 files at r1, 2 of 2 files at r3, all commit messages.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @integraledelebesgue, @orizi, and @piotmag769)
crates/cairo-lang-semantic/src/db.rs
line 1916 at r3 (raw file):
/// [`DefsGroup::default_inline_macro_plugins`], and /// [`SemanticGroup::default_analyzer_plugins`]. fn set_default_plugins_from_suite(&mut self, suite: PluginSuite) {
Maybe inverse this? up to you
Suggestion:
InternedPluginSuite
crates/cairo-lang-semantic/src/db.rs
line 1931 at r3 (raw file):
/// [`DefsGroup::override_crate_inline_macro_plugins`], and /// [`SemanticGroup::override_crate_analyzer_plugins`]. fn set_override_crate_plugins_from_suite(&mut self, crate_id: CrateId, suite: PluginSuite) {
vide supra
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.
Reviewed 2 of 2 files at r3, all commit messages.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @integraledelebesgue, @orizi, and @piotmag769)
4b6a57f
to
8b84cb3
Compare
15418f8
to
0318f63
Compare
2a0cd52
to
5438ec5
Compare
0318f63
to
3a72155
Compare
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.
Reviewed 1 of 1 files at r4, all commit messages.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @integraledelebesgue, @orizi, and @piotmag769)
5438ec5
to
c49be77
Compare
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.
Reviewed 5 of 5 files at r6, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @integraledelebesgue)
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.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @orizi)
crates/cairo-lang-semantic/src/plugin.rs
line 84 at r5 (raw file):
Previously, orizi wrote…
tough luck - that is still the correct solution.
I don't see why you can't provide a pathway for this going towards the correct solution.assuming the
suite builder
still exists - the fix should be extremely easy.
How would we rework, for example, the get_default_plugin_suite
and similar functions if we want to hold the interned data in the PluginSuite
instead of raw plugins? That's a significant breakage, both in the compiler and our tools.
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.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @integraledelebesgue)
crates/cairo-lang-semantic/src/plugin.rs
line 84 at r5 (raw file):
Previously, integraledelebesgue (Jan Smółka) wrote…
How would we rework, for example, the
get_default_plugin_suite
and similar functions if we want to hold the interned data in thePluginSuite
instead of raw plugins? That's a significant breakage, both in the compiler and our tools.
yes - they should hold that exactly - that is definitely a very minor change.
a90b920
to
7383bca
Compare
6802516
to
a8f1876
Compare
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.
Reviewed 4 of 12 files at r1, 2 of 2 files at r7, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @integraledelebesgue)
a8f1876
to
2fe85ac
Compare
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.
Reviewed 1 of 2 files at r3, 4 of 4 files at r8, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @integraledelebesgue)
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.
Reviewed 1 of 5 files at r6, 1 of 2 files at r7, 4 of 4 files at r8, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @integraledelebesgue)
11daa3b
to
06068e5
Compare
2fe85ac
to
bce330f
Compare
06068e5
to
db8368e
Compare
bce330f
to
7687ef1
Compare
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.
Reviewed 1 of 1 files at r9, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @integraledelebesgue)
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.
Reviewable status:
complete! all files reviewed, all discussions resolved (waiting on @integraledelebesgue)
crates/cairo-lang-semantic/src/plugin.rs
line 84 at r5 (raw file):
Previously, orizi wrote…
yes - they should hold that exactly - that is definitely a very minor change.
unblocking - would probably update on it after the later changes.
7687ef1
to
709b248
Compare
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.
Reviewed 2 of 2 files at r10, all commit messages.
Reviewable status:complete! all files reviewed, all discussions resolved (waiting on @integraledelebesgue)
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.
Reviewed 3 of 4 files at r8, 1 of 1 files at r9, 2 of 2 files at r10, all commit messages.
Reviewable status:complete! all files reviewed, all discussions resolved (waiting on @integraledelebesgue)
commit-id:ffce04df
709b248
to
cf72451
Compare
Stack: