Skip to content

Quick fix action to create class, method etc. #2653

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

Closed
l0b0 opened this issue Sep 21, 2018 · 11 comments
Closed

Quick fix action to create class, method etc. #2653

l0b0 opened this issue Sep 21, 2018 · 11 comments

Comments

@l0b0
Copy link

l0b0 commented Sep 21, 2018

Environment data

  • VS Code version: 1.27.2
  • Extension version (available under the Extensions sidebar): 2018.8.0
  • OS and version: Arch Linux
  • Python version (& distribution if applicable, e.g. Anaconda): 3.6.6
  • Type of virtual environment used: venv

Actual behavior

Pops up with "No code actions available".

Expected behavior

Equivalent behaviour to IntelliJ IDEA: suggest creating a method bar in class Foo. Based on the property reference string this could then be extended to create other properties:

  • Foo.bar would suggest creating a field (or possibly @Property method).
  • Foo.Bar would suggest creating an inner class.

Steps to reproduce:

  1. Create a Python file:

    class Foo:
        pass
    
    
    Foo.bar()
    
  2. Focus bar on line 5

  3. Press Ctrl-.

@DonJayamanne DonJayamanne added feature-request Request for new features or functionality feature-refactoring labels Sep 21, 2018
@brettcannon brettcannon added needs proposal Need to make some design decisions and removed needs decision labels Nov 5, 2018
@chrisjsewell
Copy link

Related to this, there should also be a quick fix for adding import <word> to the top of the file.

This is available in PyCharm, as documented here

@emmanueld
Copy link

I recently switched from pyCharm to VSCode, and this is a feature I was using a lot to fix error/warning in the code.

Is there any ETA for this function to work ?

Thanks

@luabud luabud self-assigned this Sep 11, 2019
@gramster gramster added the area-editor-* User-facing catch-all label Oct 10, 2019
@nMustaki
Copy link

Another one I would love would clean up all unused imports in one step. This is a dumb action I am finding myself doing at least once per day and it's boring as hell.

@yafesdev
Copy link

yafesdev commented Nov 3, 2019

I'm on version September 2019 (version 1.39) and this is still a problem. VS Code successfully recognizes No space allowed around keyword argument assignmentpylint(bad-whitespace) but at the same the it displays "No quick fixes available".

Is this still expected or is something wrong in my setup?

@luabud
Copy link
Member

luabud commented Nov 5, 2019

Hey folks, glad you all are interested in this feature. It's marked as needs spec, so it means it needs some design work before we're ready to work on it or mark it as "needs PR" so community contributors can work on it as well.

It's also worth mentioning that we're tracking auto imports here and unused imports cleaning here.

@yafesdev
Copy link

yafesdev commented Nov 6, 2019

@luabud Thanks for the Update.

@brettcannon brettcannon added area-intellisense LSP-related functionality: auto-complete, docstrings, navigation, refactoring, etc. and removed feature-refactoring labels Apr 9, 2020
@savannahostrowski savannahostrowski self-assigned this Jun 9, 2021
@altabe
Copy link

altabe commented Jul 17, 2021

Any news on this?
The auto imports and imports cleaning are working fine but the "create class/function/property" quick actions for unresolved reference are still missing.
As @emmanueld said, this really disrupts the workflow when switching from pyCharm to vscode.

image

@luabud luabud removed their assignment Jul 20, 2021
@luabud
Copy link
Member

luabud commented Jul 20, 2021

@altabe no updates on this issue so far AFAIK, but we definitely appreciate the feedback!

@ykvarts
Copy link

ykvarts commented Nov 18, 2022

any updates please? plugin or anything else? This is easily one of the most used and useful features I used in PyCharm, would love to see it in vscode

@savannahostrowski savannahostrowski removed their assignment Nov 18, 2022
@luabud
Copy link
Member

luabud commented Nov 23, 2022

We have been discussing about solving this in Pylance: microsoft/pylance-release#3600

@brettcannon brettcannon removed feature-request Request for new features or functionality area-intellisense LSP-related functionality: auto-complete, docstrings, navigation, refactoring, etc. needs proposal Need to make some design decisions area-editor-* User-facing catch-all labels Dec 18, 2023
@brettcannon
Copy link
Member

Closing in favour of the Discussion over on Pylance.

@brettcannon brettcannon closed this as not planned Won't fix, can't repro, duplicate, stale Dec 18, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 18, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests