diff --git a/ghcide/src/Development/IDE/Types/Exports.hs b/ghcide/src/Development/IDE/Types/Exports.hs index d8f5c35233..6c85af472a 100644 --- a/ghcide/src/Development/IDE/Types/Exports.hs +++ b/ghcide/src/Development/IDE/Types/Exports.hs @@ -58,7 +58,7 @@ mkIdentInfos (AvailTC parent (n:nn) flds) ] ++ [ IdentInfo (pack (prettyPrint n)) (pack (printName n)) Nothing (isDataConName n)] where - parentP = pack $ prettyPrint parent + parentP = pack $ printName parent mkIdentInfos (AvailTC _ nn flds) = [ IdentInfo (pack (prettyPrint n)) (pack (printName n)) Nothing (isDataConName n) diff --git a/ghcide/test/exe/Main.hs b/ghcide/test/exe/Main.hs index 2dda3cb02d..cedbda82fd 100644 --- a/ghcide/test/exe/Main.hs +++ b/ghcide/test/exe/Main.hs @@ -1300,6 +1300,22 @@ extendImportTests = testGroup "extend import actions" , "import ModuleA (bar)" , "foo = bar" ]) + , testSession "extend import list with constructor of type operator" $ template + [] + ("ModuleA.hs", T.unlines + [ "module ModuleA where" + , "import Data.Type.Equality ((:~:))" + , "x :: (:~:) [] []" + , "x = Refl" + ]) + (Range (Position 3 17) (Position 3 18)) + ["Add (:~:)(Refl) to the import list of Data.Type.Equality"] + (T.unlines + [ "module ModuleA where" + , "import Data.Type.Equality ((:~:)(Refl))" + , "x :: (:~:) [] []" + , "x = Refl" + ]) ] where codeActionTitle CodeAction{_title=x} = x