- add a searchable Insert Snippet Universal Locator provider

- support runtime locator provider registration and removal
- filter snippets with workspace-relative include/exclude globs
- add the remaining VS Code-compatible snippet variables
- support camelcase, pascalcase, snakecase, and kebabcase modifiers
- reuse the existing insertion flow for locator-selected snippets
- expand snippet parser and store test coverage
- update the implementation plan and C/C++ example snippets

Refs: SpartanJ/ecode#111
This commit is contained in:
Martín Lucas Golini
2026-07-29 18:49:01 -03:00
parent 683b35b249
commit 1dc8195187
11 changed files with 660 additions and 182 deletions
-57
View File
@@ -1,57 +0,0 @@
{
"Main Function": {
"scope": "c,cpp",
"prefix": ["main", "mainfn"],
"body": [
"int main(int argc, char** argv) {",
"\t${1:(void)argc;}",
"\t${2:(void)argv;}",
"\t$0",
"\treturn 0;",
"}"
],
"description": "Program entry point"
},
"Indexed For Loop": {
"scope": "c,cpp",
"prefix": ["fori", "for-index"],
"body": [
"for (${1:size_t} ${2:i} = 0; $2 < ${3:count}; ++$2) {",
"\t$0",
"}"
],
"description": "Indexed loop with linked iterator placeholders"
},
"Include Header": {
"scope": "c,cpp",
"prefix": "inc",
"body": "#include ${1|<stdio.h>,<stdlib.h>,<string.h>,\"header.h\"|}$0",
"description": "Include a common system header or a local header"
},
"Guard Clause": {
"scope": "c,cpp",
"prefix": "guard",
"body": [
"if (${1:condition}) {",
"\t${2:return;}",
"}",
"$0"
],
"description": "Early-return guard clause"
},
"C++ Class": {
"scope": "cpp",
"prefix": "class",
"body": [
"class ${1:${TM_FILENAME_BASE}} {",
" public:",
"\t$1(${2});",
"\t~$1();",
"",
" private:",
"\t$0",
"};"
],
"description": "Class named after the current file with linked placeholders"
}
}