@@ -288,7 +288,10 @@ completion _ide _ complParams = do
288
288
result :: Maybe VFS. PosPrefixInfo -> VirtualFile -> J. List CompletionItem
289
289
result Nothing _ = J. List []
290
290
result (Just pfix) cnts
291
- | pos ^. JL. line == 0 = J. List [buildCompletion (fst cabalVersionKeyword)]
291
+ | pos ^. JL. line == 0 = case traceShowId $ context of
292
+ Just (_, kw)
293
+ | KeyWord _ <- kw -> J. List $ map buildCompletion $ snd cabalVersionKeyword
294
+ _ -> J. List [buildCompletion (fst cabalVersionKeyword)]
292
295
| Just ctx <- context = J. List $ makeCompletionItems pfix (getCompletionsForContext ctx)
293
296
| otherwise = J. List []
294
297
where
@@ -328,7 +331,7 @@ getContext :: Position -> [T.Text] -> Maybe Context
328
331
getContext pos ls =
329
332
case lvlContext of
330
333
TopLevel -> do
331
- kwContext <- getKeyWordContext pos ls cabalKeywords
334
+ kwContext <- getKeyWordContext pos ls ( uncurry Map. insert cabalVersionKeyword cabalKeywords)
332
335
pure (TopLevel , kwContext)
333
336
Stanza s ->
334
337
case Map. lookup (traceShowId s) stanzaKeywordMap of
@@ -480,6 +483,16 @@ stanzaKeywordMap =
480
483
(" lib-version-info:" , [] ),
481
484
(" lib-version-linux:" , [] )
482
485
]
486
+ ),
487
+ ( " flag" ,
488
+ Map. fromList
489
+ [ (" description:" , [] ),
490
+ (" default:" , [" True" , " False" ]),
491
+ (" manual:" , [" False" , " True" ]),
492
+ (" lib-def-file:" , [] ),
493
+ (" lib-version-info:" , [] ),
494
+ (" lib-version-linux:" , [] )
495
+ ]
483
496
)
484
497
]
485
498
where
@@ -501,7 +514,27 @@ stanzaKeywordMap =
501
514
(" ghcjs-prof-options:" , [] ),
502
515
(" ghcjs-shared-options:" , [] ),
503
516
(" includes:" , [] ),
504
- (" install-includes:" , [] )
517
+ (" install-includes:" , [] ),
518
+ (" include-dirs:" , [] ),
519
+ (" c-sources:" , [] ),
520
+ (" cxx-sources:" , [] ),
521
+ (" asm-sources:" , [] ),
522
+ (" cmm-sources:" , [] ),
523
+ (" js-sources:" , [] ),
524
+ (" extra-libraries:" , [] ),
525
+ (" extra-ghci-libraries:" , [] ),
526
+ (" extra-bundled-libraries:" , [] ),
527
+ (" extra-lib-dirs:" , [] ),
528
+ (" cc-options:" , [] ),
529
+ (" cpp-options:" , [] ),
530
+ (" cxx-options:" , [] ),
531
+ (" cmm-options:" , [] ),
532
+ (" asm-options:" , [] ),
533
+ (" ld-options:" , [] ),
534
+ (" pkgconfig-depends:" , [] ),
535
+ (" frameworks:" , [] ),
536
+ (" extra-framework-dirs:" , [] ),
537
+ (" mixins:" , [] )
505
538
]
506
539
507
540
-- cabalFlagKeywords :: [(T.Text, T.Text)]
0 commit comments