-
Notifications
You must be signed in to change notification settings - Fork 132
Highlight @example jsdoc body as source code #693
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
Comments
Isnt this already scoped correctly because of #688 |
This is for highlighting the content |
@mjbvz I don't think that's as easy as it seems .. I think that need to be handled by editors (by removing starting |
We use a while rule to do this, see: https://github.com/Microsoft/vscode/blob/master/extensions/typescript-basics/syntaxes/ExampleJsDoc.injection.tmLanguage.json It consumes the leading |
I still don't understand how multiline example is going to work. Where do you consume leading |
Looks like the logic that was moved into this file: https://github.com/Microsoft/vscode/blob/master/extensions/typescript-basics/syntaxes/MarkdownDocumentationInjection.tmLanguage.json The |
Fixes microsoft#467 Adds a begin/while rule so that doc blocks also consume the leading *. This approach has been used by VS Code to support highlighting example blocks (see microsoft#693) Remove the `invalid.illegal.type.jsdoc` rule since we now can highlight multiline types better
TS and JS Grammar Extension version: 0.0.47 / latest
Code
For a js doc body such as:
We mark the body of the
@example
block specially but do not actually syntax highlight it. I added an injection grammar in VS Code that does this: https://github.com/Microsoft/vscode/blob/master/extensions/typescript-basics/syntaxes/ExampleJsDoc.injection.tmLanguage.jsonMay be worth including in the core grammar. Let me know if you agree. The injection grammar will not work as is, we're relying on another injection grammar that handles separating the leading stars of the doc block from the documentation content itself
The text was updated successfully, but these errors were encountered: