Skip to content

Commit 22dd031

Browse files
committed
Custom-setups completion in cabal files
1 parent d82537c commit 22dd031

1 file changed

Lines changed: 11 additions & 1 deletion

File tree

  • plugins/hls-cabal-plugin/src/Ide/Plugin/Cabal/Completion

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

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,8 @@ stanzaKeywordMap =
8888
("common", libExecTestBenchCommons Library),
8989
("common", libExecTestBenchCommons Common),
9090
("flag", flagFields),
91-
("source-repository", sourceRepositoryFields)
91+
("source-repository", sourceRepositoryFields),
92+
("custom-setup", customSetupFields)
9293
]
9394

9495
libraryFields :: Map KeyWordName Completer
@@ -236,6 +237,15 @@ libExecTestBenchCommons st =
236237
-- but not have erased the "common" stanza.
237238
noopCompleter
238239

240+
customSetupFields :: Map KeyWordName Completer
241+
customSetupFields =
242+
Map.fromList
243+
[ ("setup-depends:", noopCompleter)
244+
, ("build-depends:", noopCompleter)
245+
, ("build-tools:", noopCompleter)
246+
, ("default-language:", constantCompleter ["GHC2021", "Haskell2010", "Haskell98"])
247+
]
248+
239249
-- | Returns all possible language extensions including disabled ones.
240250
allExtensions :: [Extension]
241251
allExtensions =

0 commit comments

Comments
 (0)