Skip to content
This repository has been archived by the owner on Jan 13, 2021. It is now read-only.

add launch.json 'console' option, and some minor changes #64

Merged
merged 8 commits into from
Mar 1, 2019

Conversation

hoehrmann
Copy link
Collaborator

This adds a new launch.json option to set the kind of console the debuggee runs in. The current behaviour is dubbed deprecatedDebugConsole, new options are integratedTerminal, externalTerminal, remote, and none.

console: 'remote'

takes the place of the old if port is true-ish logic allowing port to be set to zero so that a random available port is selected automatically.

The console: 'none' mode is intended for the test suite.

The integratedTerminal and externalTerminal options use the new runInTerminal reverse request API.

Furthermore:

  • if (this.debug) console.log... has been replaced with calls to a logDebug function
  • one skip test has been fixed (confusing with paths vs cwd)
  • added (but currently disabled) code needed to log to a dedicated "Perl Debug" output stream
  • print { $DB::OUT } ... replaced with p ... as that is just what the p command does
  • removal of provideInitialConfigurations command, that's never used as far as I can tell
  • addition of a PerlDebugConfigurationProvider that does some launch.json magic. That allows you to start debugging simple scripts without any launch.json configuration at all, among other things.
  • Activation on onDebug now
  • replaced one unfortunate then callback with await
  • removed .pid exposure and adapted some tests accordingly

Test suite passes, and all but 2 tests would still pass if adapter.test.ts and connection.test.ts used console: 'none' instead (the failing tests have syntax errors, we do not quite see that with none).

@hoehrmann
Copy link
Collaborator Author

Travis says 1 tests fails for two Linux+Perl combinations, where the tests pass on Mac+Perl with the same Perl version. Inclined to mark the test to be skipped, I have no way to test this locally, and might indeed get different results than Travis for any number of reasons...

Copy link
Owner

@raix raix left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@hoehrmann over all looks good - alot of improvements!

Regarding the test - I would love to create a layer wrapping the perl debugger, the output is not consistent depending on os/platform/distribution/padwalker/perl version etc. If we could isolate that and run the test matrix against that part only. (thats the messy part, but it's basically a task to reimplement the whole perl db interface into one stable / consistent interface)

This extension could just rely on that and only run one test.

For now we have to spin up a docker image to test locally..

package.json Outdated Show resolved Hide resolved
src/extension.ts Show resolved Hide resolved
src/tests/remote.test.ts Outdated Show resolved Hide resolved
src/adapter.ts Show resolved Hide resolved
src/perlDebug.ts Outdated Show resolved Hide resolved
package.json Outdated Show resolved Hide resolved
src/tests/remote.test.ts Outdated Show resolved Hide resolved
@raix
Copy link
Owner

raix commented Feb 28, 2019

@hoehrmann I've checked out the code works great!!
I'm not sure why perl 5.14 + 5.16 fails on mac though

@hoehrmann
Copy link
Collaborator Author

hoehrmann commented Feb 28, 2019

Glad to hear that!

So what is left to do for this PR? Do you want me to change it to remove deprecatedDebugConsole?

Perl 5.14 does not even compile on my system due to an incompatibility with my version of gcc https://rt.perl.org/Public/Bug/Display.html?id=123784

Perl 5.16 has similar issues on my system. Anyways... a notable difference between 5.28.1 and 5.16.3 is the behaviour of the T command. I use "stopOnEntry": true and when it stops on entry the T command returns nothing in 5.16.3 and something like @ = DB::DB called from file 'test.pl' line 4 in 5.28.1. With an empty response to stack trace requests, vscode does not even show which line the debuggee is halted on with 5.16.3.

Note that the failing test had been .skiped up until this PR, it never worked with those versions of Perl for this and other reasons.

@raix
Copy link
Owner

raix commented Feb 28, 2019

yes - lets remove the deprecatedDebugConsole - I think the terminal is more clear .
We can just comment out the test that is failing for now

@hoehrmann
Copy link
Collaborator Author

@raix: Okay, will update the PR tomorrow.

@hoehrmann
Copy link
Collaborator Author

The new commit:

  • removes deprecatedDebugConsole
  • removes the circular reference (now only an argument to launchRequest)
  • factores the individual launch modes into separate functions
  • skips tests that cannot work anymore with these changes

@raix
Copy link
Owner

raix commented Mar 1, 2019

Awesome work @hoehrmann let's get this out :)

@raix raix merged commit a10fa81 into raix:master Mar 1, 2019
@hoehrmann hoehrmann deleted the console branch March 4, 2019 01:05
@raix
Copy link
Owner

raix commented Mar 9, 2019

🎉 This PR is included in version 0.5.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

@raix raix added the released label Mar 9, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants