@@ -19,6 +19,7 @@ import Development.IDE.GHC.Util
1919import GHC hiding (parseModule, typecheckModule)
2020import GhcPlugins as GHC hiding (fst3, (<>))
2121import qualified Language.Haskell.LSP.Types.Capabilities as LSP
22+import qualified Data.Text as T
2223
2324data IdeOptions = IdeOptions
2425 { optPreprocessor :: GHC.ParsedSource -> IdePreprocessedSource
@@ -48,6 +49,9 @@ data IdeOptions = IdeOptions
4849 -- ^ the ```language to use
4950 , optNewColonConvention :: Bool
5051 -- ^ whether to use new colon convention
52+ , optKeywords :: [T.Text]
53+ -- ^ keywords used for completions. These are customizable
54+ -- since DAML has a different set of keywords than Haskell.
5155 , optDefer :: IdeDefer
5256 -- ^ Whether to defer type errors, typed holes and out of scope
5357 -- variables. Deferral allows the IDE to continue to provide
@@ -84,6 +88,7 @@ defaultIdeOptions session = IdeOptions
8488 ,optReportProgress = IdeReportProgress False
8589 ,optLanguageSyntax = "haskell"
8690 ,optNewColonConvention = False
91+ ,optKeywords = haskellKeywords
8792 ,optDefer = IdeDefer True
8893 ,optTesting = False
8994 }
@@ -103,3 +108,23 @@ data IdePkgLocationOptions = IdePkgLocationOptions
103108defaultIdePkgLocationOptions :: IdePkgLocationOptions
104109defaultIdePkgLocationOptions = IdePkgLocationOptions f f
105110 where f _ _ = return Nothing
111+
112+-- | From https://wiki.haskell.org/Keywords
113+haskellKeywords :: [T.Text]
114+haskellKeywords =
115+ [ "as"
116+ , "case", "of"
117+ , "class", "instance", "type"
118+ , "data", "family", "newtype"
119+ , "default"
120+ , "deriving"
121+ , "do", "mdo", "proc", "rec"
122+ , "forall"
123+ , "foreign"
124+ , "hiding"
125+ , "if", "then", "else"
126+ , "import", "qualified", "hiding"
127+ , "infix", "infixl", "infixr"
128+ , "let", "in", "where"
129+ , "module"
130+ ]