diff --git a/docs/modules.org b/docs/modules.org index 9d133f884..e921ce1a5 100644 --- a/docs/modules.org +++ b/docs/modules.org @@ -111,6 +111,7 @@ Modules that bring support for a language or group of languages to Emacs. + [[file:../modules/lang/haskell/README.org][haskell]] =+dante +ghcide +lsp= - TODO + hy - TODO + [[file:../modules/lang/idris/README.org][idris]] - TODO ++ [[file:../modules/lang/json/README.org][json]] =+lsp= - TODO + java =+meghanada +lsp= - TODO + [[file:../modules/lang/javascript/README.org][javascript]] =+lsp= - JavaScript, TypeScript, and CoffeeScript support + julia =+lsp= - TODO diff --git a/init.example.el b/init.example.el index 70cfcf205..f44db3f3f 100644 --- a/init.example.el +++ b/init.example.el @@ -124,6 +124,7 @@ ;;(haskell +dante) ; a language that's lazier than I am ;;hy ; readability of scheme w/ speed of python ;;idris ; + ;;json ; At least it ain't XML ;;(java +meghanada) ; the poster child for carpal tunnel syndrome ;;javascript ; all(hope(abandon(ye(who(enter(here)))))) ;;julia ; a better, faster MATLAB diff --git a/modules/lang/data/config.el b/modules/lang/data/config.el index e625d4fd0..de828f17f 100644 --- a/modules/lang/data/config.el +++ b/modules/lang/data/config.el @@ -34,11 +34,6 @@ :mode "\\.gql\\'" :config (setq-hook! 'graphql-mode-hook tab-width graphql-indent-level)) -(use-package! json-mode - :mode "\\.js\\(?:on\\|[hl]int\\(?:rc\\)?\\)\\'" - :config - (set-electric! 'json-mode :chars '(?\n ?: ?{ ?}))) - (after! jsonnet-mode (set-electric! 'jsonnet-mode :chars '(?\n ?: ?{ ?}))) diff --git a/modules/lang/data/packages.el b/modules/lang/data/packages.el index 1c338af9e..20646ff7e 100644 --- a/modules/lang/data/packages.el +++ b/modules/lang/data/packages.el @@ -2,7 +2,6 @@ ;;; lang/data/packages.el (package! graphql-mode :pin "7c37aee28b") -(package! json-mode :pin "0e819e519a") (package! jsonnet-mode :pin "d8b486c837") (package! yaml-mode :pin "cecf4b106b") (package! csv-mode :pin "635337407c") diff --git a/modules/lang/json/README.org b/modules/lang/json/README.org new file mode 100644 index 000000000..6106c7ff1 --- /dev/null +++ b/modules/lang/json/README.org @@ -0,0 +1,40 @@ +#+TITLE: lang/json +#+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 JSON support. + +** Maintainers +This module has no dedicated maintainers. + +** Module Flags ++ =+lsp= Enable integration with LSP servers, if one is available. Requires the + =:tools lsp= module to be enabled. + +** Plugins ++ [[https://github.com/joshwnj/json-mode][json-mode]] ++ [[https://github.com/Sterlingg/json-snatcher][json-snatcher]] + +* 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/json/config.el b/modules/lang/json/config.el new file mode 100644 index 000000000..62db538af --- /dev/null +++ b/modules/lang/json/config.el @@ -0,0 +1,14 @@ +;;; lang/json/config.el -*- lexical-binding: t; -*- + +(use-package! json-mode + :mode "\\.js\\(?:on\\|[hl]int\\(?:rc\\)?\\)\\'" + :init + (when (featurep! +lsp) + (add-hook 'json-mode-local-vars-hook #'lsp!)) + :config + (set-electric! 'json-mode :chars '(?\n ?: ?{ ?})) + + (map! :after json-mode + :map json-mode-map + :localleader + "s" #'jsons-print-path)) diff --git a/modules/lang/json/packages.el b/modules/lang/json/packages.el new file mode 100644 index 000000000..69d84fb8a --- /dev/null +++ b/modules/lang/json/packages.el @@ -0,0 +1,5 @@ +;; -*- no-byte-compile: t; -*- +;;; lang/json/packages.el + +(package! json-mode :pin "0e819e519a") +(package! json-snatcher :pin "c4cecc0a50")