vscode-template-literal-editor icon indicating copy to clipboard operation
vscode-template-literal-editor copied to clipboard

How do I configure this?

Open balupton opened this issue 5 years ago • 1 comments

The instructions on the schema for templateLiteralEditor.regexes is obtuse.

For instance, given this typescript code:

import marli from 'marli'
const markdown = marli()

const html = markdown`this is some *markdown* yay`

How do I configure this extension such that the markdown tagged template literal uses the markdown syntax in vscode?

balupton avatar Jul 13 '19 05:07 balupton

Hi, sorry about obscure documentation. Regexes only affect how template literals or other editable areas are to be found from host languages. Typescript is parsed with actual typescript parser, so template literals are found automatically. When a template literal is found, the extension asks what language should be applied to the part in focus. This step is not yet configurable. I have found it to be easiest to just press Ctrl+Enter, m, a, enter (or such) to quickly select markdown, for example, especially as the extension remembers the last as default. I could look into making this configurable if you don't need nested literals or such provided by actual typescript parser, and so regexes should be fine.

plievone avatar Jul 13 '19 15:07 plievone