-
-
Notifications
You must be signed in to change notification settings - Fork 23
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
fix: parsing error for nesting {#snippet}
#540
Conversation
🦋 Changeset detectedLatest commit: 4e8b170 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Pull Request Test Coverage Report for Build 9559791113Details
💛 - Coveralls |
Pull Request Test Coverage Report for Build 9559807428Details
💛 - Coveralls |
Pull Request Test Coverage Report for Build 9560319146Details
💛 - Coveralls |
Hey! Within my project I've managed to get three different parser errors which seem to have the root cause lying in the usage of snippets https://github.com/gitbutlerapp/gitbutler/actions/runs/9582690351/job/26422242794?pr=4109. I was wondering if this was related & fixed by this PR, or whether I should make a separate issue. In my case, it doesn't seem to be a problem when when have a snippet passed directly as a prop, but it causes parser errors whenever I define a snippet at the top level and then consume it elsewhere within the same svelte file. IE: <div class="commit-list-item">
<div class="commit-card-wrapper">
{@render moveCommitDropzone()}
</div>
</div>
{#snippet moveCommitDropzone()}
<Dropzone
accepts={actions.acceptMoveCommit.bind(actions)}
ondrop={actions.onMoveCommit.bind(actions)}
fillHeight
>
{@render branchDropDropzone()}
{#snippet overlay({ hovered, activated })}
<CardOverlay {hovered} {activated} label="Move here" />
{/snippet}
</Dropzone>
{/snippet}
{#snippet branchDropDropzone()}
<Dropzone
accepts={actions.acceptBranchDrop.bind(actions)}
ondrop={actions.onBranchDrop.bind(actions)}
fillHeight
>
{@render children()}
{#snippet overlay({ hovered, activated })}
<CardOverlay {hovered} {activated} label="Move here" />
{/snippet}
</Dropzone>
{/snippet}
|
I've actually ended up building the branch locally, and can confirm that this PR does fix my snippet related errors too!!! Thanks for your hard work |
I'm making use of a self-build version of svelte-eslint-parser which contains a fix for nested snippet definitions. https://github.com/gitbutlerapp/svelte-eslint-parser When sveltejs/svelte-eslint-parser#540 is released we can revert back to the standard track
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.
Thank you!
fixes #522