Skip to content

Commit 3a4af52

Browse files
VeryMilkyJoeVeryMilkyJoe
VeryMilkyJoe
authored andcommitted
Implement completion of licenses in cabal files
Currently not sorted in suggestions
1 parent ec76a13 commit 3a4af52

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ import System.Directory (doesDirectoryExist,
2424
doesFileExist, listDirectory)
2525
import System.FilePath
2626
import qualified Text.Fuzzy.Parallel as Fuzzy
27+
import Ide.Plugin.Cabal.LicenseSuggest (licenseNames)
2728

2829
-- | Takes information needed to build possible completion items
2930
-- and returns the list of possible completion items
@@ -374,7 +375,7 @@ cabalKeywords =
374375
[ ("name:", noopCompleter) -- TODO: should complete to filename, needs meta info
375376
, ("version:", noopCompleter)
376377
, ("build-type:", constantCompleter ["Simple", "Custom", "Configure", "Make"])
377-
, ("license:", constantCompleter ["NONE"]) -- TODO: add possible values, spdx
378+
, ("license:", constantCompleter licenseNames)
378379
, ("license-file:", filePathCompleter)
379380
, ("license-files:", filePathCompleter) -- list of filenames
380381
, ("copyright:", noopCompleter)

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
module Ide.Plugin.Cabal.LicenseSuggest
77
( licenseErrorSuggestion
88
, licenseErrorAction
9+
, licenseNames
910
-- * Re-exports
1011
, T.Text
1112
, Diagnostic(..)

0 commit comments

Comments
 (0)