@@ -30,7 +30,7 @@ spec = do
30
30
doc <- openDoc " Format.hs" " haskell"
31
31
formatRange doc (FormattingOptions 5 True ) (Range (Position 4 0 ) (Position 7 19 ))
32
32
documentContents doc >>= liftIO . (`shouldBe` formattedRangeTabSize5)
33
-
33
+
34
34
describe " formatting provider" $ do
35
35
let formatLspConfig provider =
36
36
object [ " languageServerHaskell" .= object [" formattingProvider" .= (provider :: Value )] ]
@@ -42,7 +42,7 @@ spec = do
42
42
43
43
formatDoc doc (FormattingOptions 2 True )
44
44
documentContents doc >>= liftIO . (`shouldBe` orig)
45
-
45
+
46
46
formatRange doc (FormattingOptions 2 True ) (Range (Position 1 0 ) (Position 3 10 ))
47
47
documentContents doc >>= liftIO . (`shouldBe` orig)
48
48
@@ -60,34 +60,34 @@ spec = do
60
60
sendNotification WorkspaceDidChangeConfiguration (DidChangeConfigurationParams (formatLspConfig " brittany" ))
61
61
formatDoc doc (FormattingOptions 2 True )
62
62
documentContents doc >>= liftIO . (`shouldBe` formattedBrittanyPostFloskell)
63
-
63
+
64
64
describe " brittany" $ do
65
65
it " formats a document with LF endings" $ runSession hieCommand fullCaps " test/testdata" $ do
66
66
doc <- openDoc " BrittanyLF.hs" " haskell"
67
- let opts = DocumentFormattingParams doc (FormattingOptions 4 True )
67
+ let opts = DocumentFormattingParams doc (FormattingOptions 4 True ) Nothing
68
68
ResponseMessage _ _ (Just edits) _ <- request TextDocumentFormatting opts
69
69
liftIO $ edits `shouldBe` [TextEdit (Range (Position 0 0 ) (Position 3 0 ))
70
70
" foo :: Int -> String -> IO ()\n foo x y = do\n print x\n return 42\n " ]
71
71
72
72
it " formats a document with CRLF endings" $ runSession hieCommand fullCaps " test/testdata" $ do
73
73
doc <- openDoc " BrittanyCRLF.hs" " haskell"
74
- let opts = DocumentFormattingParams doc (FormattingOptions 4 True )
74
+ let opts = DocumentFormattingParams doc (FormattingOptions 4 True ) Nothing
75
75
ResponseMessage _ _ (Just edits) _ <- request TextDocumentFormatting opts
76
76
liftIO $ edits `shouldBe` [TextEdit (Range (Position 0 0 ) (Position 3 0 ))
77
77
" foo :: Int -> String -> IO ()\n foo x y = do\n print x\n return 42\n " ]
78
78
79
79
it " formats a range with LF endings" $ runSession hieCommand fullCaps " test/testdata" $ do
80
80
doc <- openDoc " BrittanyLF.hs" " haskell"
81
81
let range = Range (Position 1 0 ) (Position 2 22 )
82
- opts = DocumentRangeFormattingParams doc range (FormattingOptions 4 True )
82
+ opts = DocumentRangeFormattingParams doc range (FormattingOptions 4 True ) Nothing
83
83
ResponseMessage _ _ (Just edits) _ <- request TextDocumentRangeFormatting opts
84
84
liftIO $ edits `shouldBe` [TextEdit (Range (Position 1 0 ) (Position 3 0 ))
85
85
" foo x y = do\n print x\n return 42\n " ]
86
86
87
87
it " formats a range with CRLF endings" $ runSession hieCommand fullCaps " test/testdata" $ do
88
88
doc <- openDoc " BrittanyCRLF.hs" " haskell"
89
89
let range = Range (Position 1 0 ) (Position 2 22 )
90
- opts = DocumentRangeFormattingParams doc range (FormattingOptions 4 True )
90
+ opts = DocumentRangeFormattingParams doc range (FormattingOptions 4 True ) Nothing
91
91
ResponseMessage _ _ (Just edits) _ <- request TextDocumentRangeFormatting opts
92
92
liftIO $ edits `shouldBe` [TextEdit (Range (Position 1 0 ) (Position 3 0 ))
93
93
" foo x y = do\n print x\n return 42\n " ]
0 commit comments