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,62 @@
#+TITLE: lang/crystal
#+DATE: January 16, 2017
#+SINCE: v1.3
#+STARTUP: inlineimages nofold
* Table of Contents :TOC_3:noexport:
- [[#description][Description]]
- [[#maintainers][Maintainers]]
- [[#module-flags][Module Flags]]
- [[#plugins][Plugins]]
- [[#prerequisites][Prerequisites]]
- [[#crystal][Crystal]]
- [[#macos][MacOS]]
- [[#arch][Arch]]
- [[#icr-repl][ICR (REPL)]]
- [[#features][Features]]
- [[#configuration][Configuration]]
- [[#troubleshooting][Troubleshooting]]
* Description
This modules adds [[https://crystal-lang.org/][crystal]] support.
+ Syntax-checking (~flycheck~)
+ REPL (~inf-crystal~)
** Maintainers
This module has no dedicated maintainers.
** Module Flags
This module provides no flags.
** Plugins
+ [[https://github.com/crystal-lang-tools/emacs-crystal-mode/][crystal-mode]]
+ [[https://github.com/brantou/inf-crystal.el/][inf-crystal]]
+ if ~:checkers syntax~ is enabled
- [[https://github.com/crystal-lang-tools/emacs-crystal-mode/][flycheck-crystal]]
- [[https://github.com/crystal-ameba/ameba.el/][flycheck-ameba]]
* Prerequisites
** Crystal
you need to install [[https://crystal-lang.org/install/][the crystal compiler]].
*** MacOS
#+begin_src shell
brew install crystal
#+end_src
*** Arch
#+begin_src shell
sudo pacman -S crystal shards
#+end_src
** ICR (REPL)
you need to install [[https://github.com/crystal-community/icr][ICR]].
* TODO Features
# An in-depth list of features, how to use them, and their dependencies.
* TODO Configuration
# How to configure this module, including common problems and how to address them.
* TODO Troubleshooting
# Common issues and their solution, or places to look for help.

View File

@@ -0,0 +1,30 @@
;;; lang/crystal/config.el -*- lexical-binding: t; -*-
(after! crystal-mode
(set-lookup-handlers! 'crystal-mode
:definition #'crystal-def-jump
:references #'crystal-tool-imp)
(when (featurep! +lsp)
(add-hook 'crystal-mode-local-vars-hook #'lsp!))
(map! :localleader
:map crystal-mode-map
:prefix "t"
"a" #'crystal-spec-all
"v" #'crystal-spec-buffer
"s" #'crystal-spec-line
"t" #'crystal-spec-switch))
(use-package! flycheck-crystal
:when (featurep! :checkers syntax)
:after crystal-mode)
(use-package! flycheck-ameba
:when (featurep! :checkers syntax)
:after crystal-mode
:config (flycheck-ameba-setup))
(use-package! inf-crystal
:commands crystal-switch-to-inf)

View File

@@ -0,0 +1,5 @@
;; -*- lexical-binding: t; no-byte-compile: t; -*-
;;; lang/crystal/doctor.el
(unless (executable-find "icr")
(warn! "Couldn't find icr. REPL will not work"))

View File

@@ -0,0 +1,8 @@
;; -*- no-byte-compile: t; -*-
;;; lang/crystal/packages.el
(package! crystal-mode :pin "15998140b0a4172cd4b4d14d0377fba96a8917fc")
(package! inf-crystal :pin "02007b2a2a3bea44902d7c83c4acba1e39d278e3")
(when (featurep! :checkers syntax)
(package! flycheck-crystal :pin "15998140b0a4172cd4b4d14d0377fba96a8917fc")
(package! flycheck-ameba :pin "0c4925ae0e998818326adcb47ed27ddf9761c7dc"))