kotlin experiment

This commit is contained in:
janis 2026-08-25 21:34:45 +02:00
parent f779d171fb
commit f96e613ca5
Signed by: janis
SSH key fingerprint: SHA256:bB1qbbqmDXZNT0KKD5c2Dfjg53JGhj7B3CFcLIzSqq8

View file

@ -2522,6 +2522,44 @@ delimiters < and >'s."
:defer t) :defer t)
#+end_src #+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 ** Web
#+begin_src emacs-lisp #+begin_src emacs-lisp
(use-package web-mode (use-package web-mode