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

LS: Proc macro - scarb code #6638

Open
wants to merge 1 commit into
base: spr/main/36b6c854
Choose a base branch
from
Open

Conversation

Draggu
Copy link
Collaborator

@Draggu Draggu commented Nov 12, 2024

Code calling dylib is replaced with one calling proc-macro-server. Also aux_data is removed as it is useless for LS.


Stack:

⚠️ Part of a stack created by spr. Do not merge manually using the UI - doing so may have unexpected results.

@reviewable-StarkWare
Copy link

This change is Reviewable

Copy link
Collaborator

@piotmag769 piotmag769 left a comment

Choose a reason for hiding this comment

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

:lgtm:

Reviewed 7 of 7 files at r1, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @Arcticae, @Draggu, @mkaput, and @orizi)


crates/cairo-lang-language-server/src/lang/proc_macros/plugins/scarb/regular.rs line 30 at r1 (raw file):

}

fn calculate_metadata(db: &dyn SyntaxGroup, item_ast: ast::ModuleItem) -> TokenStreamMetadata {

This should be lower (public first)

Copy link
Collaborator Author

@Draggu Draggu left a comment

Choose a reason for hiding this comment

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

Reviewable status: 3 of 7 files reviewed, all discussions resolved (waiting on @Arcticae, @mkaput, @orizi, and @piotmag769)


crates/cairo-lang-language-server/src/lang/proc_macros/plugins/scarb/regular.rs line 30 at r1 (raw file):

Previously, piotmag769 (Piotr Magiera) wrote…

This should be lower (public first)

Done.

Copy link
Collaborator

@piotmag769 piotmag769 left a comment

Choose a reason for hiding this comment

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

Reviewed 4 of 4 files at r2, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @Arcticae, @mkaput, and @orizi)

Copy link
Member

@mkaput mkaput left a 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 r4, all commit messages.
Reviewable status: 5 of 7 files reviewed, 1 unresolved discussion (waiting on @Arcticae, @Draggu, @orizi, and @piotmag769)


crates/cairo-lang-language-server/Cargo.toml line 29 at r4 (raw file):

cairo-lang-utils = { path = "../cairo-lang-utils", version = "~2.8.4" }
cairo-lang-macro = "0.1.1"
# Used in proc-macro code copied from scarb.

These comments are unnecessary imho: if we use these deps, then we use them, and comments break easily sorting deps

Copy link
Collaborator Author

@Draggu Draggu left a comment

Choose a reason for hiding this comment

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

Reviewable status: 3 of 7 files reviewed, 1 unresolved discussion (waiting on @Arcticae, @mkaput, @orizi, and @piotmag769)


crates/cairo-lang-language-server/Cargo.toml line 29 at r4 (raw file):

Previously, mkaput (Marek Kaput) wrote…

These comments are unnecessary imho: if we use these deps, then we use them, and comments break easily sorting deps

Done.

Copy link
Collaborator

@Arcticae Arcticae left a comment

Choose a reason for hiding this comment

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

Reviewed 1 of 4 files at r2, 2 of 2 files at r4.
Reviewable status: 4 of 7 files reviewed, 5 unresolved discussions (waiting on @Draggu, @mkaput, @orizi, and @piotmag769)


crates/cairo-lang-language-server/src/lang/proc_macros/plugins/scarb/inline.rs line 12 at r4 (raw file):

use crate::lang::proc_macros::db::ProcMacroCacheGroup;

// scarb code

I would mark where it comes from, for easier exploration and maintainability (perhaps a git permalink also would be nice)


crates/cairo-lang-language-server/src/lang/proc_macros/plugins/scarb/mod.rs line 11 at r4 (raw file):

pub mod regular;

// Code from scarb.

Same as above


crates/cairo-lang-language-server/src/lang/proc_macros/plugins/scarb/regular.rs line 20 at r4 (raw file):

use crate::lang::proc_macros::db::ProcMacroCacheGroup;

// scarb code

Same as above


crates/cairo-lang-language-server/src/lang/proc_macros/plugins/mod.rs line 12 at r4 (raw file):

// Keep it private.
mod downcast;
// Code from scarb.

Let's not describe it on import

Copy link
Collaborator

@orizi orizi left a 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 r3, 2 of 2 files at r5, all commit messages.
Reviewable status: all files reviewed, 5 unresolved discussions (waiting on @Draggu and @mkaput)

@Draggu Draggu changed the title LS: Proc macros - scarb code LS: Proc macro - scarb code Nov 19, 2024
@Draggu Draggu changed the base branch from main to spr/main/36b6c854 November 19, 2024 18:35
Code calling dylib is replaced with one calling proc-macro-server. Also `aux_data` is removed as it is useless for LS.

commit-id:381d1f35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants