question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Quick fix action to create class, method etc.

See original GitHub issue

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-.

Issue Analytics

  • State:open
  • Created 5 years ago
  • Reactions:21
  • Comments:10 (3 by maintainers)

github_iconTop GitHub Comments

4reactions
altabecommented, 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

4reactions
emmanueldcommented, May 9, 2019

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

Read more comments on GitHub >

github_iconTop Results From Across the Web

Quick-Fixes and Context Actions | ReSharper Platform SDK
Quick -fixes are possible modifications that appear associated with a particular highlighting (i.e., a warning or an error). These typically ...
Read more >
Common Quick Actions - Visual Studio - Microsoft Learn
This Quick Action allows you to convert block bodies into expression-bodied members for methods, constructors, operators, properties, indexers, ...
Read more >
Quick Fix - IBM
Quick Fix · Create new method for references to methods that can not be resolved · Rename to a similar method for references...
Read more >
How To Construct Classes and Define Objects in Python 3
In this tutorial, we'll go through creating classes, instantiating objects, initializing attributes with the constructor method, and working ...
Read more >
Visual Studio Code Quick Constructor for Dart not working
if installed then try Ctrl + . within class and select Generate constructor. you can follow below numbers to quick fix the.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found