File tree 1 file changed +16
-1
lines changed
plugins/hls-cabal-plugin/src/Ide/Plugin/Cabal 1 file changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -184,7 +184,22 @@ addDependencySuggestCodeAction recorder plId verTxtDocId suggestions haskellFile
184
184
in CodeAction title (Just CodeActionKind_QuickFix ) (Just [] ) Nothing Nothing Nothing (Just command) Nothing
185
185
186
186
-- | 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", "")]@
188
203
hiddenPackageSuggestion :: Int -> Diagnostic -> [(T. Text , T. Text )]
189
204
hiddenPackageSuggestion maxCompletions diag = take maxCompletions $ getMatch (msg =~ regex)
190
205
where
You can’t perform that action at this time.
0 commit comments