fabiospampinato/vscode-debug-launcher

Extension to Python

Closed this issue · 14 comments

Hi,

first, thanks a lot for creating this plugin! I really don't understand why something like this is not natively supported in vscode.

A lot of Python developers would love to have this feature. I've never dealt with vscode plugins otherwise I would create a PR. Do you see any chance to add Python support in near future? Would be awesome.

The related issue in vscode's repo is actually "On Deck", but it's been open for 3 years so I wouldn't hold my breath.

I'd be happy to add support for Python, but I don't use it, if you'd like to submit a PR for it I'd be happy to consider it. Adding support for other languages should be trivial, you basically only need to define a default debug configuration, you can find the one I'm using for launching JS files here

kgfly commented

+1

kgfly commented

I notice that example from https://github.com/microsoft/vscode-extension-samples has a .vscode folder which is used for debugging the extension.

I am new to vscode extension. Could you please add a .vscode for this project? This will help to debug this extension.

I copied .vscode from https://github.com/microsoft/vscode-extension-samples/tree/master/helloworld-sample/.vscode to this project root folder. However, debugging does not work. I've no idea what wrong.

Thanks.

I notice that example from https://github.com/microsoft/vscode-extension-samples has a .vscode folder which is used for debugging the extension.

As the whole purpose of this extension is not having a .vscode folder and related debug configuration I think it would make more sense to use the extension to debug itself, as mentioned here.

kgfly commented

It does not work.

On a Mac, I installed the extension first. I opened the project root folder. I set breakpoint on return statement in two "node.ts" files. In the command palette, "Debug Launcher: File".

vscode prompted error: "Couldn't generate a launch configuration"

(BTW, I can debug other .js file).

Any suggestion?

"Debug Launcher: File".

Well, you don't want to debug a file, but the whole extension. Just run Debug Launcher: Auto.

kgfly commented

I setup a clean ubuntu VM. and install necessary npm module.

"npm ls" does not prompt anything wrong. Here webpack failed with

internal/modules/cjs/loader.js:613
throw err;
^

Error: Cannot find module 'yargs'
Require stack:

  • /usr/lib/nodejs/webpack/bin/webpack.js
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:610:15)
    at Function.Module._load (internal/modules/cjs/loader.js:526:27)
    at Module.require (internal/modules/cjs/loader.js:666:19)
    at require (internal/modules/cjs/helpers.js:16:16)
    at Object. (/usr/lib/nodejs/webpack/bin/webpack.js:16:13)
    at Module._compile (internal/modules/cjs/loader.js:759:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:770:10)
    at Module.load (internal/modules/cjs/loader.js:628:32)
    at Function.Module._load (internal/modules/cjs/loader.js:555:12)
    at Function.Module.runMain (internal/modules/cjs/loader.js:822:10)

do you have any suggestion?

and install necessary npm module.

Via npm install, right?

kgfly commented

I ran "npm i yargs". After installation, it still prompts the same error. I install node by

curl -sL https://deb.nodesource.com/setup_12.x | sudo -E bash -
sudo apt-get install -y nodejs

from https://nodejs.org/en/download/package-manager/

kgfly commented

I figured out what's wrong: nodejs is too new which has compatibility issue.
I just setup another vm. Install default version which comes with apt install. Debugging is working now.
Thanks. I will see if I can add python support or not.

kgfly commented

I've added python file support. I would like to create a PR.

However, I never create a PR on github before. I

git checkout -b python_file_support
git add -A
git commit -m python_file_support
git push --set-upstream origin python_file_support

Then after I input my id/password. I got

remote: Permission to fabiospampinato/vscode-debug-launcher.git denied to 9527KGG.
fatal: unable to access 'https://github.com/fabiospampinato/vscode-debug-launcher/': The requested URL returned error: 403

Is it because you need authorize me first? So I can push my branch??? A really dumb question.

kgfly commented

Just realized that I need fork first. Anyway, just sent out the PR (my first one on github ^_^).

Pls review.

kgfly commented

Resolved with b7fd49a

Partially, it we don't support debugging python projects yet, but let's track that here #7.