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

Specify target with new-repl #33

Closed
4 tasks done
cah6 opened this issue Apr 19, 2019 · 5 comments · May be fixed by #34
Closed
4 tasks done

Specify target with new-repl #33

cah6 opened this issue Apr 19, 2019 · 5 comments · May be fixed by #34

Comments

@cah6
Copy link

cah6 commented Apr 19, 2019

Status

  • A workaround is available
  • A fix is written
  • A fix is released
  • The fixed verison is on the marketplace.

  • Version of vscode-ghc-simple: 0.1.10
  • Version of VSCode: 1.33.1
  • Version of Haskell-related tools:
    • GHC: 8.4.3
    • Cabal: 2.2.0.0

Steps to reproduce

Given the workspace, launch VSCode in the nix shell with nix-shell -A shells.ghc --run "code .".

I found that you can force cabal new-style commands by setting "workspaceType" to "cabal new", but this doesn't work out of the box with multi-folder repositories. Notably, for these repositories the command needs to be cabal new-repl all. Is there a way to specify more arguments that will be passed through to the cabal launch?

Note that to work around this you can just set workspaceType to "cabal" to use cabal repl instead, but I would like to try getting the new-style commands to work.

Workspace

Workspace available here https://github.com/cah6/haskell-nix-skeleton-2, see .vscode/settings.json for my overrides.

@edmundnoble
Copy link
Contributor

Hi there,

You're in luck; I wrote this up just yesterday before seeing your issue! See #34

@cah6
Copy link
Author

cah6 commented Apr 22, 2019

Nice! That looks like exactly what I needed.

@dramforever
Copy link
Owner

I have to say I'm not familiar with how cabal works, especially the new-build part.

Is cabal new-repl all supposed to always select all targets? If so I'm going to actually make that the default, since it's actually what I do for stack.

@cah6
Copy link
Author

cah6 commented Apr 24, 2019

@dramforever I think so! There might be some edge case I don't know about, but it looks like it selects all for single cabal file projects (where the cabal file is in the root, no .project file), and multiple cabal file repositories, where the .project file points to multiple sub-directories.

@dramforever
Copy link
Owner

v0.1.11 now uses target all by default (cabal {new,v2}-repl all) and allows customizing the REPL command with ghcSimple.replCommand and ghcSimple.replScope. If this version does not solve this problem or causes other problems, please feel free to reopen this issue or raise a new one.

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

Successfully merging a pull request may close this issue.

3 participants