haskell / haskell-language-server

Official haskell ide support via language server (LSP). Successor of ghcide & haskell-ide-engine.
Apache License 2.0
2.65k stars 355 forks source link

How to prevent `Apply hint` changing tabs to spaces? #3141

Closed RichardJECooke closed 1 year ago

RichardJECooke commented 2 years ago

How do I prevent the hint applier (like remove redundant brackets) from changing all my indentation and changing my tabs to spaces please? I can't see a setting in the config.

RichardJECooke commented 2 years ago

And also, how do I turn off the indentation underliner completely in my code please?

michaelpj commented 2 years ago

I'm not aware of a control knob for tabs-vs-spaces here. It would be helpful to know where this is coming from. Could you try applying the refactoring with hlint directly using hlint --refactor? If the same thing happens then you can open a bug there.

I don't know what the "indentation underliner" is, but I don't think it's something from HLS, probably it comes from your editor.

RichardJECooke commented 2 years ago

I might be confused, but isn't HLS (i.e this repository) the Visual Studio Code plugin? So my editor is Visual Studio Code.

So the indentation underline comes from this plugin, doesn't it?

And how do I do this please? Could you try applying the refactoring with hlint directly using hlint --refactor

michaelpj commented 2 years ago

You might find this useful: https://haskell-language-server.readthedocs.io/en/latest/what-is-hls.html

So the indentation underline comes from this plugin, doesn't it?

It comes from vscode somewhere, I assume. I don't use vscode, so I don't know. HLS is not responsible for everything in vsocde! Maybe you could be more specific about what you're talking about?

And how do I do this please? Could you try applying the refactoring with hlint directly using hlint --refactor

I don't remember exactly, I just know there's an option like that. Your digging into the help of hlint is as good as mine :)

RichardJECooke commented 2 years ago

This issue should be in the repository: https://github.com/haskell/vscode-haskell/issues/701

michaelpj commented 2 years ago

Well, it sounds like you might have found a bug in HLS or in hlint, it's not clear yet. So some more investigation is needed to figure out where the problem lies!

fendor commented 2 years ago

Behaviour is reproducible and non-configurable in hlint --refactor. Maybe even specific to apply-refact

michaelpj commented 2 years ago

Okay, sounds like it's an upstream issue. Would someone like to open an upstream issue?

michaelpj commented 1 year ago

Known upstream, doesn't seem like they're going to do anything about it https://github.com/mpickering/apply-refact/issues/14#issuecomment-157912508.