@@ -107,7 +107,27 @@ main = defaultTestRunner $ testGroup "import-actions"
107
107
o = " (Athing, Bthing, ... (4 items))"
108
108
in ExplicitImports. abbreviateImportTitleWithoutModule i @?= o
109
109
]
110
- ]]
110
+ ],
111
+ testGroup
112
+ " Import package inlay hints"
113
+ [ testGroup " Without package imports"
114
+ [ inlayHintsTestWithCap " ImportUsual" 2 $ (@=?)
115
+ [mkInlayHintNoTextEdit (Position 2 6 ) " \" base\" " ]
116
+ , inlayHintsTestWithCap " ImportUsual" 3 $ (@=?)
117
+ [mkInlayHintNoTextEdit (Position 3 16 ) " \" containers\" " ]
118
+ , inlayHintsTestWithCap " ImportUsual" 4 $ (@=?) []
119
+ , inlayHintsTestWithoutCap " ImportUsual" 2 $ (@=?) []
120
+ , inlayHintsTestWithoutCap " ImportUsual" 3 $ (@=?) []
121
+ , inlayHintsTestWithoutCap " ImportUsual" 4 $ (@=?) []
122
+ ], testGroup " With package imports"
123
+ [ inlayHintsTestWithCap " ImportWithPackageImport" 3 $ (@=?) []
124
+ , inlayHintsTestWithCap " ImportWithPackageImport" 4 $ (@=?)
125
+ [mkInlayHintNoTextEdit (Position 4 16 ) " \" containers\" " ]
126
+ , inlayHintsTestWithCap " ImportWithPackageImport" 5 $ (@=?) []
127
+ , inlayHintsTestWithoutCap " ImportWithPackageImport" 3 $ (@=?) []
128
+ , inlayHintsTestWithoutCap " ImportWithPackageImport" 4 $ (@=?) []
129
+ , inlayHintsTestWithoutCap " ImportWithPackageImport" 5 $ (@=?) []
130
+ ]]]
111
131
112
132
-- code action tests
113
133
@@ -252,6 +272,19 @@ mkInlayHint pos label textEdit =
252
272
, _data_ = Nothing
253
273
}
254
274
275
+ mkInlayHintNoTextEdit :: Position -> Text -> InlayHint
276
+ mkInlayHintNoTextEdit pos label =
277
+ InlayHint
278
+ { _position = pos
279
+ , _label = InL label
280
+ , _kind = Nothing
281
+ , _textEdits = Nothing
282
+ , _tooltip = Nothing
283
+ , _paddingLeft = Just True
284
+ , _paddingRight = Nothing
285
+ , _data_ = Nothing
286
+ }
287
+
255
288
-- Execute command and wait for result
256
289
executeCmd :: Command -> Session ()
257
290
executeCmd cmd = do
0 commit comments