1

I have downloaded a plugin for Language A. It is at %USERPROFILE%\.vscode\extensions\langA\syntaxes. There is a file langA.tmLanguage. It is XML.

I am creating Language B. I have a JSON .tmLanguage file. I have already added some custom coloring and folding rules. I would like to inherit Language A's syntax when it is embedded in Language B between START_MARKER and END_MARKER. Is this possible? Can someone help with the JSON syntax to accomplish this?

Bonus Question: Can anyone point me to a real simple hover example not using a language server? I would like to create a hover that takes the word with the cursor and searches the document for DEF_MARKER word to display in the hover. I am struggling with the real language examples due to my lack of experience in these languages and the complexity involved in, say, the Go example or other plugins I have downloaded.

Michael
  • 8,362
  • 6
  • 61
  • 88
user64600
  • 21
  • 2

1 Answers1

1

I think I got it.

{
    "name": "entity.name.tag",
    "begin": "^START_MARKER",
    "end": "^END_MARKER",
    "patterns": [
        {
            "include": "source.LangA"
        }
    ]           
}
user64600
  • 21
  • 2
  • For future people finding this: Most languages are "source.lang" eg "source.php", except for HTML (and maybe others?) which for some reason is "text.html.basic". It tripped me up at first. – jkrei0 May 25 '23 at 21:39