Skip to content
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 embedding in new YAML grammar #17

Merged
merged 2 commits into from
Aug 31, 2024
Merged

Conversation

RedCMD
Copy link
Contributor

@RedCMD RedCMD commented Aug 17, 2024

VSCode is adopting a new YAML grammar
microsoft/vscode#224978

Injecting into nested block maps doesn't work fully anymore
this is because the new grammar captures the prefixing whitespace, disallowing this injection to capture the newline ^

Workaround is to change ^ to (^|\\G)

working

broken fixed

nested:
  test: | #js
    console.log("hello world")

Install VSCode 1.92.0, the insiders build or the new grammar
Make sure no other YAML extension is installed (Red Hat's etc)

@RedCMD
Copy link
Contributor Author

RedCMD commented Aug 29, 2024

@ruschaaf VSCode is looking at re-adding the new YAML grammar again in the upcoming Sep 4th release
microsoft/vscode#180523 (comment)

@ruschaaf
Copy link
Owner

Thanks for the fix, looking forward to the new grammar too

@ruschaaf ruschaaf merged commit 64f7cf2 into ruschaaf:trunk Aug 31, 2024
@RedCMD
Copy link
Contributor Author

RedCMD commented Sep 1, 2024

Sorry, my bad
\\G should have been \G, which expands to \\G in the JSON (not \\\\G)

RedCMD added a commit to RedCMD/extended-embedded-languages that referenced this pull request Oct 21, 2024
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