kotlin experiment
This commit is contained in:
parent
f779d171fb
commit
f96e613ca5
38
init.org
38
init.org
|
|
@ -2522,6 +2522,44 @@ delimiters < and >'s."
|
|||
:defer t)
|
||||
#+end_src
|
||||
|
||||
** Kotlin
|
||||
#+begin_src emacs-lisp
|
||||
(defun nemo/eglot-uri-to-path-kotlin-advice (orig-fun uri &rest args)
|
||||
(if (and (stringp uri) (string-prefix-p "jar:///" uri))
|
||||
(apply orig-fun (replace-regexp-in-string "^jar:///" "jar:file:///" uri) args)
|
||||
(apply orig-fun uri args)))
|
||||
|
||||
(defun nemo/eglot-path-to-uri-kotlin-advice (orig-fun path &rest args)
|
||||
(if (and (stringp path) (string-prefix-p "jar:file:///" path))
|
||||
(apply orig-fun (replace-regexp-in-string "^jar:file:///" "jar:///" path) args)
|
||||
(apply orig-fun path args)))
|
||||
|
||||
(use-package kotlin-ts-mode
|
||||
:straight t
|
||||
:after eglot
|
||||
:after (inheritenv envrc)
|
||||
:mode ("\\.kt\\'" . kotlin-ts-mode)
|
||||
:config
|
||||
(if (fboundp 'eglot-uri-to-path)
|
||||
(progn
|
||||
(advice-add 'eglot-uri-to-path :around #'nemo/eglot-uri-to-path-kotlin-advice)
|
||||
(advice-add 'eglot-path-to-uri :around #'nemo/eglot-path-to-uri-kotlin-advice)
|
||||
)
|
||||
(progn
|
||||
(advice-add 'eglot--uri-to-path :around #'nemo/eglot-uri-to-path-kotlin-advice)
|
||||
(advice-add 'eglot--path-to-uri :around #'nemo/eglot-path-to-uri-kotlin-advice))
|
||||
)
|
||||
)
|
||||
|
||||
(use-package jarchive
|
||||
:straight t
|
||||
:config
|
||||
(jarchive-mode))
|
||||
|
||||
|
||||
|
||||
#+end_src
|
||||
|
||||
** Web
|
||||
#+begin_src emacs-lisp
|
||||
(use-package web-mode
|
||||
|
|
|
|||
Loading…
Reference in a new issue