Skip to content

Delete unused binding code action doesn't delete haddock #4876

@TeofilC

Description

@TeofilC

The delete unused binding code action seems to leave the Haddock attached to the binding it was meant to delete.

Your environment

Which OS do you use? NixOs

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

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

Which LSP client (editor/plugin) do you use? emacs+lsp-mode

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

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

Steps to reproduce

If I have a definition like:

module Foo () where
{- | My haddock goes here 
-}
foo :: Int
foo = ...

and foo is unused, then I get a code action to delete foo.

If I trigger this code action then the definition of foo is deleted by the haddock comment is left, even though it is attached to foo.

Expected behaviour

I would expect the Haddock docstring to also get deleted.

Actual behaviour

The Haddock docstring is not deleted.

Debug information

Metadata

Metadata

Assignees

No one assigned

    Labels

    component: hls-refactor-pluginIssues related to the hls-refactor-plugintype: bugSomething isn't right: doesn't work as intended, documentation is missing/outdated, etc..

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions