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

scriptcs -debug without -repl does not configure REPL correctly. #990

Closed
adamralph opened this issue Mar 24, 2015 · 12 comments · Fixed by #944
Closed

scriptcs -debug without -repl does not configure REPL correctly. #990

adamralph opened this issue Mar 24, 2015 · 12 comments · Fixed by #944
Assignees
Labels
Milestone

Comments

@adamralph
Copy link
Contributor

This is not new in 0.14. It is pre-existing in 0.13.3.

Leads to all kinds of problems, e.g.

mkdir bug-repro
cd bug-repro
scriptcs -install Nancy
scriptcs -debug
using Nancy;

Index was outside the bounds of the array.

Without -debug, there is no error.

@filipw
Copy link
Member

filipw commented Mar 24, 2015

The scriptcs -debug was intended to be used for PDB debugging not for log messages.
If you want debugging log in REPL you should:

  • scriptcs -log debug
  • scriptcs -debug -repl

Right now the ArgumentParser will not set the REPL flag if the only argument is debug.

@adamralph
Copy link
Contributor Author

OK, well, we need to do something about the UX here then. To any user this will just appear as the bug I have described.

Shall we just prevent REPL when -debug is passed?

@filipw
Copy link
Member

filipw commented Mar 24, 2015

the easiest would be just treat single debug argument same way as single log argument - and force repl https://github.com/scriptcs/scriptcs/blob/dev/src/ScriptCs/Argument/ArgumentParser.cs#L30

@adamralph
Copy link
Contributor Author

That line of code redundant, since the command factory now falls back to REPL when no script name is passed. This PR gets rid of it - #944

@adamralph
Copy link
Contributor Author

...that is why scriptcs -debug works today and goes into REPL.

@adamralph
Copy link
Contributor Author

In which case, I think the bug stands. Either we disable REPL when in debug mode, or we have to fix it.

@filipw
Copy link
Member

filipw commented Mar 24, 2015

but does it set the REPL flag? the flag is important since that's how the module chooses the appropriate engine.
In this case it doesnt set the engine properly - notice not only using doesn't work, but nothing works in that REPL since the debugger engine can't handle REPL at all.

@filipw
Copy link
Member

filipw commented Mar 24, 2015

here

engineType = config.IsRepl ? typeof(RoslynReplEngine) : engineType;

Right now this flag is missing, and everything fails. ArgumentParser sets it if the only argument is log for example

@adamralph
Copy link
Contributor Author

Ah I see. Yes, that's the problem then.

@adamralph adamralph changed the title Cannot add a using statement in debug REPL scriptcs -debug with -repl does not configure REPL correctly. Mar 24, 2015
@adamralph adamralph changed the title scriptcs -debug with -repl does not configure REPL correctly. scriptcs -debug without -repl does not configure REPL correctly. Mar 24, 2015
@filipw
Copy link
Member

filipw commented Mar 24, 2015

can you make sure the PR in #944 handles this scenario?

@adamralph
Copy link
Contributor Author

Yes, will do.

@adamralph
Copy link
Contributor Author

@filipw PR #944 now addresses this

@adamralph adamralph added this to the v0.15 milestone Mar 27, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants