Skip to content

Commit

Permalink
Apply recommendations for uri-to-path conversions #6
Browse files Browse the repository at this point in the history
The URI processed is not always a string and maybe checks will change/improve over time
  • Loading branch information
yveszoundi committed Feb 13, 2023
1 parent 154861e commit ff0f951
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions eglot-java.el
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

;; Copyright (C) 2019-2023 Yves Zoundi

;; Version: 1.9
;; Version: 1.10
;; Author: Yves Zoundi <yves_zoundi@hotmail.com>
;; Maintainer: Yves Zoundi <yves_zoundi@hotmail.com>
;; URL: https://github.com/yveszoundi/eglot-java
Expand Down Expand Up @@ -807,9 +807,10 @@ ARGS is a list with one element, a URI.
If URI is a jar URI, don't parse and let the `jdthandler--file-name-handler'
handle it. If it is not a jar call ORIGINAL-FN."
(let ((uri (car args)))
(if (string= "file" (url-type (url-generic-parse-url uri)))
(apply original-fn args)
uri)))
(if (and (stringp uri)
(string= "jdt" (url-type (url-generic-parse-url uri))))
uri
(apply original-fn args))))

(defun eglot-java--jdthandler-patch-eglot ()
"Patch old versions of Eglot to work with Jdthandler."
Expand Down

0 comments on commit ff0f951

Please sign in to comment.