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

(parser) continueScanAtSamePosition can break highlighting if no other matches are found #2649

Closed
pkaminski opened this issue Aug 9, 2020 · 5 comments · Fixed by #2650 or #2678
Closed
Labels
bug help welcome Could use help from community language
Milestone

Comments

@pkaminski
Copy link
Contributor

Describe the issue
When accessing a reflected class object using .class, a string following it doesn't get highlighted as such.

Which language seems to have the issue?
java

Are you using highlight or highlightAuto?
highlight

Sample Code to Reproduce
For example, ImmutablePair.of(stuff, "bar") works fine, but ImmutablePair.of(Stuff.class, "bar") doesn't highlight "bar" as a string. There's a live repro using highlightjs 10.1.2 here: https://jsfiddle.net/chmxa1ze/

Expected behavior
The string should be highlighted as such.

Additional context
This may be related to #2428 and/or its fix.

@pkaminski pkaminski added bug help welcome Could use help from community language labels Aug 9, 2020
@joshgoebel
Copy link
Member

Yikes. :-/

@joshgoebel joshgoebel added this to the 10.2 milestone Aug 9, 2020
@joshgoebel joshgoebel changed the title (java) Using .class breaks string highlighting (parser) continueScanAtSamePosition can break highlighting if no other matches are found Aug 9, 2020
@joshgoebel
Copy link
Member

What do you think about #2650?

@pkaminski
Copy link
Contributor Author

Not sure if "you" meant me above, but if so I'm the wrong person to ask. :) I only have surface knowledge of language definitions, and no idea at all about the engine itself.

@pkaminski
Copy link
Contributor Author

@joshgoebel I don't think this is quite fixed yet. The specific repro I posted above is now working, but this one is broken: https://jsfiddle.net/zxbtunvy/1/ Could you please have one more go at it? Thanks!

@joshgoebel
Copy link
Member

Related: #2678

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug help welcome Could use help from community language
Projects
None yet
2 participants