Skip to content

Missing node warning and quickfixes#402

Merged
desplesda merged 8 commits intoYarnSpinnerTool:mainfrom
pappleby:missing-node-warning-and-quickfixes
Apr 10, 2025
Merged

Missing node warning and quickfixes#402
desplesda merged 8 commits intoYarnSpinnerTool:mainfrom
pappleby:missing-node-warning-and-quickfixes

Conversation

@pappleby
Copy link
Copy Markdown
Contributor

@pappleby pappleby commented Mar 23, 2025

  • Please check if the pull request fulfills these requirements
  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)
  • CHANGELOG.md has been updated to describe this change

To update the documentation on yarnspinner.dev, please visit the documentation repository.

  • What kind of change does this pull request introduce?
  • Bug Fix
  • Feature
  • Something else
  1. Show a warning if there is a jump statement to a node name that does not exist in the current project {C0AC4330-A3A3-4305-9CA2-7F2A940498CF}
  2. Adds code actions to either generate a stub node with that node title, or rename the jump destination if it looks like a typo of a known node name (same fuzzy matching as the undeclared variable code action).
    {B10B5891-F11F-4679-B096-75975D4372D1}
  • Does this pull request introduce a breaking change? (What changes might users need to make in their application due to this PR?)
    Nope!

  • Other information:

Comment on lines +236 to +246
suggestions = suggestions.Prepend(
new CommandOrCodeAction(
new CodeAction
{
Title = $"Generate node '{jumpDestination}'",
Kind = CodeActionKind.QuickFix,
IsPreferred = true,
Edit = new WorkspaceEdit { Changes = insertDeclarationEdit },
}
)
);
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Would be great if this could move the cursor to the newly created node. Didn't find a way to do this with an edit, but maybe it's possible with a command instead?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Command is a no go :/ (won't show up as a suggestion if its not a CodeAction QuickFix).

@pappleby pappleby marked this pull request as ready for review March 26, 2025 06:00
@desplesda desplesda merged commit 12e418c into YarnSpinnerTool:main Apr 10, 2025
1 check passed
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