Skip to content

Yarn Spinner doesn't gracefully handle actions it knows are invalid. #157

Description

@McJones

Currently the ysls can know if an action (command or function) has some sort of error via the containsErrors key which is nice but it has a slightly weird behaviour around situations where that action is then attempted to be used in yarn.
These invalid actions are stuck in a weird limbo state where Yarn Spinner knows some stuff about it but not enough to diagnose or fix the issues with it.

As it currently stands you get told in the yarn that the error is an unknown command or unable to determine expression type when it would be better to let us know that the action is known but it won't work if you try and use it.
And because the action is in this weird limbo state the jump to definition doesn't work so the area where you'd see the issue and potentially fix it is disconnected.
Related to this though if you attempt to call a broken function in an expression it appears in the list of available expressions despite the project knowing this won't work.

I think the following changes should happen:

  1. Compiler emits a new warning for actions it knows about that have issues
  2. Calls to these invalid actions should appear struck through similar to deprecated methods in other programming languages
  3. Enable normally hover and jump-to-definition info on the invalid actions

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

CoreIssues concerning the compiler or engine-independent code in the YarnSpinner repoProposalAn idea for a new feature or changed behaviour you wantVSCodeIssues concerning the extension for Visual Studio Code in the VSCodeExtension repo

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions