-
Notifications
You must be signed in to change notification settings - Fork 142
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
Java syntax highlighting wrong (JavaDoc does not end) #160
Comments
Note: this happens with both newlines and no-newlines mode. |
Bisecting shows it come from sublimehq/Packages#1351 Since it keeps treating the rest of the class as JavaDoc, I'm guessing some context is not popped? Related to #104 maybe? |
Changing https://github.com/sublimehq/Packages/pull/1351/files#diff-9100242f2b69d8e25efae312969f1256R15 to |
Looks like it could be caused by the same problem that plagues the ASP syntax in syntect re |
I wasted a bit of time due to not finding this issue earlier, but hopefully someone else can benefit from what I've discovered here. I've managed to boil down the JavaDoc syntax into this much smaller form which demonstrates the issue: %YAML 1.2
---
name: Javadoc
scope: text.html.javadoc
contexts:
prototype:
- match: ^(\*)
captures:
1: punctuation.definition.comment.javadoc
main:
- meta_include_prototype: false
- match: /\*\*
scope: comment.block.documentation.javadoc punctuation.definition.comment.begin.javadoc
embed: contents
embed_scope: comment.block.documentation.javadoc text.html.javadoc
escape: \*/
escape_captures:
0: comment.block.documentation.javadoc punctuation.definition.comment.end.javadoc
contents:
- match: ''
scope: comment.block.documentation.javadoc I am using the newlines (NOT no newlines) mode with a patched version of synhtml, which produces the following output: Test case 1package org.joda.time.chrono;/**
**/class BasicChronology extends AssembledChronology {
} Test case 2package org.joda.time.chrono;/**
*/class BasicChronology extends AssembledChronology {
}
I didn't manage to track the issue further down than this, though, as I'm just not proficient enough in Rust or Syntect's inner workings yet. |
Fixed by #172. Anyone who uses syntect: let me know if you'd like a prompt release for this, otherwise I'll wait and batch it with other things. |
@trishume could you reopen this issue? @keith-hall Unfortunately I just discovered that #172 did not fully resolve this. It did resolve the "test case 2" I wrote above, however if there is a space in front of the final
Renders via Without the space in front of It renders fine in ST3 with this same syntax version, of course. I have not yet narrowed down the problem, however I did discover a crude workaround that for some reason solves the issue in Syntect: emidoots/Packages@d8c964e |
another crude workaround that significantly reduces the number of |
This is also occurring in D programming language.
Removing the additional asterisk from allows highlighting until another double asterisk is found. |
The following Java file
renders correctly with
syncat
and sublimehq/Packages pinned to fa6b862 (see testdata/Packages):However, when updating sublimehq/Packages to master (currently at 0f852a3) ...
the docstring highlighting does not end:
I'm not sure if syntect always aims to support the current state of sublimehq/Packages, but I thought it might be worth to report this.
The text was updated successfully, but these errors were encountered: