File tree 3 files changed +10
-4
lines changed
3 files changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -520,6 +520,7 @@ test-suite func-test
520
520
import : common-deps
521
521
, warnings
522
522
, pedantic
523
+ , refactor
523
524
type : exitcode-stdio-1.0
524
525
default-language : Haskell2010
525
526
build-tool-depends :
Original file line number Diff line number Diff line change @@ -47,10 +47,13 @@ providerTests = testGroup "formatting provider" [
47
47
testCase " respects none" $ runSessionWithConfig (formatConfig " none" ) hlsCommand fullCaps " test/testdata/format" $ do
48
48
doc <- openDoc " Format.hs" " haskell"
49
49
resp <- request STextDocumentFormatting $ DocumentFormattingParams Nothing doc (FormattingOptions 2 True Nothing Nothing Nothing )
50
- liftIO $ resp ^. LSP. result @?= Left (ResponseError InvalidRequest
51
- (" No plugin enabled for STextDocumentFormatting, available:\n "
52
- <> " PluginId \" floskell\"\n PluginId \" fourmolu\"\n PluginId \" stylish-haskell\"\n PluginId \" brittany\"\n PluginId \" ormolu\"\n " )
53
- Nothing )
50
+ case resp ^. LSP. result of
51
+ result@ (Left (ResponseError reason message Nothing )) -> case reason of
52
+ MethodNotFound -> pure () -- No formatter
53
+ InvalidRequest | " No plugin enabled for STextDocumentFormatting" `isPrefixOf` message -> pure ()
54
+ _ -> assertFailure $ " strange response from formatting provider:" ++ show result
55
+ result -> assertFailure $ " strange response from formatting provider:" ++ show result
56
+
54
57
55
58
, requiresOrmoluPlugin . requiresFloskellPlugin $ testCase " can change on the fly" $ runSession hlsCommand fullCaps " test/testdata/format" $ do
56
59
formattedOrmolu <- liftIO $ T. readFile " test/testdata/format/Format.ormolu.formatted.hs"
Original file line number Diff line number Diff line change @@ -24,13 +24,15 @@ import Test.Hls.Command
24
24
25
25
tests :: TestTree
26
26
tests = testGroup " code actions" [
27
+ #if hls_refactor
27
28
importTests
28
29
, packageTests
29
30
, redundantImportTests
30
31
, renameTests
31
32
, signatureTests
32
33
, typedHoleTests
33
34
, unusedTermTests
35
+ #endif
34
36
]
35
37
36
38
renameTests :: TestTree
You can’t perform that action at this time.
0 commit comments