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

Add a flag to print generated locations. #7187

Merged
merged 1 commit into from
Feb 2, 2025

Conversation

ilyalesokhin-starkware
Copy link
Contributor

No description provided.

@reviewable-StarkWare
Copy link

This change is Reviewable

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 r1, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @ilyalesokhin-starkware)


crates/cairo-lang-filesystem/src/db.rs line 352 at r1 (raw file):

/// Returns the location of the originating user code.
pub fn get_originating_location(

maybe move this check to the call site?
this sound like it would happen everywhere in the language server.

Code quote:

get_originating_location

@ilyalesokhin-starkware
Copy link
Contributor Author

crates/cairo-lang-filesystem/src/db.rs line 352 at r1 (raw file):

Previously, orizi wrote…

maybe move this check to the call site?
this sound like it would happen everywhere in the language server.

DiagnosticLocation::user_location?

do you know what is the first place that is used by the compiler but not the language server?

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.

Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @ilyalesokhin-starkware)


crates/cairo-lang-filesystem/src/db.rs line 352 at r1 (raw file):

Previously, ilyalesokhin-starkware wrote…

DiagnosticLocation::user_location?

do you know what is the first place that is used by the compiler but not the language server?

https://github.com/software-mansion/cairols/blob/50d36dc4f062f9d076987f384e13beeca8c34b24/src/lang/defs.rs#L133

seems like it at least does not rely on diagnostics.

@ilyalesokhin-starkware
Copy link
Contributor Author

crates/cairo-lang-filesystem/src/db.rs line 352 at r1 (raw file):

Previously, orizi wrote…

https://github.com/software-mansion/cairols/blob/50d36dc4f062f9d076987f384e13beeca8c34b24/src/lang/defs.rs#L133

seems like it at least does not rely on diagnostics.

I've decide to add it as a note

@ilyalesokhin-starkware
Copy link
Contributor Author

crates/cairo-lang-filesystem/src/db.rs line 352 at r1 (raw file):

Previously, ilyalesokhin-starkware wrote…

I've decide to add it as a note

Code snippet:

 error: Plugin diagnostic: Closing `}` without a matching `{`.
  --> lib.cairo:2:8
 panic!("bad_format(})")
        ^^^^^^^^^^^^^^^
note: The error originates from the generated code in lib.cairo[panic_macro]:4:47
        write!(__formatter_for_panic_macro__, "bad_format(})")
                                              ^^^^^^^^^^^^^^^
 

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 2 of 2 files at r2.
Reviewable status: all files reviewed (commit messages unreviewed), 1 unresolved discussion (waiting on @ilyalesokhin-starkware)


crates/cairo-lang-diagnostics/src/diagnostics.rs line 326 at r2 (raw file):

                diag_location.user_location_with_plugin_notes(files_db, file_notes);

            let print_generated_location = diag_location != user_location

Suggestion:

            let include_generated_location = diag_location != user_location

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.

:lgtm:

Reviewed 1 of 1 files at r3, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @ilyalesokhin-starkware)

@ilyalesokhin-starkware ilyalesokhin-starkware added this pull request to the merge queue Feb 2, 2025
Merged via the queue into main with commit e8df798 Feb 2, 2025
48 checks passed
@ilyalesokhin-starkware ilyalesokhin-starkware deleted the ilya/debug_generated branch February 2, 2025 12:03
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.

3 participants