lol

Add haskell-ide-engine

+508 -1
+6
pkgs/development/haskell-modules/configuration-common.nix
··· 1012 1012 { patches = (drv.patches or []) ++ [ patch ]; 1013 1013 editedCabalFile = null; 1014 1014 }); 1015 + 1016 + # https://github.com/haskell/cabal/issues/4969 1017 + haddock-library_1_4_4 = dontHaddock super.haddock-library_1_4_4; 1018 + 1019 + haddock-api = super.haddock-api.override 1020 + { haddock-library = self.haddock-library_1_4_4; }; 1015 1021 }
+1 -1
pkgs/development/haskell-modules/default.nix
··· 2 2 , compilerConfig ? (self: super: {}) 3 3 , packageSetConfig ? (self: super: {}) 4 4 , overrides ? (self: super: {}) 5 - , initialPackages ? import ./hackage-packages.nix 5 + , initialPackages ? import ./initial-packages.nix 6 6 , configurationCommon ? import ./configuration-common.nix 7 7 , configurationNix ? import ./configuration-nix.nix 8 8 }:
+459
pkgs/development/haskell-modules/hie-packages.nix
··· 1 + { pkgs, stdenv, callPackage }: self: 2 + let src = pkgs.fetchFromGitHub 3 + { owner = "haskell"; 4 + repo = "haskell-ide-engine"; 5 + rev = "3ec8e93e9ca751cf282556998851ffa65f32e06b"; 6 + sha256 = "1wzqzvsa39c1cngmmjryqrq4vqdg6d4wp5wdf17vp96ljvz1cczw"; 7 + }; 8 + cabal-helper-src = pkgs.fetchgit 9 + { url = "https://gitlab.com/dxld/cabal-helper.git"; 10 + rev = "4bfc6b916fcc696a5d82e7cd35713d6eabcb0533"; 11 + sha256 = "1a8231as0wdvi0q73ha9lc0qrx23kmcwf910qaicvmdar5p2b15m"; 12 + }; 13 + ghc-dump-tree-src = pkgs.fetchgit 14 + { url = "https://gitlab.com/alanz/ghc-dump-tree.git"; 15 + rev = "50f8b28fda675cca4df53909667c740120060c49"; 16 + sha256 = "0v3r81apdqp91sv7avy7f0s3im9icrakkggw8q5b7h0h4js6irqj"; 17 + }; 18 + ghc-mod-src = pkgs.fetchFromGitHub 19 + { owner = "wz1000"; 20 + repo = "ghc-mod"; 21 + rev = "03c91ea53b6389e7a1fcf4e471171aa3d6c8de41"; 22 + sha256 = "11iic93klsh5izp8v4mhl7vnnlib821cfhdymlpg4drx7zbm9il6"; 23 + }; 24 + HaRe-src = pkgs.fetchgit 25 + { url = "https://gitlab.com/alanz/HaRe.git"; 26 + rev = "e325975450ce89d790ed3f92de3ef675967d9538"; 27 + sha256 = "0z7r3l4j5a1brz7zb2rgd985m58rs0ki2p59y1l9i46fcy8r9y4g"; 28 + }; 29 + cabal-helper = self.cabal-helper_hie; 30 + haddock-library = self.haddock-library_1_4_4; 31 + ghc-dump-tree = self.ghc-dump-tree_hie; 32 + ghc-mod = self.ghc-mod_hie; 33 + HaRe = self.HaRe_hie; 34 + in 35 + { ### Overrides required by hie 36 + cabal-helper_hie = callPackage 37 + ({ mkDerivation, base, bytestring, Cabal, cabal-install, containers 38 + , directory, exceptions, filepath, ghc-prim, mtl, process 39 + , semigroupoids, template-haskell, temporary, transformers 40 + , unix, unix-compat, utf8-string 41 + }: 42 + mkDerivation { 43 + pname = "cabal-helper"; 44 + version = "0.8.0.0"; 45 + src = cabal-helper-src; 46 + isLibrary = true; 47 + isExecutable = true; 48 + jailbreak = true; 49 + setupHaskellDepends = [ base Cabal directory filepath ]; 50 + libraryHaskellDepends = [ 51 + base Cabal directory filepath ghc-prim mtl process semigroupoids 52 + transformers unix unix-compat 53 + ]; 54 + executableHaskellDepends = [ 55 + base bytestring Cabal containers directory exceptions filepath 56 + ghc-prim mtl process template-haskell temporary transformers unix 57 + unix-compat utf8-string 58 + ]; 59 + testHaskellDepends = [ 60 + base bytestring Cabal directory exceptions filepath ghc-prim mtl 61 + process template-haskell temporary transformers unix unix-compat 62 + utf8-string 63 + ]; 64 + testToolDepends = [ cabal-install ]; 65 + postInstall = 66 + '' 67 + libexec="$out/libexec/$(basename $out/lib/ghc*/*ghc*)/$name" 68 + mkdir -p "$libexec" 69 + ln -sv $out/bin/cabal-helper-wrapper "$libexec" 70 + ''; 71 + doCheck = false; 72 + description = "Simple interface to some of Cabal's configuration state, mainly used by ghc-mod"; 73 + license = stdenv.lib.licenses.agpl3; 74 + }) {}; 75 + ghc-dump-tree_hie = callPackage 76 + ({ mkDerivation, aeson, base, bytestring, ghc, optparse-applicative 77 + , pretty, pretty-show, process, unordered-containers 78 + , vector 79 + }: 80 + mkDerivation { 81 + pname = "ghc-dump-tree"; 82 + version = "0.2.0.1"; 83 + src = ghc-dump-tree-src; 84 + isLibrary = true; 85 + isExecutable = true; 86 + libraryHaskellDepends = [ 87 + aeson base bytestring ghc pretty pretty-show process 88 + unordered-containers vector 89 + ]; 90 + executableHaskellDepends = [ 91 + aeson base bytestring ghc optparse-applicative pretty pretty-show 92 + process unordered-containers vector 93 + ]; 94 + homepage = "https://github.com/edsko/ghc-dump-tree"; 95 + description = "Dump GHC's parsed, renamed, and type checked ASTs"; 96 + license = stdenv.lib.licenses.bsd3; 97 + }) {}; 98 + ghc-mod-core = callPackage 99 + ({ mkDerivation, base, binary, bytestring, Cabal, cabal-helper 100 + , containers, deepseq, directory, djinn-ghc, extra, fclabels 101 + , filepath, fingertree, ghc, ghc-boot, ghc-paths, ghc-syb-utils 102 + , haskell-src-exts, hlint, monad-control, monad-journal, mtl 103 + , old-time, optparse-applicative, pipes, process, safe, semigroups 104 + , split, syb, template-haskell, temporary, text, time 105 + , transformers, transformers-base 106 + }: 107 + mkDerivation { 108 + pname = "ghc-mod-core"; 109 + version = "5.9.0.0"; 110 + src = "${ghc-mod-src}/core"; 111 + setupHaskellDepends = [ 112 + base Cabal containers directory filepath process template-haskell 113 + transformers 114 + ]; 115 + libraryHaskellDepends = [ 116 + base binary bytestring cabal-helper containers deepseq directory 117 + djinn-ghc extra fclabels filepath fingertree ghc ghc-boot ghc-paths 118 + ghc-syb-utils haskell-src-exts hlint monad-control monad-journal 119 + mtl old-time optparse-applicative pipes process safe semigroups 120 + split syb template-haskell temporary text time transformers 121 + transformers-base 122 + ]; 123 + homepage = "https://github.com/DanielG/ghc-mod"; 124 + description = "Happy Haskell Hacking"; 125 + license = stdenv.lib.licenses.agpl3; 126 + }) { inherit cabal-helper; }; 127 + ghc-mod_hie = callPackage 128 + ({ mkDerivation, base, binary, bytestring, Cabal, cabal-doctest 129 + , cabal-helper, containers, criterion, deepseq, directory 130 + , djinn-ghc, doctest, extra, fclabels, filepath, ghc, ghc-boot 131 + , ghc-mod-core, ghc-paths, ghc-syb-utils, haskell-src-exts, hlint 132 + , hspec, monad-control, monad-journal, mtl, old-time 133 + , optparse-applicative, pipes, process, safe, semigroups, shelltest 134 + , split, syb, template-haskell, temporary, text, time 135 + , transformers, transformers-base 136 + }: 137 + mkDerivation { 138 + pname = "ghc-mod"; 139 + version = "5.9.0.0"; 140 + src = ghc-mod-src; 141 + isLibrary = true; 142 + isExecutable = true; 143 + enableSeparateDataOutput = true; 144 + setupHaskellDepends = [ 145 + base Cabal cabal-doctest containers directory filepath process 146 + template-haskell transformers 147 + ]; 148 + libraryHaskellDepends = [ 149 + base binary bytestring cabal-helper containers deepseq directory 150 + djinn-ghc extra fclabels filepath ghc ghc-boot ghc-mod-core 151 + ghc-paths ghc-syb-utils haskell-src-exts hlint monad-control 152 + monad-journal mtl old-time optparse-applicative pipes process safe 153 + semigroups split syb template-haskell temporary text time 154 + transformers transformers-base 155 + ]; 156 + executableHaskellDepends = [ 157 + base binary deepseq directory fclabels filepath ghc ghc-mod-core 158 + monad-control mtl old-time optparse-applicative process semigroups 159 + split time 160 + ]; 161 + testHaskellDepends = [ 162 + base cabal-helper containers directory doctest fclabels filepath 163 + ghc ghc-boot ghc-mod-core hspec monad-journal mtl process split 164 + temporary transformers 165 + ]; 166 + testToolDepends = [ shelltest ]; 167 + # Doesn't work with our doctest 168 + doCheck = false; 169 + benchmarkHaskellDepends = [ 170 + base criterion directory filepath ghc-mod-core temporary 171 + ]; 172 + homepage = "https://github.com/DanielG/ghc-mod"; 173 + description = "Happy Haskell Hacking"; 174 + license = stdenv.lib.licenses.agpl3; 175 + }) { shelltest = null; inherit cabal-helper; }; 176 + HaRe_hie = callPackage 177 + ({ mkDerivation, attoparsec, base, base-prelude, Cabal, cabal-helper 178 + , case-insensitive, containers, conversion 179 + , conversion-case-insensitive, conversion-text, Diff, directory 180 + , filepath, foldl, ghc, ghc-exactprint, ghc-mod-core, ghc-syb-utils 181 + , gitrev, hslogger, hspec, HUnit, monad-control, mtl 182 + , optparse-applicative, optparse-simple, parsec, stdenv 183 + , Strafunski-StrategyLib, syb, syz, turtle 184 + }: 185 + mkDerivation { 186 + pname = "HaRe"; 187 + version = "0.8.4.1"; 188 + src = HaRe-src; 189 + isLibrary = true; 190 + isExecutable = true; 191 + enableSeparateDataOutput = true; 192 + libraryHaskellDepends = [ 193 + base cabal-helper containers directory filepath ghc ghc-exactprint 194 + ghc-mod-core ghc-syb-utils hslogger monad-control mtl 195 + Strafunski-StrategyLib syb syz 196 + ]; 197 + executableHaskellDepends = [ 198 + base Cabal ghc-mod-core gitrev mtl optparse-applicative 199 + optparse-simple 200 + ]; 201 + testHaskellDepends = [ 202 + attoparsec base base-prelude cabal-helper case-insensitive 203 + containers conversion conversion-case-insensitive conversion-text 204 + Diff directory filepath foldl ghc ghc-exactprint ghc-mod-core 205 + ghc-syb-utils hslogger hspec HUnit monad-control mtl parsec 206 + Strafunski-StrategyLib syb syz turtle 207 + ]; 208 + # Test directory doesn't exist 209 + doCheck = false; 210 + homepage = "https://github.com/RefactoringTools/HaRe/wiki"; 211 + description = "the Haskell Refactorer"; 212 + license = stdenv.lib.licenses.bsd3; 213 + }) { inherit cabal-helper; }; 214 + ### hie packages 215 + haskell-ide-engine = callPackage 216 + ({ mkDerivation, aeson, async, base, bytestring, Cabal, cabal-install 217 + , containers, data-default, Diff, directory, either, ekg, filepath, ghc 218 + , ghc-mod-core, gitrev, haskell-lsp, hie-apply-refact, hie-base 219 + , hie-brittany, hie-build-plugin, hie-eg-plugin-async 220 + , hie-example-plugin2, hie-ghc-mod, hie-ghc-tree, hie-haddock 221 + , hie-hare, hie-hoogle, hie-plugin-api, hoogle, hslogger, hspec 222 + , lens, mtl, optparse-simple, QuickCheck, quickcheck-instances 223 + , sorted-list, stm, text, time, transformers 224 + , unordered-containers, vector, vinyl, yaml, yi-rope 225 + }: 226 + mkDerivation { 227 + pname = "haskell-ide-engine"; 228 + version = "0.1.0.0"; 229 + inherit src; 230 + isLibrary = true; 231 + isExecutable = true; 232 + libraryHaskellDepends = [ 233 + aeson async base bytestring Cabal containers data-default directory 234 + either filepath ghc ghc-mod-core gitrev haskell-lsp 235 + hie-apply-refact hie-base hie-brittany hie-ghc-mod hie-haddock 236 + hie-hare hie-hoogle hie-plugin-api hslogger lens mtl 237 + optparse-simple sorted-list stm text transformers 238 + unordered-containers vector yi-rope 239 + ]; 240 + executableHaskellDepends = [ 241 + base Cabal containers directory ekg ghc-mod-core gitrev haskell-lsp 242 + hie-apply-refact hie-build-plugin hie-eg-plugin-async 243 + hie-example-plugin2 hie-ghc-mod hie-ghc-tree hie-hare hie-hoogle 244 + hie-plugin-api hslogger optparse-simple stm text time transformers 245 + unordered-containers vinyl 246 + ]; 247 + testHaskellDepends = [ 248 + aeson base containers Diff directory filepath ghc-mod-core 249 + haskell-lsp hie-apply-refact hie-base hie-eg-plugin-async 250 + hie-example-plugin2 hie-ghc-mod hie-ghc-tree hie-hare hie-hoogle 251 + hie-plugin-api hoogle hslogger hspec QuickCheck 252 + quickcheck-instances stm text transformers unordered-containers 253 + vector vinyl yaml 254 + ]; 255 + preCheck = "export HOME=$NIX_BUILD_TOP/home; mkdir $HOME"; 256 + # https://github.com/haskell/haskell-ide-engine/issues/425 257 + # The disabled tests do work in a local nix-shell with cabal available. 258 + patches = [ ./patches/hie-testsuite.patch ]; 259 + homepage = "http://github.com/githubuser/haskell-ide-engine#readme"; 260 + description = "Provide a common engine to power any Haskell IDE"; 261 + license = stdenv.lib.licenses.bsd3; 262 + }) {}; 263 + hie-apply-refact = callPackage 264 + ({ mkDerivation, aeson, apply-refact, base, either, extra, ghc-mod 265 + , ghc-mod-core, haskell-src-exts, hie-base, hie-plugin-api, hlint 266 + , text, transformers 267 + }: 268 + mkDerivation { 269 + pname = "hie-apply-refact"; 270 + version = "0.1.0.0"; 271 + inherit src; 272 + postUnpack = "sourceRoot=source/hie-apply-refact"; 273 + libraryHaskellDepends = [ 274 + aeson apply-refact base either extra ghc-mod ghc-mod-core 275 + haskell-src-exts hie-base hie-plugin-api hlint text transformers 276 + ]; 277 + description = "Haskell IDE Apply Refact plugin"; 278 + license = stdenv.lib.licenses.bsd3; 279 + }) { inherit ghc-mod; }; 280 + hie-base = callPackage 281 + ({ mkDerivation, aeson, base, haskell-lsp, text }: 282 + mkDerivation { 283 + pname = "hie-base"; 284 + version = "0.1.0.0"; 285 + inherit src; 286 + preUnpack = "sourceRoot=source/hie-base"; 287 + libraryHaskellDepends = [ aeson base haskell-lsp text ]; 288 + description = "Haskell IDE API base types"; 289 + license = stdenv.lib.licenses.bsd3; 290 + }) {}; 291 + hie-brittany = callPackage 292 + ({ mkDerivation, aeson, base, brittany, ghc-mod, ghc-mod-core 293 + , haskell-lsp, hie-plugin-api, lens, text 294 + }: 295 + mkDerivation { 296 + pname = "hie-brittany"; 297 + version = "0.1.0.0"; 298 + inherit src; 299 + postUnpack = "sourceRoot=source/hie-brittany"; 300 + libraryHaskellDepends = [ 301 + aeson base brittany ghc-mod ghc-mod-core haskell-lsp hie-plugin-api 302 + lens text 303 + ]; 304 + description = "Haskell IDE Hoogle plugin"; 305 + license = stdenv.lib.licenses.bsd3; 306 + }) { inherit ghc-mod; }; 307 + hie-build-plugin = callPackage 308 + ({ mkDerivation, aeson, base, bytestring, Cabal, cabal-helper 309 + , containers, directory, filepath, haskell-lsp, hie-plugin-api 310 + , process, stm, text, transformers, yaml 311 + }: 312 + mkDerivation { 313 + pname = "hie-build-plugin"; 314 + version = "0.1.0.0"; 315 + inherit src; 316 + postUnpack = "sourceRoot=source/hie-build-plugin"; 317 + libraryHaskellDepends = [ 318 + aeson base bytestring Cabal cabal-helper containers directory 319 + filepath haskell-lsp hie-plugin-api process stm text transformers 320 + yaml 321 + ]; 322 + description = "Haskell IDE build plugin"; 323 + license = stdenv.lib.licenses.bsd3; 324 + }) { inherit cabal-helper; }; 325 + hie-eg-plugin-async = callPackage 326 + ({ mkDerivation, base, ghc-mod-core, hie-plugin-api, stm 327 + , text 328 + }: 329 + mkDerivation { 330 + pname = "hie-eg-plugin-async"; 331 + version = "0.1.0.0"; 332 + inherit src; 333 + postUnpack = "sourceRoot=source/hie-eg-plugin-async"; 334 + libraryHaskellDepends = [ 335 + base ghc-mod-core hie-plugin-api stm text 336 + ]; 337 + description = "Haskell IDE example plugin, using async processes"; 338 + license = stdenv.lib.licenses.bsd3; 339 + }) {}; 340 + hie-example-plugin2 = callPackage 341 + ({ mkDerivation, base, hie-plugin-api, text }: 342 + mkDerivation { 343 + pname = "hie-example-plugin2"; 344 + version = "0.1.0.0"; 345 + inherit src; 346 + postUnpack = "sourceRoot=source/hie-example-plugin2"; 347 + libraryHaskellDepends = [ base hie-plugin-api text ]; 348 + description = "Haskell IDE example plugin"; 349 + license = stdenv.lib.licenses.bsd3; 350 + }) {}; 351 + hie-ghc-mod = callPackage 352 + ({ mkDerivation, aeson, base, containers, ghc, ghc-mod, ghc-mod-core 353 + , hie-base, hie-plugin-api, text, transformers 354 + }: 355 + mkDerivation { 356 + pname = "hie-ghc-mod"; 357 + version = "0.1.0.0"; 358 + inherit src; 359 + postUnpack = "sourceRoot=source/hie-ghc-mod"; 360 + libraryHaskellDepends = [ 361 + aeson base containers ghc ghc-mod ghc-mod-core hie-base 362 + hie-plugin-api text transformers 363 + ]; 364 + description = "Haskell IDE ghc-mod plugin"; 365 + license = stdenv.lib.licenses.bsd3; 366 + }) { inherit ghc-mod; }; 367 + hie-ghc-tree = callPackage 368 + ({ mkDerivation, aeson, base, ghc-dump-tree, ghc-mod, ghc-mod-core 369 + , hie-base, hie-plugin-api, text 370 + }: 371 + mkDerivation { 372 + pname = "hie-ghc-tree"; 373 + version = "0.1.0.0"; 374 + inherit src; 375 + postUnpack = "sourceRoot=source/hie-ghc-tree"; 376 + libraryHaskellDepends = [ 377 + aeson base ghc-dump-tree ghc-mod ghc-mod-core hie-base 378 + hie-plugin-api text 379 + ]; 380 + description = "Haskell IDE GHC Tree plugin"; 381 + license = stdenv.lib.licenses.bsd3; 382 + }) { inherit ghc-dump-tree ghc-mod; }; 383 + hie-haddock = callPackage 384 + ({ mkDerivation, aeson, base, containers, directory, either 385 + , filepath, ghc, ghc-exactprint, ghc-mod, ghc-mod-core, haddock-api 386 + , haddock-library, HaRe, haskell-lsp, hie-base, hie-ghc-mod 387 + , hie-hare, hie-plugin-api, lens, monad-control, mtl, text 388 + , transformers 389 + }: 390 + mkDerivation { 391 + pname = "hie-haddock"; 392 + version = "0.1.0.0"; 393 + inherit src; 394 + postUnpack = "sourceRoot=source/hie-haddock"; 395 + libraryHaskellDepends = [ 396 + aeson base containers directory either filepath ghc ghc-exactprint 397 + ghc-mod ghc-mod-core haddock-api haddock-library HaRe haskell-lsp 398 + hie-base hie-ghc-mod hie-hare hie-plugin-api lens monad-control mtl 399 + text transformers 400 + ]; 401 + description = "Haskell IDE Haddock plugin"; 402 + license = stdenv.lib.licenses.bsd3; 403 + }) { inherit haddock-library HaRe ghc-mod; }; 404 + hie-hare = callPackage 405 + ({ mkDerivation, aeson, base, containers, Diff, either, ghc 406 + , ghc-exactprint, ghc-mod, ghc-mod-core, HaRe, haskell-lsp 407 + , hie-base, hie-ghc-mod, hie-plugin-api, lens, monad-control, mtl 408 + , text, transformers 409 + }: 410 + mkDerivation { 411 + pname = "hie-hare"; 412 + version = "0.1.0.0"; 413 + inherit src; 414 + postUnpack = "sourceRoot=source/hie-hare"; 415 + libraryHaskellDepends = [ 416 + aeson base containers Diff either ghc ghc-exactprint ghc-mod 417 + ghc-mod-core HaRe haskell-lsp hie-base hie-ghc-mod hie-plugin-api 418 + lens monad-control mtl text transformers 419 + ]; 420 + description = "Haskell IDE HaRe plugin"; 421 + license = stdenv.lib.licenses.bsd3; 422 + }) { inherit ghc-mod HaRe; }; 423 + hie-hoogle = callPackage 424 + ({ mkDerivation, aeson, base, directory, filepath, ghc-mod 425 + , ghc-mod-core, hie-plugin-api, hoogle, tagsoup, text 426 + }: 427 + mkDerivation { 428 + pname = "hie-hoogle"; 429 + version = "0.1.0.0"; 430 + inherit src; 431 + postUnpack = "sourceRoot=source/hie-hoogle"; 432 + libraryHaskellDepends = [ 433 + aeson base directory filepath ghc-mod ghc-mod-core hie-plugin-api 434 + hoogle tagsoup text 435 + ]; 436 + description = "Haskell IDE Hoogle plugin"; 437 + license = stdenv.lib.licenses.bsd3; 438 + }) { inherit ghc-mod; }; 439 + hie-plugin-api = callPackage 440 + ({ mkDerivation, aeson, base, containers, Diff, directory, either 441 + , filepath, fingertree, ghc, ghc-mod-core, haskell-lsp, hie-base 442 + , hslogger, lifted-base, monad-control, mtl, stdenv, stm, syb, text 443 + , time, transformers, unordered-containers 444 + }: 445 + mkDerivation { 446 + pname = "hie-plugin-api"; 447 + version = "0.1.0.0"; 448 + inherit src; 449 + postUnpack = "sourceRoot=source/hie-plugin-api"; 450 + libraryHaskellDepends = [ 451 + aeson base containers Diff directory either filepath fingertree ghc 452 + ghc-mod-core haskell-lsp hie-base hslogger lifted-base 453 + monad-control mtl stm syb text time transformers 454 + unordered-containers 455 + ]; 456 + description = "Haskell IDE API for plugin communication"; 457 + license = stdenv.lib.licenses.bsd3; 458 + }) {}; 459 + }
+2
pkgs/development/haskell-modules/initial-packages.nix
··· 1 + args@{ pkgs, stdenv, callPackage }: self: 2 + (import ./hie-packages.nix args self) // (import ./hackage-packages.nix args self)
+40
pkgs/development/haskell-modules/patches/hie-testsuite.patch
··· 1 + diff --git a/test/HaRePluginSpec.hs b/test/HaRePluginSpec.hs 2 + index 039c094..d0d1fa4 100644 3 + --- a/test/HaRePluginSpec.hs 4 + +++ b/test/HaRePluginSpec.hs 5 + @@ -326,35 +326,6 @@ hareSpec = do 6 + $ List [TextEdit (Range (Position 4 0) (Position 8 12)) 7 + "parseStr = char '\"' *> (many1 (noneOf \"\\\"\")) <* char '\"'"]) 8 + Nothing) 9 + - it "finds definition across components" $ do 10 + - let u = filePathToUri "./app/Main.hs" 11 + - let lreq = setTypecheckedModule u 12 + - let req = findDef u (toPos (7,8)) 13 + - r <- dispatchRequestPGoto $ lreq >> req 14 + - r `shouldBe` IdeResponseOk [Location (filePathToUri $ cwd </> "test/testdata/gototest/src/Lib.hs") 15 + - (Range (toPos (6,1)) (toPos (6,9)))] 16 + - let req2 = findDef u (toPos (7,20)) 17 + - r2 <- dispatchRequestPGoto $ lreq >> req2 18 + - r2 `shouldBe` IdeResponseOk [Location (filePathToUri $ cwd </> "test/testdata/gototest/src/Lib2.hs") 19 + - (Range (toPos (5,1)) (toPos (5,2)))] 20 + - it "finds definition in the same component" $ do 21 + - let u = filePathToUri "./src/Lib2.hs" 22 + - let lreq = setTypecheckedModule u 23 + - let req = findDef u (toPos (6,5)) 24 + - r <- dispatchRequestPGoto $ lreq >> req 25 + - r `shouldBe` IdeResponseOk [Location (filePathToUri $ cwd </> "test/testdata/gototest/src/Lib.hs") 26 + - (Range (toPos (6,1)) (toPos (6,9)))] 27 + - it "finds local definitions" $ do 28 + - let u = filePathToUri "./src/Lib2.hs" 29 + - let lreq = setTypecheckedModule u 30 + - let req = findDef u (toPos (7,11)) 31 + - r <- dispatchRequestPGoto $ lreq >> req 32 + - r `shouldBe` IdeResponseOk [Location (filePathToUri $ cwd </> "test/testdata/gototest/src/Lib2.hs") 33 + - (Range (toPos (10,9)) (toPos (10,10)))] 34 + - let req2 = findDef u (toPos (10,13)) 35 + - r2 <- dispatchRequestPGoto $ lreq >> req2 36 + - r2 `shouldBe` IdeResponseOk [Location (filePathToUri $ cwd </> "test/testdata/gototest/src/Lib2.hs") 37 + - (Range (toPos (9,9)) (toPos (9,10)))] 38 + 39 + 40 + -- ---------------------------------