vscode-ampscript icon indicating copy to clipboard operation
vscode-ampscript copied to clipboard

Update ampscript.tmLanguage.json

Open muenzpraeger opened this issue 2 years ago • 2 comments

This PR extends the AMPscript TextMate definitions to:

  • be autodetected for .amp files
  • apply syntax highlighting also when AMPscript is used outside of a block statement

muenzpraeger avatar Dec 01 '22 22:12 muenzpraeger

Hi @muenzpraeger Thanks a lot for your PR. I really appreciate your contribution. Could you please extend your description a bit more and help me understand the exact problems this PR solves?

be autodetected for .amp files In the current version, if you open an amp file, it will automatically enable ampscript syntax highlighting. But it feels like your PR helps to do smth else.

apply syntax highlighting also when AMPscript is used outside of a block statement Right now extension supports block (%%[...]%%) and inline (%%==%%) ampscript

Thanks a lot in advance.

Bizcuit avatar Dec 02 '22 09:12 Bizcuit

The autodetection (aka: property fileTypes) is meant to be for cases when a language can't be autodetected (see 12.1, 2nd bullet here). It's part of the grammar spec. That's less a thing for VS Code itself, and more a general practice.

The other part (apply syntax highlighting) is so that syntax highlighting is even applied when AMPscript is not inline/block (sorry for being clear). Like when you build some AMP within an .amp file, you'll always have to have it enclosed as block/inline, otherwise it's not highlighted.

muenzpraeger avatar Dec 02 '22 11:12 muenzpraeger