-
Notifications
You must be signed in to change notification settings - Fork 545
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
LS: add support for struct members #6145
Conversation
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 10 files at r1, all commit messages.
Reviewable status: 4 of 10 files reviewed, 1 unresolved discussion (waiting on @Arcticae, @Draggu, @mkaput, and @piotmag769)
crates/cairo-lang-language-server/src/lang/inspect/defs.rs
line 26 at r1 (raw file):
use crate::{find_definition, ResolvedItem}; type StructDef = ItemDef;
explain the redefinition.
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: 4 of 10 files reviewed, 2 unresolved discussions (waiting on @Arcticae, @Draggu, and @piotmag769)
crates/cairo-lang-language-server/src/lang/inspect/defs.rs
line 37 at r1 (raw file):
ExprInlineMacro(String), Member((MemberId, StructDef)), }
Suggestion:
/// Keeps information about the symbol that is being searched for/inspected.
///
/// This is an ephemeral data structure.
/// Do not store it in any kind of state.
pub enum SymbolDef {
Item(ItemDef),
Variable(VariableDef),
ExprInlineMacro(String),
Member(MemberDef),
}
pub enum MemberDef {
member: MemberId,
struct: ItemDef,
}
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 10 files at r1, all commit messages.
Reviewable status: 7 of 10 files reviewed, 3 unresolved discussions (waiting on @Arcticae, @Draggu, and @piotmag769)
crates/cairo-lang-doc/src/db.rs
line 13 at r1 (raw file):
/// Item which documentation can be fetched from source code. #[derive(Clone, Debug, Hash, Eq, PartialEq)]
Suggestion:
#[derive(Copy, Clone, Debug, Hash, Eq, PartialEq)]
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 10 of 10 files at r1.
Reviewable status: 7 of 10 files reviewed, 3 unresolved discussions (waiting on @Arcticae, @Draggu, @mkaput, and @orizi)
crates/cairo-lang-doc/src/db.rs
line 13 at r1 (raw file):
/// Item which documentation can be fetched from source code. #[derive(Clone, Debug, Hash, Eq, PartialEq)]
Done.
crates/cairo-lang-language-server/src/lang/inspect/defs.rs
line 26 at r1 (raw file):
Previously, orizi wrote…
explain the redefinition.
Not relevant anymore.
crates/cairo-lang-language-server/src/lang/inspect/defs.rs
line 37 at r1 (raw file):
ExprInlineMacro(String), Member((MemberId, StructDef)), }
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 5 of 10 files at r1, 3 of 3 files at r2, all commit messages.
Reviewable status: all files reviewed, 4 unresolved discussions (waiting on @Arcticae, @Draggu, @orizi, and @piotmag769)
crates/cairo-lang-language-server/src/lang/inspect/defs.rs
line 141 at r1 (raw file):
contexts .chain(this) .map(|item| db.get_item_signature(DocumentableItemId::LookupItem(item)))
Implement From<T> for DocumentableItemId
for all variants.
crates/cairo-lang-language-server/src/lang/inspect/defs.rs
line 37 at r2 (raw file):
} pub struct MemberDef {
doc
crates/cairo-lang-language-server/src/lang/inspect/defs.rs
line 39 at r2 (raw file):
pub struct MemberDef { pub member: MemberId, pub r#struct: ItemDef,
Suggestion:
structure
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 10 files at r1.
Reviewable status: all files reviewed, 4 unresolved discussions (waiting on @Arcticae, @Draggu, @orizi, and @piotmag769)
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 all commit messages.
Reviewable status: all files reviewed, 3 unresolved discussions (waiting on @Arcticae, @Draggu, and @piotmag769)
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 3 files at r2, 5 of 5 files at r3, all commit messages.
Reviewable status: all files reviewed, 3 unresolved discussions (waiting on @Arcticae, @Draggu, and @mkaput)
crates/cairo-lang-language-server/src/lang/inspect/defs.rs
line 141 at r1 (raw file):
Previously, mkaput (Marek Kaput) wrote…
Implement
From<T> for DocumentableItemId
for all variants.
Done.
crates/cairo-lang-language-server/src/lang/inspect/defs.rs
line 37 at r2 (raw file):
Previously, mkaput (Marek Kaput) wrote…
doc
Done.
crates/cairo-lang-language-server/src/lang/inspect/defs.rs
line 39 at r2 (raw file):
pub struct MemberDef { pub member: MemberId, pub r#struct: ItemDef,
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 5 of 5 files at r3, all commit messages.
Reviewable status: complete! all files reviewed, all discussions resolved (waiting on @Arcticae and @Draggu)
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: complete! all files reviewed, all discussions resolved (waiting on @Arcticae and @Draggu)
This change is