Skip to content

Debugging without an open folder #285

Closed

Description

Why is folder required to have debugging enabled?
Case in point - trying out single file ps scripts. Am I missing something?

Activity

  1. isidorn commented on Nov 20, 2015

    @isidorn

    I see that your scenario would not require the workspace, however our vscode frontend has to support multiple languages to debug and for most having a workspace is required. Also debugging requires a launch.json file, and when there is no workspace there needs to be a shared launch.json which is a bit cumbersome.

    Due to the above this is by design.

  2. shashankt1989 commented on Nov 20, 2015

    @shashankt1989
    Author

    So keep it as an open issue in case someone wants to code up a solution? Or is it something that we don't want to have at all because it would make the product worse?

  3. isidorn commented on Nov 20, 2015

    @isidorn

    Let's keep it open for now then

  4. added
    feature-request
    on Nov 23, 2015
  5. added
    debug
    on Nov 24, 2015
  6. mateuszlewko commented on Feb 21, 2016

    @mateuszlewko

    Yes this would be a useful feature. Debuging just a single file. Please add this.

  7. davehope commented on Nov 10, 2016

    @davehope

    I'd like to explain a possible use case for this.

    I use vscode to write PowerShell scripts, these are usually single-files. I'd like to be able to open a Powershell file, set some break points and debug the script like I can with the PowerShell ISE

  8. 21 remaining items

  9. daviwil commented on Jan 13, 2017

    @daviwil
    Contributor

    Just thought to check this with the latest official release of the PowerShell extension, version 0.8.0 which came out in mid-December. When starting the debug adapter it hangs on startup in the same way that I described above. Something definitely must have changed in how the debug adapter client communicates with debug adapters, but I'm not quite sure how.

    If you want to give this a try, install the PowerShell extension and open the following folder (adjust the path appropriately for OS X if needed):

    c:\Users\<your username>\.vscode\extensions\ms-vscode.PowerShell-0.8.0\examples\

    Open the DebugTest.ps1 file in that folder and hit F5, you'll see that the debug adapter never fully starts up (no orange status bar).

  10. weinand commented on Jan 13, 2017

    @weinand
    Contributor

    Isidor Nikolic (@isidorn) David's problem sounds like a regression to me. Can you look into this?

  11. isidorn commented on Jan 13, 2017

    @isidorn

    Just verified that VScode is sending exactly the same requests as before.
    What we introduced recently is a handshake node module between vscode and adapters but this should not effect powershell as your adapter is not sending the 'handshake' request.

    I am currently git bisecting to see what commit caused the issue
    In order to spot issues like this in the future sooner it would be cool if you guys self hosted on vscode insiders :)

  12. isidorn commented on Jan 13, 2017

    @isidorn

    Here's the commit that breaks it - praise git bisect 🙏
    140f1ec

    Here's the commit that fixes the issue fb838d2

  13. weinand commented on Jan 13, 2017

    @weinand
    Contributor

    Isidor Nikolic (@isidorn) but your commit does not explain what went wrong with the Map code. I'm using the identical Map code in node-debug and have no issues...

  14. daviwil commented on Jan 13, 2017

    @daviwil
    Contributor

    Sorry about that, I'll use Insiders from now on. I had been using it in the past but somehow switched back over to stable.

    Just pulled down the latest code after your change, that fixed it! Everything works perfectly now. Thanks a lot Isidor!

  15. isidorn commented on Jan 13, 2017

    @isidorn

    After closer inspection with Andre Weinand (@weinand) we figured out that the exact issue is that powershell is sending back strings instead of numbers for response.request_seq, so instead of 1 we are getting "1".
    David Wilson (@daviwil) can you look into fixing this issue on your side so we go back to our proper usage of es5 maps on our side.

  16. daviwil commented on Jan 13, 2017

    @daviwil
    Contributor

    Hah! Wow, wouldn't have expected that. Yep, I'll make the change.

  17. daviwil commented on Jan 13, 2017

    @daviwil
    Contributor

    I can confirm that changing request_seq to int in my message serializer fixed the issue in the Insider's build.

  18. isidorn commented on Jan 13, 2017

    @isidorn

    Awesome - we'll go back to using a map

  19. locked and limited conversation to collaborators on Nov 18, 2017
  20. added a commit that references this issue on Sep 6, 2026
    51e828c
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

debugfeature-request

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions