Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/peterjclaw/vscode-tuck
VSCode extension for Tuck
https://github.com/peterjclaw/vscode-tuck
formatter python vscode-extension
Last synced: about 1 month ago
JSON representation
VSCode extension for Tuck
- Host: GitHub
- URL: https://github.com/peterjclaw/vscode-tuck
- Owner: PeterJCLaw
- License: apache-2.0
- Created: 2020-01-05T16:20:35.000Z (almost 5 years ago)
- Default Branch: main
- Last Pushed: 2024-06-16T12:44:25.000Z (5 months ago)
- Last Synced: 2024-06-16T13:57:28.685Z (5 months ago)
- Topics: formatter, python, vscode-extension
- Language: TypeScript
- Homepage:
- Size: 313 KB
- Stars: 0
- Watchers: 14
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# VSCode Tuck
[![CircleCI](https://circleci.com/gh/PeterJCLaw/vscode-tuck.svg?style=svg)](https://circleci.com/gh/PeterJCLaw/vscode-tuck)
VSCode extension for [tuck][] -- semi-automated Python formatting.
[tuck]: https://github.com/PeterJCLaw/tuck
## Install
Install from the [Extension Marketplace][marketplace] using this extension's
full name: `peterjclaw.tuck`.[marketplace]: https://marketplace.visualstudio.com/items?itemName=peterjclaw.tuck
## Features
This extension current provides a single command, equivalent to calling tuck
against the current file and using the cursor position as the position to wrap.The command can most easily be run using the keyboard shortcut
Alt+Shift+W.### Examples
#### Function definition
Place cursor on `foo` or within the parentheses, then run the command:
``` python
def foo(bar: str, quox: int = 0) -> float:
return 4.2
```wraps to:
``` python
def foo(
bar: str,
quox: int = 0,
) -> float:
return 4.2
```#### List comprehension
Place cursor on `for`, then run the command:
``` python
[x for x in 'aBcD' if x.isupper()]
```wraps to:
``` python
[
x
for x in 'aBcD'
if x.isupper()
]
```## Release Notes
See [CHANGELOG.md](./CHANGELOG.md).
## Attribution
Tuck uses [`asttokens`][asttokens] to aid its handling of the Python AST.
`asttokens` is included in the extension, licensed under Apache 2.0.[asttokens]: https://pypi.org/project/asttokens/