-
Notifications
You must be signed in to change notification settings - Fork 174
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
Fontifies documentation comments #64
Conversation
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @pnkfelix (or someone else) soon. If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. The way Github handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes. Please see CONTRIBUTING.md for more information. |
|
||
(defun rust-look-for-line-doc-comment (bound) | ||
;; Find documentation comments starging with //! or ///. It will | ||
;; only match it if it is inside a non-nestable comment. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typo: "starging" should be "starting"
I use Emacs 24.4.1. I haven't test it at all with other versions. |
@davazp I assume your response means that you noticed that travis CI says that emacs23 build is failing with this change? |
In Emacs>=24, it is possible to use the macros by prefixing them with cl-, (e.g: cl-loop), and it is not necessary to require the library. However, this is still necessary for Emacs23.
Actually I didn't notice, but I read about emacs23 in the README.md and I supposed things could go wrong. It was easy to fix. I have switched |
I'd love to see this merged -- is it missing anything? Looks good to me, other than one minor comment. |
@@ -374,6 +381,51 @@ | |||
("fn" . font-lock-function-name-face) | |||
("static" . font-lock-constant-face))))) | |||
|
|||
|
|||
(defun rust-extend-region-nested-comment () | |||
;; Extend the region given by `font-lock-beg' and `font-lock-end' to |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think these should be docstrings, what do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree they should be docstrings.
I opened an issue to run checkdoc as part of the test suite. I think checkdoc-compliance is a must for any elisp package. #70
Using the syntactic-face-function, we can assign the proper `font-lock-doc-face' to doc comments ("///", "//!", "/**", "/*!"). Test changes graciously copied from rust-lang#64
I close this pull request as #71 is a better solution. |
Using the syntactic-face-function, we can assign the proper `font-lock-doc-face' to doc comments ("///", "//!", "/**", "/*!"). Test changes graciously copied from rust-lang#64
I have implemented fontification of both line (/// and //!) and block (/* and /!) comments. It uses the
font-lock-doc-face
, which does not look very pretty in some themes. We could change this if necessary. It includes unit tests and it fixes #61.See a couple of screenshots: