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

No dependency resolution for can_macroexpand + external macro #2811

Open
damourChris opened this issue Feb 15, 2024 · 4 comments
Open

No dependency resolution for can_macroexpand + external macro #2811

damourChris opened this issue Feb 15, 2024 · 4 comments
Labels
bug Something isn't working macro Julia macros: @oops reactivity The Pluto programming paradigm

Comments

@damourChris
Copy link

damourChris commented Feb 15, 2024

A function definition that use the @htl macro and has a docstrings attached to it cannot be called before the definition as the cell isn't ordered properly.

You can see in MWE that the cell with the call to the bad function is located
before the function definition and does not work. When placed after, it does.

Note that this only seems to be when combining @htl and docstring.

Minimum Working Example

MWE

Tested in Pluto v0.19.38

@damourChris damourChris changed the title Cell Ordering fails for methods that use @htl macro and have a docstring Wrong order of cell execution for methods that use @htl macro and have a docstring Feb 15, 2024
@Pangoraw Pangoraw added bug Something isn't working reactivity The Pluto programming paradigm macro Julia macros: @oops labels Feb 15, 2024
@fonsp
Copy link
Owner

fonsp commented Feb 21, 2024

Thanks for writing a MWE!

@geoextra
Copy link

I was facing the same issue and I think go introduced in a recent version. In my git history I can see that my notebook file got "corrupted" without having docstrings added.

@fonsp
Copy link
Owner

fonsp commented Feb 29, 2024

@Pangoraw Do you see a way to fix this? Otherwise let's just revert #2797

@Pangoraw
Copy link
Collaborator

Pangoraw commented Mar 1, 2024

@Pangoraw Do you see a way to fix this? Otherwise let's just revert #2797

It is interesting because it should carry on with the macro resolution but it doesn't. Maybe we can revert for now?

I think the problem is that we don't mark failed ExEx.try_macroexpand as unresolved so they are never resolved. See #1388 (comment). Another example with @bind + @u_str:

Screencast.from.01-03-2024.14.04.50.webm

@Pangoraw Pangoraw changed the title Wrong order of cell execution for methods that use @htl macro and have a docstring No dependency resolution for can_macroexpand + external macro Mar 1, 2024
VEZY added a commit to VEZY/STICS-IC-paper that referenced this issue Mar 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working macro Julia macros: @oops reactivity The Pluto programming paradigm
Projects
None yet
Development

No branches or pull requests

4 participants