Skip to content

fix some python snippet prefixes, add init snippet #576

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 21 additions & 6 deletions snippets/python/python.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,24 @@
"description": "Ignore specific line diagnostic in pyright (ignore all is unsafe)"
},
"Multiline string": {
"prefix": "#",
"prefix": "#s",
"body": ["\"\"\"$0", "\"\"\""],
"description": "Snippet to avoid autopair plugin annoyances when typing multiple \""
"description": "Snippet to avoid weird autopair plugin behaviour"
},
"One-line multiline string": {
"prefix": "##",
"prefix": "#ss",
"body": "\"\"\"$0\"\"\"",
"description": "Snippet to avoid autopair plugin annoyances when typing multiple \""
"description": "Snippet to avoid weird autopair plugin behaviour"
},
"Single-quote multiline string": {
"prefix": "#q",
"body": ["'''$0", "'''"],
"description": "Snippet to avoid weird autopair plugin behaviour"
},
"One-line single-quote multiline string": {
"prefix": "#qq",
"body": "'''$0'''",
"description": "Snippet to avoid weird autopair plugin behaviour"
},
"self": {
"prefix": "s",
Expand Down Expand Up @@ -140,15 +150,20 @@
"description": "Class definition template"
},
"Method": {
"prefix": "defs",
"prefix": "defm",
"body": ["def ${1:mname}(self$2):", "\t${3:pass}"],
"description": "Class method definition"
},
"Method w/ return type": {
"prefix": "defst",
"prefix": "defmt",
"body": ["def ${1:mname}(self$2) -> ${3:None}:", "\t${4:pass}"],
"description": "Class method definition"
},
"Init method": {
"prefix": "defi",
"body": ["def __init__(self$1):", "\t${2:pass}"],
"description": "Class method definition"
},
"property template": {
"prefix": "property",
"body": [
Expand Down