{
    "Component Class": {
        "prefix": ["component", "comp"],
        "body": [
            "@Component",
            "class ${1:ComponentName} {",
            "    state = {",
            "        ${2:// component state}",
            "    }",
            "    ",
            "    function render(${3:props}) {",
            "        return `",
            "            <div class=\"${4:component-class}\">",
            "                ${5:// JSX-like template}",
            "            </div>",
            "        `",
            "    }",
            "    ",
            "    function ${6:onMount}() {",
            "        ${7:// lifecycle method}",
            "    }",
            "    ",
            "    function ${8:onUpdate}() {",
            "        ${9:// update handler}",
            "    }",
            "}"
        ],
        "description": "Create a NovaLang Frontend Component"
    },
    "Entity Class": {
        "prefix": ["entity", "ent"],
        "body": [
            "@Entity",
            "class ${1:EntityName} {",
            "    ${2:id}: number",
            "    ${3:name}: string",
            "    ${4:// additional fields}",
            "    ",
            "    function ${1:EntityName}(${5:params}) {",
            "        ${6:// constructor}",
            "    }",
            "    ",
            "    function validate() {",
            "        let errors = []",
            "        ${7:// validation logic}",
            "        return len(errors) == 0 ? null : errors",
            "    }",
            "    ",
            "    function ${8:businessMethod}() {",
            "        ${9:// business logic}",
            "    }",
            "}"
        ],
        "description": "Create a NovaLang Entity (works in frontend and backend)"
    },
    "Service Class": {
        "prefix": ["service", "svc"],
        "body": [
            "@Service",
            "class ${1:ServiceName} {",
            "    ",
            "    function ${2:methodName}(${3:params}) {",
            "        print \"🔄 ${1:ServiceName}.${2:methodName}()\"",
            "        ",
            "        ${4:// business logic}",
            "        ",
            "        return ${5:result}",
            "    }",
            "    ",
            "    function ${6:anotherMethod}(${7:params}) {",
            "        ${8:// additional business logic}",
            "    }",
            "}"
        ],
        "description": "Create a NovaLang Service (business logic layer)"
    },
    "Repository Class": {
        "prefix": ["repository", "repo"],
        "body": [
            "@Repository",
            "class ${1:EntityName}Repository {",
            "    ",
            "    function findAll() {",
            "        print \"📋 ${1:EntityName}Repository.findAll()\"",
            "        let sql = \"SELECT * FROM ${2:table_name}\"",
            "        print \"📝 SQL:\", sql",
            "        ${3:// database query logic}",
            "        return ${4:results}",
            "    }",
            "    ",
            "    function findById(id) {",
            "        print \"🔍 ${1:EntityName}Repository.findById(\" + str(id) + \")\"",
            "        let sql = \"SELECT * FROM ${2:table_name} WHERE id = ?\"",
            "        print \"📝 SQL:\", sql",
            "        ${5:// find by id logic}",
            "        return ${6:result}",
            "    }",
            "    ",
            "    function save(${7:entity}) {",
            "        print \"💾 ${1:EntityName}Repository.save()\"",
            "        ${8:// save logic}",
            "        return ${7:entity}",
            "    }",
            "    ",
            "    function deleteById(id) {",
            "        print \"🗑️ ${1:EntityName}Repository.deleteById(\" + str(id) + \")\"",
            "        ${9:// delete logic}",
            "        return true",
            "    }",
            "}"
        ],
        "description": "Create a NovaLang Repository (data access layer)"
    },
    "Controller Class": {
        "prefix": ["controller", "ctrl"],
        "body": [
            "@Controller(\"${1:/api/endpoint}\")",
            "class ${2:ControllerName} {",
            "    ",
            "    function GET ${3:index}() {",
            "        print \"🌐 GET ${1:/api/endpoint}\"",
            "        ",
            "        ${4:// GET endpoint logic}",
            "        ",
            "        return {",
            "            status: 200,",
            "            data: ${5:data}",
            "        }",
            "    }",
            "    ",
            "    function POST ${6:create}(request) {",
            "        print \"🌐 POST ${1:/api/endpoint}\"",
            "        print \"📥 Request body:\", request.body",
            "        ",
            "        ${7:// POST endpoint logic}",
            "        ",
            "        return {",
            "            status: 201,",
            "            data: ${8:result}",
            "        }",
            "    }",
            "    ",
            "    function GET ${9:show}(id) {",
            "        print \"🌐 GET ${1:/api/endpoint}/\" + str(id)",
            "        ",
            "        ${10:// GET by ID logic}",
            "        ",
            "        return {",
            "            status: 200,",
            "            data: ${11:item}",
            "        }",
            "    }",
            "    ",
            "    function PUT ${12:update}(id, request) {",
            "        print \"🌐 PUT ${1:/api/endpoint}/\" + str(id)",
            "        ",
            "        ${13:// PUT endpoint logic}",
            "        ",
            "        return {",
            "            status: 200,",
            "            data: ${14:updated}",
            "        }",
            "    }",
            "    ",
            "    function DELETE ${15:destroy}(id) {",
            "        print \"🌐 DELETE ${1:/api/endpoint}/\" + str(id)",
            "        ",
            "        ${16:// DELETE endpoint logic}",
            "        ",
            "        return {",
            "            status: 204",
            "        }",
            "    }",
            "}"
        ],
        "description": "Create a NovaLang REST Controller (API endpoints)"
    },
    "Function": {
        "prefix": ["func", "fn"],
        "body": [
            "function ${1:functionName}(${2:params}) {",
            "    ${3:// function body}",
            "    return ${4:result}",
            "}"
        ],
        "description": "Create a function"
    },
    "Print Statement": {
        "prefix": ["print", "log"],
        "body": [
            "print ${1:\"message\"}"
        ],
        "description": "Print statement"
    },
    "If Statement": {
        "prefix": ["if"],
        "body": [
            "if (${1:condition}) {",
            "    ${2:// code}",
            "}"
        ],
        "description": "If statement"
    },
    "If-Else Statement": {
        "prefix": ["ifelse", "ie"],
        "body": [
            "if (${1:condition}) {",
            "    ${2:// if code}",
            "} else {",
            "    ${3:// else code}",
            "}"
        ],
        "description": "If-else statement"
    },
    "While Loop": {
        "prefix": ["while"],
        "body": [
            "while (${1:condition}) {",
            "    ${2:// loop body}",
            "}"
        ],
        "description": "While loop"
    },
    "For Loop": {
        "prefix": ["for"],
        "body": [
            "for (let ${1:i} = 0; ${1:i} < ${2:length}; ${1:i}++) {",
            "    ${3:// loop body}",
            "}"
        ],
        "description": "For loop"
    },
    "Variable Declaration": {
        "prefix": ["let"],
        "body": [
            "let ${1:variableName} = ${2:value}"
        ],
        "description": "Variable declaration"
    },
    "Constant Declaration": {
        "prefix": ["const"],
        "body": [
            "const ${1:constantName} = ${2:value}"
        ],
        "description": "Constant declaration"
    },
    "Application Class": {
        "prefix": ["app", "application"],
        "body": [
            "@Application",
            "class ${1:ApplicationName} {",
            "    ",
            "    function main() {",
            "        print \"🚀 Starting ${1:ApplicationName}...\"",
            "        ",
            "        ${2:// Auto-configuration}",
            "        print \"⚙️ Auto-configuring database...\"",
            "        print \"⚙️ Scanning for components...\"",
            "        print \"⚙️ Setting up dependency injection...\"",
            "        ",
            "        print \"✅ Application started successfully!\"",
            "        print \"🌐 Server running on http://localhost:8080\"",
            "        ",
            "        ${3:// Start web server}",
            "        startWebServer()",
            "    }",
            "    ",
            "    function startWebServer() {",
            "        print \"🌐 Starting web server...\"",
            "        ${4:// Server startup logic}",
            "    }",
            "}"
        ],
        "description": "Create a NovaLang Application (main entry point)"
    },
    "Database Configuration": {
        "prefix": ["dbconfig", "database"],
        "body": [
            "@Configuration",
            "class DatabaseConfig {",
            "    ",
            "    function createDatabase() {",
            "        print \"🗄️ Auto-configuring MySQL database...\"",
            "        ",
            "        let sql = `",
            "            CREATE DATABASE IF NOT EXISTS ${1:database_name};",
            "            USE ${1:database_name};",
            "            ",
            "            ${2:// Table definitions}",
            "        `",
            "        ",
            "        print \"📝 Generated SQL for MySQL Workbench:\"",
            "        print sql",
            "        ",
            "        print \"✅ Database schema ready!\"",
            "    }",
            "}"
        ],
        "description": "Create database configuration"
    }
}
