Skip to content

Commit e16833e

Browse files
berbermanjneira
andauthored
Fix missing parens of auto extending imports (#1526)
Co-authored-by: Javier Neira <atreyu.bbb@gmail.com>
1 parent 94573be commit e16833e

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

ghcide/src/Development/IDE/Plugin/Completions/Logic.hs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -349,8 +349,8 @@ cacheDataProducer uri env curMod globalEnv inScopeEnv limports = do
349349
docs <- getDocumentationTryGhc packageState curMod n
350350
let (mbParent, originName) = case par of
351351
NoParent -> (Nothing, nameOccName n)
352-
ParentIs n' -> (Just $ showNameWithoutUniques n', nameOccName n)
353-
FldParent n' lbl -> (Just $ showNameWithoutUniques n', maybe (nameOccName n) mkVarOccFS lbl)
352+
ParentIs n' -> (Just . T.pack $ printName n', nameOccName n)
353+
FldParent n' lbl -> (Just . T.pack $ printName n', maybe (nameOccName n) mkVarOccFS lbl)
354354
tys <- catchSrcErrors (hsc_dflags packageState) "completion" $ do
355355
name' <- lookupName packageState m n
356356
return ( name' >>= safeTyThingType
@@ -360,7 +360,7 @@ cacheDataProducer uri env curMod globalEnv inScopeEnv limports = do
360360

361361
let recordCompls = case record_ty of
362362
Just (ctxStr, flds) | not (null flds) ->
363-
[mkRecordSnippetCompItem uri mbParent ctxStr flds (ppr mn) docs imp']
363+
[mkRecordSnippetCompItem uri mbParent ctxStr flds (ppr mn) docs imp']
364364
_ -> []
365365

366366
return $ mkNameCompItem uri mbParent originName mn ty Nothing docs imp'

ghcide/test/exe/Main.hs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3993,6 +3993,12 @@ nonLocalCompletionTests =
39933993
["module A where", "import Data.Maybe ()", "Nothing"]
39943994
(Position 2 4)
39953995
"Nothing"
3996+
, completionCommandTest
3997+
"type operator parent"
3998+
["module A where", "import Data.Type.Equality ()", "f = Ref"]
3999+
(Position 2 8)
4000+
"Refl"
4001+
["module A where", "import Data.Type.Equality ((:~:) (Refl))", "f = Ref"]
39964002
]
39974003
, testGroup "Record completion"
39984004
[ completionCommandTest

0 commit comments

Comments
 (0)