Add basic LSP support

Still needs to be documented, but includes support for the following
languages:

+ C/C++/ObjC
+ Go
+ Java
+ Javascript
+ OCaml
+ PHP
+ Python
+ Ruby
+ Scala
+ Swift
+ HTML/CSS

Relevant to #460, #716, #1186
This commit is contained in:
Henrik Lissner 2019-02-21 16:08:27 -05:00
parent d7308799f6
commit cb923eadcc
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395
25 changed files with 182 additions and 57 deletions

View file

@ -1,5 +1,9 @@
;;; lang/ocaml/config.el -*- lexical-binding: t; -*-
(when (featurep! +lsp)
(add-hook! (tuareg-mode reason-mode) #'+lsp|init))
(after! tuareg
;; tuareg-mode has the prettify symbols itself
(set-pretty-symbols! 'tuareg-mode :alist
@ -18,6 +22,7 @@
(def-package! merlin
:unless (featurep! +lsp)
:defer t
:init
(defun +ocaml|init-merlin ()
@ -37,7 +42,20 @@
(map! :localleader
:map tuareg-mode-map
"t" #'merlin-type-enclosing
"a" #'tuareg-find-alternate-file))
"a" #'tuareg-find-alternate-file)
(def-package! merlin-eldoc
:hook (merlin-mode . merlin-eldoc-setup))
(def-package! merlin-iedit
:when (featurep! :editor multiple-cursors)
:config
(map! :map tuareg-mode-map
:v "R" #'merlin-iedit-occurrences))
(def-package! merlin-imenu
:when (featurep! :emacs imenu)
:hook (merlin-mode . merlin-use-merlin-imenu)))
(def-package! flycheck-ocaml
@ -53,22 +71,6 @@
(add-hook 'merlin-mode-hook #'+ocaml|init-flycheck))
(def-package! merlin-eldoc
:hook (merlin-mode . merlin-eldoc-setup))
(def-package! merlin-iedit
:when (featurep! :editor multiple-cursors)
:config
(map! :map tuareg-mode-map
:v "R" #'merlin-iedit-occurrences))
(def-package! merlin-imenu
:when (featurep! :emacs imenu)
:hook (merlin-mode . merlin-use-merlin-imenu))
(def-package! utop
:when (featurep! :feature eval)
:defer t ; loaded by hook below