Skip to content

Add support for embedding languages for the runs keyword #266

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

Open
dekimsey opened this issue Oct 11, 2023 · 3 comments
Open

Add support for embedding languages for the runs keyword #266

dekimsey opened this issue Oct 11, 2023 · 3 comments
Labels
enhancement New feature or request

Comments

@dekimsey
Copy link

Is your feature request related to a problem? Please describe.
Not specifically.

Describe the solution you'd like
I would like to see my step runs show the correct syntax when I'm editing GH Actions or Workflows. Thank you!

Additional context

IntelliJ supports this via a feature called Language Injection. Users can either add a comment before the key such as # language=sh or modify their JSON Schema to provide the "x-intellij-language-injection": "Shell Script" property.

For VSCode, a request for generic support didn't gain much traction. Based on the discussion in microsoft/vscode#1751 it seems the preferred way to do this is with an extension using Grammar Injection or Embedded Languages.

@dekimsey dekimsey added the enhancement New feature or request label Oct 11, 2023
@squiddickod squiddickod mentioned this issue Oct 30, 2023
Closed
@ronjouch
Copy link

Complementing OP's request: it would be great to support several "languages embedded in YAML":

  • Shell script in a run: block
  • JavaScript in a uses: actions/github-script@v7 block

And "Support" means:

  • Syntax highlighting
  • Checking (e.g. via Shellcheck for Shell, and via tsserver for JavaScript)

@voxpelli
Copy link

voxpelli commented Aug 2, 2024

Somewhat related proposal: microsoft/vscode#224581

@kdeldycke
Copy link

In the mean time, there is an extension which provides YAML blocks syntax highlighting: https://github.com/harrydowning/yaml-embedded-languages

Still not practical in this case as we would have to tag each run: | block with its corresponding language, like:

- shell: python
- run:|  # python
    print("Yo!") 

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

4 participants