Skip to content

Commit 9860ea3

Browse files
committed
cabal outline test imports change
1 parent 526fac3 commit 9860ea3

File tree

1 file changed

+17
-17
lines changed

1 file changed

+17
-17
lines changed

plugins/hls-cabal-plugin/test/Outline.hs

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,24 @@
1-
{-# LANGUAGE DisambiguateRecordFields #-}
2-
{-# LANGUAGE OverloadedStrings #-}
1+
{-# LANGUAGE OverloadedStrings #-}
32

43
module Outline (
54
outlineTests
65
) where
76

8-
import qualified Language.LSP.Protocol.Types as LSP
9-
import Test.Hls
7+
import Language.LSP.Protocol.Types (DocumentSymbol (..),
8+
Position (..), Range (..))
9+
import qualified Test.Hls as T
1010
import Utils
1111

12-
testSymbols :: (HasCallStack) => TestName -> FilePath -> [DocumentSymbol] -> TestTree
12+
testSymbols :: (T.HasCallStack) => T.TestName -> FilePath -> [DocumentSymbol] -> T.TestTree
1313
testSymbols testName path expectedSymbols =
1414
runCabalTestCaseSession testName "outline-cabal" $ do
15-
docId <- openDoc path "cabal"
16-
symbols <- getDocumentSymbols docId
17-
liftIO $ symbols @?= Right expectedSymbols
15+
docId <- T.openDoc path "cabal"
16+
symbols <- T.getDocumentSymbols docId
17+
T.liftIO $ symbols T.@?= Right expectedSymbols
1818

19-
outlineTests :: TestTree
19+
outlineTests :: T.TestTree
2020
outlineTests =
21-
testGroup
21+
T.testGroup
2222
"Cabal Outline Tests"
2323
[ testSymbols
2424
"cabal Field outline test"
@@ -42,43 +42,43 @@ outlineTests =
4242
fieldDocumentSymbol = (defDocumentSymbol (Range {_start = Position {_line = 0, _character = 0},
4343
_end = Position {_line = 0, _character = 8}}))
4444
{ _name = "homepage",
45-
_kind = SymbolKind_Field,
45+
_kind = T.SymbolKind_Field,
4646
_children = Nothing
4747
}
4848
fieldLineDocumentSymbol :: DocumentSymbol
4949
fieldLineDocumentSymbol = (defDocumentSymbol (Range {_start = Position {_line = 0, _character = 0},
5050
_end = Position {_line = 0, _character = 13}}))
5151
{ _name = "cabal-version",
52-
_kind = SymbolKind_Field,
52+
_kind = T.SymbolKind_Field,
5353
_children = Nothing -- the values of fieldLine are removed from the outline
5454
}
5555
sectionDocumentSymbol :: DocumentSymbol
5656
sectionDocumentSymbol = (defDocumentSymbol (Range {_start = Position {_line = 0, _character = 2},
5757
_end = Position {_line = 0, _character = 15}}))
5858
{ _name = "build-depends",
59-
_kind = SymbolKind_Field,
59+
_kind = T.SymbolKind_Field,
6060
_children = Nothing -- the values of fieldLine are removed from the outline
6161
}
6262
sectionArgDocumentSymbol :: DocumentSymbol
6363
sectionArgDocumentSymbol = (defDocumentSymbol (Range {_start = Position {_line = 0, _character = 2},
6464
_end = Position {_line = 0, _character = 19}}))
6565
{ _name = "if os ( windows )",
66-
_kind = SymbolKind_Object,
66+
_kind = T.SymbolKind_Object,
6767
_children = Just $ [sectionArgChildrenDocumentSymbol] }
6868
sectionArgChildrenDocumentSymbol :: DocumentSymbol
6969
sectionArgChildrenDocumentSymbol = (defDocumentSymbol (Range {_start = Position {_line = 1, _character = 4},
7070
_end = Position {_line = 1, _character = 17}}))
7171
{ _name = "build-depends",
72-
_kind = SymbolKind_Field,
72+
_kind = T.SymbolKind_Field,
7373
_children = Nothing
7474
}
7575

76-
defDocumentSymbol :: LSP.Range -> DocumentSymbol
76+
defDocumentSymbol :: Range -> DocumentSymbol
7777
defDocumentSymbol range = DocumentSymbol
7878
{ _detail = Nothing
7979
, _deprecated = Nothing
8080
, _name = ""
81-
, _kind = LSP.SymbolKind_File
81+
, _kind = T.SymbolKind_File
8282
, _range = range
8383
, _selectionRange = range
8484
, _children = Nothing

0 commit comments

Comments
 (0)