Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support hie-bios’ none cradle #1023

Closed
cocreature opened this issue Dec 16, 2019 · 2 comments
Closed

Support hie-bios’ none cradle #1023

cocreature opened this issue Dec 16, 2019 · 2 comments

Comments

@cocreature
Copy link
Contributor

hie-bios 0.3.0 added a none cradle for files that should be ignored, e.g., because they cannot be loaded for some reason. We should also support this but it doesn’t make much sense before we support multi cradles.

@jneira
Copy link
Member

jneira commented Jun 6, 2020

Hi, i've just tested a simple stack project with this hie.yaml

cradle:
  multi:
    - path: "./test/MyTest"
      config: { cradle: { none:  } }

    - path: "./"
      config:
        cradle:
          stack:
            - path: "./.stack-work"
              component: "stack-test:lib"
            - path: "./app"
              component: "stack-test:exe:stack-test"
            - path: "./src"
              component: "stack-test:lib"
            - path: "./test"
              component: "stack-test:test:stack-test-test"

Executing ghcide in the project root:

PS D:\dev\ws\haskell\stack-test> ghcide
ghcide version: 0.2.0 (GHC: 8.8.3) (PATH: D:\bin\ghcide.exe)   
Ghcide setup tester in D:\dev\ws\haskell\stack-test.
Report bugs at https://github.com/digital-asset/ghcide/issues  

Step 1/4: Finding files to test in D:\dev\ws\haskell\stack-test
Found 3 files

Step 2/4: Looking for hie.yaml files that control setup
Found 1 cradle

Step 3/4: Initializing the IDE

Step 4/4: Type checking the files
[INFO] Consulting the cradle for "D:\\dev\\ws\\haskell\\stack-test\\app\\Main.hs"
> Using main module: 1. Package `stack-test' component stack-test:exe:stack-test with main-is file: D:\dev\ws\haskell\stack-test\app\Main.hs
> Configuring GHCi with the following packages: stack-test
> D:\dev\ws\haskell\stack-test\.stack-work\install\87555bbb\pkgdb;C:\sr\snapshots\4b7c4109\pkgdb;D:\bin\stack\x86_64-windows\ghc-8.8.3\lib\package.conf.d
[INFO] Making new HscEnv[main]
[INFO] Consulting the cradle for "D:\\dev\\ws\\haskell\\stack-test\\test\\MyLibTest.hs"
[INFO] Consulting the cradle for "D:\\dev\\ws\\haskell\\stack-test\\src\\MyLib.hs"
> Configuring GHCi with the following packages: stack-test
> D:\dev\ws\haskell\stack-test\.stack-work\install\87555bbb\pkgdb;C:\sr\snapshots\4b7c4109\pkgdb;D:\bin\stack\x86_64-windows\ghc-8.8.3\lib\package.conf.d
[INFO] Making new HscEnv[main,main]
[INFO] Consulting the cradle for "D:\\dev\\ws\\haskell\\stack-test\\.stack-work\\dist\\29cc6475\\build\\autogen\\Paths_stack_test.hs"
> Configuring GHCi with the following packages: stack-test
> D:\dev\ws\haskell\stack-test\.stack-work\install\87555bbb\pkgdb;C:\sr\snapshots\4b7c4109\pkgdb;D:\bin\stack\x86_64-windows\ghc-8.8.3\lib\package.conf.d
[INFO] Making new HscEnv[main,main,main]
Files that failed:
 * D:\dev\ws\haskell\stack-test\test\MyLibTest.hs

In the editor you can observe hover has no effect in MyLibTest.hs and there is no diagnostics for it
If i remove the none cradle:

[INFO] Consulting the cradle for "D:\\dev\\ws\\haskell\\stack-test\\test\\MyLibTest.hs"
[INFO] Consulting the cradle for "D:\\dev\\ws\\haskell\\stack-test\\src\\MyLib.hs"
File:     D:\dev\ws\haskell\stack-test\test\MyLibTest.hs
Hidden:   no
Range:    1:0-100001:0
Source:   compiler
Severity: DsError
Message:
  Multi Cradle: No prefixes matched
  pwd: D:\dev\ws\haskell\stack-test
  filepath: D:\dev\ws\haskell\stack-test\test\MyLibTest.hs
  prefixes:
  ("./.stack-work",Stack {component = Just "stack-test:lib"})
  ("./app",Stack {component = Just "stack-test:exe:stack-test"})
  ("./src",Stack {component = Just "stack-test:lib"})

@cocreature so i guess that the none cradle is supported since haskell/ghcide#522 was merged

@jneira
Copy link
Member

jneira commented Sep 16, 2020

closing as the feature is supported

@jneira jneira closed this as completed Sep 16, 2020
@pepeiborra pepeiborra transferred this issue from haskell/ghcide Jan 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants