hoangKnLai / vscode-ipython

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

Bug: commands don't run when no workspace/folder is selected #31

Closed AmerM137 closed 12 months ago

AmerM137 commented 1 year ago

When a workspace/project_folder is not open in VSCode, the [run selection / run section of code] commands error out. Here is a screenshot: bug

To reproduce: Start VSCode without a workspace open, i.e. just open a single file, and try to run selection or run code section and move to next, the command in the ipython terminal is executed as "%run -i "undefined" #(Line X0:X1)"

Potential solutions: Remove dependency to have a workspace open, which would probably entail having a static location for the code.py file, and on that note... Maybe allow the user to set the location of the code.py file? I feel that the way it works currently you'll end up with a ".vscode" folder in every project you open, which is not ideal. It would be great to expose a feature where the user can pick his own location for code.py, and make it default to store it under ~/.vscode/... or any other static location that makes sense if the user chooses not to override the filepath. I don't see any real reason for a user to open the code.py for inspection, it's simply a file to store the intermediate code before sending to IPython.

hoangKnLai commented 12 months ago

Fixed in #38