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

Repl command suffix #34

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

edmundnoble
Copy link
Contributor

Allow the user to specify arbitrary options at the end of the command for starting the REPL. Seems a bit dirty to me, not sure of what refactoring would make this nicer.

Fixes #33.

@edmundnoble edmundnoble mentioned this pull request Apr 22, 2019
4 tasks
@dramforever
Copy link
Owner

dramforever commented Apr 23, 2019

It's good that the user can configure, but I'm considering that maybe we should let the user fully configure the entire command line. Basically I want to make this part better:

if (wst == 'stack') {
const result = await new Promise<string>((resolve, reject) => {
child_process.exec(
'stack ide targets',
this.cwdOption,
(err, stdout, stderr) => {
if (err) reject('Command stack ide targets failed:\n' + stderr);
else resolve(stderr);
}
)
});
return ['stack', 'repl', '--no-load'].concat(result.match(/^[^\s]+$/gm));
} else if (wst == 'cabal')
return ['cabal', 'repl'];
else if (wst == 'cabal new')
return ['cabal', 'new-repl'];
else if (wst == 'cabal v2')
return ['cabal', 'v2-repl'];
else if (wst == 'bare-stack')
return ['stack', 'exec', 'ghci'];
else if (wst == 'bare')
return ['ghci'];

@edmundnoble
Copy link
Contributor Author

Agreed. I think Nix users would like that particularly. Will do.

@edmundnoble
Copy link
Contributor Author

Actually, you know what; I think it would be nice to have both an "append options" and a "raw command" option. In particular this is because you might have multiple projects with different (even slightly different) build commands so detection is nice, but having common suffixes (project suffixes, or optimization or profiling flags). Let me know what you think.

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 this pull request may close these issues.

Specify target with new-repl
2 participants