microsoft / microsoft/vscode-custom-data

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

Open
#17 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
240
Forks
95
PR merge metrics
No merged PRs in 30d

Description

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", ... }
  ]
}

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading the repository's custom data format documentation and sample, then review how the HTML language service handles script/style content and custom tags. Determine the supported shape for declaring RAWTEXT or PLAINTEXT elements and verify that an Ecmarkup-style custom element receives the intended language mode without a fork.

Written by the indexing model from the issue text.

Assessment

Tech stack
html, javascript, json
Domain
developer-experience, tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.