Skip to content

Conversation

mjbvz
Copy link
Contributor

@mjbvz mjbvz commented Apr 8, 2019

Fixes #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 Highlight @example jsdoc body as source code #693). This allows injected grammars to not know they are being used inside a doc block

  • Remove the invalid.illegal.type.jsdoc rule since we now can highlight multiline types better

Before, without the begin/while rule:

Screen Shot 2019-04-08 at 2 24 39 PM

After:

Screen Shot 2019-04-08 at 2 24 54 PM

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
@mjbvz mjbvz requested a review from sheetalkamat April 8, 2019 21:26
- include: '#docblock'
- contentName: comment.block.documentation.body.ts
begin: (?<=/\*\*)([^*]|\*(?!/))*$
while: (^|\G)\s*\*(?!/)(?=([^*]|[*](?!/))*$)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The while pattern does not work in sublime and results in error and hence cannot be applied in this repo as it sublime typescript package also uses this grammar.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unfortunately is no way to implement this without begin/while. I can keep this grammar modification VS Code but it means that other consumers of this grammar (like VS) will not benefit

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants