Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not depend on nor require haskell-mode #193

Merged
merged 1 commit into from
Jan 26, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion Eask
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@

(depends-on "emacs" "27.1")
(depends-on "lsp-mode")
(depends-on "haskell-mode")

(development
(depends-on "f")
Expand Down
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this actually required? I'm not sure I have this? Is this handled now by the :major-modes thing in lsp-mode now?

I definitely don't want it to be the case that everyone has to add hooks, but I think maybe they already don't?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm, not sure if this works. I do see that haskell-ts-mode is part of :major-modes in lsp-haskell, but for me this does not trigger lsp-mode in a haskell-ts-mode buffer.

I basically have this setup:

(use-package haskell-ts-mode
  :mode "\\.hs\\'")

(use-package lsp-haskell
  :after haskell-ts-mode
  :config
  (add-hook 'haskell-ts-mode-hook #'lsp-deferred))

If I remove the add-hook 'haskell-ts-mode line, lsp is not activated in Haskell buffers with haskell-ts-mode activated.

My lsp-mode setup is quite old (years), so maybe I am missing some new configuration necessary to make the automatic initialization work?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, I think you're right and my emacs setup just does this for me. So I think this is fine.k


```emacs-lisp
(add-hook 'haskell-mode-hook #'lsp)
Expand Down
3 changes: 1 addition & 2 deletions lsp-haskell.el
Original file line number Diff line number Diff line change
@@ -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

Expand Down Expand Up @@ -29,7 +29,6 @@
;;; Code:

(require 'lsp-mode)
(require 'haskell-mode)

;; ---------------------------------------------------------------------
;; Configuration
Expand Down
Loading