Skip to content
This repository was archived by the owner on Apr 2, 2025. It is now read-only.
Open
Show file tree
Hide file tree
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
9 changes: 8 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
"vscode": "^1.38.0"
},
"categories": [
"Programming Languages"
"Programming Languages",
"Snippets"
],
"repository": {
"type": "git",
Expand Down Expand Up @@ -344,6 +345,12 @@
"when": "editorTextFocus && editorLangId == lean"
}
],
"snippets": [
{
"language": "lean",
"path": "./snippets/lean.json"
}
],
"menus": {
"commandPalette": [
{
Expand Down
48 changes: 48 additions & 0 deletions snippets/lean.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
{
"lemma": {
"prefix": "lemma",
"body": [
"lemma ${1:name (args)} : ${2:sorry} := ${3:sorry}"
],
"description": "Insert a one-line lemma"
},
"theorem": {
"prefix": "theorem",
"body": [
"theorem ${1:name (args)} : ${2:sorry} := ${3:sorry}"
],
"description": "Insert a one-line lemma"
},
"example": {
"prefix": "example",
"body": [
"example : ${2:sorry} := ${2:sorry}"
],
"description": "Insert a one-line example"
},
"namespace": {
"prefix": "namespace",
"body": [
"namespace ${1:name}",
"$0",
"end ${1}"
],
"description": "Insert a namespace"
},
"structure": {
"prefix": "structure",
"body": [
"structure ${1:name} ${2:(args : sorry)}",
":=",
"\t${3:(field : sorry)}",
"",
"namespace ${1:}",
Copy link
Contributor

@utensil utensil Jul 27, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The lines below are a little too much. structure should not make too much assumption on the organization after the structure. If this snippet is called theory for boilerplate of developing a theory, maybe it would be OK but there would be much more.

"variables ${2:}",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Usually variables should be declared in a named section.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Declaring variables in a namespace is fine too.

"",
"",
"",
"end ${1:}"
],
"description": "Insert a structure and matching namespace"
}
}