@@ -2951,34 +2951,6 @@ nonLocalCompletionTests =
2951
2951
(Position 3 8 )
2952
2952
[ (" permutations" , CiFunction , " permutations ${1:[a]}" , False , False , Nothing )
2953
2953
],
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, " }]))],
2982
2954
completionTest
2983
2955
" dont show hidden items"
2984
2956
[ " {-# LANGUAGE NoImplicitPrelude #-}" ,
@@ -2988,16 +2960,47 @@ nonLocalCompletionTests =
2988
2960
]
2989
2961
(Position 3 6 )
2990
2962
[] ,
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
+ ]
3001
3004
],
3002
3005
-- 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
3003
3006
completionTest
0 commit comments