Skip to content
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

Consume leading docblock *s #740

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

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.

None yet

2 participants