Skip to content

Commit 9df1d8a

Browse files
authored
Prepare release 0.6.0.2 (haskell/ghcide#958)
* Disable auto-extend of module imports * Prepare for v0.6.0.2 release
1 parent 547dc32 commit 9df1d8a

File tree

4 files changed

+48
-45
lines changed

4 files changed

+48
-45
lines changed

ghcide/CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
### 0.6.0.2 (2020-12-26)
2+
* Fix disappearing diagnostics bug (#959) - (Pepe Iborra)
3+
* Use qualified module name from diagnostics in suggestNewImport (#945) - (Potato Hatsue)
4+
* Disable auto extend import snippets in completions (these need a bit more work)
5+
16
### 0.6.0.1 (2020-12-13)
27
* Fix build with GHC 8.8.2 and 8.8.3 - (Javier Neira)
38
* Update old URLs still pointing to digital-asset - (Jan Hrcek)

ghcide/ghcide.cabal

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ cabal-version: 1.20
22
build-type: Simple
33
category: Development
44
name: ghcide
5-
version: 0.6.0.1
5+
version: 0.6.0.2
66
license: Apache-2.0
77
license-file: LICENSE
88
author: Digital Asset and Ghcide contributors

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

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -287,10 +287,6 @@ cacheDataProducer packageState curMod rdrEnv limports deps = do
287287
let dflags = hsc_dflags packageState
288288
curModName = moduleName curMod
289289

290-
importMap = Map.fromList [
291-
(getLoc imp, imp)
292-
| imp <- limports ]
293-
294290
iDeclToModName :: ImportDecl name -> ModuleName
295291
iDeclToModName = unLoc . ideclName
296292

@@ -319,8 +315,7 @@ cacheDataProducer packageState curMod rdrEnv limports deps = do
319315
(, mempty) <$> toCompItem curMod curModName n Nothing
320316
getComplsForOne (GRE n _ False prov) =
321317
flip foldMapM (map is_decl prov) $ \spec -> do
322-
let originalImportDecl = Map.lookup (is_dloc spec) importMap
323-
compItem <- toCompItem curMod (is_mod spec) n originalImportDecl
318+
compItem <- toCompItem curMod (is_mod spec) n Nothing
324319
let unqual
325320
| is_qual spec = []
326321
| otherwise = compItem

ghcide/test/exe/Main.hs

Lines changed: 41 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -2951,34 +2951,6 @@ nonLocalCompletionTests =
29512951
(Position 3 8)
29522952
[ ("permutations", CiFunction, "permutations ${1:[a]}", False, False, Nothing)
29532953
],
2954-
completionTest
2955-
"show imports not in list - simple"
2956-
["{-# LANGUAGE NoImplicitPrelude #-}",
2957-
"module A where", "import Control.Monad (msum)", "f = joi"]
2958-
(Position 3 6)
2959-
[("join", CiFunction, "join ${1:m (m a)}", False, False,
2960-
Just (List [TextEdit {_range = Range {_start = Position {_line = 2, _character = 26}, _end = Position {_line = 2, _character = 26}}, _newText = "join, "}]))],
2961-
completionTest
2962-
"show imports not in list - multi-line"
2963-
["{-# LANGUAGE NoImplicitPrelude #-}",
2964-
"module A where", "import Control.Monad (\n msum)", "f = joi"]
2965-
(Position 4 6)
2966-
[("join", CiFunction, "join ${1:m (m a)}", False, False,
2967-
Just (List [TextEdit {_range = Range {_start = Position {_line = 3, _character = 8}, _end = Position {_line = 3, _character = 8}}, _newText = "join, "}]))],
2968-
completionTest
2969-
"show imports not in list - names with _"
2970-
["{-# LANGUAGE NoImplicitPrelude #-}",
2971-
"module A where", "import qualified Control.Monad as M (msum)", "f = M.mapM_"]
2972-
(Position 3 11)
2973-
[("mapM_", CiFunction, "mapM_ ${1:a -> m b} ${2:t a}", False, False,
2974-
Just (List [TextEdit {_range = Range {_start = Position {_line = 2, _character = 41}, _end = Position {_line = 2, _character = 41}}, _newText = "mapM_, "}]))],
2975-
completionTest
2976-
"show imports not in list - initial empty list"
2977-
["{-# LANGUAGE NoImplicitPrelude #-}",
2978-
"module A where", "import qualified Control.Monad as M ()", "f = M.joi"]
2979-
(Position 3 10)
2980-
[("join", CiFunction, "join ${1:m (m a)}", False, False,
2981-
Just (List [TextEdit {_range = Range {_start = Position {_line = 2, _character = 37}, _end = Position {_line = 2, _character = 37}}, _newText = "join, "}]))],
29822954
completionTest
29832955
"dont show hidden items"
29842956
[ "{-# LANGUAGE NoImplicitPrelude #-}",
@@ -2988,16 +2960,47 @@ nonLocalCompletionTests =
29882960
]
29892961
(Position 3 6)
29902962
[],
2991-
completionTest
2992-
"record snippet on import"
2993-
["module A where", "import Text.Printf (FormatParse(FormatParse))", "FormatParse"]
2994-
(Position 2 10)
2995-
[("FormatParse", CiStruct, "FormatParse ", False, False,
2996-
Just (List [TextEdit {_range = Range {_start = Position {_line = 1, _character = 44}, _end = Position {_line = 1, _character = 44}}, _newText = "FormatParse, "}])),
2997-
("FormatParse", CiConstructor, "FormatParse ${1:String} ${2:Char} ${3:String}", False, False,
2998-
Just (List [TextEdit {_range = Range {_start = Position {_line = 1, _character = 44}, _end = Position {_line = 1, _character = 44}}, _newText = "FormatParse, "}])),
2999-
("FormatParse", CiSnippet, "FormatParse {fpModifiers=${1:_fpModifiers}, fpChar=${2:_fpChar}, fpRest=${3:_fpRest}}", False, False,
3000-
Just (List [TextEdit {_range = Range {_start = Position {_line = 1, _character = 44}, _end = Position {_line = 1, _character = 44}}, _newText = "FormatParse, "}]))
2963+
expectFailBecause "Auto import completion snippets were disabled in v0.6.0.2" $
2964+
testGroup "auto import snippets"
2965+
[ completionTest
2966+
"show imports not in list - simple"
2967+
["{-# LANGUAGE NoImplicitPrelude #-}",
2968+
"module A where", "import Control.Monad (msum)", "f = joi"]
2969+
(Position 3 6)
2970+
[("join", CiFunction, "join ${1:m (m a)}", False, False,
2971+
Just (List [TextEdit {_range = Range {_start = Position {_line = 2, _character = 26}, _end = Position {_line = 2, _character = 26}}, _newText = "join, "}]))]
2972+
, completionTest
2973+
"show imports not in list - multi-line"
2974+
["{-# LANGUAGE NoImplicitPrelude #-}",
2975+
"module A where", "import Control.Monad (\n msum)", "f = joi"]
2976+
(Position 4 6)
2977+
[("join", CiFunction, "join ${1:m (m a)}", False, False,
2978+
Just (List [TextEdit {_range = Range {_start = Position {_line = 3, _character = 8}, _end = Position {_line = 3, _character = 8}}, _newText = "join, "}]))]
2979+
, completionTest
2980+
"show imports not in list - names with _"
2981+
["{-# LANGUAGE NoImplicitPrelude #-}",
2982+
"module A where", "import qualified Control.Monad as M (msum)", "f = M.mapM_"]
2983+
(Position 3 11)
2984+
[("mapM_", CiFunction, "mapM_ ${1:a -> m b} ${2:t a}", False, False,
2985+
Just (List [TextEdit {_range = Range {_start = Position {_line = 2, _character = 41}, _end = Position {_line = 2, _character = 41}}, _newText = "mapM_, "}]))]
2986+
, completionTest
2987+
"show imports not in list - initial empty list"
2988+
["{-# LANGUAGE NoImplicitPrelude #-}",
2989+
"module A where", "import qualified Control.Monad as M ()", "f = M.joi"]
2990+
(Position 3 10)
2991+
[("join", CiFunction, "join ${1:m (m a)}", False, False,
2992+
Just (List [TextEdit {_range = Range {_start = Position {_line = 2, _character = 37}, _end = Position {_line = 2, _character = 37}}, _newText = "join, "}]))]
2993+
, completionTest
2994+
"record snippet on import"
2995+
["module A where", "import Text.Printf (FormatParse(FormatParse))", "FormatParse"]
2996+
(Position 2 10)
2997+
[("FormatParse", CiStruct, "FormatParse ", False, False,
2998+
Just (List [TextEdit {_range = Range {_start = Position {_line = 1, _character = 44}, _end = Position {_line = 1, _character = 44}}, _newText = "FormatParse, "}])),
2999+
("FormatParse", CiConstructor, "FormatParse ${1:String} ${2:Char} ${3:String}", False, False,
3000+
Just (List [TextEdit {_range = Range {_start = Position {_line = 1, _character = 44}, _end = Position {_line = 1, _character = 44}}, _newText = "FormatParse, "}])),
3001+
("FormatParse", CiSnippet, "FormatParse {fpModifiers=${1:_fpModifiers}, fpChar=${2:_fpChar}, fpRest=${3:_fpRest}}", False, False,
3002+
Just (List [TextEdit {_range = Range {_start = Position {_line = 1, _character = 44}, _end = Position {_line = 1, _character = 44}}, _newText = "FormatParse, "}]))
3003+
]
30013004
],
30023005
-- we need this test to make sure the ghcide completions module does not return completions for language pragmas. this functionality is turned on in hls
30033006
completionTest

0 commit comments

Comments
 (0)