File tree Expand file tree Collapse file tree 3 files changed +7
-0
lines changed
plugins/hls-refactor-plugin
src/Development/IDE/Plugin Expand file tree Collapse file tree 3 files changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -110,6 +110,8 @@ test-suite tests
110
110
, hls-test-utils == 2.6.0.0
111
111
, lens
112
112
, lsp-types
113
+ -- for MIN_VERSION_ghc
114
+ , ghc
113
115
, text
114
116
, hls-plugin-api
115
117
, parser-combinators
Original file line number Diff line number Diff line change @@ -1453,7 +1453,11 @@ suggestNewImport df packageExportsMap ps fileContents Diagnostic{..}
1453
1453
*> extractQualifiedModuleNameFromMissingName (extractTextInRange _range fileContents)
1454
1454
, Just (range, indent) <- newImportInsertRange ps fileContents
1455
1455
, extendImportSuggestions <- matchRegexUnifySpaces msg
1456
+ #if MIN_VERSION_ghc(9,7,0)
1457
+ " Add ‘[^’]*’ to the import list in the import of ‘([^’]*)’"
1458
+ #else
1456
1459
" Perhaps you want to add ‘[^’]*’ to the import list in the import of ‘([^’]*)’"
1460
+ #endif
1457
1461
= let qis = qualifiedImportStyle df
1458
1462
-- FIXME: we can use thingMissing once the support for GHC 9.4 is dropped.
1459
1463
-- In what fllows, @missing@ is assumed to be qualified name.
Original file line number Diff line number Diff line change @@ -1673,6 +1673,7 @@ suggestImportTests :: TestTree
1673
1673
suggestImportTests = testGroup " suggest import actions"
1674
1674
[ testGroup " Dont want suggestion"
1675
1675
[ -- extend import
1676
+ -- We don't want to suggest a new import, but extend existing imports
1676
1677
test False [" Data.List.NonEmpty ()" ] " f = nonEmpty" [] " import Data.List.NonEmpty (nonEmpty)"
1677
1678
-- data constructor
1678
1679
, test False [] " f = First" [] " import Data.Monoid (First)"
You can’t perform that action at this time.
0 commit comments