diff --git a/Eask b/Eask index 451e1a2..6828be3 100644 --- a/Eask +++ b/Eask @@ -14,7 +14,6 @@ (depends-on "emacs" "27.1") (depends-on "lsp-mode") -(depends-on "haskell-mode") (development (depends-on "f") diff --git a/README.md b/README.md index 304026e..2466460 100644 --- a/README.md +++ b/README.md @@ -23,9 +23,8 @@ Do not skip this! It has important information. `lsp-mode` automatically requires the `lsp-haskell` package , so you do not need to `require` `lsp-haskell` unless you like being explicit. -Similarly, `lsp-haskell` automatically requires the `haskell-mode` package, so you do not need to `require` `haskell-mode`. -You will need to set some hooks to ensure that `lsp-mode` is triggered when the `haskell-mode` major mode is entered. +You will need to set some hooks to ensure that `lsp-mode` is triggered when your Haskell major mode (e.g., `haskell-mode` or `haskell-ts-mode`) is entered. ```emacs-lisp (add-hook 'haskell-mode-hook #'lsp) diff --git a/lsp-haskell.el b/lsp-haskell.el index 54e2a2b..97cf01a 100644 --- a/lsp-haskell.el +++ b/lsp-haskell.el @@ -1,7 +1,7 @@ ;;; lsp-haskell.el --- Haskell support for lsp-mode -*- lexical-binding: t; -*- ;; Version: 1.1 -;; Package-Requires: ((emacs "27.1") (lsp-mode "3.0") (haskell-mode "16.1")) +;; Package-Requires: ((emacs "27.1") (lsp-mode "3.0")) ;; Keywords: haskell ;; URL: https://github.com/emacs-lsp/lsp-haskell @@ -29,7 +29,6 @@ ;;; Code: (require 'lsp-mode) -(require 'haskell-mode) ;; --------------------------------------------------------------------- ;; Configuration @@ -467,11 +466,11 @@ but will take exponentially more time." "method" "LSP semantic token type to use for typeclass methods" :type '(choice (const "namespace") (const "type") (const "class") (const "enum") - (const "interface") (const "struct") (const "typeParameter") - (const "parameter") (const "variable") (const "property") (const "enumMember") - (const "event") (const "function") (const "method") (const "macro") - (const "keyword") (const "modifier") (const "comment") (const "string") - (const "number") (const "regexp") (const "operator") (const "decorator")) + (const "interface") (const "struct") (const "typeParameter") + (const "parameter") (const "variable") (const "property") (const "enumMember") + (const "event") (const "function") (const "method") (const "macro") + (const "keyword") (const "modifier") (const "comment") (const "string") + (const "number") (const "regexp") (const "operator") (const "decorator")) :group 'lsp-haskell-plugins :package-version '(lsp-mode . "9.0.0") :lsp-path "haskell.plugin.semanticTokens.config.classMethodToken") @@ -480,11 +479,11 @@ but will take exponentially more time." "class" "LSP semantic token type to use for typeclasses" :type '(choice (const "namespace") (const "type") (const "class") (const "enum") - (const "interface") (const "struct") (const "typeParameter") - (const "parameter") (const "variable") (const "property") (const "enumMember") - (const "event") (const "function") (const "method") (const "macro") - (const "keyword") (const "modifier") (const "comment") (const "string") - (const "number") (const "regexp") (const "operator") (const "decorator")) + (const "interface") (const "struct") (const "typeParameter") + (const "parameter") (const "variable") (const "property") (const "enumMember") + (const "event") (const "function") (const "method") (const "macro") + (const "keyword") (const "modifier") (const "comment") (const "string") + (const "number") (const "regexp") (const "operator") (const "decorator")) :group 'lsp-haskell-plugins :package-version '(lsp-mode . "9.0.0") :lsp-path "haskell.plugin.semanticTokens.config.classToken") @@ -493,11 +492,11 @@ but will take exponentially more time." "enumMember" "LSP semantic token type to use for data constructors" :type '(choice (const "namespace") (const "type") (const "class") (const "enum") - (const "interface") (const "struct") (const "typeParameter") - (const "parameter") (const "variable") (const "property") (const "enumMember") - (const "event") (const "function") (const "method") (const "macro") - (const "keyword") (const "modifier") (const "comment") (const "string") - (const "number") (const "regexp") (const "operator") (const "decorator")) + (const "interface") (const "struct") (const "typeParameter") + (const "parameter") (const "variable") (const "property") (const "enumMember") + (const "event") (const "function") (const "method") (const "macro") + (const "keyword") (const "modifier") (const "comment") (const "string") + (const "number") (const "regexp") (const "operator") (const "decorator")) :group 'lsp-haskell-plugins :package-version '(lsp-mode . "9.0.0") :lsp-path "haskell.plugin.semanticTokens.config.dataConstructorToken") @@ -506,11 +505,11 @@ but will take exponentially more time." "function" "LSP semantic token type to use for functions" :type '(choice (const "namespace") (const "type") (const "class") (const "enum") - (const "interface") (const "struct") (const "typeParameter") - (const "parameter") (const "variable") (const "property") (const "enumMember") - (const "event") (const "function") (const "method") (const "macro") - (const "keyword") (const "modifier") (const "comment") (const "string") - (const "number") (const "regexp") (const "operator") (const "decorator")) + (const "interface") (const "struct") (const "typeParameter") + (const "parameter") (const "variable") (const "property") (const "enumMember") + (const "event") (const "function") (const "method") (const "macro") + (const "keyword") (const "modifier") (const "comment") (const "string") + (const "number") (const "regexp") (const "operator") (const "decorator")) :group 'lsp-haskell-plugins :package-version '(lsp-mode . "9.0.0") :lsp-path "haskell.plugin.semanticTokens.config.functionToken") @@ -519,11 +518,11 @@ but will take exponentially more time." "namespace" "LSP semantic token type to use for modules" :type '(choice (const "namespace") (const "type") (const "class") (const "enum") - (const "interface") (const "struct") (const "typeParameter") - (const "parameter") (const "variable") (const "property") (const "enumMember") - (const "event") (const "function") (const "method") (const "macro") - (const "keyword") (const "modifier") (const "comment") (const "string") - (const "number") (const "regexp") (const "operator") (const "decorator")) + (const "interface") (const "struct") (const "typeParameter") + (const "parameter") (const "variable") (const "property") (const "enumMember") + (const "event") (const "function") (const "method") (const "macro") + (const "keyword") (const "modifier") (const "comment") (const "string") + (const "number") (const "regexp") (const "operator") (const "decorator")) :group 'lsp-haskell-plugins :package-version '(lsp-mode . "9.0.0") :lsp-path "haskell.plugin.semanticTokens.config.moduleToken") @@ -532,11 +531,11 @@ but will take exponentially more time." "operator" "LSP semantic token type to use for operators" :type '(choice (const "namespace") (const "type") (const "class") (const "enum") - (const "interface") (const "struct") (const "typeParameter") - (const "parameter") (const "variable") (const "property") (const "enumMember") - (const "event") (const "function") (const "method") (const "macro") - (const "keyword") (const "modifier") (const "comment") (const "string") - (const "number") (const "regexp") (const "operator") (const "decorator")) + (const "interface") (const "struct") (const "typeParameter") + (const "parameter") (const "variable") (const "property") (const "enumMember") + (const "event") (const "function") (const "method") (const "macro") + (const "keyword") (const "modifier") (const "comment") (const "string") + (const "number") (const "regexp") (const "operator") (const "decorator")) :group 'lsp-haskell-plugins :package-version '(lsp-mode . "9.0.0") :lsp-path "haskell.plugin.semanticTokens.config.operatorToken") @@ -545,11 +544,11 @@ but will take exponentially more time." "macro" "LSP semantic token type to use for pattern synonyms" :type '(choice (const "namespace") (const "type") (const "class") (const "enum") - (const "interface") (const "struct") (const "typeParameter") - (const "parameter") (const "variable") (const "property") (const "enumMember") - (const "event") (const "function") (const "method") (const "macro") - (const "keyword") (const "modifier") (const "comment") (const "string") - (const "number") (const "regexp") (const "operator") (const "decorator")) + (const "interface") (const "struct") (const "typeParameter") + (const "parameter") (const "variable") (const "property") (const "enumMember") + (const "event") (const "function") (const "method") (const "macro") + (const "keyword") (const "modifier") (const "comment") (const "string") + (const "number") (const "regexp") (const "operator") (const "decorator")) :group 'lsp-haskell-plugins :package-version '(lsp-mode . "9.0.0") :lsp-path "haskell.plugin.semanticTokens.config.patternSynonymToken") @@ -558,11 +557,11 @@ but will take exponentially more time." "property" "LSP semantic token type to use for record fields" :type '(choice (const "namespace") (const "type") (const "class") (const "enum") - (const "interface") (const "struct") (const "typeParameter") - (const "parameter") (const "variable") (const "property") (const "enumMember") - (const "event") (const "function") (const "method") (const "macro") - (const "keyword") (const "modifier") (const "comment") (const "string") - (const "number") (const "regexp") (const "operator") (const "decorator")) + (const "interface") (const "struct") (const "typeParameter") + (const "parameter") (const "variable") (const "property") (const "enumMember") + (const "event") (const "function") (const "method") (const "macro") + (const "keyword") (const "modifier") (const "comment") (const "string") + (const "number") (const "regexp") (const "operator") (const "decorator")) :group 'lsp-haskell-plugins :package-version '(lsp-mode . "9.0.0") :lsp-path "haskell.plugin.semanticTokens.config.recordFieldToken") @@ -571,11 +570,11 @@ but will take exponentially more time." "enum" "LSP semantic token type to use for type constructors" :type '(choice (const "namespace") (const "type") (const "class") (const "enum") - (const "interface") (const "struct") (const "typeParameter") - (const "parameter") (const "variable") (const "property") (const "enumMember") - (const "event") (const "function") (const "method") (const "macro") - (const "keyword") (const "modifier") (const "comment") (const "string") - (const "number") (const "regexp") (const "operator") (const "decorator")) + (const "interface") (const "struct") (const "typeParameter") + (const "parameter") (const "variable") (const "property") (const "enumMember") + (const "event") (const "function") (const "method") (const "macro") + (const "keyword") (const "modifier") (const "comment") (const "string") + (const "number") (const "regexp") (const "operator") (const "decorator")) :group 'lsp-haskell-plugins :package-version '(lsp-mode . "9.0.0") :lsp-path "haskell.plugin.semanticTokens.config.typeConstructorToken") @@ -584,11 +583,11 @@ but will take exponentially more time." "interface" "LSP semantic token type to use for type families" :type '(choice (const "namespace") (const "type") (const "class") (const "enum") - (const "interface") (const "struct") (const "typeParameter") - (const "parameter") (const "variable") (const "property") (const "enumMember") - (const "event") (const "function") (const "method") (const "macro") - (const "keyword") (const "modifier") (const "comment") (const "string") - (const "number") (const "regexp") (const "operator") (const "decorator")) + (const "interface") (const "struct") (const "typeParameter") + (const "parameter") (const "variable") (const "property") (const "enumMember") + (const "event") (const "function") (const "method") (const "macro") + (const "keyword") (const "modifier") (const "comment") (const "string") + (const "number") (const "regexp") (const "operator") (const "decorator")) :group 'lsp-haskell-plugins :package-version '(lsp-mode . "9.0.0") :lsp-path "haskell.plugin.semanticTokens.config.typeFamilyToken") @@ -597,11 +596,11 @@ but will take exponentially more time." "type" "LSP semantic token type to use for type synonyms" :type '(choice (const "namespace") (const "type") (const "class") (const "enum") - (const "interface") (const "struct") (const "typeParameter") - (const "parameter") (const "variable") (const "property") (const "enumMember") - (const "event") (const "function") (const "method") (const "macro") - (const "keyword") (const "modifier") (const "comment") (const "string") - (const "number") (const "regexp") (const "operator") (const "decorator")) + (const "interface") (const "struct") (const "typeParameter") + (const "parameter") (const "variable") (const "property") (const "enumMember") + (const "event") (const "function") (const "method") (const "macro") + (const "keyword") (const "modifier") (const "comment") (const "string") + (const "number") (const "regexp") (const "operator") (const "decorator")) :group 'lsp-haskell-plugins :package-version '(lsp-mode . "9.0.0") :lsp-path "haskell.plugin.semanticTokens.config.typeSynonymToken") @@ -610,11 +609,11 @@ but will take exponentially more time." "typeParameter" "LSP semantic token type to use for type variables" :type '(choice (const "namespace") (const "type") (const "class") (const "enum") - (const "interface") (const "struct") (const "typeParameter") - (const "parameter") (const "variable") (const "property") (const "enumMember") - (const "event") (const "function") (const "method") (const "macro") - (const "keyword") (const "modifier") (const "comment") (const "string") - (const "number") (const "regexp") (const "operator") (const "decorator")) + (const "interface") (const "struct") (const "typeParameter") + (const "parameter") (const "variable") (const "property") (const "enumMember") + (const "event") (const "function") (const "method") (const "macro") + (const "keyword") (const "modifier") (const "comment") (const "string") + (const "number") (const "regexp") (const "operator") (const "decorator")) :group 'lsp-haskell-plugins :package-version '(lsp-mode . "9.0.0") :lsp-path "haskell.plugin.semanticTokens.config.typeVariableToken") @@ -623,11 +622,11 @@ but will take exponentially more time." "variable" "LSP semantic token type to use for variables" :type '(choice (const "namespace") (const "type") (const "class") (const "enum") - (const "interface") (const "struct") (const "typeParameter") - (const "parameter") (const "variable") (const "property") (const "enumMember") - (const "event") (const "function") (const "method") (const "macro") - (const "keyword") (const "modifier") (const "comment") (const "string") - (const "number") (const "regexp") (const "operator") (const "decorator")) + (const "interface") (const "struct") (const "typeParameter") + (const "parameter") (const "variable") (const "property") (const "enumMember") + (const "event") (const "function") (const "method") (const "macro") + (const "keyword") (const "modifier") (const "comment") (const "string") + (const "number") (const "regexp") (const "operator") (const "decorator")) :group 'lsp-haskell-plugins :package-version '(lsp-mode . "9.0.0") :lsp-path "haskell.plugin.semanticTokens.config.variableToken") @@ -718,19 +717,19 @@ arguments are non-nullable booleans." ;; Register the client itself (lsp-register-client - (make-lsp--client - :new-connection (lsp-stdio-connection (lambda () (lsp-haskell--server-command))) - ;; Should run under haskell-mode, haskell-literate-mode and haskell-tng-mode. We need to list haskell-literate-mode even though it's a derived mode of haskell-mode. - :major-modes '(haskell-mode haskell-literate-mode haskell-tng-mode haskell-cabal-mode haskell-ts-mode) - ;; This is arbitrary. - :server-id 'lsp-haskell - :synchronize-sections '("haskell") - ;; This is somewhat irrelevant, but it is listed in lsp-language-id-configuration, so - ;; we should set something consistent here. - :language-id "haskell" - :completion-in-comments? lsp-haskell-completion-in-comments - :action-filter #'lsp-haskell--action-filter - )) + (make-lsp--client + :new-connection (lsp-stdio-connection (lambda () (lsp-haskell--server-command))) + ;; Should run under haskell-mode, haskell-literate-mode and haskell-tng-mode. We need to list haskell-literate-mode even though it's a derived mode of haskell-mode. + :major-modes '(haskell-mode haskell-literate-mode haskell-tng-mode haskell-cabal-mode haskell-ts-mode) + ;; This is arbitrary. + :server-id 'lsp-haskell + :synchronize-sections '("haskell") + ;; This is somewhat irrelevant, but it is listed in lsp-language-id-configuration, so + ;; we should set something consistent here. + :language-id "haskell" + :completion-in-comments? lsp-haskell-completion-in-comments + :action-filter #'lsp-haskell--action-filter + )) ;; ---------------------------------------------------------------------