-
-
Notifications
You must be signed in to change notification settings - Fork 648
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
Extend the default doc xref regexp #2781
Conversation
To recognize [[var]] syntax and fully qualified symbols as xref links
That's a nice improvement! I believe we did something similar a while ago in |
(rx (or (: "`" (group-n 1 (+ (not space))) "`") ; `var` | ||
(eval-and-compile | ||
(defcustom cider-doc-xref-regexp | ||
(rx-to-string |
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.
Shouldn't the eval-and-compile
be here?
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.
Ah of course, changing it now-
(not space) was too permissive and would include commas and other punctuation.
I looked into writing tests for this, but realised there were none written for the entire |
The best approach is to simply stub the functions that require a REPL connection. |
I added a test for the regexp matching in cider-util, which should cover the changes for this PR. |
Great work! Thanks! 🙇 |
@yuhan0 Btw, it'd be a good idea to update the font-locking of fully-qualified vars appearing in docstrings in |
This allows cider-doc buffers to recognize
[[var]]
syntax and fully qualified symbols as xref links.Both are fairly common in docstrings in core and 3rd-party libraries that I've personally encountered, and it's otherwise somewhat annoying to navigate to a referenced var or function. (E.g. executing
M-x cider-doc
in a*cider-doc*
buffer doesn't pick up the symbol at point).If this is acceptable I'll go ahead with adding tests and changelogs :)
Before submitting the PR make sure the following things have been done (and denote this
by checking the relevant checkboxes):
make test
)make lint
) which is based onelisp-lint
and includescheckdoc
, check-declare, packaging metadata, indentation, and trailing whitespace checks.