From 4a8c4815f1c684a0bf0a9b9876c88bee363c0203 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Thu, 23 Apr 2020 17:43:42 -0400 Subject: [PATCH] Add :lang yaml module Removes yaml-mode from :lang data and adds LSP support (#2502). Closes #2502 Co-authored-by: Seong Yong-ju --- docs/modules.org | 1 + init.example.el | 1 + modules/lang/data/config.el | 3 --- modules/lang/data/packages.el | 1 - modules/lang/yaml/README.org | 38 +++++++++++++++++++++++++++++++++++ modules/lang/yaml/config.el | 9 +++++++++ modules/lang/yaml/packages.el | 4 ++++ 7 files changed, 53 insertions(+), 4 deletions(-) create mode 100644 modules/lang/yaml/README.org create mode 100644 modules/lang/yaml/config.el create mode 100644 modules/lang/yaml/packages.el diff --git a/docs/modules.org b/docs/modules.org index e921ce1a5..5b3796d94 100644 --- a/docs/modules.org +++ b/docs/modules.org @@ -143,6 +143,7 @@ Modules that bring support for a language or group of languages to Emacs. + swift =+lsp= - TODO + terra - TODO + web =+lsp= - HTML and CSS (SCSS/SASS/LESS/Stylus) support. ++ [[file:../modules/lang/yaml/README.org][yaml]] =+lsp= - TODO * :term Modules that offer terminal emulation. diff --git a/init.example.el b/init.example.el index f44db3f3f..3c54247a7 100644 --- a/init.example.el +++ b/init.example.el @@ -158,6 +158,7 @@ ;;swift ; who asked for emoji variables? ;;terra ; Earth and Moon in alignment for performance. ;;web ; the tubes + ;;yaml ; JSON, but readable :email ;;(mu4e +gmail) diff --git a/modules/lang/data/config.el b/modules/lang/data/config.el index de828f17f..19776b4e4 100644 --- a/modules/lang/data/config.el +++ b/modules/lang/data/config.el @@ -37,9 +37,6 @@ (after! jsonnet-mode (set-electric! 'jsonnet-mode :chars '(?\n ?: ?{ ?}))) -(after! yaml-mode - (setq-hook! 'yaml-mode-hook tab-width yaml-indent-offset)) - ;; ;;; Frameworks diff --git a/modules/lang/data/packages.el b/modules/lang/data/packages.el index 20646ff7e..d98d089ad 100644 --- a/modules/lang/data/packages.el +++ b/modules/lang/data/packages.el @@ -3,7 +3,6 @@ (package! graphql-mode :pin "7c37aee28b") (package! jsonnet-mode :pin "d8b486c837") -(package! yaml-mode :pin "cecf4b106b") (package! csv-mode :pin "635337407c") (package! dhall-mode :pin "ef4d33debe") (package! protobuf-mode diff --git a/modules/lang/yaml/README.org b/modules/lang/yaml/README.org new file mode 100644 index 000000000..f036f5a24 --- /dev/null +++ b/modules/lang/yaml/README.org @@ -0,0 +1,38 @@ +#+TITLE: lang/yaml +#+DATE: April 23, 2020 +#+SINCE: v3.0.0 +#+STARTUP: inlineimages nofold + +* Table of Contents :TOC_3:noexport: +- [[#description][Description]] + - [[#maintainers][Maintainers]] + - [[#module-flags][Module Flags]] + - [[#plugins][Plugins]] +- [[#prerequisites][Prerequisites]] +- [[#features][Features]] +- [[#configuration][Configuration]] +- [[#troubleshooting][Troubleshooting]] + +* Description +This module provides support for the [[https://yaml.org/][YAML file format]]. + +** Maintainers +This module has no dedicated maintainers. + +** Module Flags ++ =+lsp= Enables integration with LSP servers. Requires the =:tools lsp= module to be enabled. + +** Plugins ++ [[https://github.com/yoshiki/yaml-mode][yaml-mode]] + +* Prerequisites +This module has no prereqisites. + +* 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. diff --git a/modules/lang/yaml/config.el b/modules/lang/yaml/config.el new file mode 100644 index 000000000..282b4ed7a --- /dev/null +++ b/modules/lang/yaml/config.el @@ -0,0 +1,9 @@ +;;; lang/yaml/config.el -*- lexical-binding: t; -*- + +(use-package! yaml-mode + :hook "Procfile\\'" + :init + (when (featurep! +lsp) + (add-hook 'yaml-mode-local-vars-hook #'lsp!)) + :config + (setq-hook! 'yaml-mode-hook tab-width yaml-indent-offset)) diff --git a/modules/lang/yaml/packages.el b/modules/lang/yaml/packages.el new file mode 100644 index 000000000..6e0f161f3 --- /dev/null +++ b/modules/lang/yaml/packages.el @@ -0,0 +1,4 @@ +;; -*- no-byte-compile: t; -*- +;;; lang/yaml/packages.el + +(package! yaml-mode :pin "cecf4b106b")