microsoft / vscode-custom-data

Documentation and sample for using VS Code custom data format
MIT License
196 stars 75 forks source link

Suggestion: Ability to define custom elements that support RAWTEXT/PLAINTEXT content like script/style #17

Open rbuckton opened 4 years ago

rbuckton commented 4 years ago

I've been working on a VS Code extension for Ecmarkup, which is an HTML-based dialect. However, there is a case where I've run into issues with the html language service and have spent far too much time trying to build a custom embedded language service just to work around. In Ecmarkup, there is a tag that is essentially treated like RAWTEXT in the same way that a <style> or <script> tag might be parsed: <emu-grammar>. The contents of this tag are essentially a different language mode with custom syntax based on Grammarkdown.

Unfortunately, there's no way to indicate such a tag should be parsed in this way, and as a result I've had to essentially fork the html language service and implement a custom parser to work around this case.

I'd imagine something like this:

{
  "tags": [
    { "name": "style", "content": "rawtext", ... }
  ]
}