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

Following -Werror from cabal file #3602

Closed
fkrunic opened this issue May 20, 2023 · 2 comments
Closed

Following -Werror from cabal file #3602

fkrunic opened this issue May 20, 2023 · 2 comments
Labels
type: enhancement New feature or request

Comments

@fkrunic
Copy link

fkrunic commented May 20, 2023

Your environment

Which OS do you use?

  • macOS Monterey (12.6.6)

Which version of GHC do you use and how did you install it?

  • 9.2.7 from ghcup

How is your project built (alternative: link to the project)?

  • Cabal 3.2.6.0

Which LSP client (editor/plugin) do you use?

  • Neovim + HLS via lsp-zero.

Which version of HLS do you use and how did you install it?

  • 1.10.0.0 from ghcup

Have you configured HLS in any way (especially: a hie.yaml file)?

  • No

What's wrong?

The following options are specified under the ghc-options section of my cabal file:

  • -Wall
  • -Werror=missing-fields
  • -Werror=incomplete-patterns

How do I pass these options into HLS so that instead of highlighting missing fields or incomplete patterns as warnings in Neovim, it highlights them as build errors to match the behavior of cabal build?

Debug Information

LSP configuration in after/plugin/lsp_config.lua:

local lsp = require('lsp-zero')

lsp.preset('recommended')
lsp.ensure_installed({
  'lua_ls',
  'hls'
})

-- Fix for undefined 'vim'
lsp.nvim_workspace()
lsp.setup()

vim.diagnostic.config({
  virtual_text = false
})
@fkrunic fkrunic added status: needs triage type: support User support tickets, questions, help with setup etc. labels May 20, 2023
@michaelpj
Copy link
Collaborator

We do get the flags from the cabal file. I believe the issue here is that we explicitly disable -Werror after all that, so that we don't block compilation for warnings.

There is some discussion in #853, probably continue there?

@michaelpj michaelpj added type: enhancement New feature or request and removed status: needs triage type: support User support tickets, questions, help with setup etc. labels May 21, 2023
@michaelpj michaelpj changed the title Reading GHC options in Cabal file Following -Werror from cabal file May 22, 2023
@fkrunic
Copy link
Author

fkrunic commented May 23, 2023

We do get the flags from the cabal file. I believe the issue here is that we explicitly disable -Werror after all that, so that we don't block compilation for warnings.

There is some discussion in #853, probably continue there?

Sounds good, thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants