Skip to content

Code completion imports the current module when completing a TH lens #3474

Closed as not planned
@Ptival

Description

@Ptival

I'm on 1.9.0.0, compiled with GHC 9.4.4, working on a 9.4.4 project.

Consider:

{-# LANGUAGE TemplateHaskell #-}

module LensCompletion where

import Control.Lens ( makeLenses )

newtype Testing = Testing
  { _someField :: Int
  }

makeLenses ''Testing

Now start typing:

whatever = someF<Trigger-code-completion>

This will add a cyclic import:

import LensCompletion (someField)

at the top of the current file.

It's quite annoying, likely never the correct thing to do.

This might already have been reported (I'd be surprised if not), but I did a search and could not find it. Sorry if this is a duplicate.

Metadata

Metadata

Assignees

No one assigned

    Labels

    status: needs infoNot actionable, because there's missing informationtype: 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