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

customization of the tagged language strings #4

Open
baronfel opened this issue Aug 27, 2021 · 2 comments
Open

customization of the tagged language strings #4

baronfel opened this issue Aug 27, 2021 · 2 comments

Comments

@baronfel
Copy link

I wonder if it would be possible to define some kind of mechanism that lets a user define what the language of the embeddedLanguages should map to. I ask because there are existing VSCode tooling extensions around the postgresql language for example that might be able to be lit up if the text was tagged as postgres language instead of just sql. Are you aware of any ways to do this?

@alfonsogarciacaro
Copy link
Owner

For what I've seen, the way to "customize" this is to have different patterns in a comment preceding the literal, like (* sql *) or (* postgresql *). I used the function to make it less verbose, but we could check for a comment for extra fine-tuning. Like this extension that I was using at the beginning (but had to uninstall because it was messing with other code many times).

BTW, about embeddedLanguages, they don't really seem to work. The highlighting is just activated when defining the content of the match as text.html.derivative or source.sql.

@texastoland
Copy link

texastoland commented Jun 7, 2023

I'm not sure to what extent embedded languages could work with interpolated strings anyway. Their tooling wouldn't know how to deal with the holes. Perhaps worth investigating for HTML first.

As for custom languages would let postgresql = sql work? Unfortunately due to a limitation of TextMate language grammars postgresql would still need added to the syntax definition though. Close?

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 a pull request may close this issue.

3 participants