Giter Site home page Giter Site logo

Comments (5)

EeyoreLee avatar EeyoreLee commented on August 28, 2024 1

Seems there's a PR to fix it, upgrade your local yapf package when yapf merge it may fix it. Related PR yapf #1102

from vscode-extension-yapf.

EeyoreLee avatar EeyoreLee commented on August 28, 2024

@lsouder-ozone3d - hi, has the formatOnSave affected you? Could you try the following setting for [python] section

  "[python]": {
    "editor.formatOnSave": false,
    "editor.defaultFormatter": "eeyore.yapf",
    "editor.formatOnType": false
  }

If there's still a unexpect problem, please show me a code snippet can reproduct this as I just try this on my side that seems working fine.

from vscode-extension-yapf.

lsouder-ozone3d avatar lsouder-ozone3d commented on August 28, 2024

@EeyoreLee thanks for responding. That config didn't solve the problem.

def do_something():
    xs = []
    for x in xs:
        y = 'y'
        
        if y:
            pass

def do_something_else():
    return '-path 1'

Line 5 has 2 unnecessary tabs. If I Format Selection for just the last line, it will strip the whitespace in Line 5

from vscode-extension-yapf.

EeyoreLee avatar EeyoreLee commented on August 28, 2024

@lsouder-ozone3d - yup, I reproducted it not only through vscode extension but also yapf xx.py -l 10-10 -i. So it's a bug of yapf package. I'll issue it to yapf repo.

from vscode-extension-yapf.

lsouder-ozone3d avatar lsouder-ozone3d commented on August 28, 2024

@EeyoreLee Thanks for looking into that! I'll close out this issue and watch for a change over there.

from vscode-extension-yapf.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.