Open gfarrell opened 10 months ago
Hi, thank you for your bug report! Your feedback is very welcome and we appreciate any improvements to our quite outdated tutorial!
Only addressing a subset of the issue for now:
Some outdated types (and missing links)
The PR #3655 should take care of these issues.
Alternatively, I'd love it if HLS was packaged up on Hackage and therefore Hoogleable
It is not hackage but not on stackage which is likely too much work for the resources we currently have.
Not knowing what is imported whence
This is a very painful issue with our setup which we try to improve. For now, it should work much better if you use cabal
for building HLS and create a hie.yaml
file in the root of your project with the contents:
cradle:
cabal:
This instructs haskell-language-server
to compile this repository using the cabal
build tool.
@fendor thanks. I'm slowly working through trying to create my plugin (which might be beyond me). I'm happy to keep adding to this issue (and then maybe contribute to the documentation myself) if that is helpful?
(This issue is WIP -- I'm going to record all the things I found confusing about writing a plugin and then suggest changes, but welcome comments as I go.)
I'm currently following the plugin writing documentation / tutorial, and encountered the following things. I'm using the plugin name
ArgSwap
because that's the plugin I was writing.Creating a new plugin and linking it
I had to edit a load of files and do a load of work just to include my plugin in my build:
plugins/hls-argswap-plugin
plugins/hls-argswap-plugin/hls-argswap-plugin.cabal
(for which I copied the cabal file ofhls-module-name-plugin
plugins/hls-argswap-plusin/src/Ide/Plugin/ArgSwap.hs
I then had to "link" it:
cabal.project
by adding./plugins/hls-argswap-plugin
topackages
haskell-language-server.cabal
src/HlsPlugins.hs
stack.yaml
andstack-lts21.yaml
underpackages:
Not knowing what is imported whence
Example plugins I looked at used some implicit imports. HLS wouldn't work for me on the HLS codebase, so I had to make a lot of guesses as to what came whence.
Some outdated types (and missing links)
Near the beginning of the tutorial, there is a description of the
PluginDescriptor
datatype as being defined inIde.Plugin
as:In fact (at least in 2.4.0) it is defined in
Ide.Types
as:Keeping documentation up to date is hard, but one of the things which would be really helpful (especially as HLS just won't run on the HLS codebase for me) is links to the definitions.
Alternatively, I'd love it if HLS was packaged up on Hackage and therefore Hoogleable, because at the moment building local hoogle (via
stack hoogle
) exhausted my machine's memory (and I have 32GB of RAM on this laptop).