-
-
Notifications
You must be signed in to change notification settings - Fork 649
Introduce Java doc comment rendering #3472
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
Changes from all commits
43f574c
d0f0819
e5cf775
4074afa
f8286c9
8c336c2
c91a296
aab2ce9
97b1761
9084c4d
7331b29
9b3ce28
fe71782
8850264
5a438f2
d18baef
73e9680
f1d5257
7e77c20
2d831b1
a04f436
69fd34a
b9dcc30
6ab5381
548a57b
952bbbc
e0fd855
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,6 +23,7 @@ jobs: | |
matrix: | ||
os: [macos-latest, ubuntu-latest, windows-latest] | ||
emacs_version: ['26.3', '27.2', '28.2', '29.1'] | ||
java_version: ['11', '17'] | ||
|
||
steps: | ||
- name: Set up Emacs | ||
|
@@ -67,7 +68,7 @@ jobs: | |
with: | ||
distribution: 'temurin' | ||
# shadow requires java 11 | ||
java-version: 11 | ||
java-version: ${{matrix.java_version}} | ||
|
||
- name: Install Clojure Tools | ||
# Use SHA until | ||
|
@@ -91,3 +92,11 @@ jobs: | |
# be GH connectivity runner issues. We attempt to address this | ||
# problem by rerunning the tests more than once. | ||
eldev -p -dtTC test --test-type integration || eldev -p -dtTC test --test-type integration | ||
|
||
- name: Run tests that need enrich-classpath | ||
if: "!startsWith(matrix.os, 'windows')" | ||
run: | | ||
cd dev; ../clojure.sh clojure -M:gen; cd - | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. now the As a nice side-effect, we get to exercise our clojure.sh script, and with it, enrich-classpath. Both get an extra exercise given the JVM matrix. We could build more tests like this in a future - nice middle ground between reliable and realistic tests (since there's no nrepl connection - only data). |
||
wc -l test/File.edn | ||
eldev -p -dtTC test --test-type enrich || eldev -p -dtTC test --test-type enrich | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,3 +16,4 @@ cider-pkg.el | |
cider-refcard.aux | ||
cider-refcard.log | ||
doc/auto/ | ||
test/*.edn |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,25 +11,32 @@ | |
(eldev-add-loading-roots 'test "test/utils") | ||
(eldev-add-extra-dependencies 'runtime '(:package logview :optional t)) | ||
|
||
;; slightly increase the maximum (applies to checkdoc and the byte compiler alike) | ||
(setq byte-compile-docstring-max-column 100) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The Emacs maintainers advised against doing this, that's why I had changed it. Normally it's best to have development settings in There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It didn't work otherwise though 😞 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hmm, I can't imagine how - after all There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't know There's no mention of .dir-locals in the Eldev repo, which might be a signal that it isn't considered as a config mechanism (it does mention There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @doublep Does Eldev ignore dir-locals intentionally? If so, I guess we should have the config in both places. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No, it simply doesn't do anything special. Which means they are not activated through some automatic magic.
Those don't include |
||
|
||
;; allow commas to indicate that the first sentence continues, which enables longer first sentences | ||
(setq checkdoc-permit-comma-termination-flag t) | ||
|
||
(defvar cider-test-type 'main) | ||
(setf eldev-standard-excludes `(:or ,eldev-standard-excludes | ||
;; Avoid including files in test "projects". | ||
(eldev-pcase-exhaustive cider-test-type | ||
(`main "./test/*/") | ||
(`integration '("./test/" "!./test/integration")) | ||
(`enrich '("./test/" "!./test/enrich")) | ||
(`all '("./test/*/" "!./test/integration"))) | ||
"test/integration/projects" | ||
;; This file is _supposed_ to be excluded | ||
;; from automated testing. | ||
"test/cider-tests--no-auto.el")) | ||
|
||
(eldev-defoption cider-test-selection (type) | ||
"Select tests to run; type can be `main', `integration' or `all'" | ||
"Select tests to run; type can be `main', `integration', `enrich' or `all'" | ||
:options (-T --test-type) | ||
:for-command test | ||
:value TYPE | ||
:default-value cider-test-type | ||
(unless (memq (intern type) '(main integration all)) | ||
(unless (memq (intern type) '(main integration enrich all)) | ||
(signal 'eldev-wrong-option-usage `("unknown test type `%s'" ,type))) | ||
(setf cider-test-type (intern type))) | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,122 @@ | ||
;;; cider-completion-context.el --- Context parsing -*- lexical-binding: t -*- | ||
|
||
;; Copyright © 2013-2023 Bozhidar Batsov, Artur Malabarba and CIDER contributors | ||
;; | ||
;; Author: Bozhidar Batsov <bozhidar@batsov.dev> | ||
;; Artur Malabarba <bruce.connor.am@gmail.com> | ||
|
||
;; This program is free software: you can redistribute it and/or modify | ||
;; it under the terms of the GNU General Public License as published by | ||
;; the Free Software Foundation, either version 3 of the License, or | ||
;; (at your option) any later version. | ||
|
||
;; This program is distributed in the hope that it will be useful, | ||
;; but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
;; GNU General Public License for more details. | ||
|
||
;; You should have received a copy of the GNU General Public License | ||
;; along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
|
||
;; This file is not part of GNU Emacs. | ||
|
||
;;; Commentary: | ||
|
||
;; Context-parsing utilities. Extracted from cider-completion.el. | ||
|
||
;;; Code: | ||
|
||
(defcustom cider-completion-use-context t | ||
"When true, uses context at point to improve completion suggestions." | ||
:type 'boolean | ||
:group 'cider | ||
:package-version '(cider . "0.7.0")) | ||
|
||
(defun cider-completion--bounds-of-non-string-symbol-at-point () | ||
"Returns the bounds of the symbol at point, unless it's inside a string." | ||
(let ((sap (symbol-at-point))) | ||
(when (and sap (not (nth 3 (syntax-ppss)))) | ||
(bounds-of-thing-at-point 'symbol)))) | ||
|
||
(defun cider-completion-symbol-start-pos () | ||
"Find the starting position of the symbol at point, unless inside a string." | ||
(car (cider-completion--bounds-of-non-string-symbol-at-point))) | ||
|
||
(defun cider-completion-symbol-end-pos () | ||
"Find the end position of the symbol at point, unless inside a string." | ||
(cdr (cider-completion--bounds-of-non-string-symbol-at-point))) | ||
|
||
(defun cider-completion-get-info-context-at-point () | ||
"Extract a context at point that is suitable for eldoc and info ops. | ||
Note that this context is slightly different than that of | ||
`cider-completion-get-context-at-point': this one does not include | ||
the current symbol at point." | ||
(when (save-excursion | ||
(condition-case _ | ||
(progn | ||
(up-list) | ||
(check-parens) | ||
t) | ||
(scan-error nil) | ||
(user-error nil))) | ||
(save-excursion | ||
(let* ((pref-start (cider-completion-symbol-start-pos)) | ||
(context (cider-defun-at-point)) | ||
(end (cider-completion-symbol-end-pos)) | ||
(_ (beginning-of-defun-raw)) | ||
(expr-start (point)) | ||
(_ (if (derived-mode-p 'cider-repl-mode) | ||
(goto-char (point-max)) | ||
(end-of-defun))) | ||
(expr-end (point))) | ||
(string-remove-suffix "\n" | ||
(concat (when pref-start (substring context 0 (- pref-start expr-start))) | ||
"__prefix__" | ||
(substring context (- (- expr-end end))))))))) | ||
|
||
(defun cider-completion-get-context-at-point () | ||
"Extract the context at point. | ||
If point is not inside the list, returns nil; otherwise return \"top-level\" | ||
form, with symbol at point replaced by __prefix__." | ||
(when (save-excursion | ||
(condition-case _ | ||
(progn | ||
(up-list) | ||
(check-parens) | ||
t) | ||
(scan-error nil) | ||
(user-error nil))) | ||
(save-excursion | ||
(let* ((pref-end (point)) | ||
(pref-start (cider-completion-symbol-start-pos)) | ||
(context (cider-defun-at-point)) | ||
(_ (beginning-of-defun-raw)) | ||
(expr-start (point))) | ||
(concat (when pref-start (substring context 0 (- pref-start expr-start))) | ||
"__prefix__" | ||
(substring context (- pref-end expr-start))))))) | ||
|
||
(defvar cider-completion-last-context nil) | ||
|
||
(defun cider-completion-get-context (&optional info) | ||
"Extract context depending (maybe of INFO type). | ||
|
||
Output depends on `cider-completion-use-context' and the current major mode." | ||
(let ((context (if cider-completion-use-context | ||
;; We use ignore-errors here since grabbing the context | ||
;; might fail because of unbalanced parens, or other | ||
;; technical reasons, yet we don't want to lose all | ||
;; completions and throw error to user because of that. | ||
(or (ignore-errors | ||
(if info | ||
(cider-completion-get-info-context-at-point) | ||
(cider-completion-get-context-at-point))) | ||
"nil") | ||
"nil"))) | ||
(if (string= cider-completion-last-context context) | ||
":same" | ||
(setq cider-completion-last-context context) | ||
context))) | ||
|
||
(provide 'cider-completion-context) | ||
;;; cider-completion-context.el ends 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.
I introduced a JVM matrix (soon to be expanded with JDK 21)