@@ -107,7 +107,27 @@ main = defaultTestRunner $ testGroup "import-actions"
107107 o = " (Athing, Bthing, ... (4 items))"
108108 in ExplicitImports. abbreviateImportTitleWithoutModule i @?= o
109109 ]
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+ ]]]
111131
112132-- code action tests
113133
@@ -252,6 +272,19 @@ mkInlayHint pos label textEdit =
252272 , _data_ = Nothing
253273 }
254274
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+
255288-- Execute command and wait for result
256289executeCmd :: Command -> Session ()
257290executeCmd cmd = do
0 commit comments