Skip to content
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

Create a python file should automatically select the language for the file as python #18376

Closed
karthiknadig opened this issue Jan 26, 2022 · 14 comments
Assignees
Labels
area-editor-* User-facing catch-all feature-request Request for new features or functionality verification-needed Verification of issue is requested verified Verification succeeded
Milestone

Comments

@karthiknadig
Copy link
Member

Testing #18355

Currently create a python file opens a generic untitled file. Instead, it should set the language on the untitled file.
image

@github-actions github-actions bot added the triage-needed Needs assignment to the proper sub-team label Jan 26, 2022
@luabud
Copy link
Member

luabud commented Jan 27, 2022

@karthiknadig Do you know if there's a command to do it? Cause AFAIK it can't be done programmatically :(

@luabud luabud added area-editor-* User-facing catch-all feature-request Request for new features or functionality needs PR and removed triage-needed Needs assignment to the proper sub-team labels Jan 27, 2022
@karthiknadig
Copy link
Member Author

We should ask for this API in VS Code repo. There is a command 'Change language mode', but this does a quick pick.

@luabud luabud modified the milestone: January 2022 Jan 27, 2022
@luabud
Copy link
Member

luabud commented Jan 27, 2022

I guess they do offer a way through this? https://code.visualstudio.com/updates/v1_59#_contribution-point-for-new-file-menu

@luabud
Copy link
Member

luabud commented Feb 23, 2022

To verify, set "python.createNewFileEnabled": true in the user settings. Then open the VS Code start page (Help: Get Started) and and click "New File":

image

image

This is behind a setting to be run as an experiment (motivation)

@luabud luabud closed this as completed Feb 23, 2022
@luabud luabud added the verification-needed Verification of issue is requested label Feb 23, 2022
@amunger
Copy link

amunger commented Feb 23, 2022

It looks like the "create Python file" command through the "help: get started" page still asks for a language selection. Was that supposed to be updated as well?
New file... works as described

@amunger amunger reopened this Feb 23, 2022
@amunger amunger added the verification-found Issue verification failed label Feb 23, 2022
@karthiknadig
Copy link
Member Author

@amunger looks like the build did not publish with that change in due to a network issue. Can you try with this one: https://github.com/microsoft/vscode-python/suites/5410040257/artifacts/170851098

@amunger
Copy link

amunger commented Feb 23, 2022

Still the same behavior after installing that visx (v2022.1.1884760391-dev)

@luabud
Copy link
Member

luabud commented Feb 23, 2022

@amunger sorry, what do you mean by language selection?

once you click on "new file" it should show up a list with of possible files you'd like to create. Is this not what you're seeing?

@luabud
Copy link
Member

luabud commented Feb 23, 2022

oh sorry, do you mean the "New Python file" command? if so, when I run it, it creates the file as I'd expect 😢
image

@amunger
Copy link

amunger commented Feb 23, 2022

yeah "New File..." works fine. The Help: Getting Started file creation is the one that isn't auto selecting the language:
image

@amunger
Copy link

amunger commented Feb 23, 2022

Oh, I read through your verification steps too quickly. It doesn't look like this was actually something to verify

@amunger amunger closed this as completed Feb 23, 2022
@amunger amunger removed the verification-found Issue verification failed label Feb 23, 2022
@luabud
Copy link
Member

luabud commented Feb 23, 2022

oh that is such a good point, though! I'll create a new issue to use that in the walkthrough: #18575

Thanks for bringing it up! 😊

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 26, 2022
@karrtikr
Copy link

karrtikr commented Jul 1, 2022

We should ask for this API in VS Code repo. There is a command 'Change language mode', but this does a quick pick.

@luabud It should now be possible with microsoft/vscode#153872 🥳 Does Python extension still need its own Python: New Python File command?

@luabud
Copy link
Member

luabud commented Jul 4, 2022

@karrtikr Awesome! I don't think we need the command anymore then. We can remove it 😢

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-editor-* User-facing catch-all feature-request Request for new features or functionality verification-needed Verification of issue is requested verified Verification succeeded
Projects
None yet
Development

No branches or pull requests

5 participants