VSCode extension to sort and refactor python imports using reorder-python-imports.

Overview

reorder-python-imports

VSCode extension to sort and refactor python imports using reorder-python-imports.

Unlike other import organizers, reorder-python-imports focuses on reducing the frequency of merge conflicts, using static analysis to avoid the need for an active venv, and providing better better compatibility with pre-commit and black.

To learn more, visit the original tool's homepage.

Features

Refactoring the imports is provided as a code action, which can be invoked by right clicking on the code or the lightbulb icon and selecting Reorder Imports, or selecting Python Refactor: Reorder Imports from the command palette.

Example usage from context menu

Settings

Below is an example of a settings.json file with settings relevant to vscode-reorder-python-imports.

{
    "reorder-python-imports.args": [
        "--application-directories=.:src",
        "--add-import 'from __future__ import absolute_import'",
        "--add-import 'from __future__ import division'",
        "--add-import 'from __future__ import print_function'"
  ]
}

Reordering on Save

Reordering imports on save is also supported, but requires you to set the following in your settings to prevent Microsoft's python extension from running isort:

"[python]": {
    "editor.codeActionsOnSave": {
        "source.organizeImports": false,
        "source.organizeImports.reorder-python-imports": true
    },
}

Requirements

reorder-python-imports must be installed in the venv used by visual studio.

Known Issues

isort from Microsoft's Python Extension also provides a code action for organizing imports. When vscode is configured to organize imports on save, both isort and reorder-python-imports are run. To work around this, see the reordering on save section.

Release Notes

v0.1.0

Added support and documentation for reordering on save. First feature-complete release.

v0.0.1

Initial version with minimal required features - provided context menu and command through which the code action can be run.

Gaphor is a UML and SysML modeling application written in Python.

Gaphor is a UML and SysML modeling application written in Python. It is designed to be easy to use, while still being powerful. Gaphor implements a fully-compliant UML 2 data model, so it is much mor

Gaphor 1.3k Jan 07, 2023
A way to integrate Latex, VSCode, and Inkscape in macOS. Adopted the whole workflow from Gilles Castel.

VSCode-LaTeX-Inkscape A way to integrate LaTeX, VSCode, and Inkscape in macOS Abstract I use LaTeX heavily in past two years for both academic work an

Pingbang Hu 62 Dec 14, 2022
Run context-aware commands from your source code comments

Run context-aware commands from your source code comments. Codeline allows you to run custom commands directly from source-code comments, combining th

Rory Byrne 32 Nov 09, 2021
Shows Odin Lang errors in Sublime Text.

OdinErrors Shows Odin Lang errors in Sublime Text. Config Collections and defines are stored in ols.json (Hijacked from ols). { "collections": [

Gus 3 Nov 20, 2021
Jarvide - A powerful AI mixed with a powerful IDE.

Jarvide About Jarvide Welcome to Jarvide. A powerful AI mixed with a powerful ID

Caeden 23 Oct 28, 2022
Live coding in Python with PyCharm, Emacs, Sublime Text, or even a browser

Live Coding in Python Visualize your Python code while you type it in PyCharm, Emacs, Sublime Text, or even your browser. To see how to use one of the

Don Kirkby 256 Dec 14, 2022
Multi-user server for Jupyter notebooks

Technical Overview | Installation | Configuration | Docker | Contributing | License | Help and Resources Please note that this repository is participa

JupyterHub 7k Jan 02, 2023
ROS2 Docker tutorial with VSCode

ROS2-Docker-tutorial I made this repository using athackst/vscode_ros2_workspace templete with foxy-nvidia branch. You could see more information abov

Tae Young Kim 4 Nov 03, 2022
A GitHub Action hosted Python IDE!

What is this ? This is an IDE running on GitHub Actions which can help in..... Running small snippets. Running codes whenever PC is not available and

Jainam Oswal 21 Nov 09, 2022
Automatically detect obfuscated code and other state machines

Scripts to automatically detect obfuscated code and state machines in binaries.

Aaron 110 Dec 04, 2022
This is a backend for VCode Editor for saving & retriving data.

This is a backend for VCode Editor for saving & retriving data through the API.

Tejas Magade 1 Nov 22, 2021
cottonformation is a Python tool providing best development experience and highest productivity

Welcome to cottonformation Documentation Full Documentatioin Here cottonformation is a Python tool providing best development experience and highest p

Sanhe 6 Jul 08, 2022
An echo kernel for JupyterLite

jupyterlite-echo-kernel An echo kernel for JupyterLite. Requirements JupyterLite = 0.1.0a10 Install To install the extension, execute: pip install ju

JupyterLite 7 Dec 07, 2022
notebookJS: seamless JavaScript integration in Python Notebooks

notebookJS enables the execution of custom JavaScript code in Python Notebooks (Jupyter Notebook and Google Colab). This Python library can be useful for implementing and reusing interactive Data Vis

jorgehpo 146 Dec 07, 2022
CTO (Call Tree Overviewer) is an IDA plugin for creating a simple and efficiant function call tree graph

CTO (Call Tree Overviewer) CTO (Call Tree Overviewer) is an IDA plugin for creating a simple and efficiant function call tree graph. It can also summa

Hiroshi Suzuki 257 Dec 24, 2022
Joy is a tiny creative coding library in Python.

Joy Joy is a tiny creative coding library in Python. Installation The easiest way to install it is download joy.py and place it in your directory. The

FOSS United Foundation 181 Dec 04, 2022
Python IDE or notebook to generate a basic Kepler.gl data visualization

geospatial-data-analysis [readme] Use this code in your Python IDE or notebook to generate a basic Kepler.gl data visualization, without pre-configura

2 Sep 05, 2022
VSCode Development Container Template

VSCode Development Container Template This template enables you to use a full-fledged containerized development environment for your machine learning

Paige Bailey 10 Oct 10, 2022
Mu - A Simple Python Code Editor

A small, simple editor for beginner Python programmers. Written in Python and Qt5.

Mu 1.2k Jan 03, 2023
Launch a ready-to-code Wagtail Live development environment with a single click.

Wagtail Live Gitpod Launch a ready-to-code Wagtail Live development environment with a single click. Steps: Click the Open in Gitpod button. Relax: a

Coen van der Kamp 6 Oct 29, 2021