Skip to content

Commit

Permalink
feat: restore the module docstring code snippet (#7030)
Browse files Browse the repository at this point in the history
We had this in mathlib3, allowing one to type `mo` (then press tab, at least for me) in an empty file and have a snippet template of a module docstring inserted with the title named to the filename, which can save a little time.
The implementation is now a bit overkill as it splits on `_` and capitalizes still to get from the filename to the module title, which likely has no affect for most lean 4 filenames.
  • Loading branch information
alexjbest committed Sep 8, 2023
1 parent c48c769 commit 2df6bb4
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions .vscode/module-docstring.code-snippets
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{
"Module docstring for mathlib": {
"scope": "lean4",
"prefix": "module docstring",
"body": [
"/-!",
"# ${TM_FILENAME_BASE/([^_]*)(_?)/${1:/capitalize}${2:+ }/g}",
"",
"## Main definitions",
"",
"* `FooBar`",
"",
"## Main statements",
"",
"* `fooBar_unique`",
"",
"## Notation",
"",
"",
"",
"## Implementation details",
"",
"",
"",
"## References",
"",
"* [F. Bar, *Quuxes*][bibkey]",
"",
"## Tags",
"",
"Foobars, barfoos",
"-/",
"",
]},
}

0 comments on commit 2df6bb4

Please sign in to comment.