This commit is contained in:
ry
2022-01-11 18:05:13 -08:00
parent 2046befee2
commit 8e7b654716
846 changed files with 71287 additions and 4 deletions

View File

@@ -0,0 +1,36 @@
#+TITLE: lang/kotlin
#+DATE: March 28, 2019
#+SINCE: v3.0.0
#+STARTUP: inlineimages
* Table of Contents :TOC_3:noexport:
- [[#description][Description]]
- [[#module-flags][Module Flags]]
- [[#plugins][Plugins]]
- [[#prerequisites][Prerequisites]]
- [[#features][Features]]
- [[#configuration][Configuration]]
- [[#troubleshooting][Troubleshooting]]
* Description
This module adds Kotlin support to Emacs.
** Module Flags
+ =+lsp= Enables integration with [[https://github.com/emacs-lsp/lsp-mode][kotlin-language-server]]. This requires the
=:tools lsp= module.
** Plugins
+ kotlin-mode
+ flycheck-kotlin
* Prerequisites
TODO
* Features
TODO
* Configuration
TODO
* Troubleshooting
TODO

View File

@@ -0,0 +1,15 @@
;;; lang/kotlin/autoload.el -*- lexical-binding: t; -*-
;;;autoload
(defun +kotlin-locate-gradlew-file ()
"Gradlew file location for this project."
(locate-dominating-file buffer-file-name "gradlew"))
;;;###autoload
(defun +kotlin/run-gradlew (command)
"Run gradlew in this project."
(interactive "sCommand: ")
(let ((default-directory (+kotlin-locate-gradlew-file))
(compilation-read-command nil)
(compile-command (format "sh gradlew %s" command)))
(call-interactively #'compile)))

View File

@@ -0,0 +1,19 @@
;;; lang/kotlin/config.el -*- lexical-binding: t; -*-
(after! kotlin-mode
(when (featurep! +lsp)
(add-hook 'kotlin-mode-local-vars-hook #'lsp!))
(set-docsets! 'kotlin-mode "Kotlin")
(set-repl-handler! 'kotlin-mode #'kotlin-repl)
(map! :map kotlin-mode-map
:localleader
:prefix ("b" . "build")
:desc "gradlew assemble" "a" (cmd! (+kotlin/run-gradlew "assemble"))
:desc "gradlew build" "b" (cmd! (+kotlin/run-gradlew "build"))
:desc "gradlew test" "t" (cmd! (+kotlin/run-gradlew "test"))))
(use-package! flycheck-kotlin
:when (featurep! :checkers syntax)
:hook (kotlin-mode . flycheck-kotlin-setup))

View File

@@ -0,0 +1,8 @@
;;; lang/kotlin/doctor.el -*- lexical-binding: t; -*-
(unless (executable-find "ktlint")
(warn! "ktlint not found. flycheck-kotlin won't work."))
(assert! (or (not (featurep! +lsp))
(featurep! :tools lsp))
"This module requires (:tools lsp)")

View File

@@ -0,0 +1,7 @@
;; -*- no-byte-compile: t; -*-
;;; lang/kotlin/packages.el
(package! kotlin-mode :pin "876cc27dc105979a0b59782141785f8e172891e8")
(when (featurep! :checkers syntax)
(package! flycheck-kotlin :pin "bf1b398bdde128806a0a7479ebbe369bbaa40dae"))