* Language Servers

This will include any language server packages and configuration.

** HTML

#+begin_src emacs-lisp
(use-package web-mode
  :defer t
  :mode "\\.html\\'"
  :hook (web-mode . lsp-deferred))
#+end_src

** JavaScript/Typescript

#+begin_src emacs-lisp
(use-package typescript-mode
  :defer t
  :mode ("\\.ts\\'" "\\.js\\'")
  :hook (typescript-mode . lsp-deferred))
#+end_src

Install the ~typescript-language-server~ through npm.

#+begin_src sh
  npm install -g typescript-language-server
#+end_src

** Python

#+begin_src emacs-lisp
(use-package python-mode
  :defer t
  :mode ("\\.py\\'")
  :hook (python-mode . lsp-deferred))
#+end_src

Install the ~python-lsp-server~ though pip.

#+begin_src sh
  pip install python-lsp-server
#+end_src

** C/C++

#+begin_src emacs-lisp
(use-package ccls
  :defer t
  :hook ((c-mode cc-mode c++-mode objc-mode cuda-mode) .
         (lambda () (require 'ccls) (lsp)))
  :config
  (setq ccls-executable "/usr/bin/ccls"))
#+end_src

Install ~ccls~ with homebrew using the following command.

#+begin_src sh
  sudo apt install ccls
#+end_src

** Golang

#+begin_src emacs-lisp
(use-package go-mode
  :defer t
  :hook (go-mode . lsp-deferred))
#+end_src

** Rust

#+begin_src emacs-lisp
(use-package rustic
  :defer t
  :hook (rust-mode . lsp-deferred))
#+end_src

** C# 

#+begin_src emacs-lisp
(use-package csharp-mode
  :defer t
  :hook (csharp-mode . lsp-deferred))
#+end_src

** JSON

#+begin_src emacs-lisp
(use-package json-mode
  :defer t
  :hook (json-mode . lsp-deferred))
#+end_src

** Yaml

#+begin_src emacs-lisp
(use-package yaml-mode
  :defer t
  :hook (yaml-mode . lsp-deferred))
#+end_src

** Yara

To install the corresponding LSP, you need to install ~yls~. Using the command ~pip install -U yls-yara~. Keep in mind that ~yls~ is dependent on an up to date version of ~yara-python~.

#+begin_src emacs-lisp
(use-package yara-mode
  :defer t
  :hook (yara-mode . lsp-deferred)
  :config
  (with-eval-after-load 'lsp-mode
    (add-to-list 'lsp-language-id-configuration
                 '(yara-mode . "yara"))

    (lsp-register-client
     (make-lsp-client :new-connection (lsp-stdio-connection "yls")
                      :activation-fn (lsp-activate-on "yara")
                      :server-id 'yls))))
#+end_src

** R

#+begin_src emacs-lisp
(use-package ess
  :defer t
  :hook (R-mode . lsp-deferred))
#+end_src

** Haskell

#+begin_src emacs-lisp
(use-package haskell-mode
  :defer t
  :hook (haskell-mode . lsp-deferred))
#+end_src
