hoangKnLai / vscode-ipython

VSCode Extension integrating Editor with IPython console.
MIT License
18 stars 5 forks source link

Send current line. #11

Closed ubaldot closed 2 years ago

ubaldot commented 2 years ago

Improvement suggestion: A very useful feature would be to send only the current line. Both Matlaband Spyderhave it and it is widely used by the users of these apps. I am sure that VSCodeusers would enjoy it as well! :)

FabianHofmann commented 2 years ago

@hoangKnLai, I think this would be a very helpful feature. If you want, you could point me to the part where this would be implemented and I could try to draft a PR.

hoangKnLai commented 2 years ago

Happy to have someone else working on this project 😄.

Hmm. Where to start...

At the moment, the framework is like this:

An option is to look into extending runCursor() which uses the framework above.

P.S. I really should start actually commenting the code properly to typescript standard.

WilliamsTravis commented 2 years ago

Hi, thanks so much for this extension it's working great for me! I would also find the single line execution useful, so I'd like to second Ubaldo79's comment. In the meantime, as a work around for anyone else who'd like this, a combination of the multi-command extension and this one has been working for me with this key binding in keybindings.json:

    {
        "key": "f9",
        "command": "extension.multiCommand.execute",
        "args": {
            "sequence": [
                "expandLineSelection",
                "ipython.runSelections",
                "cursorRight"
            ]
        }
    }
hoangKnLai commented 2 years ago

Plan to deploy today's update soon which includes:

WilliamsTravis commented 2 years ago

Works like a charm! Bravo.