Skip to content

[feature] Open in playground feature #2000

Description

@samwightt

⭐ Suggestion

It would be nice if there were a CLI command and / or way in VSCode to open a rule and the error that triggered it in the playground.

For example, maybe the command is:

ast-grep open-playground --file ./something.ts --rule some-rule-id # Errors show the path and the rule ID,
# not the rule file location.

# Also I don't like this command name, it's just an example. Might be nice to put it under a 'debug' command group or something.

The command would use open and open the link in the browser.

💻 Use Cases

Sometimes when there's an error brought up by a rule I want to be able to open the playground with the rule and the code file to see what's going on. I can do this manually, but it'd be nice if there was a shortcut.

Testing Library has this as a feature, where if you add screen.logTestingPlaygroundURL() to a test it will output a clickable URL to the testing library playground.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions