2016-04-15 4 views
2

die Erweiterung mit Python, mit yapf - nichts passiert, wenn ich Format getroffen:Format mit yapf ist erroring leise

  • VSCode Version: 1.0.0
  • OS Version: OSX 10.11.4

Mein Arbeitsplatz Einstellungen:

// Place your settings in this file to overwrite the default settings 
{ 
    "search.exclude": { 
     "**/node_modules": true, 
     "**/bower_components": true, 
     "**/js-build": true 
    }, 
    "editor.scrollBeyondLastLine": false, 
    "python.pythonPath": "/Users/joshma/.envs/venv/bin/python", 
    "python.linting.flake8Path": "/Users/joshma/.envs/venv/bin/flake8", 
    "python.linting.pylintEnabled": false, 
    "python.linting.flake8Enabled": true, 
    "editor.formatOnType": true, 
    "python.formatting.provider": "yapf", 
    "python.formatting.yapfPath": "/Users/joshma/.envs/venv/bin/yapf" 
} 

Die Schritte, die ich nahm:

  1. einen Funktionsaufruf zu foo('a' ) Rewrite
  2. Stellen Sie sicher, dass Lauf cat path/to/file.py | yapf Formate, die foo('a')
  3. Wählen gesamte Datei, cmd + shift + p, Format-Code zu zeichnen.
  4. Nichts passiert :(

es möglich ist, habe ich nicht einige Pfad/Konfiguration richtig eingestellt - ist es eine Möglichkeit, dies zu debuggen

+0

Bitte überprüfen Sie den Inhalt des Python-Ausgabefensters. Wenn Fehler auftreten, werden sie dort angezeigt. – Don

Antwort

0

Ich denke, dass Sie diese Option fehlt,

?

python.formatting.formatOnSave

Dies ist meine Konfiguration und die Formatierung funktioniert,

"python.formatting.formatOnSave": true, 
"python.formatting.provider": "yapf", 
"python.formatting.yapfPath": "/usr/bin/yapf"