XMonad: Difference between revisions
imported>Srid m Url change |
imported>Efim Adding way to get lsp support that worked for me |
||
| Line 13: | Line 13: | ||
=== Configuring XMonad with IDE support === | === Configuring XMonad with IDE support === | ||
To edit XMonad configuration with IDE support, see https://www.srid.ca/xmonad-conf-ide | To edit XMonad configuration with IDE support, see https://www.srid.ca/xmonad-conf-ide | ||
=== Another way to set up lsp support === | |||
Previous way to set up lsp support didn't work for me. | |||
[https://discourse.nixos.org/t/haskell-language-server-support-for-xmonad/12348 This post] helped: | |||
==== if setting up xmonad with extra packages: ==== | |||
{{file|~/.config/home-config.nix|nix|<nowiki> | |||
e.g: | |||
windowManager = { | |||
xmonad = { | |||
enable = true; | |||
enableContribAndExtras = true; | |||
extraPackages = haskellPackages: [ | |||
haskellPackages.dbus | |||
haskellPackages.List | |||
haskellPackages.monad-logger | |||
haskellPackages.xmonad | |||
]; | |||
}; | |||
}; | |||
</nowiki>}} | |||
==== having ghc and other things for the lsp server in the system: ==== | |||
{{file|~/.config/home-config.nix|nix|<nowiki> | |||
home.packages = with pkgs; [ | |||
haskellPackages.haskell-language-server | |||
haskellPackages.hoogle | |||
cabal-install | |||
stack | |||
] | |||
</nowiki>}} | |||
(but I'm not sure whether all of those are required, maybe only one of cabal \ stack?) | |||
==== creating project around `xmonad.hs` file ==== | |||
{{file|~/.config/xmonad/hie-bios.sh|sh|<nowiki> | |||
echo "xmonad" >> $HIE_BIOS_OUTPUT | |||
</nowiki>}} | |||
{{file|~/.config/xmonad/hie.yaml|yaml|<nowiki> | |||
cradle: | |||
bios: | |||
program: "./hie-bios.sh" | |||
with-ghc: "/nix/store/waa0dlvlszwbplrz5c7j674ab6v1n5wi-ghc-8.8.4-with-packages/bin/ghc" | |||
</nowiki>}} | |||
The "with-ghc" should be ghc that's in the "ghc-with-packages" dependency of the "xmonad-with-packages" | |||
It can be easily found with "nix-tree" utili, get with "nix-shell -p nix-tree" | |||
this shows dependencies between packages on the machine, "/" is for searching for "with-packages" | |||
see the store path in the bottom of the screen | |||
==== to check what are the problems ==== | |||
I try to manually run "haskell-language-server" in the directory with `xmonad.hs`, `hie.yaml` and `hie-bios.sh` | |||
when there are no errors, my editor also successfully starts lsp | |||