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

lang: semantic tests #949

Merged
merged 3 commits into from
Sep 30, 2023
Merged

lang: semantic tests #949

merged 3 commits into from
Sep 30, 2023

Conversation

shramee
Copy link
Contributor

@shramee shramee commented Sep 30, 2023

Semantic tests for set! and get! macros.
#924

//! > semantic_diagnostics
error: Identifier not found.
--> get_inline_macro:2:96
let mut __get_macro_keys__ = array::ArrayTrait::new();serde::Serde::serialize(@key, ref __get_macro_keys__);
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we improve formatting here? i.e. new line. I guess it's not possible to define key / suppress this? It adds noise to the test

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's just showing the whole line where stuff happens. I think most straightforward is to add some line breaks in macro expansion. Which is what I've done in the latest commit 😉

with concise diagnostics
//! > semantic_diagnostics
error: Identifier not found.
--> get_inline_macro:3:26
serde::Serde::serialize(@key, ref __get_macro_keys__);
Copy link
Contributor

Choose a reason for hiding this comment

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

If we add key and world to setup and intern dojo-core in the semantic db i think these diagnostics will go away

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Aah, I misunderstood...
Yeah, I can look into it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

To get rid of all diagnostic, we actually need the whole dojo crate to have it work.
Or mock stuff we need.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

🫡

@shramee shramee merged commit 92fa8b1 into dojoengine:main Sep 30, 2023
@shramee shramee deleted the semantic-tests branch September 30, 2023 17:59
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.

2 participants