-
Notifications
You must be signed in to change notification settings - Fork 633
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
First stage of cleaning up the export handling of the slint root component #2095
Conversation
This needs more work. |
internal/compiler/lib.rs
Outdated
} | ||
|
||
diagnostics.all_loaded_files = loader.all_files().cloned().collect(); | ||
|
||
(doc, diagnostics) | ||
(root_component, doc, diagnostics) |
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.
Why do we return a root_component here instead of just using Document::root_component?
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.
I removed the root_component from the document because we use the document for each file but the root component concept only makes IMO sense for the component we generate code for / run. Perhaps eventually we'll remove it altogether and just go by exports?
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.
Besides feeling like a natural change, this also makes it easy to issue the warning only for the true root component, instead of for every Slint file. But if you prefer then I can try to solve that differently and restore root_component in Document.
internal/compiler/tests/syntax/exports/single_global_missing_export.slint
Show resolved
Hide resolved
0e154b2
to
3a3aa85
Compare
Implemented differently now, less invasive :) |
3a3aa85
to
98b67ab
Compare
98b67ab
to
d8ec67e
Compare
…onent We implicitly export the last component of a .slint file to the generator. Issue a warning when that happens and suggest to export it explicitly.
d8ec67e
to
ec64754
Compare
These assert that no diagnostics are produced
Don't produce warnings
We implicitly export the last component of a .slint file to the generator. Issue a warning when that happens and suggest to export it explicitly.