From 3e8a8a8cf880ea0d1f7310aa5e8119cc8008cc4d Mon Sep 17 00:00:00 2001 From: Juan Placencia Date: Tue, 15 Mar 2022 20:44:15 -0500 Subject: [PATCH] Updates and Java related support --- straight.lock.el | 118 +++++++++++++++++---------------- uno/bootstrap.org | 1 + uno/modules/dev/+index.org | 9 +++ uno/modules/dev/lsp.org | 1 + uno/modules/doc/org.org | 3 +- uno/modules/lang/groovy.org | 53 +++++++++++++++ uno/modules/lang/java.org | 44 ++++++++++++ uno/modules/lang/js/+index.org | 2 + uno/modules/lang/js/lsp.org | 63 ++++++++---------- uno/modules/lang/js/ts.org | 20 +++--- uno/modules/lang/kotlin.org | 52 +++++++++++++++ 11 files changed, 261 insertions(+), 105 deletions(-) create mode 100644 uno/modules/lang/groovy.org create mode 100644 uno/modules/lang/java.org create mode 100644 uno/modules/lang/kotlin.org diff --git a/straight.lock.el b/straight.lock.el index 3581a3b..b875897 100644 --- a/straight.lock.el +++ b/straight.lock.el @@ -1,103 +1,107 @@ (("ace-link" . "e1b1c91b280d85fce2194fea861a9ae29e8b03dd") - ("ace-window" . "c7cb315c14e36fded5ac4096e158497ae974bec9") - ("all-the-icons.el" . "483dba65e897071c156cefec937edcf51aa333db") + ("ace-window" . "0577c426a9833ab107bab46c60d1885c611b2fb9") + ("all-the-icons.el" . "2c963ebb75f211d2f7ac3d2db5f4a9ee2f3e27da") ("annalist.el" . "134fa3f0fb91a636a1c005c483516d4b64905a6d") ("anzu" . "5abb37455ea44fa401d5f4c1bdc58adb2448db67") - ("avy" . "e92cb37457b43336b765630dbfbea8ba4be601fa") + ("avy" . "ba5f035be33693d1a136a5cbeedb24327f551a92") + ("bui.el" . "f3a137628e112a91910fd33c0cff0948fa58d470") ("centered-cursor-mode.el" . "4093821cc9759ca5a3c6e527d4cc915fc3a5ad74") - ("cfrs" . "c1f639d7bfd3e728cf85dbe224b06a4be76158f4") - ("closql" . "15f906c393db1a0fb6577afc3cf59466531eafef") + ("cfrs" . "f3a21f237b2a54e6b9f8a420a9da42b4f0a63121") + ("closql" . "1ba85ce9f7094aeddce25044689278eda6739531") ("company-box" . "f9cbbc7df8efbb56a8d31a5b422d158660d9109e") - ("company-mode" . "eb9be0bff7c323c720198dcd539ee05fa2485cd3") + ("company-mode" . "18a662082948b5aa9bea6b4ad752e027fc12aeb5") ("company-quickhelp" . "3ca2708b4e5190205aca01d65fe1b391963a53f9") ("company-restclient" . "e5a3ec54edb44776738c13e13e34c85b3085277b") ("company-statistics" . "e62157d43b2c874d2edbd547c3bdfb05d0a7ae5c") - ("consult" . "0d0a2f335889f82e91d96f77d71884ebd554aa62") + ("consult" . "800824601b610016066991d6e2dde198d4b0ad8f") + ("dap-mode" . "6933fca0b53ea5d2d65a0545e5a4ae6424d32e9b") ("dash.el" . "da167c51e9fd167a48d06c7c0ee8e3ac7abd9718") + ("diff-hl" . "4a08b02afec1fc6b1e84de46cc34f75f6c9c3bcc") ("disable-mouse" . "cae3be9dd012727b40ad3b511731191f79cebe42") - ("doom-modeline" . "36fed6d1a1614f72d425073d7c9e1529f622fe7a") + ("doom-modeline" . "27c374d8013819885653b6065e236b9119992158") ("drag-stuff.el" . "6d06d846cd37c052d79acd0f372c13006aa7e7c8") - ("editorconfig-emacs" . "2ab86dc9a8ed7a669ca348252d4af46522b5c411") - ("el-get" . "960f3fb962c35d3196bab20b2a3f6d6228119277") + ("editorconfig-emacs" . "1d4acc3ec73609990eabacb59c038708bc401003") + ("el-get" . "9353309744e4f8a7c9b1adf22ec99536fb2146b0") ("elfeed" . "162d7d545ed41c27967d108c04aa31f5a61c8e16") ("elfeed-org" . "268efdd0121fa61f63b722c30e0951c5d31224a4") - ("elisp-refs" . "c06aec4486c034d0d4efae98cb7054749f9cc0ec") - ("emacs-dashboard" . "a19868f2fb8f7fc4132b4e9bfac5cdd65f245181") - ("emacs-doom-themes" . "96edc0ceb864b7d72218e58c8e9272cd96e5712c") + ("elisp-refs" . "8f84280997d8b233d66fb9958a34b46078c58b03") + ("emacs-dashboard" . "f042f820d919d529668a3ea240b71ef231f6c388") ("emacs-hide-mode-line" . "bc5d293576c5e08c29e694078b96a5ed85631942") - ("emacs-undo-fu" . "ab8bc10e424bccc847800c31ab41888db789d55d") - ("emacs-which-key" . "4790a14683a2f3e4f72ade197c78e4c0af1cdd4b") + ("emacs-undo-fu" . "e81c8da4416b15cac9d5ac7574e11471417a65ca") + ("emacs-which-key" . "1217db8c6356659e67b35dedd9f5f260c06f6e99") ("emacs-winum" . "c5455e866e8a5f7eab6a7263e2057aff5f1118b9") - ("emacsmirror-mirror" . "5bcbacbecf32c7615f53c9d5d5d4d3e8bf4070e5") - ("emacsql" . "9dca5996168c4963eb67e61c7f17fdcb8228e314") + ("emacsmirror-mirror" . "641994eed3590a39a778431a16758c2c041963a9") + ("emacsql" . "374726060d74df0e2bcb9d0355ff41e2c400ed30") ("epl" . "78ab7a85c08222cd15582a298a364774e3282ce6") - ("evil" . "c28e42126c4ae349e2d77c80b38feb68bc1b5b78") + ("evil" . "3e41a823334abbba9cf16e482855699054d9dfe0") ("evil-anzu" . "d3f6ed4773b48767bd5f4708c7f083336a8a8a86") - ("evil-collection" . "652d74acfb5789eacef36660c4ffc68905c8d741") - ("evil-nerd-commenter" . "63baf2d1c796edd11bbec5fe1dee711173d4155d") - ("evil-org-mode" . "c3ec94bc2fb79127826ea85509247f082bc394aa") + ("evil-collection" . "a9c4545f4107bbae1e477c6b94c690b12d7de27b") + ("evil-nerd-commenter" . "42ba1a473b4f1df061baddd2f8b812a2f35e366e") + ("evil-org-mode" . "0d10ff7bb9a3a93d25cd91018b17f0a052b335f3") ("exec-path-from-shell" . "3a8d97c096c2c5714b667130fd8a80d5622ee067") ("f.el" . "50af874cd19042f17c8686813d52569b1025c76a") ("flycheck" . "784f184cdd9f9cb4e3dbb997c09d93e954142842") - ("forge" . "41efa674cff0b447efbc103494fd61ec9b9156ae") + ("forge" . "bc99603b5a0cd5b3a5f209772b7f818d205b8a3f") ("frame-cmds" . "7c9a30bae30c113e267dee3364e618a682fbaac8") ("frame-fns" . "b675ee568c0133709c2c39a125395486cdf1c610") ("frame-local" . "7ee1106c3bcd4022f48421f8cb1ef4f995da816e") ("gcmh" . "0089f9c3a6d4e9a310d0791cf6fa8f35642ecfd9") - ("general.el" . "26f1d4c4e258c40e6b70ce831a04800c914f29b3") - ("ghub" . "4d6a4b2bc1d88b993c09c1cb47b575a08eb264ea") + ("general.el" . "9651024e7f40a8ac5c3f31f8675d3ebe2b667344") + ("ghub" . "bd6e02b884368f26aeef9fd67107809f355c2c3d") ("git-modes" . "62fbf2e5b84ca789e7bc2f87939386023b5ba3df") - ("gnu-elpa-mirror" . "870aae430e9eb6afb9097492cbd4076e87a677f5") - ("gnuplot" . "7138b139d2dca9683f1a81325c643b2744aa1ea3") - ("goto-chg" . "3ce1389fea12edde4e343bc7d54c8da97a1a6136") - ("graphviz-dot-mode" . "3642a0a5f41a80c8ecef7c6143d514200b80e194") - ("helpful" . "8df39c15d290cd499ef261de868191d3fc84f75a") + ("gnu-elpa-mirror" . "2591e62b67453eca5ab64e34b4bf3ae727181492") + ("gnuplot" . "d1a6a606dcb389a7c91a6b0d9fb995434df561be") + ("goto-chg" . "278cd3e6d5107693aa2bb33189ca503f22f227d0") + ("graphviz-dot-mode" . "6e96a89762760935a7dff6b18393396f6498f976") + ("helpful" . "67cdd1030b3022d3dc4da2297f55349da57cde01") ("ht.el" . "c4c1be487d6ecb353d07881526db05d7fc90ea87") - ("hydra" . "2d553787aca1aceb3e6927e426200e9bb9f056f1") + ("hydra" . "9e9e00cb240ea1903ffd36a54956b3902c379d29") ("json-mode" . "eedb4560034f795a7950fa07016bd4347c368873") ("json-snatcher" . "b28d1c0670636da6db508d03872d96ffddbc10f2") ("keychain-environment" . "d3643196de6dc79ea77f9f4805028350fd76100b") ("know-your-http-well" . "3cc5ab6d2764ab7aacb1b6e026abaccbeb6c37f2") - ("let-alist" . "d2d0cac92851d4480328bc3f41d30c518beb1f99") + ("let-alist" . "592553db5929b54db40af0df90c5add0aaca045b") ("ligature.el" . "d3426509cc5436a12484d91e48abd7b62429b7ef") - ("lsp-mode" . "a7effcc79114e91e74f06ef3a7e078bafba05c2a") - ("lsp-ui" . "dd4c181a22d19a28236c442cf6c9cd4bbd6d85f8") - ("magit" . "9413847c1a085899d8de6f8d978bd7265f65e5d8") - ("markdown-mode" . "c3c2f0d473a3f8ca8c4ffb2ecc094d5c3541769f") - ("melpa" . "db77988a14c8bdcc457bdae4bedd4e7535b4e3a6") + ("lsp-mode" . "ec57aab424b881ead7a8cf7af977ca4db4bc04d8") + ("lsp-treemacs" . "72d367757a89453a712f6ba1df9b6e789ece2bbd") + ("lsp-ui" . "96b1ecbfbf87a775f05b5f0b55253376a3bd61e7") + ("magit" . "9d8d5e560394c001b866c00200ccea65b7d94a04") + ("markdown-mode" . "521658eb32e456681592443e04ae507c3a59ed07") + ("melpa" . "144364ae1ab127dd4e630a848741eb561e00ab24") ("mixed-pitch" . "519e05f74825abf04b7d2e0e38ec040d013a125a") - ("ob-restclient.el" . "bfbc4d8e8a348c140f9328542daf5d979f0993e2") + ("ob-restclient.el" . "586f1fa07f76aaca13cb3f86945759f4b9fb8db7") ("olivetti" . "a31ac05a161a91fe5c157930b62a6c07037982ee") - ("orderless" . "62f71c34baca0b7d0adeab4a1c07d85ffcee80d9") - ("org" . "2bbac432a8c7d70c6ecd154fb3867c6cb2b4f4b2") - ("org-contrib" . "e14dfea59491f889f35868813122c5b8c0b4b3db") - ("org-present" . "7414e406326622dbfb5aaf2905c4ac9f6696d6ed") - ("org-roam" . "d93423d4e11da95bcf177b2bc3c74cb1d1acf807") + ("orderless" . "7ddf5dfe9e982ee1510ceec36eeb4d8bb802ea73") + ("org" . "91681fc03334285dc0879fcb9a27583bd7ab9782") + ("org-contrib" . "8c138dc5375dc13a0d1952e61c638ef4d57df368") + ("org-present" . "c0f1f36b2384b58b00a2000f2e30895a6230bb6b") + ("org-roam" . "c51cadfe255fdac8f84213adeda6aa43769c65af") ("org-superstar-mode" . "03be6c0a3081c46a59b108deb8479ee24a6d86c0") - ("pdf-tools" . "a8847b75d3487d60e27762816bdbdd23b6dc1c11") - ("pfuture" . "d7926de3ba0105a36cfd00811fd6278aea903eef") + ("pdf-tools" . "326552eef71ae6d53e215c46be5bf532575b7abb") + ("pfuture" . "bde5b06795e3e35bfb2bba4c34b538d506a0856e") ("pkg-info" . "76ba7415480687d05a4353b27fea2ae02b8d9d61") ("pos-tip" . "179cc126b363f72ca12fab1e0dc462ce0ee79742") - ("posframe" . "66b16a20a7b43f19c27487c475799200ad81b3bd") - ("projectile" . "31069dc31469e0d5cddb53126a2993432a22399b") + ("posframe" . "c91d4d53fa479ceb604071008ce0a901770eff57") + ("projectile" . "2c948f3a8ed378ae5fd800d2c66aece06ba058b8") ("restart-emacs" . "1607da2bc657fe05ae01f7fdf26f716eafead02c") - ("restclient.el" . "f59a7f5abf366145a2c9c1e9f0a2184139d2adce") - ("ripgrep.el" . "40e871dcc4519a70981e9f28acea304692a60978") + ("restclient.el" . "9e2cfa86529133eba6c9ef53794be182f15e4c21") + ("ripgrep.el" . "4ed5c741233a81d96115f556784269042070901e") ("s.el" . "08661efb075d1c6b4fa812184c1e5e90c08795a9") ("shrink-path.el" . "c14882c8599aec79a6e8ef2d06454254bb3e1e41") - ("smartparens" . "f59a40d54f35299007c396bd667ce3e9ec4714e3") + ("smartparens" . "37f77bf2e2199be9fe27e981317b02cfd0e8c70e") ("spinner" . "34905eae12a236753fa88abc831eff1e41e8576e") ("straight.el" . "af5437f2afd00936c883124d6d3098721c2d306c") ("tablist" . "faab7a035ef2258cc4ea2182f67e3aedab7e2af9") - ("transient" . "349116159f707a474926b47e5f6b6240e8997a4d") - ("treemacs" . "d00cc19cab8df4fec7ed6608e00bd16fe797369a") + ("themes" . "83fd9545c2823b4b2610947802fa3a52995517b4") + ("transient" . "45ef6df3fbc7f4fc87fd0db20b48334f61b521e0") + ("treemacs" . "b18a05b1f62074a40e6011d83cd4c92cbee040dd") ("treepy.el" . "3ac940e97f3d03e48ca9d7fcd74916a9b01c72f3") - ("typescript.el" . "13e6da6c5746187842d8ebb5323bf2d88d5759c2") + ("typescript.el" . "88f317f0b6aef8f8d232e912fdbc679799580c56") ("use-package" . "a7422fb8ab1baee19adb2717b5b47b9c3812a84c") - ("vertico" . "608d2ef213d0fd2018c5d9be54390a3dcfd9c0ff") - ("web-mode" . "61f057a6baeba6b3595e412ba79b3080dca17dcc") - ("with-editor" . "cfe70f43c551852125bc139df467e28e1b6087df") - ("yaml-mode" . "63b637f846411806ae47e63adc06fe9427be1131") - ("yaml.el" . "84b88c9ed178af16da18b230c1f61c57cefedf28") + ("vertico" . "e98ccbcad7278b1937b346d488d1cd5a21a5ea99") + ("web-mode" . "f70277774a725e177774cc81ecbd228792cd6656") + ("with-editor" . "f514f23258af67a10fc8e1c431bfe94702b6e65b") + ("yaml-mode" . "535273d5a1eb76999d20afbcf4d9f056d8ffd2da") + ("yaml.el" . "34c300b08579b72c7c92aefee1f4b500913f0c85") ("zoom-frm" . "ca865f395a8c93f7180e152218ecf2a1e1091f50")) :beta diff --git a/uno/bootstrap.org b/uno/bootstrap.org index ec8716f..567505b 100644 --- a/uno/bootstrap.org +++ b/uno/bootstrap.org @@ -49,6 +49,7 @@ Isolate or remove backup files for a clean structure. backup-directory-alist `((".*" . ,temporary-file-directory)) bookmark-default-file (uno-cache-path "bookmarks") create-lockfiles nil + nsm-settings-file (uno-cache-path "network-security.data") recentf-save-file (uno-cache-path "recentf/list") tramp-persistency-file-name (uno-cache-path "tramp/history")) #+END_SRC diff --git a/uno/modules/dev/+index.org b/uno/modules/dev/+index.org index ad67067..8c15437 100644 --- a/uno/modules/dev/+index.org +++ b/uno/modules/dev/+index.org @@ -33,3 +33,12 @@ Set up integration with keychain. :config (keychain-refresh-environment)) #+END_SRC + +* Debug Adapter Protocol + +#+BEGIN_SRC emacs-lisp + (use-package dap-mode + :after uno-dev + :custom + (dap-breakpoints-file (uno-cache-path ".dap-breakpoints"))) +#+END_SRC diff --git a/uno/modules/dev/lsp.org b/uno/modules/dev/lsp.org index 17cd0a4..d026501 100644 --- a/uno/modules/dev/lsp.org +++ b/uno/modules/dev/lsp.org @@ -34,6 +34,7 @@ Define LSP dev package. :config (uno/add-useless-buffer "\\*lsp-install") (uno/add-useless-buffer "\\*lsp-log\\*") + (uno/handle-side-window "\\*lsp-install") (uno/handle-side-window "\\*lsp-help\\*")) (use-package lsp-mode diff --git a/uno/modules/doc/org.org b/uno/modules/doc/org.org index 8b71a4f..1a18a00 100644 --- a/uno/modules/doc/org.org +++ b/uno/modules/doc/org.org @@ -21,6 +21,7 @@ Define Org document package. (org-adapt-indentation nil) (org-ellipsis " ▼") (org-hide-emphasis-markers t) + (org-id-locations-file (uno-cache-path "org/.org-id-locations")) (org-src-window-setup 'current-window) (org-todo-keywords '((sequence "TODO" "LIVE" "DONE"))) :hook @@ -151,7 +152,7 @@ Define Org document package. "#+TITLE: ${title}\n#+STARTUP: showall\n\n") :unnarrowed t))) (org-roam-complete-everywhere t) - (org-roam-db-location (uno-cache-path "org-roam/org-roam.db")) + (org-roam-db-location (uno-cache-path "org/org-roam.db")) (org-roam-directory "~/Roam") :general (uno-leader-define diff --git a/uno/modules/lang/groovy.org b/uno/modules/lang/groovy.org new file mode 100644 index 0000000..836d2bd --- /dev/null +++ b/uno/modules/lang/groovy.org @@ -0,0 +1,53 @@ +#+TITLE: Language - Groovy +#+AUTHOR: Juan Placencia + +* Package + +Define Groovy language package. + +#+BEGIN_SRC emacs-lisp + (use-package emacs + :after uno-lang + :config + (provide 'uno-lang-groovy)) +#+END_SRC + +* Groovy Mode + +#+BEGIN_SRC emacs-lisp + (use-package groovy-mode + :after uno-lang-groovy) +#+END_SRC + +* LSP Integration + +#+BEGIN_SRC emacs-lisp + (use-package emacs + :after (uno-lang-groovy uno-dev-lsp groovy-mode) + :if + (executable-find "javac") + :config + (setq lsp-groovy-server-file + (uno-cache-path "lsp/server/groovy-language-server-all.jar")) + (when (file-exists-p lsp-groovy-server-file) + (add-hook 'groovy-mode-hook 'lsp))) +#+END_SRC + +* Ligatures + +#+BEGIN_SRC emacs-lisp + (use-package emacs + :after uno-lang-groovy + :config + (ligature-set-ligatures 'groovy-mode '("==" + "!=" + "__" + "/*" + "*/" + "?." + "//" + ">=" + "<=" + "||" + "&&"))) +#+END_SRC diff --git a/uno/modules/lang/java.org b/uno/modules/lang/java.org new file mode 100644 index 0000000..18918a2 --- /dev/null +++ b/uno/modules/lang/java.org @@ -0,0 +1,44 @@ +#+TITLE: Language - Java +#+AUTHOR: Juan Placencia + +* Package + +Define Java language package. + +#+BEGIN_SRC emacs-lisp + (use-package emacs + :after uno-lang + :config + (provide 'uno-lang-java)) +#+END_SRC + +* LSP Integration + +#+BEGIN_SRC emacs-lisp + (use-package lsp-java + :after (uno-lang-java uno-dev-lsp) + :if (executable-find "javac") + :custom + (dap-java-test-runner (uno-cache-path "lsp/server/eclipse.jdt.ls/test-runner/junit-platform-console-standalone.jar")) + (lsp-java-workspace-dir (uno-cache-path "lsp/workspace/")) + :hook + (java-mode . lsp)) +#+END_SRC + +* Ligatures + +#+BEGIN_SRC emacs-lisp + (use-package emacs + :after uno-lang-java + :config + (ligature-set-ligatures 'java-mode '("==" + "!=" + "__" + "/*" + "*/" + "//" + ">=" + "<=" + "||" + "&&"))) +#+END_SRC diff --git a/uno/modules/lang/js/+index.org b/uno/modules/lang/js/+index.org index f991083..3ce9460 100644 --- a/uno/modules/lang/js/+index.org +++ b/uno/modules/lang/js/+index.org @@ -12,6 +12,8 @@ Define JavaScript language package. (provide 'uno-lang-js)) #+END_SRC +* Ligatures + #+BEGIN_SRC emacs-lisp (use-package emacs :after uno-lang-js diff --git a/uno/modules/lang/js/lsp.org b/uno/modules/lang/js/lsp.org index 17e9c25..2996a1d 100644 --- a/uno/modules/lang/js/lsp.org +++ b/uno/modules/lang/js/lsp.org @@ -19,20 +19,34 @@ Define JavaScript language LSP Integration package. :after uno-lang-js-lsp :init (require 'seq) + (defun uno/lang/js/lsp () + "Set up LSP for JavaScript." + (require 'lsp-javascript) + (make-local-variable 'lsp-disabled-clients) + (when (uno/lang/js/lsp/local-provider) + (plist-put lsp-deps-providers + :local '(:path uno/lang/js/lsp/local-provider)) + (setq-local lsp-auto-guess-root t)) + (uno/lang/js/lsp/add-to-local + 'typescript-language-server + "typescript-language-server/lib/cli.js") + (uno/lang/js/lsp/add-to-local + 'typescript + "typescript/bin/tsserver") + (when (uno/lang/js/lsp/local-provider "eslint/bin/eslint.js") + (let ((-eslint + (uno/lang/js/lsp/local-provider "eslint/bin/eslint.js")) + (-node-path (uno/lang/js/lsp/local-provider)) + (-package-manager (uno/lang/js/lsp/local-provider-type))) + (setq-local + flycheck-javascript-eslint-executable -eslint + lsp-eslint-node-path -node-path + lsp-eslint-package-manager -package-manager)))) (defun uno/lang/js/lsp/add-to-local (name file) "Add NAME dependency from FILE to local instance." (when (uno/lang/js/lsp/local-provider file) (lsp-dependency name `(:local ,file)) t)) - (defun uno/lang/js/lsp/check () - "Set up support with local SDK instance." - (when (uno/lang/js/lsp/local-provider) - (require 'lsp-javascript) - (make-local-variable 'lsp-enabled-clients) - (plist-put lsp-deps-providers - :local '(:path uno/lang/js/lsp/local-provider)) - (setq-local lsp-auto-guess-root t) - (run-hooks 'uno-lang-js-lsp-hook))) (defun uno/lang/js/lsp/local-provider (&optional path) "Provide path for local SDK instance relative to PATH." (seq-reduce @@ -43,33 +57,12 @@ Define JavaScript language LSP Integration package. (if (file-exists-p -path) -path nil)))) '(".yarn/sdks/" "node_modules/") nil)) - (defun uno/lang/js/lsp/local-provider-type (&optional path) - "Check SDK instance type relative to PATH." - (let ((-path (uno/lang/js/lsp/local-provider path))) + (defun uno/lang/js/lsp/local-provider-type () + "Check SDK instance type." + (let ((-root (projectile-project-root))) (cond - (string-match-p ".yarn/sdks/" -path) "yarn") - (string-match-p "node_modules/" -path) "npm"))) -#+END_SRC - -** ESLint Integration - -#+BEGIN_SRC emacs-lisp - (use-package emacs - :after (uno-lang-js-lsp flycheck) - :hook - (uno-lang-js-lsp . uno/lang/js/eslint/add) - :init - (defun uno/lang/js/eslint/add () - "Add support for ESLint." - (when (uno/lang/js/lsp/local-provider "eslint/bin/eslint.js") - (let ((-eslint-full - (uno/lang/js/lsp/local-provider "eslint/bin/eslint.js")) - (-node-path (uno/lang/js/lsp/local-provider))) - (setq-local - flycheck-javascript-eslint-executable -eslint-full - lsp-eslint-node-path -node-path - lsp-eslint-package-manager (uno/lang/js/lsp/local-provider-type))) - (push 'eslint lsp-enabled-clients))) + ((file-exists-p (concat -root ".yarn/")) "yarn") + ((file-exists-p (concat -root "node_modules/")) "npm")))) (uno/add-useless-buffer "\\*eslint\\*") (uno/add-useless-buffer "\\*eslint::.*\\*")) #+END_SRC diff --git a/uno/modules/lang/js/ts.org b/uno/modules/lang/js/ts.org index 175ad93..0feceb3 100644 --- a/uno/modules/lang/js/ts.org +++ b/uno/modules/lang/js/ts.org @@ -37,20 +37,16 @@ Define TypeScript JavaScript language package. (use-package emacs :after (uno-lang-js-ts uno-lang-js-lsp typescript-mode) :hook - (uno-lang-js-lsp . uno/lang/js/ts/lsp) - ((typescript-mode typescript-tsx-mode) . uno/lang/js/lsp/check) + ((typescript-mode typescript-tsx-mode) . lsp) + ((typescript-mode typescript-tsx-mode) . uno/lang/js/ts/lsp) + ((typescript-mode typescript-tsx-mode) . uno/lang/js/lsp) :init (defun uno/lang/js/ts/lsp () - "Attempt to load local SDKs." - (when (and (member major-mode '(typescript-mode typescript-tsx-mode)) - (uno/lang/js/lsp/add-to-local - 'typescript-language-server - "typescript-language-server/lib/cli.js") - (uno/lang/js/lsp/add-to-local - 'typescript - "typescript/bin/tsserver")) - (push 'ts-ls lsp-enabled-clients) - (lsp))) + "Set up LSP for TypeScript." + (when (or (file-exists-p (concat (projectile-project-root) + "package.json")) + (not (executable-find lsp-clients-deno-server))) + (push 'deno-ls lsp-disabled-clients))) (uno/add-useless-buffer "\\*ts-ls\\*") (uno/add-useless-buffer "\\*ts-ls::.*\\*")) #+END_SRC diff --git a/uno/modules/lang/kotlin.org b/uno/modules/lang/kotlin.org new file mode 100644 index 0000000..9ffee36 --- /dev/null +++ b/uno/modules/lang/kotlin.org @@ -0,0 +1,52 @@ +#+TITLE: Language - Kotlin +#+AUTHOR: Juan Placencia + +* Package + +Define Kotlin language package. + +#+BEGIN_SRC emacs-lisp + (use-package emacs + :after uno-lang + :config + (provide 'uno-lang-kotlin)) +#+END_SRC + +* Kotlin Mode + +#+BEGIN_SRC emacs-lisp + (use-package kotlin-mode + :after uno-lang-kotlin) +#+END_SRC + +* LSP Integration + +#+BEGIN_SRC emacs-lisp + (use-package emacs + :after (uno-lang-kotlin uno-dev-lsp kotlin-mode) + :if (executable-find "javac") + :hook + (kotlin-mode . lsp)) +#+END_SRC + +* Ligatures + +#+BEGIN_SRC emacs-lisp + (use-package emacs + :after uno-lang-kotlin + :config + (ligature-set-ligatures 'kotlin-mode '("==" + "!=" + "__" + "/*" + "*/" + "??" + "?." + "//" + ">=" + "<=" + ".." + "||" + "&&" + "!!"))) +#+END_SRC