-
Notifications
You must be signed in to change notification settings - Fork 29.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Provide a smart run/debug command for loose files #124280
Comments
I think 'running' should == debugging in this scenario. Yes, for the new user I would want to skip step 5. VS Code already ships with Typescript, which has compilation and transpilation. It should be possible to leverage that to install a loader in Node.js (e.g. from the js-debug bootloader) so that they can run TS files without any installation/setup. There's still the question of how we get users from there to a 'proper' Typescript setup, but (a) that may not be needed for all cases, especially people in CS101 writing their first hello world/quicksort and (b) it moves a choke point of the funnel much later. |
VS Code already supports "smart run/debug command for loose files" if the corresponding extension is smart enough. Here is the flow if "Java Extension Pack" is installed in VS Code:
Please note: VS Code is not in folder mode and Java compiles, runs, and debugs the file without problems (thanks @akaroml). And here the equivalent for Python (@luabud Python is not yet using our "editor/title/run" menu contribution point but contributing just a "loose" run button): Doing the same for TS/JS just requires to contribute a "Run" and a "Debug" command to the "editor/title/run" menu contribution point. |
Agree with @weinand here. I do not think a lot is missing in order to make this experience butter smooth. As for users with nothing installed. Installing extensions should be tackled via our automatic language detection and extension recommendations. For installing dependencies and compiling I would create a separate issue for that as that seems language specific and not something that Debug can solve imho. |
There's a few paths for TS compilation:
For TS there should not be any additional extension installations needed. |
One idea is to run with
Things get weird if you have |
After syncing with @connor4312 here's our thinking:
@DanielRosenwasser @gcrev93 what do you think? |
Also fyi @mjbvz |
I think that's fine as a starting point - I wonder if there should be a special case when a |
@DanielRosenwasser great! What should be the best way to go forward. Should I file an issue in the Typescript repo with our recommendation on how to do this or what do you think is best? Thanks |
As far as I can tell, it's just work that needs to happen on the TS extension side. If there's any places where the extension doesn't have the right information and needs to consult the server, we can try to figure that out and bring it to one of the editor syncs. |
Great, then we should plan work on the TS extension side. Thanks |
I would be happy to but I have a bunch of work in the pipeline and will need to discuss scheduling with Kai |
@connor4312 great 👏 |
loose files cannot have configured debug button in python: microsoft/vscode-python-debugger#525 It would be great to configure run/debug button for loose files:
by these cases the priority is launch.json > Workspace > User
|
@byehack thanks for your proposal. Please note that VS Code knows nothing (cannot make assumptions) about debugging loose files because there is no generic way to associate a launch configuration (from a launch.json or workspace/user setting) with a specific file. Debugging loose files can only be handled by a debugger extension which knows the language specific details about debugging. Having said that, I think your proposal can be easily implemented by a specific debugger extension, but not by VS Code. |
Moving to next milestone since we did not find time in January. |
tl;dr: Running a single file without a workspace open is a common pain point in usertesting. It should not just be easier, but also take the opportunity to check the user's environment and guide through the installation/configuration of missing dependencies.
Context
VS Code is used by many as their first editor while learning to code. Other editors in the space make it a lot easier to run a single file to see the output, which puts expectations on how VS Code should work. VS Code's latest improvements with auto-attach and JS debug terminal show how the setup time for debugging can be cut dramatically with smart affordances.
End to End Scenario
Alternative Scenerios
How the user is set up:
How the file is opened
Improvement ideas
Next steps
cc @gcrev93 @DanielRosenwasser @connor4312 @misolori @JacksonKearl @kieferrm @mattbierner
The text was updated successfully, but these errors were encountered: