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

[feat] Warn on pasting if out of scope #763

Open
Kitenite opened this issue Nov 8, 2024 · 0 comments
Open

[feat] Warn on pasting if out of scope #763

Kitenite opened this issue Nov 8, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@Kitenite
Copy link
Contributor

Kitenite commented Nov 8, 2024

Describe the feature

When pasting, a code block can have dependencies that no longer exist outside of its scope. In this case, we should detect and warn the user if pasting the code block will cause an issue.

This can be a simple check on if the component field on the templateNode and the destination's templateNode is the same. Though this does not handle cases where the dependencies are generated inside a lambda. Example:

<div>
    {a.map((b: string) => <p>{b}</p>)}
</div>

In this case, moving p anywhere will cause a problem.

Related user convo: https://discord.com/channels/1258534787279355975/1299391079489212416/1304485766491148439

@Kitenite Kitenite added the enhancement New feature or request label Nov 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant