How to make damlc ide parse {-# LANGUAGE -#}?
- LucianoOP 1
When I run
daml damlc ideto use the LSP server with vim, I need to pass it explicit arguments--ghc-option -X_____to enable a language feature.Is there a way to automate this, so that the LSP server infers these from the
{-# LANGAUGE _____ #-}pragma in my source code, rather than having to pass them in explicitly? - cocreature
damlc should always parse that pragma both in the IDE mode as well as in
daml build. Do you have a concrete example where this doesn’t work? - Luciano
It happens every time I start the IDE from vim. It executes
daml damlc ideindirectly, as far as I know. - cocreature
Can you reproduce it in VSCode? All the logic for this should be in damlc not in the editor-specific side so it shouldn’t be specific to vim.
- Luciano
Looks like I can reproduce it:

Just ran
daml initand then createddaml/Main.damllike above. The error says/home/luciano/src/testextensions/daml/Main.daml:5:6: error:
Illegal declaration of a type or class operator ‘:+:’
Use TypeOperators to declare operators in type and declarations - cocreature
The lanugage pragma needs to be above the module header not below. So try the following:
{-# LANGUAGE TypeOperators #-} module Main where