yeet
This commit is contained in:
36
.config/emacs/modules/lang/kotlin/README.org
Normal file
36
.config/emacs/modules/lang/kotlin/README.org
Normal 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
|
||||
15
.config/emacs/modules/lang/kotlin/autoload.el
Normal file
15
.config/emacs/modules/lang/kotlin/autoload.el
Normal 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)))
|
||||
19
.config/emacs/modules/lang/kotlin/config.el
Normal file
19
.config/emacs/modules/lang/kotlin/config.el
Normal 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))
|
||||
8
.config/emacs/modules/lang/kotlin/doctor.el
Normal file
8
.config/emacs/modules/lang/kotlin/doctor.el
Normal 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)")
|
||||
7
.config/emacs/modules/lang/kotlin/packages.el
Normal file
7
.config/emacs/modules/lang/kotlin/packages.el
Normal 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"))
|
||||
Reference in New Issue
Block a user