@@ -23,17 +23,14 @@ import Ide.Plugin.Cabal.LicenseSuggest (licenseNames)
23
23
-- Completion Data
24
24
-- ----------------------------------------------------------------
25
25
26
- supportedCabalVersions :: [CabalSpecVersion ]
27
- supportedCabalVersions = [CabalSpecV2_2 .. maxBound ]
28
-
29
26
-- | Keyword for cabal version; required to be the top line in a cabal file
30
27
cabalVersionKeyword :: Map KeyWordName Completer
31
28
cabalVersionKeyword =
32
29
Map. singleton " cabal-version:" $
33
30
constantCompleter $
34
31
-- We only suggest cabal versions newer than 2.2
35
32
-- since we don't recommend using older ones.
36
- map (T. pack . showCabalSpecVersion) supportedCabalVersions
33
+ map (T. pack . showCabalSpecVersion) [ CabalSpecV2_2 .. maxBound ]
37
34
38
35
-- | Top level keywords of a cabal file.
39
36
--
@@ -90,6 +87,7 @@ libraryFields =
90
87
(" visibility:" , constantCompleter [" private" , " public" ]),
91
88
(" reexported-modules:" , noopCompleter),
92
89
(" signatures:" , noopCompleter),
90
+ (" autogen-modules:" , modulesCompleter sourceDirsExtractionLibrary),
93
91
(" other-modules:" , modulesCompleter sourceDirsExtractionLibrary)
94
92
]
95
93
@@ -98,13 +96,15 @@ executableFields =
98
96
Map. fromList
99
97
[ (" main-is:" , mainIsCompleter sourceDirsExtractionExecutable),
100
98
(" scope:" , constantCompleter [" public" , " private" ]),
99
+ (" autogen-modules:" , modulesCompleter sourceDirsExtractionExecutable),
101
100
(" other-modules:" , modulesCompleter sourceDirsExtractionExecutable)
102
101
]
103
102
104
103
testSuiteFields :: Map KeyWordName Completer
105
104
testSuiteFields =
106
105
Map. fromList
107
106
[ (" type:" , constantCompleter [" exitcode-stdio-1.0" , " detailed-0.9" ]),
107
+ (" autogen-modules:" , modulesCompleter sourceDirsExtractionTestSuite),
108
108
(" main-is:" , mainIsCompleter sourceDirsExtractionTestSuite),
109
109
(" other-modules:" , modulesCompleter sourceDirsExtractionTestSuite)
110
110
]
@@ -113,6 +113,7 @@ benchmarkFields :: Map KeyWordName Completer
113
113
benchmarkFields =
114
114
Map. fromList
115
115
[ (" type:" , noopCompleter),
116
+ (" autogen-modules:" , modulesCompleter sourceDirsExtractionBenchmark),
116
117
(" main-is:" , mainIsCompleter sourceDirsExtractionBenchmark),
117
118
(" other-modules:" , modulesCompleter sourceDirsExtractionBenchmark)
118
119
]
@@ -165,8 +166,7 @@ flagFields =
165
166
libExecTestBenchCommons :: Map KeyWordName Completer
166
167
libExecTestBenchCommons =
167
168
Map. fromList
168
- [ (" import:" , importCompleter),
169
- (" build-depends:" , noopCompleter),
169
+ [ (" build-depends:" , noopCompleter),
170
170
(" hs-source-dirs:" , directoryCompleter),
171
171
(" default-extensions:" , noopCompleter),
172
172
(" other-extensions:" , noopCompleter),
@@ -181,6 +181,7 @@ libExecTestBenchCommons =
181
181
(" ghcjs-prof-options:" , constantCompleter ghcOptions),
182
182
(" ghcjs-shared-options:" , constantCompleter ghcOptions),
183
183
(" includes:" , filePathCompleter),
184
+ (" autogen-includes:" , filePathCompleter),
184
185
(" install-includes:" , filePathCompleter),
185
186
(" include-dirs:" , directoryCompleter),
186
187
(" c-sources:" , filePathCompleter),
@@ -264,3 +265,6 @@ weightedLicenseNames =
264
265
265
266
ghcOptions :: [T. Text ]
266
267
ghcOptions = map T. pack $ flagsForCompletion False
268
+
269
+ supportedCabalVersions :: [CabalSpecVersion ]
270
+ supportedCabalVersions = [CabalSpecV2_2 .. maxBound ]
0 commit comments