Skip to content

Commit 207827a

Browse files
committed
docs
1 parent 4df66fc commit 207827a

File tree

1 file changed

+16
-1
lines changed
  • plugins/hls-cabal-plugin/src/Ide/Plugin/Cabal

1 file changed

+16
-1
lines changed

plugins/hls-cabal-plugin/src/Ide/Plugin/Cabal/CabalAdd.hs

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,22 @@ addDependencySuggestCodeAction recorder plId verTxtDocId suggestions haskellFile
184184
in CodeAction title (Just CodeActionKind_QuickFix) (Just []) Nothing Nothing Nothing (Just command) Nothing
185185

186186
-- | Gives a mentioned number of @(dependency, version)@ pairs
187-
-- found in the "hidden package" diagnostic message
187+
-- found in the "hidden package" diagnostic message.
188+
--
189+
-- For example, if a ghc error looks like this:
190+
--
191+
-- > "Could not load module ‘Data.List.Split’
192+
-- > It is a member of the hidden package ‘split-0.2.5’.
193+
-- > Perhaps you need to add ‘split’ to the build-depends in your .cabal file."
194+
--
195+
-- It extracts mentioned package names and version numbers.
196+
-- In this example, it will be @[("split", "0.2.5")]@
197+
--
198+
-- Also supports messages without a version.
199+
--
200+
-- > "Perhaps you need to add ‘split’ to the build-depends in your .cabal file."
201+
--
202+
-- Will turn into @[("split", "")]@
188203
hiddenPackageSuggestion :: Int -> Diagnostic -> [(T.Text, T.Text)]
189204
hiddenPackageSuggestion maxCompletions diag = take maxCompletions $ getMatch (msg =~ regex)
190205
where

0 commit comments

Comments
 (0)