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

Let Projectile choose haskell-build-type if possible #1874

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

webdevred
Copy link

@webdevred webdevred commented Mar 11, 2025

Overview:
This patch enhances Haskell Mode by integrating Projectile to determine whether Stack, Cabal, or system GHC should be used for a project. Previously, GHC selection relied on auto-detection, which could mistakenly pick up unintended project files (e.g., a stray stack.yaml in the home directory). This change gives users explicit control over the selection based on their project's context.

What This Patch Does:

  • Projectile Integration: Uses Projectile to determine the project root and select the appropriate GHC environment.
  • Avoids Misconfiguration: Prevents Haskell Mode from mistakenly using the wrong compiler due to stray configuration files outside the intended project.

Benefits:

  • More Predictable Behavior: Ensures the correct compiler is used based on project settings.
  • Better Workflow with Projectile: Works seamlessly with existing Emacs project management tools.
  • Prevents Confusion: Eliminates cases where users might unknowingly use an unintended Stack or Cabal project.

Testing:

  • Verified that the correct GHC environment is selected based on the project type.
  • Ensured that fallback behavior works as expected when no specific configuration is found.

Conclusion:
This update makes Haskell Mode more robust and user-friendly by giving users direct control over how GHC is selected per project. It prevents unintended behavior while integrating well with the existing Emacs tooling.

Let me know if any refinements are needed!

@webdevred webdevred marked this pull request as draft March 12, 2025 18:52
@webdevred webdevred changed the title Clarify project file selection for GHC auto-detection Let Projectile choose haskell-build-type if possible Mar 12, 2025
@webdevred webdevred marked this pull request as ready for review March 12, 2025 20:44
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.

1 participant