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

[Java] Refactor javadoc #1351

Merged
merged 1 commit into from
Feb 8, 2018
Merged

Conversation

lastsecondsave
Copy link
Contributor

Javadoc's syntax hasn't been changed since tmLanguage era and there are so many things wrong with it so I just redid it from the scratch.

'Strategic' changes:

  1. Syntax is now hidden. It is part of Java, by itself it's pointless.
  2. It is not included anymore, it now relies on new embed/escape functionality. This fixes issue [Java] Javadoc can 'escape' its bounds #1216.
  3. URL's highlighting was removed. It isn't part of the javadoc, links are defined with html's <a> tag (which is already highlighted).

Fixes/improvements:

  1. One-line javadocs now work.
  2. Leading html tag doesn't turn off the highlighting.
  3. Lines without leading asterisk are not treated as invalid anymore. The asterisk is optional since 2002.
  4. All inline tags can now be multiline. They do not re-highlight the leading asterisk.
  5. 'code' tag now supports brackets' balancing.
  6. 'link' tag has reference and label scoped properly. Label can now contain html tags.
  7. 'param' tag has its parameters highlighted. Type parameter is not recognized as html tag anymore.
  8. 'see', 'throws' and other tags with reference now have this reference recognized.
  9. Added new tags from Java 8 and 9.

Before:

After:

@lastsecondsave
Copy link
Contributor Author

BTW this also fixes issue #966

@FichteFoll
Copy link
Collaborator

FichteFoll commented Dec 11, 2017

Always love seeing screenshot comparisons of PR changes.

Python needs this too. Primarily for the sphinx style, which is the easiest to recognize correctly, but there are other docstring styles that I haven't studied yet wrt their distinguishability.

@wbond
Copy link
Member

wbond commented Feb 8, 2018

Awesome, thanks for this!

@rwols
Copy link
Contributor

rwols commented Feb 12, 2018

Perhaps we can use this in C/C++/ObjC/ObjC++ too?

@wbond
Copy link
Member

wbond commented Feb 12, 2018

@rwols Do people use Javadoc in C languages?

@rwols
Copy link
Contributor

rwols commented Feb 12, 2018

No, but it's so similar to Doxygen, I wonder if it'll "just work".

deathaxe pushed a commit to deathaxe/sublime-packages that referenced this pull request Jun 9, 2019
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