harrydowning / vscode-yaml-embedded-languages

A VS Code syntax extension for embedded language highlighting in YAML
https://marketplace.visualstudio.com/items?itemName=harrydowning.yaml-embedded-languages
MIT License
32 stars 7 forks source link

Support specifying a folder / file extension pattern to apply highlighting #57

Open devkeydet opened 1 month ago

devkeydet commented 1 month ago

I love the new file level comment feature to enable syntax highlighting across multiple yaml properties. However, it requires modifying every file you want highlighted. It would be nice to have an alternative way to do this that does not require editing each file. Instead, have the extension read from a workspace setting. Something along the lines of...

{
    "yaml-embedded-languages.someSettingName": [
        {
            "path": "folder\\subfolder\\**\\*.pa.yaml",
            "language": "powerfx"
        }
    ]
}
harrydowning commented 1 month ago

Thanks. Something like this should be possible, but with the way the extension currently works, it may require the VS code window to be reloaded when switching to a yaml file which doesn't match the pattern for a particular language. That may not be too bad though. I should see if there is a way to update the syntax without requiring a reload.