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

Conversation

dschrempf
Copy link
Contributor

@dschrempf dschrempf commented Jan 20, 2025

Solves #188.

I tried using lsp-haskell with haskell-mode, and haskell-ts-mode, and both seems to work. However, I suggest other people testing their setups.

@dschrempf dschrempf force-pushed the rm-dep-haskell-mode branch from 34db0b8 to f5214c6 Compare January 20, 2025 18:52

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

@michaelpj
Copy link
Collaborator

Thanks!

@michaelpj michaelpj merged commit 1d618c6 into emacs-lsp:master Jan 26, 2025
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants