@@ -183,7 +183,10 @@ completion _ide _ complParams = do
183
183
result :: Maybe VFS. PosPrefixInfo -> VirtualFile -> J. List CompletionItem
184
184
result Nothing _ = J. List []
185
185
result (Just pfix) cnts
186
- | pos ^. JL. line == 0 = J. List [buildCompletion (fst cabalVersionKeyword)]
186
+ | pos ^. JL. line == 0 = case traceShowId $ context of
187
+ Just (_, kw)
188
+ | KeyWord _ <- kw -> J. List $ map buildCompletion $ snd cabalVersionKeyword
189
+ _ -> J. List [buildCompletion (fst cabalVersionKeyword)]
187
190
| Just ctx <- context = J. List $ makeCompletionItems pfix (getCompletionsForContext ctx)
188
191
| otherwise = J. List []
189
192
where
@@ -223,7 +226,7 @@ getContext :: Position -> [T.Text] -> Maybe Context
223
226
getContext pos ls =
224
227
case lvlContext of
225
228
TopLevel -> do
226
- kwContext <- getKeyWordContext pos ls cabalKeywords
229
+ kwContext <- getKeyWordContext pos ls ( uncurry Map. insert cabalVersionKeyword cabalKeywords)
227
230
pure (TopLevel , kwContext)
228
231
Stanza s ->
229
232
case Map. lookup (traceShowId s) stanzaKeywordMap of
@@ -375,6 +378,16 @@ stanzaKeywordMap =
375
378
(" lib-version-info:" , [] ),
376
379
(" lib-version-linux:" , [] )
377
380
]
381
+ ),
382
+ ( " flag" ,
383
+ Map. fromList
384
+ [ (" description:" , [] ),
385
+ (" default:" , [" True" , " False" ]),
386
+ (" manual:" , [" False" , " True" ]),
387
+ (" lib-def-file:" , [] ),
388
+ (" lib-version-info:" , [] ),
389
+ (" lib-version-linux:" , [] )
390
+ ]
378
391
)
379
392
]
380
393
where
@@ -396,7 +409,27 @@ stanzaKeywordMap =
396
409
(" ghcjs-prof-options:" , [] ),
397
410
(" ghcjs-shared-options:" , [] ),
398
411
(" includes:" , [] ),
399
- (" install-includes:" , [] )
412
+ (" install-includes:" , [] ),
413
+ (" include-dirs:" , [] ),
414
+ (" c-sources:" , [] ),
415
+ (" cxx-sources:" , [] ),
416
+ (" asm-sources:" , [] ),
417
+ (" cmm-sources:" , [] ),
418
+ (" js-sources:" , [] ),
419
+ (" extra-libraries:" , [] ),
420
+ (" extra-ghci-libraries:" , [] ),
421
+ (" extra-bundled-libraries:" , [] ),
422
+ (" extra-lib-dirs:" , [] ),
423
+ (" cc-options:" , [] ),
424
+ (" cpp-options:" , [] ),
425
+ (" cxx-options:" , [] ),
426
+ (" cmm-options:" , [] ),
427
+ (" asm-options:" , [] ),
428
+ (" ld-options:" , [] ),
429
+ (" pkgconfig-depends:" , [] ),
430
+ (" frameworks:" , [] ),
431
+ (" extra-framework-dirs:" , [] ),
432
+ (" mixins:" , [] )
400
433
]
401
434
402
435
-- cabalFlagKeywords :: [(T.Text, T.Text)]
0 commit comments