profile
viewpoint
If you are wondering where the data of this site comes from, please visit https://api.github.com/users/yuhan0/events. GitMemory does not store any data, but only uses NGINX to cache data for a period of time. The idea behind GitMemory is simply to give users a better reading experience.

yuhan0/ace-link 0

Quickly follow links in Emacs

yuhan0/anaconda-mode 0

Code navigation, documentation lookup and completion for Python.

yuhan0/asciidoctorj 0

:coffee: Java bindings for Asciidoctor. Asciidoctor on the JVM!

yuhan0/cider 0

The Clojure Interactive Development Environment that Rocks for Emacs

yuhan0/cider-eval-sexp-fu 0

eval-sexp-fu.el extensions for CIDER.

yuhan0/cider-nrepl 0

A collection of nREPL middleware originally designed to enhance Clojure editors

yuhan0/clj-fast 0

Unpredictably faster Clojure

yuhan0/clj-kondo 0

A linter for Clojure code that sparks joy.

yuhan0/clj-refactor.el 0

A collection of Clojure refactoring functions for Emacs

push eventyuhan0/clojure-mode

yuhan0

commit sha eebb3534b789c13c3a3e1fa9f0fa728225a3743d

Add tests for shorthand fn

view details

push time in 16 hours

push eventyuhan0/clojure-mode

yuhan0

commit sha 394e6ba8371d4f65194b3bb1f1dc6dcca9565eb6

Add tests for shorthand fn

view details

push time in 16 hours

PR opened clojure-emacs/clojure-mode

Add refactoring command for converting #() shorthand

M-x clojure-convert-shorthand-fn turns the closest #() before point into a regular (fn ...) form. If there are any % arguments it prompts interactively for the arg names. Useful for fixing nested #() forms and general refactoring for readability. (I believe the reverse refactoring is much less necessary in practice)

Keybindings:

Not implemented yet, but I think "convert function" ( prefix + cf / fc) makes sense in the clj-refactor package, as well as here in the default clojure-refactor-map as the single key bindings # f and c are all taken.


Before submitting a PR mark the checkboxes for the items you've done (if you think a checkbox does not apply, then leave it unchecked):

  • [x] The commits are consistent with our contribution guidelines.
  • [x] You've added tests (if possible) to cover your change(s). Bugfix, indentation, and font-lock tests are extremely important!
  • [ ] You've run M-x checkdoc and fixed any warnings in the code you've written.
  • [ ] You've updated the changelog (if adding/changing user-visible functionality).
  • [ ] You've updated the readme (if adding/changing user-visible functionality).

Thanks!

+133 -0

0 comment

2 changed files

pr created time in 17 hours

create barnchyuhan0/clojure-mode

branch : convert-fn-shorthand

created branch time in 18 hours

Pull request review commentclojure-emacs/cider

Fix errors on empty stacktraces

 counting from 0 while Clojure starts from 1. Accordingly, the `cider-nrepl` middleware uses 1-based indexing and all conversions to 0-based indexing should be handled client-side. See https://github.com/clojure-emacs/cider/issues/2852. -=== Empty Java stacktraces resulting in `NullPointerException`

(I removed this clause since it's not clear that the stacktraces are only omitted for NPEs or cause them to occur)

yuhan0

comment created time in 16 days

PullRequestReviewEvent

PR opened clojure-emacs/cider

Fix errors on empty stacktraces

Fixes #3022, succeeds #3023.

I also edited the docs to reflect that Cider no longer throws an error, and added beginner-friendly instructions for setting the JVM opts. Note: only added examples for Clojure CLI, since Leiningen enables the flag by default and I'm not familiar with Boot.


Before submitting the PR make sure the following things have been done (and denote this by checking the relevant checkboxes):

  • [x] The commits are consistent with our contribution guidelines
  • [ ] You've added tests (if possible) to cover your change(s)
  • [ ] All tests are passing (eldev test)
  • [x] All code passes the linter (eldev lint) which is based on elisp-lint and includes
  • [x] You've updated the changelog (if adding/changing user-visible functionality)
  • [ ] You've updated the user manual (if adding/changing user-visible functionality)

Thanks!

If you're just starting out to hack on CIDER you might find this section of its manual extremely useful.

+51 -33

0 comment

3 changed files

pr created time in 16 days

delete branch yuhan0/cider

delete branch : qyh

delete time in 16 days

create barnchyuhan0/cider

branch : fix-empty-stacktrace

created branch time in 16 days

create barnchyuhan0/cider

branch : qyh

created branch time in 16 days

issue commentclojure-emacs/cider

CIDER 1.1.1 Can't Handle Errors Without Stack Traces

I just got around to looking at this - turns out that change was for something else entirely! Sorry for any confusion 😓

The issue is in cider-stacktrace-render-frame - when this 'optimization' happens the argument frame is nil and further destructuring it into nils causes the formatting string error.

I agree with the discussion in #3023 that we should just check for this and point users to the relevant troubleshooting page, instead of setting any JVM option by default.

Here's what it might look like: image

If that's ok I'll submit a PR :) But first the website should be updated to reflect the commit linked above https://github.com/clojure-emacs/cider/commit/2f9bec5131dc3f06caeb9fdb36249f5d299104f4

