Skip to content

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

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

Closed
Ptival opened this issue Jan 31, 2023 · 2 comments
Closed

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

Ptival opened this issue Jan 31, 2023 · 2 comments
Labels
status: needs info Not actionable, because there's missing information type: bug Something isn't right: doesn't work as intended, documentation is missing/outdated, etc..

Comments

@Ptival
Copy link

Ptival commented Jan 31, 2023

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.

@Ptival Ptival added status: needs triage type: bug Something isn't right: doesn't work as intended, documentation is missing/outdated, etc.. labels Jan 31, 2023
@michaelpj
Copy link
Collaborator

Is the TH important here? Or does this happen whenever you try and import something which is defined in the current module?

@michaelpj michaelpj added status: needs info Not actionable, because there's missing information and removed status: needs triage labels Feb 5, 2023
@michaelpj
Copy link
Collaborator

I believe this is a duplicate of #2270

@michaelpj michaelpj closed this as not planned Won't fix, can't repro, duplicate, stale Aug 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: needs info Not actionable, because there's missing information type: bug Something isn't right: doesn't work as intended, documentation is missing/outdated, etc..
Projects
None yet
Development

No branches or pull requests

2 participants