File tree 1 file changed +5
-6
lines changed
plugins/hls-refactor-plugin/src/Development/IDE/Plugin
1 file changed +5
-6
lines changed Original file line number Diff line number Diff line change @@ -1503,12 +1503,16 @@ suggestNewImport df packageExportsMap ps fileContents Diagnostic{..}
1503
1503
| GHC94 <- ghcVersion
1504
1504
, isNothing (qual <|> qual')
1505
1505
, Just q <- qualGHC94 =
1506
- mapNotInScope ((q <> " . " ) <> ) thingMissing
1506
+ qualify q thingMissing
1507
1507
| otherwise = thingMissing
1508
1508
suggestions = nubSortBy simpleCompareImportSuggestion
1509
1509
(constructNewImportSuggestions packageExportsMap (qual <|> qual' <|> qualGHC94, missing) extendImportSuggestions qis) in
1510
1510
map (\ (ImportSuggestion _ kind (unNewImport -> imp)) -> (imp, kind, TextEdit range (imp <> " \n " <> T. replicate indent " " ))) suggestions
1511
1511
where
1512
+ qualify q (NotInScopeDataConstructor d) = NotInScopeDataConstructor (q <> " ." <> d)
1513
+ qualify q (NotInScopeTypeConstructorOrClass d) = NotInScopeTypeConstructorOrClass (q <> " ." <> d)
1514
+ qualify q (NotInScopeThing d) = NotInScopeThing (q <> " ." <> d)
1515
+
1512
1516
L _ HsModule {.. } = astA ps
1513
1517
suggestNewImport _ _ _ _ _ = []
1514
1518
@@ -1815,11 +1819,6 @@ data NotInScope
1815
1819
| NotInScopeThing T. Text
1816
1820
deriving Show
1817
1821
1818
- mapNotInScope :: (T. Text -> T. Text ) -> NotInScope -> NotInScope
1819
- mapNotInScope f (NotInScopeDataConstructor d) = NotInScopeDataConstructor (f d)
1820
- mapNotInScope f (NotInScopeTypeConstructorOrClass d) = NotInScopeTypeConstructorOrClass (f d)
1821
- mapNotInScope f (NotInScopeThing d) = NotInScopeThing (f d)
1822
-
1823
1822
notInScope :: NotInScope -> T. Text
1824
1823
notInScope (NotInScopeDataConstructor t) = t
1825
1824
notInScope (NotInScopeTypeConstructorOrClass t) = t
You can’t perform that action at this time.
0 commit comments