timvisher

comment created time in 17 days

pull request commentclojure-emacs/cider

Allow clojuredocs navigation on qualified symbols and within *cider-clojuredocs* buffer

I was thinking the same thing :) There's some relevant "See also" button code already implemented at the bottom of cider-docview-render-info.

ag91

comment created time in 17 days

pull request commentclojure-emacs/cider

Allow clojuredocs navigation on qualified symbols and within *cider-clojuredocs* buffer

I don't think this is the right approach -- (thing-at-point 'symbol) works as expected in clojure-mode buffers and doesn't need a separate regex based approach to replace it. The problem is that the clojuredocs buffer uses the default fundamental-mode syntax table, which doesn't recognize . and ? as symbol constituents. Executing (set-syntax-table clojure-mode-syntax-table) in the buffer solves the issue.

The question might be whether to apply this more generally to other popups, in cider-make-popup-buffer, or only to cider-create-clojuredocs-buffer.

ag91

comment created time in 17 days

issue commentclojure-emacs/cider

CIDER 1.1.1 Can't Handle Errors Without Stack Traces

Here's a commit that I made more than a year ago on my local branch of Cider that I think tackles the surface symptoms of this same issue (the stacktrace buffer's formatting errors). In any case it was a hacky workaround, just pasting it here in case it helps anyone in their way to a better solution:

diff --git a/cider-stacktrace.el b/cider-stacktrace.el
index 73bf2636..012c14a6 100644
--- a/cider-stacktrace.el
+++ b/cider-stacktrace.el
@@ -796,15 +796,14 @@ cider-stacktrace-render-cause
   (with-current-buffer buffer
     (nrepl-dbind-response cause (class message data spec stacktrace)
       (let ((indent "   ")
-            (class-face 'cider-stacktrace-error-class-face)
-            (message-face 'cider-stacktrace-error-message-face))
+            (message-face 'cider-stacktrace-error-message-face)
+            (level-0-message (concat (propertize note 'font-lock-face 'font-lock-comment-face) " "
+                                     (propertize class 'font-lock-face 'cider-stacktrace-error-class-face))))
+        ;; (message (propertize level-0-message 'face 'cider-test-failure-face))
         (cider-propertize-region `(cause ,num)
           ;; Detail level 0: exception class
           (cider-propertize-region '(detail 0)
-            (insert (format "%d. " num)
-                    (propertize note 'font-lock-face 'font-lock-comment-face) " "
-                    (propertize class 'font-lock-face class-face)
-                    "\n"))
+            (insert (format "%d. " num) level-0-message "\n"))
           ;; Detail level 1: message + ex-data
           (cider-propertize-region '(detail 1)
             (if (equal class "clojure.lang.Compiler$CompilerException")
@@ -852,7 +851,8 @@ cider-stacktrace-initialize
               (goto-char (next-single-property-change (point) 'compile-error))
             (progn
               (while (cider-stacktrace-next-cause))
-              (goto-char (next-single-property-change (point) 'flags)))))))))
+              (goto-char (next-single-property-change (point) 'flags nil (point-max))))))))))
+
 
 (defun cider-stacktrace-render (buffer causes &optional error-types)
   "Emit into BUFFER useful stacktrace information for the CAUSES.
timvisher

comment created time in 22 days

startedclojure-emacs/enrich-classpath

started time in a month