<dtid="bracket">bracket: <em>kind</em></dt><dd><spanclass="adv">(Advanced)</span> The <code><em>kind</em></code> can be either <code>'@open'</code> or <code>'@close'</code>. This signifies that a token is either an open or close brace. This attribute is set automatically if the token class is <ahref="#@brackets"><codeclass="dt">@brackets</code></a>.
The editor uses the bracket information to show matching braces (where an open bracket matches with a close bracket if their token classes are the same). Moreover, when a user opens a new line the editor will do auto indentation on open braces. Normally, this attribute does not need to be set if you are using the <ahref="#brackets"><codeclass="dt">brackets</code></a> attribute and it is only used for complex brace matching. This is discussed further in the next section on <ahref="#complexmatch">advanced brace matching</a>.</dd>
<dtid="nextEmbedded">nextEmbedded: <em>langId</em><span>or</span> '@pop'</dt><dd><spanclass="adv">(Advanced)</span> Signifies to the editor that this token is followed by code in another language specified by the <code><em>langId</em></code>, i.e. for example <code>javascript</code>. Internally, our syntax highlighter keeps tokenizing the source until it finds an an ending sequence. At that point, you can use <codeclass="dt">nextEmbedded</code> with a <codeclass="dt">'@pop'</code> value to pop out of the embedded mode again. Usually, we need to use a <codeclass="dt">next</code> attribute too to switch to a state where we can tokenize the foreign code. As an example, here is how we could support CSS fragments in our language:
<dtid="nextEmbedded">nextEmbedded: <em>langId</em><span>or</span> '@pop'</dt><dd><spanclass="adv">(Advanced)</span> Signifies to the editor that this token is followed by code in another language specified by the <code><em>langId</em></code>, i.e. for example <code>javascript</code>. Internally, our syntax highlighter keeps tokenizing the source until it finds an an ending sequence. At that point, you can use <codeclass="dt">nextEmbedded</code> with a <codeclass="dt">'@pop'</code> value to pop out of the embedded mode again. <codeclass="dt">nextEmbedded</code> usually needs a <codeclass="dt">next</code> attribute to switch to a state where we can tokenize the foreign code. As an example, here is how we could support CSS fragments in our language:
<p>This will show a display over the currently selected token for its language, token type, basic font style and colors, and selector you can target in your editor themes.</p>
<p> </p>
<h2>Additional Examples</h2>
<p>Additional examples can be found in the <codeclass="dt">src</code> folder of the <ahref='https://github.com/microsoft/monaco-languages'>monaco-languages</a> repo.</p>