I am currently trying to get started with Haskell because I want to use parts of the code base of Pandoc for a different project. Since I am new to Haskell I need proper IDE features like code completion and jump to definition AND type information and documentation on hover. I chose VSCode with the Haskell extension for the job.
Now comes my problem: Pandoc depends on pandoc-types which is an integral part of the code, which I need to understand and modify. But using the ghc-option
"$everything": -haddock
(which should be the right way to achieve my goal according to this) does not seem to give me proper type information and documentation on hover. Since I copied the entire repo and do not intend to pull or push from the original repos I would like to add the code from pandoc-types
to the existing Haskell code in the main pandoc
repo.
So part of what I have tried was downloading pandoc-types
moving the .hs
files into the according dir in pandoc
, adding the modules to the .cabal
file while removing the pandoc-<version>
dependency from the .cabal
file and the stack.yaml
. But all I got where compatibility errors when building:
➜ pandoc git:(master) ✗ stack build
Error: While constructing the build plan, the following exceptions were encountered:
In the dependencies for citeproc-0.1.0.1:
pandoc-types-1.17.6 from stack configuration does not match >=1.22 && <1.23 (latest matching version is 1.22)
needed due to pandoc-2.11.0.1 -> citeproc-0.1.0.1
In the dependencies for commonmark-pandoc-0.2.0.1:
pandoc-types-1.17.6 from stack configuration does not match >=1.21 && <1.23 (latest matching version is 1.22)
needed due to pandoc-2.11.0.1 -> commonmark-pandoc-0.2.0.1
In the dependencies for texmath-0.12.0.3:
pandoc-types-1.17.6 from stack configuration does not match >=1.20 && <1.23 (latest matching version is 1.22)
needed due to pandoc-2.11.0.1 -> texmath-0.12.0.3
Some different approaches to resolving this:
* Set 'allow-newer: true' in /Users/johannes/.stack/config.yaml to ignore all version constraints and build anyway.
* Recommended action: try adding the following to your extra-deps in /Users/johannes/Programmieren/GITGOV/Pandocs/pandoc/stack.yaml:
- pandoc-types-1.22@sha256:15512ce011555ee720820f11cac0598317293406da5812337cbb1550d144e3bd,4071
Plan construction failed.
How can I change a repo from a dependency be part of the code base. I have tried a few different things, but nothing seemed to work out. I am not really familiar with GHC
, stack
and cabal
or even Haskell itself for that matter. Or is there another way to get the type information and documentation on hover working?
Especially as a Haskell beginner I really need this functionality to properly grasp the code base.
Maybe also relevant:
Both repos seem to generate Paths_*.hs
files in the building process. As far as I understand it, they also need to be copied into the src/
dir like mentioned here.