Skip to content

Incorrect completion text when using DuplicateRecordFields  #682

Closed
@expipiplus1

Description

@expipiplus1

Your environment

Output of haskell-language-server --probe-tools or haskell-language-server-wrapper --probe-tools:

❯ haskell-language-server --probe-tools
haskell-language-server version: 0.7.0.0 (GHC: 8.10.2) (PATH: /nix/store/r7bgp8sh4hm7x4r7nz3y3if9n74hv5zx-haskell-language-server-0.7.0.0/bin/haskell-language-server)
Tool versions found on the $PATH
cabal:          3.2.0.0
stack:          Not found
ghc:            8.10.2

Which lsp-client do you use:

This happens with nvim/coc and vscode

Steps to reproduce

In Foo.hs:

{-# language DuplicateRecordFields #-}
module Foo
  where

newtype Foo = Foo { member :: () }
newtype Bar = Bar { member :: () }

in Bar.hs:

module Bar where

import Foo

foo = memb
  • Trigger a completion for memb
  • Observe that member is suggested twice (not useful)
  • Accept either one of the suggestions for member
  • Observe that the text :member:Foo is inserted instead of member

I suppose that this is some incorrect demangling of the $sel:Foo:member names that GHC uses.

image

Metadata

Metadata

Assignees

No one assigned

    Labels

    component: pluginstype: 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