From f96e613ca5a84025bf970e49cf437a62d0ded690 Mon Sep 17 00:00:00 2001 From: janis Date: Tue, 25 Aug 2026 21:34:45 +0200 Subject: [PATCH] kotlin experiment --- init.org | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/init.org b/init.org index a6fc121..636e87d 100644 --- a/init.org +++ b/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