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

[C/C++/ObjC/ObjC++] Fix javadoc comment word wrap #3855

Merged
merged 1 commit into from
Oct 20, 2023

Conversation

BenjaminSchaaf
Copy link
Member

This was broken by e4e5273

@deathaxe
Copy link
Collaborator

deathaxe commented Oct 19, 2023

I can remember discussions about when leading asterisks are to be treated as punctuation. Especially Mitranim had some objections about it, IIRC.

The arguments were about JavaDoc always requiring /** and stripping leading asterisks, while normal block comments beginning with /* wouldn't treat leading asterisks special.

Go therefore even has an indentation based heuristic to decide when to treat them punctuation.

# Indentation, followed by exactly one space, followed by *.
# This enables support for javadoc comments, while avoiding false
# positives in non-javadoc comments that use "*" as simple list bullets.
- match: ^(?:\t|[ ]{2}|[ ]{4}|[ ]{8})*[ ](\*)(?!/)
captures:
1: punctuation.definition.comment.go

JavaScript also added this kind of separation in f850f0a. It didn't scope those at all before.

At least it not being present in normal block comments is not broken but by intent.

I have no objections about it. Actually scope them punctuation in normal block comments of Java as well.

If we add it here, we should probably also do that for JavaScript.

@deathaxe deathaxe merged commit 2038dad into sublimehq:master Oct 20, 2023
2 checks passed
deathaxe added a commit to deathaxe/sublime-packages that referenced this pull request Oct 20, 2023
This commit adds scoping for leading asterisks in (normal) block comments
so ST's word_wrap command can add them to each wrapped line, if present in
the first one.

Notes:

This change aligns JavaScript with Java and C/C++.

Related with sublimehq#3855
Thom1729 pushed a commit that referenced this pull request Oct 23, 2023
This commit adds scoping for leading asterisks in (normal) block comments
so ST's word_wrap command can add them to each wrapped line, if present in
the first one.

Notes:

This change aligns JavaScript with Java and C/C++.

Related with #3855
deathaxe added a commit to deathaxe/sublime-packages that referenced this pull request Nov 17, 2023
This commit ...

1. fixes missing closing `punctuation.definition` scopes
2. renames a `.js` final scope to `.json`
3. adjusts leading asterisk scoping according to sublimehq#3855 and sublimehq#3856.
4. refactors comment related contexts to use only named contexts.
deathaxe added a commit that referenced this pull request Nov 17, 2023
This commit ...

1. fixes missing closing `punctuation.definition` scopes
2. renames a `.js` final scope to `.json`
3. adjusts leading asterisk scoping according to #3855 and #3856.
4. refactors comment related contexts to use only named contexts.
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.

4 participants