diff --git a/.gitignore b/.gitignore index 7bf3d7aa..3fc908a5 100644 --- a/.gitignore +++ b/.gitignore @@ -16,6 +16,7 @@ out/ # Distribution / packaging .Python env/ +env3/ build/ develop-eggs/ dist/ diff --git a/pyls/plugins/autopep8_format.py b/pyls/plugins/autopep8_format.py index f69d3256..61260068 100644 --- a/pyls/plugins/autopep8_format.py +++ b/pyls/plugins/autopep8_format.py @@ -6,13 +6,13 @@ log = logging.getLogger(__name__) -@hookimpl +@hookimpl(tryfirst=True) # Prefer autopep8 over YAPF def pyls_format_document(config, document): log.info("Formatting document %s with autopep8", document) return _format(config, document) -@hookimpl +@hookimpl(tryfirst=True) # Prefer autopep8 over YAPF def pyls_format_range(config, document, range): # pylint: disable=redefined-builtin log.info("Formatting document %s in range %s with autopep8", document, range) diff --git a/pyls/plugins/yapf_format.py b/pyls/plugins/yapf_format.py index 765f8c9f..4d770a4b 100644 --- a/pyls/plugins/yapf_format.py +++ b/pyls/plugins/yapf_format.py @@ -8,12 +8,12 @@ log = logging.getLogger(__name__) -@hookimpl(tryfirst=True) # Prefer YAPF over autopep8 if available +@hookimpl def pyls_format_document(document): return _format(document) -@hookimpl(tryfirst=True) # Prefer YAPF over autopep8 if available +@hookimpl def pyls_format_range(document, range): # pylint: disable=redefined-builtin # First we 'round' the range up/down to full lines only range['start']['character'] = 0