Files
MonkeyCode/backend/pkg/cli/tools/dist/cli.cjs.map
chriscco 5ad50a9a26 feat: 添加了CLI脚本文件
fix: update content assignment in CreateFromIndexResult to use ImplementText

feat: enhance EnsureWorkspace method with automatic name generation and retry logic for workspace creation
2025-07-31 15:56:06 +08:00

8 lines
1.2 MiB

{
"version": 3,
"sources": ["../../../../node_modules/.pnpm/web-tree-sitter@0.22.6/node_modules/web-tree-sitter/tree-sitter.js", "../node_modules/commander/lib/error.js", "../node_modules/commander/lib/argument.js", "../node_modules/commander/lib/help.js", "../node_modules/commander/lib/option.js", "../node_modules/commander/lib/suggestSimilar.js", "../node_modules/commander/lib/command.js", "../node_modules/commander/index.js", "../../autocompletion/v2/CodeSnippets.ts", "../../autocompletion/v2/types.ts", "../../autocompletion/v2/CodeContext.ts", "../../../../src/services/CT-tree-sitter/languageParser.ts", "../../../../src/services/CT-tree-sitter/queries/solidity.ts", "../../../../src/services/CT-tree-sitter/queries/php.ts", "../../../../src/services/CT-tree-sitter/queries/vue.ts", "../../../../src/services/CT-tree-sitter/queries/typescript.ts", "../../../../src/services/CT-tree-sitter/queries/tsx.ts", "../../../../src/services/CT-tree-sitter/queries/python.ts", "../../../../src/services/CT-tree-sitter/queries/javascript.ts", "../../../../src/services/CT-tree-sitter/queries/jsx.ts", "../../../../src/services/CT-tree-sitter/queries/java.ts", "../../../../src/services/CT-tree-sitter/queries/rust.ts", "../../../../src/services/CT-tree-sitter/queries/ruby.ts", "../../../../src/services/CT-tree-sitter/queries/cpp.ts", "../../../../src/services/CT-tree-sitter/queries/c.ts", "../../../../src/services/CT-tree-sitter/queries/c-sharp.ts", "../../../../src/services/CT-tree-sitter/queries/go.ts", "../../../../src/services/CT-tree-sitter/queries/swift.ts", "../../../../src/services/CT-tree-sitter/queries/kotlin.ts", "../../../../src/services/CT-tree-sitter/queries/css.ts", "../../../../src/services/CT-tree-sitter/queries/elixir.ts", "../../../../src/services/CT-tree-sitter/queries/html.ts", "../../../../src/services/CT-tree-sitter/queries/lua.ts", "../../../../src/services/CT-tree-sitter/queries/ocaml.ts", "../../../../src/services/CT-tree-sitter/queries/toml.ts", "../../../../src/services/CT-tree-sitter/queries/systemrdl.ts", "../../../../src/services/CT-tree-sitter/queries/tlaplus.ts", "../../../../src/services/CT-tree-sitter/queries/zig.ts", "../../../../src/services/CT-tree-sitter/queries/embedded_template.ts", "../../../../src/services/CT-tree-sitter/queries/elisp.ts", "../../autocompletion/v2/utils/processUtils.ts", "../../autocompletion/v2/capturesProcess/general.ts", "../../autocompletion/v2/Logger.ts", "../../autocompletion/v2/capturesProcess/go.ts", "../../autocompletion/v2/capturesProcess/python.ts", "../../autocompletion/v2/capturesProcess/java.ts", "../../autocompletion/v2/capturesProcess/javascript.ts", "../../autocompletion/v2/capturesProcess/jsx.ts", "../../autocompletion/v2/capturesProcess/typescript.ts", "../../autocompletion/v2/capturesProcess/tsx.ts", "../../autocompletion/v2/capturesProcess/swift.ts", "../../autocompletion/v2/capturesProcess/css.ts", "../../autocompletion/v2/capturesProcess/html.ts", "../../autocompletion/v2/capturesProcess/kotlin.ts", "../../autocompletion/v2/capturesProcess/php.ts", "../../autocompletion/v2/capturesProcess/rust.ts", "../../autocompletion/v2/capturesProcess/c.ts", "../../autocompletion/v2/capturesProcess/cpp.ts", "../../autocompletion/v2/capturesProcess/index.ts", "../../autocompletion/v2/dependenciesProcess/queries/go.ts", "../../autocompletion/v2/dependenciesProcess/queries/typescript.ts", "../../autocompletion/v2/dependenciesProcess/queries/javascript.ts", "../../autocompletion/v2/dependenciesProcess/queries/java.ts", "../../autocompletion/v2/dependenciesProcess/queries/python.ts", "../../autocompletion/v2/dependenciesProcess/queries/jsx.ts", "../../autocompletion/v2/dependenciesProcess/queries/tsx.ts", "../../autocompletion/v2/dependenciesProcess/go.ts", "../../autocompletion/v2/dependenciesProcess/typescript.ts", "../../autocompletion/v2/dependenciesProcess/javascript.ts", "../../autocompletion/v2/dependenciesProcess/java.ts", "../../autocompletion/v2/dependenciesProcess/python.ts", "../../autocompletion/v2/dependenciesProcess/jsx.ts", "../../autocompletion/v2/dependenciesProcess/tsx.ts", "../../autocompletion/v2/dependenciesProcess/index.ts", "../../autocompletion/v2/utils/languageCommentUtils.ts", "../../autocompletion/v2/utils/treeUtils.ts", "../cli.ts"],
"sourcesContent": ["var Module=void 0!==Module?Module:{},TreeSitter=function(){var initPromise,document=\"object\"==typeof window?{currentScript:window.document.currentScript}:null;class Parser{constructor(){this.initialize()}initialize(){throw new Error(\"cannot construct a Parser before calling `init()`\")}static init(moduleOptions){return initPromise||(Module=Object.assign({},Module,moduleOptions),initPromise=new Promise((resolveInitPromise=>{var moduleOverrides=Object.assign({},Module),arguments_=[],thisProgram=\"./this.program\",quit_=(e,t)=>{throw t},ENVIRONMENT_IS_WEB=\"object\"==typeof window,ENVIRONMENT_IS_WORKER=\"function\"==typeof importScripts,ENVIRONMENT_IS_NODE=\"object\"==typeof process&&\"object\"==typeof process.versions&&\"string\"==typeof process.versions.node,scriptDirectory=\"\",read_,readAsync,readBinary;function locateFile(e){return Module.locateFile?Module.locateFile(e,scriptDirectory):scriptDirectory+e}if(ENVIRONMENT_IS_NODE){var fs=require(\"fs\"),nodePath=require(\"path\");scriptDirectory=ENVIRONMENT_IS_WORKER?nodePath.dirname(scriptDirectory)+\"/\":__dirname+\"/\",read_=(e,t)=>(e=isFileURI(e)?new URL(e):nodePath.normalize(e),fs.readFileSync(e,t?void 0:\"utf8\")),readBinary=e=>{var t=read_(e,!0);return t.buffer||(t=new Uint8Array(t)),t},readAsync=(e,t,_,s=!0)=>{e=isFileURI(e)?new URL(e):nodePath.normalize(e),fs.readFile(e,s?void 0:\"utf8\",((e,r)=>{e?_(e):t(s?r.buffer:r)}))},!Module.thisProgram&&process.argv.length>1&&(thisProgram=process.argv[1].replace(/\\\\/g,\"/\")),arguments_=process.argv.slice(2),\"undefined\"!=typeof module&&(module.exports=Module),quit_=(e,t)=>{throw process.exitCode=e,t}}else(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER)&&(ENVIRONMENT_IS_WORKER?scriptDirectory=self.location.href:void 0!==document&&document.currentScript&&(scriptDirectory=document.currentScript.src),scriptDirectory=scriptDirectory.startsWith(\"blob:\")?\"\":scriptDirectory.substr(0,scriptDirectory.replace(/[?#].*/,\"\").lastIndexOf(\"/\")+1),read_=e=>{var t=new XMLHttpRequest;return t.open(\"GET\",e,!1),t.send(null),t.responseText},ENVIRONMENT_IS_WORKER&&(readBinary=e=>{var t=new XMLHttpRequest;return t.open(\"GET\",e,!1),t.responseType=\"arraybuffer\",t.send(null),new Uint8Array(t.response)}),readAsync=(e,t,_)=>{var s=new XMLHttpRequest;s.open(\"GET\",e,!0),s.responseType=\"arraybuffer\",s.onload=()=>{200==s.status||0==s.status&&s.response?t(s.response):_()},s.onerror=_,s.send(null)});var out=Module.print||console.log.bind(console),err=Module.printErr||console.error.bind(console);Object.assign(Module,moduleOverrides),moduleOverrides=null,Module.arguments&&(arguments_=Module.arguments),Module.thisProgram&&(thisProgram=Module.thisProgram),Module.quit&&(quit_=Module.quit);var dynamicLibraries=Module.dynamicLibraries||[],wasmBinary,wasmMemory;Module.wasmBinary&&(wasmBinary=Module.wasmBinary),\"object\"!=typeof WebAssembly&&abort(\"no native wasm support detected\");var ABORT=!1,EXITSTATUS,HEAP8,HEAPU8,HEAP16,HEAPU16,HEAP32,HEAPU32,HEAPF32,HEAPF64;function updateMemoryViews(){var e=wasmMemory.buffer;Module.HEAP8=HEAP8=new Int8Array(e),Module.HEAP16=HEAP16=new Int16Array(e),Module.HEAPU8=HEAPU8=new Uint8Array(e),Module.HEAPU16=HEAPU16=new Uint16Array(e),Module.HEAP32=HEAP32=new Int32Array(e),Module.HEAPU32=HEAPU32=new Uint32Array(e),Module.HEAPF32=HEAPF32=new Float32Array(e),Module.HEAPF64=HEAPF64=new Float64Array(e)}var INITIAL_MEMORY=Module.INITIAL_MEMORY||33554432;wasmMemory=Module.wasmMemory?Module.wasmMemory:new WebAssembly.Memory({initial:INITIAL_MEMORY/65536,maximum:32768}),updateMemoryViews(),INITIAL_MEMORY=wasmMemory.buffer.byteLength;var __ATPRERUN__=[],__ATINIT__=[],__ATMAIN__=[],__ATPOSTRUN__=[],__RELOC_FUNCS__=[],runtimeInitialized=!1;function preRun(){if(Module.preRun)for(\"function\"==typeof Module.preRun&&(Module.preRun=[Module.preRun]);Module.preRun.length;)addOnPreRun(Module.preRun.shift());callRuntimeCallbacks(__ATPRERUN__)}function initRuntime(){runtimeInitialized=!0,callRuntimeCallbacks(__RELOC_FUNCS__),callRuntimeCallbacks(__ATINIT__)}function preMain(){callRuntimeCallbacks(__ATMAIN__)}function postRun(){if(Module.postRun)for(\"function\"==typeof Module.postRun&&(Module.postRun=[Module.postRun]);Module.postRun.length;)addOnPostRun(Module.postRun.shift());callRuntimeCallbacks(__ATPOSTRUN__)}function addOnPreRun(e){__ATPRERUN__.unshift(e)}function addOnInit(e){__ATINIT__.unshift(e)}function addOnPostRun(e){__ATPOSTRUN__.unshift(e)}var runDependencies=0,runDependencyWatcher=null,dependenciesFulfilled=null;function getUniqueRunDependency(e){return e}function addRunDependency(e){runDependencies++,Module.monitorRunDependencies?.(runDependencies)}function removeRunDependency(e){if(runDependencies--,Module.monitorRunDependencies?.(runDependencies),0==runDependencies&&(null!==runDependencyWatcher&&(clearInterval(runDependencyWatcher),runDependencyWatcher=null),dependenciesFulfilled)){var t=dependenciesFulfilled;dependenciesFulfilled=null,t()}}function abort(e){throw Module.onAbort?.(e),err(e=\"Aborted(\"+e+\")\"),ABORT=!0,EXITSTATUS=1,e+=\". Build with -sASSERTIONS for more info.\",new WebAssembly.RuntimeError(e)}var dataURIPrefix=\"data:application/octet-stream;base64,\",isDataURI=e=>e.startsWith(dataURIPrefix),isFileURI=e=>e.startsWith(\"file://\"),wasmBinaryFile;function getBinarySync(e){if(e==wasmBinaryFile&&wasmBinary)return new Uint8Array(wasmBinary);if(readBinary)return readBinary(e);throw\"both async and sync fetching of the wasm failed\"}function getBinaryPromise(e){if(!wasmBinary&&(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER)){if(\"function\"==typeof fetch&&!isFileURI(e))return fetch(e,{credentials:\"same-origin\"}).then((t=>{if(!t.ok)throw`failed to load wasm binary file at '${e}'`;return t.arrayBuffer()})).catch((()=>getBinarySync(e)));if(readAsync)return new Promise(((t,_)=>{readAsync(e,(e=>t(new Uint8Array(e))),_)}))}return Promise.resolve().then((()=>getBinarySync(e)))}function instantiateArrayBuffer(e,t,_){return getBinaryPromise(e).then((e=>WebAssembly.instantiate(e,t))).then(_,(e=>{err(`failed to asynchronously prepare wasm: ${e}`),abort(e)}))}function instantiateAsync(e,t,_,s){return e||\"function\"!=typeof WebAssembly.instantiateStreaming||isDataURI(t)||isFileURI(t)||ENVIRONMENT_IS_NODE||\"function\"!=typeof fetch?instantiateArrayBuffer(t,_,s):fetch(t,{credentials:\"same-origin\"}).then((e=>WebAssembly.instantiateStreaming(e,_).then(s,(function(e){return err(`wasm streaming compile failed: ${e}`),err(\"falling back to ArrayBuffer instantiation\"),instantiateArrayBuffer(t,_,s)}))))}function createWasm(){var e={env:wasmImports,wasi_snapshot_preview1:wasmImports,\"GOT.mem\":new Proxy(wasmImports,GOTHandler),\"GOT.func\":new Proxy(wasmImports,GOTHandler)};function t(e,t){wasmExports=e.exports,wasmExports=relocateExports(wasmExports,1024);var _=getDylinkMetadata(t);return _.neededDynlibs&&(dynamicLibraries=_.neededDynlibs.concat(dynamicLibraries)),mergeLibSymbols(wasmExports,\"main\"),LDSO.init(),loadDylibs(),addOnInit(wasmExports.__wasm_call_ctors),__RELOC_FUNCS__.push(wasmExports.__wasm_apply_data_relocs),removeRunDependency(\"wasm-instantiate\"),wasmExports}if(addRunDependency(\"wasm-instantiate\"),Module.instantiateWasm)try{return Module.instantiateWasm(e,t)}catch(e){return err(`Module.instantiateWasm callback failed with error: ${e}`),!1}return instantiateAsync(wasmBinary,wasmBinaryFile,e,(function(e){t(e.instance,e.module)})),{}}wasmBinaryFile=\"tree-sitter.wasm\",isDataURI(wasmBinaryFile)||(wasmBinaryFile=locateFile(wasmBinaryFile));var ASM_CONSTS={};function ExitStatus(e){this.name=\"ExitStatus\",this.message=`Program terminated with exit(${e})`,this.status=e}var GOT={},currentModuleWeakSymbols=new Set([]),GOTHandler={get(e,t){var _=GOT[t];return _||(_=GOT[t]=new WebAssembly.Global({value:\"i32\",mutable:!0})),currentModuleWeakSymbols.has(t)||(_.required=!0),_}},callRuntimeCallbacks=e=>{for(;e.length>0;)e.shift()(Module)},UTF8Decoder=\"undefined\"!=typeof TextDecoder?new TextDecoder(\"utf8\"):void 0,UTF8ArrayToString=(e,t,_)=>{for(var s=t+_,r=t;e[r]&&!(r>=s);)++r;if(r-t>16&&e.buffer&&UTF8Decoder)return UTF8Decoder.decode(e.subarray(t,r));for(var a=\"\";t<r;){var o=e[t++];if(128&o){var n=63&e[t++];if(192!=(224&o)){var l=63&e[t++];if((o=224==(240&o)?(15&o)<<12|n<<6|l:(7&o)<<18|n<<12|l<<6|63&e[t++])<65536)a+=String.fromCharCode(o);else{var d=o-65536;a+=String.fromCharCode(55296|d>>10,56320|1023&d)}}else a+=String.fromCharCode((31&o)<<6|n)}else a+=String.fromCharCode(o)}return a},getDylinkMetadata=e=>{var t=0,_=0;function s(){for(var _=0,s=1;;){var r=e[t++];if(_+=(127&r)*s,s*=128,!(128&r))break}return _}function r(){var _=s();return UTF8ArrayToString(e,(t+=_)-_,_)}function a(e,t){if(e)throw new Error(t)}var o=\"dylink.0\";if(e instanceof WebAssembly.Module){var n=WebAssembly.Module.customSections(e,o);0===n.length&&(o=\"dylink\",n=WebAssembly.Module.customSections(e,o)),a(0===n.length,\"need dylink section\"),_=(e=new Uint8Array(n[0])).length}else{a(!(1836278016==new Uint32Array(new Uint8Array(e.subarray(0,24)).buffer)[0]),\"need to see wasm magic number\"),a(0!==e[8],\"need the dylink section to be first\"),t=9;var l=s();_=t+l,o=r()}var d={neededDynlibs:[],tlsExports:new Set,weakImports:new Set};if(\"dylink\"==o){d.memorySize=s(),d.memoryAlign=s(),d.tableSize=s(),d.tableAlign=s();for(var u=s(),m=0;m<u;++m){var c=r();d.neededDynlibs.push(c)}}else{a(\"dylink.0\"!==o);for(;t<_;){var w=e[t++],p=s();if(1===w)d.memorySize=s(),d.memoryAlign=s(),d.tableSize=s(),d.tableAlign=s();else if(2===w)for(u=s(),m=0;m<u;++m)c=r(),d.neededDynlibs.push(c);else if(3===w)for(var h=s();h--;){var g=r();256&s()&&d.tlsExports.add(g)}else if(4===w)for(h=s();h--;){r(),g=r();1==(3&s())&&d.weakImports.add(g)}else t+=p}}return d};function getValue(e,t=\"i8\"){switch(t.endsWith(\"*\")&&(t=\"*\"),t){case\"i1\":case\"i8\":return HEAP8[e];case\"i16\":return HEAP16[e>>1];case\"i32\":return HEAP32[e>>2];case\"i64\":abort(\"to do getValue(i64) use WASM_BIGINT\");case\"float\":return HEAPF32[e>>2];case\"double\":return HEAPF64[e>>3];case\"*\":return HEAPU32[e>>2];default:abort(`invalid type for getValue: ${t}`)}}var newDSO=(e,t,_)=>{var s={refcount:1/0,name:e,exports:_,global:!0};return LDSO.loadedLibsByName[e]=s,null!=t&&(LDSO.loadedLibsByHandle[t]=s),s},LDSO={loadedLibsByName:{},loadedLibsByHandle:{},init(){newDSO(\"__main__\",0,wasmImports)}},___heap_base=78096,zeroMemory=(e,t)=>(HEAPU8.fill(0,e,e+t),e),alignMemory=(e,t)=>Math.ceil(e/t)*t,getMemory=e=>{if(runtimeInitialized)return zeroMemory(_malloc(e),e);var t=___heap_base,_=t+alignMemory(e,16);return ___heap_base=_,GOT.__heap_base.value=_,t},isInternalSym=e=>[\"__cpp_exception\",\"__c_longjmp\",\"__wasm_apply_data_relocs\",\"__dso_handle\",\"__tls_size\",\"__tls_align\",\"__set_stack_limits\",\"_emscripten_tls_init\",\"__wasm_init_tls\",\"__wasm_call_ctors\",\"__start_em_asm\",\"__stop_em_asm\",\"__start_em_js\",\"__stop_em_js\"].includes(e)||e.startsWith(\"__em_js__\"),uleb128Encode=(e,t)=>{e<128?t.push(e):t.push(e%128|128,e>>7)},sigToWasmTypes=e=>{for(var t={i:\"i32\",j:\"i64\",f:\"f32\",d:\"f64\",e:\"externref\",p:\"i32\"},_={parameters:[],results:\"v\"==e[0]?[]:[t[e[0]]]},s=1;s<e.length;++s)_.parameters.push(t[e[s]]);return _},generateFuncType=(e,t)=>{var _=e.slice(0,1),s=e.slice(1),r={i:127,p:127,j:126,f:125,d:124,e:111};t.push(96),uleb128Encode(s.length,t);for(var a=0;a<s.length;++a)t.push(r[s[a]]);\"v\"==_?t.push(0):t.push(1,r[_])},convertJsFunctionToWasm=(e,t)=>{if(\"function\"==typeof WebAssembly.Function)return new WebAssembly.Function(sigToWasmTypes(t),e);var _=[1];generateFuncType(t,_);var s=[0,97,115,109,1,0,0,0,1];uleb128Encode(_.length,s),s.push(..._),s.push(2,7,1,1,101,1,102,0,0,7,5,1,1,102,0,0);var r=new WebAssembly.Module(new Uint8Array(s));return new WebAssembly.Instance(r,{e:{f:e}}).exports.f},wasmTableMirror=[],wasmTable=new WebAssembly.Table({initial:27,element:\"anyfunc\"}),getWasmTableEntry=e=>{var t=wasmTableMirror[e];return t||(e>=wasmTableMirror.length&&(wasmTableMirror.length=e+1),wasmTableMirror[e]=t=wasmTable.get(e)),t},updateTableMap=(e,t)=>{if(functionsInTableMap)for(var _=e;_<e+t;_++){var s=getWasmTableEntry(_);s&&functionsInTableMap.set(s,_)}},functionsInTableMap,getFunctionAddress=e=>(functionsInTableMap||(functionsInTableMap=new WeakMap,updateTableMap(0,wasmTable.length)),functionsInTableMap.get(e)||0),freeTableIndexes=[],getEmptyTableSlot=()=>{if(freeTableIndexes.length)return freeTableIndexes.pop();try{wasmTable.grow(1)}catch(e){if(!(e instanceof RangeError))throw e;throw\"Unable to grow wasm table. Set ALLOW_TABLE_GROWTH.\"}return wasmTable.length-1},setWasmTableEntry=(e,t)=>{wasmTable.set(e,t),wasmTableMirror[e]=wasmTable.get(e)},addFunction=(e,t)=>{var _=getFunctionAddress(e);if(_)return _;var s=getEmptyTableSlot();try{setWasmTableEntry(s,e)}catch(_){if(!(_ instanceof TypeError))throw _;var r=convertJsFunctionToWasm(e,t);setWasmTableEntry(s,r)}return functionsInTableMap.set(e,s),s},updateGOT=(e,t)=>{for(var _ in e)if(!isInternalSym(_)){var s=e[_];_.startsWith(\"orig$\")&&(_=_.split(\"$\")[1],t=!0),GOT[_]||=new WebAssembly.Global({value:\"i32\",mutable:!0}),(t||0==GOT[_].value)&&(\"function\"==typeof s?GOT[_].value=addFunction(s):\"number\"==typeof s?GOT[_].value=s:err(`unhandled export type for '${_}': ${typeof s}`))}},relocateExports=(e,t,_)=>{var s={};for(var r in e){var a=e[r];\"object\"==typeof a&&(a=a.value),\"number\"==typeof a&&(a+=t),s[r]=a}return updateGOT(s,_),s},isSymbolDefined=e=>{var t=wasmImports[e];return!(!t||t.stub)},dynCallLegacy=(e,t,_)=>(0,Module[\"dynCall_\"+e])(t,..._),dynCall=(e,t,_=[])=>e.includes(\"j\")?dynCallLegacy(e,t,_):getWasmTableEntry(t)(..._),createInvokeFunction=e=>function(){var t=stackSave();try{return dynCall(e,arguments[0],Array.prototype.slice.call(arguments,1))}catch(e){if(stackRestore(t),e!==e+0)throw e;_setThrew(1,0)}},resolveGlobalSymbol=(e,t=!1)=>{var _;return t&&\"orig$\"+e in wasmImports&&(e=\"orig$\"+e),isSymbolDefined(e)?_=wasmImports[e]:e.startsWith(\"invoke_\")&&(_=wasmImports[e]=createInvokeFunction(e.split(\"_\")[1])),{sym:_,name:e}},UTF8ToString=(e,t)=>e?UTF8ArrayToString(HEAPU8,e,t):\"\",loadWebAssemblyModule=(binary,flags,libName,localScope,handle)=>{var metadata=getDylinkMetadata(binary);function loadModule(){var firstLoad=!handle||!HEAP8[handle+8];if(firstLoad){var memAlign=Math.pow(2,metadata.memoryAlign),memoryBase=metadata.memorySize?alignMemory(getMemory(metadata.memorySize+memAlign),memAlign):0,tableBase=metadata.tableSize?wasmTable.length:0;handle&&(HEAP8[handle+8]=1,HEAPU32[handle+12>>2]=memoryBase,HEAP32[handle+16>>2]=metadata.memorySize,HEAPU32[handle+20>>2]=tableBase,HEAP32[handle+24>>2]=metadata.tableSize)}else memoryBase=HEAPU32[handle+12>>2],tableBase=HEAPU32[handle+20>>2];var tableGrowthNeeded=tableBase+metadata.tableSize-wasmTable.length,moduleExports;function resolveSymbol(e){var t=resolveGlobalSymbol(e).sym;return!t&&localScope&&(t=localScope[e]),t||(t=moduleExports[e]),t}tableGrowthNeeded>0&&wasmTable.grow(tableGrowthNeeded);var proxyHandler={get(e,t){switch(t){case\"__memory_base\":return memoryBase;case\"__table_base\":return tableBase}if(t in wasmImports&&!wasmImports[t].stub)return wasmImports[t];var _;t in e||(e[t]=(...e)=>(_||=resolveSymbol(t),_(...e)));return e[t]}},proxy=new Proxy({},proxyHandler),info={\"GOT.mem\":new Proxy({},GOTHandler),\"GOT.func\":new Proxy({},GOTHandler),env:proxy,wasi_snapshot_preview1:proxy};function postInstantiation(module,instance){function addEmAsm(addr,body){for(var args=[],arity=0;arity<16&&-1!=body.indexOf(\"$\"+arity);arity++)args.push(\"$\"+arity);args=args.join(\",\");var func=`(${args}) => { ${body} };`;ASM_CONSTS[start]=eval(func)}if(updateTableMap(tableBase,metadata.tableSize),moduleExports=relocateExports(instance.exports,memoryBase),flags.allowUndefined||reportUndefinedSymbols(),\"__start_em_asm\"in moduleExports)for(var start=moduleExports.__start_em_asm,stop=moduleExports.__stop_em_asm;start<stop;){var jsString=UTF8ToString(start);addEmAsm(start,jsString),start=HEAPU8.indexOf(0,start)+1}function addEmJs(name,cSig,body){var jsArgs=[];if(cSig=cSig.slice(1,-1),\"void\"!=cSig)for(var i in cSig=cSig.split(\",\"),cSig){var jsArg=cSig[i].split(\" \").pop();jsArgs.push(jsArg.replace(\"*\",\"\"))}var func=`(${jsArgs}) => ${body};`;moduleExports[name]=eval(func)}for(var name in moduleExports)if(name.startsWith(\"__em_js__\")){var start=moduleExports[name],jsString=UTF8ToString(start),parts=jsString.split(\"<::>\");addEmJs(name.replace(\"__em_js__\",\"\"),parts[0],parts[1]),delete moduleExports[name]}var applyRelocs=moduleExports.__wasm_apply_data_relocs;applyRelocs&&(runtimeInitialized?applyRelocs():__RELOC_FUNCS__.push(applyRelocs));var init=moduleExports.__wasm_call_ctors;return init&&(runtimeInitialized?init():__ATINIT__.push(init)),moduleExports}if(flags.loadAsync){if(binary instanceof WebAssembly.Module){var instance=new WebAssembly.Instance(binary,info);return Promise.resolve(postInstantiation(binary,instance))}return WebAssembly.instantiate(binary,info).then((e=>postInstantiation(e.module,e.instance)))}var module=binary instanceof WebAssembly.Module?binary:new WebAssembly.Module(binary),instance=new WebAssembly.Instance(module,info);return postInstantiation(module,instance)}return currentModuleWeakSymbols=metadata.weakImports,flags.loadAsync?metadata.neededDynlibs.reduce(((e,t)=>e.then((()=>loadDynamicLibrary(t,flags)))),Promise.resolve()).then(loadModule):(metadata.neededDynlibs.forEach((e=>loadDynamicLibrary(e,flags,localScope))),loadModule())},mergeLibSymbols=(e,t)=>{for(var[_,s]of Object.entries(e)){const e=e=>{isSymbolDefined(e)||(wasmImports[e]=s)};e(_);const t=\"__main_argc_argv\";\"main\"==_&&e(t),_==t&&e(\"main\"),_.startsWith(\"dynCall_\")&&!Module.hasOwnProperty(_)&&(Module[_]=s)}},asyncLoad=(e,t,_,s)=>{var r=s?\"\":getUniqueRunDependency(`al ${e}`);readAsync(e,(e=>{t(new Uint8Array(e)),r&&removeRunDependency(r)}),(t=>{if(!_)throw`Loading data file \"${e}\" failed.`;_()})),r&&addRunDependency(r)};function loadDynamicLibrary(e,t={global:!0,nodelete:!0},_,s){var r=LDSO.loadedLibsByName[e];if(r)return t.global?r.global||(r.global=!0,mergeLibSymbols(r.exports,e)):_&&Object.assign(_,r.exports),t.nodelete&&r.refcount!==1/0&&(r.refcount=1/0),r.refcount++,s&&(LDSO.loadedLibsByHandle[s]=r),!t.loadAsync||Promise.resolve(!0);function a(){if(s){var _=HEAPU32[s+28>>2],r=HEAPU32[s+32>>2];if(_&&r){var a=HEAP8.slice(_,_+r);return t.loadAsync?Promise.resolve(a):a}}var o=locateFile(e);if(t.loadAsync)return new Promise((function(e,t){asyncLoad(o,e,t)}));if(!readBinary)throw new Error(`${o}: file not found, and synchronous loading of external files is not available`);return readBinary(o)}function o(){return t.loadAsync?a().then((r=>loadWebAssemblyModule(r,t,e,_,s))):loadWebAssemblyModule(a(),t,e,_,s)}function n(t){r.global?mergeLibSymbols(t,e):_&&Object.assign(_,t),r.exports=t}return(r=newDSO(e,s,\"loading\")).refcount=t.nodelete?1/0:1,r.global=t.global,t.loadAsync?o().then((e=>(n(e),!0))):(n(o()),!0)}var reportUndefinedSymbols=()=>{for(var[e,t]of Object.entries(GOT))if(0==t.value){var _=resolveGlobalSymbol(e,!0).sym;if(!_&&!t.required)continue;if(\"function\"==typeof _)t.value=addFunction(_,_.sig);else{if(\"number\"!=typeof _)throw new Error(`bad export type for '${e}': ${typeof _}`);t.value=_}}},loadDylibs=()=>{dynamicLibraries.length?(addRunDependency(\"loadDylibs\"),dynamicLibraries.reduce(((e,t)=>e.then((()=>loadDynamicLibrary(t,{loadAsync:!0,global:!0,nodelete:!0,allowUndefined:!0})))),Promise.resolve()).then((()=>{reportUndefinedSymbols(),removeRunDependency(\"loadDylibs\")}))):reportUndefinedSymbols()},noExitRuntime=Module.noExitRuntime||!0;function setValue(e,t,_=\"i8\"){switch(_.endsWith(\"*\")&&(_=\"*\"),_){case\"i1\":case\"i8\":HEAP8[e]=t;break;case\"i16\":HEAP16[e>>1]=t;break;case\"i32\":HEAP32[e>>2]=t;break;case\"i64\":abort(\"to do setValue(i64) use WASM_BIGINT\");case\"float\":HEAPF32[e>>2]=t;break;case\"double\":HEAPF64[e>>3]=t;break;case\"*\":HEAPU32[e>>2]=t;break;default:abort(`invalid type for setValue: ${_}`)}}var ___memory_base=new WebAssembly.Global({value:\"i32\",mutable:!1},1024),___stack_pointer=new WebAssembly.Global({value:\"i32\",mutable:!0},78096),___table_base=new WebAssembly.Global({value:\"i32\",mutable:!1},1),nowIsMonotonic=1,__emscripten_get_now_is_monotonic=()=>nowIsMonotonic;__emscripten_get_now_is_monotonic.sig=\"i\";var _abort=()=>{abort(\"\")};_abort.sig=\"v\";var _emscripten_date_now=()=>Date.now(),_emscripten_get_now;_emscripten_date_now.sig=\"d\",_emscripten_get_now=()=>performance.now(),_emscripten_get_now.sig=\"d\";var _emscripten_memcpy_js=(e,t,_)=>HEAPU8.copyWithin(e,t,t+_);_emscripten_memcpy_js.sig=\"vppp\";var getHeapMax=()=>2147483648,growMemory=e=>{var t=(e-wasmMemory.buffer.byteLength+65535)/65536;try{return wasmMemory.grow(t),updateMemoryViews(),1}catch(e){}},_emscripten_resize_heap=e=>{var t=HEAPU8.length;e>>>=0;var _=getHeapMax();if(e>_)return!1;for(var s,r,a=1;a<=4;a*=2){var o=t*(1+.2/a);o=Math.min(o,e+100663296);var n=Math.min(_,(s=Math.max(e,o))+((r=65536)-s%r)%r);if(growMemory(n))return!0}return!1};_emscripten_resize_heap.sig=\"ip\";var _fd_close=e=>52;_fd_close.sig=\"ii\";var convertI32PairToI53Checked=(e,t)=>t+2097152>>>0<4194305-!!e?(e>>>0)+4294967296*t:NaN;function _fd_seek(e,t,_,s,r){convertI32PairToI53Checked(t,_);return 70}_fd_seek.sig=\"iiiiip\";var printCharBuffers=[null,[],[]],printChar=(e,t)=>{var _=printCharBuffers[e];0===t||10===t?((1===e?out:err)(UTF8ArrayToString(_,0)),_.length=0):_.push(t)},SYSCALLS={varargs:void 0,get(){var e=HEAP32[+SYSCALLS.varargs>>2];return SYSCALLS.varargs+=4,e},getp:()=>SYSCALLS.get(),getStr:e=>UTF8ToString(e)},_fd_write=(e,t,_,s)=>{for(var r=0,a=0;a<_;a++){var o=HEAPU32[t>>2],n=HEAPU32[t+4>>2];t+=8;for(var l=0;l<n;l++)printChar(e,HEAPU8[o+l]);r+=n}return HEAPU32[s>>2]=r,0};function _tree_sitter_log_callback(e,t){if(currentLogCallback){const _=UTF8ToString(t);currentLogCallback(_,0!==e)}}function _tree_sitter_parse_callback(e,t,_,s,r){const a=currentParseCallback(t,{row:_,column:s});\"string\"==typeof a?(setValue(r,a.length,\"i32\"),stringToUTF16(a,e,10240)):setValue(r,0,\"i32\")}_fd_write.sig=\"iippp\";var runtimeKeepaliveCounter=0,keepRuntimeAlive=()=>noExitRuntime||runtimeKeepaliveCounter>0,_proc_exit=e=>{EXITSTATUS=e,keepRuntimeAlive()||(Module.onExit?.(e),ABORT=!0),quit_(e,new ExitStatus(e))};_proc_exit.sig=\"vi\";var exitJS=(e,t)=>{EXITSTATUS=e,_proc_exit(e)},handleException=e=>{if(e instanceof ExitStatus||\"unwind\"==e)return EXITSTATUS;quit_(1,e)},lengthBytesUTF8=e=>{for(var t=0,_=0;_<e.length;++_){var s=e.charCodeAt(_);s<=127?t++:s<=2047?t+=2:s>=55296&&s<=57343?(t+=4,++_):t+=3}return t},stringToUTF8Array=(e,t,_,s)=>{if(!(s>0))return 0;for(var r=_,a=_+s-1,o=0;o<e.length;++o){var n=e.charCodeAt(o);if(n>=55296&&n<=57343)n=65536+((1023&n)<<10)|1023&e.charCodeAt(++o);if(n<=127){if(_>=a)break;t[_++]=n}else if(n<=2047){if(_+1>=a)break;t[_++]=192|n>>6,t[_++]=128|63&n}else if(n<=65535){if(_+2>=a)break;t[_++]=224|n>>12,t[_++]=128|n>>6&63,t[_++]=128|63&n}else{if(_+3>=a)break;t[_++]=240|n>>18,t[_++]=128|n>>12&63,t[_++]=128|n>>6&63,t[_++]=128|63&n}}return t[_]=0,_-r},stringToUTF8=(e,t,_)=>stringToUTF8Array(e,HEAPU8,t,_),stringToUTF8OnStack=e=>{var t=lengthBytesUTF8(e)+1,_=stackAlloc(t);return stringToUTF8(e,_,t),_},stringToUTF16=(e,t,_)=>{if(_??=2147483647,_<2)return 0;for(var s=t,r=(_-=2)<2*e.length?_/2:e.length,a=0;a<r;++a){var o=e.charCodeAt(a);HEAP16[t>>1]=o,t+=2}return HEAP16[t>>1]=0,t-s},AsciiToString=e=>{for(var t=\"\";;){var _=HEAPU8[e++];if(!_)return t;t+=String.fromCharCode(_)}},wasmImports={__heap_base:___heap_base,__indirect_function_table:wasmTable,__memory_base:___memory_base,__stack_pointer:___stack_pointer,__table_base:___table_base,_emscripten_get_now_is_monotonic:__emscripten_get_now_is_monotonic,abort:_abort,emscripten_get_now:_emscripten_get_now,emscripten_memcpy_js:_emscripten_memcpy_js,emscripten_resize_heap:_emscripten_resize_heap,fd_close:_fd_close,fd_seek:_fd_seek,fd_write:_fd_write,memory:wasmMemory,tree_sitter_log_callback:_tree_sitter_log_callback,tree_sitter_parse_callback:_tree_sitter_parse_callback},wasmExports=createWasm(),___wasm_call_ctors=()=>(___wasm_call_ctors=wasmExports.__wasm_call_ctors)(),___wasm_apply_data_relocs=()=>(___wasm_apply_data_relocs=wasmExports.__wasm_apply_data_relocs)(),_malloc=Module._malloc=e=>(_malloc=Module._malloc=wasmExports.malloc)(e),_calloc=Module._calloc=(e,t)=>(_calloc=Module._calloc=wasmExports.calloc)(e,t),_realloc=Module._realloc=(e,t)=>(_realloc=Module._realloc=wasmExports.realloc)(e,t),_free=Module._free=e=>(_free=Module._free=wasmExports.free)(e),_ts_language_symbol_count=Module._ts_language_symbol_count=e=>(_ts_language_symbol_count=Module._ts_language_symbol_count=wasmExports.ts_language_symbol_count)(e),_ts_language_state_count=Module._ts_language_state_count=e=>(_ts_language_state_count=Module._ts_language_state_count=wasmExports.ts_language_state_count)(e),_ts_language_version=Module._ts_language_version=e=>(_ts_language_version=Module._ts_language_version=wasmExports.ts_language_version)(e),_ts_language_field_count=Module._ts_language_field_count=e=>(_ts_language_field_count=Module._ts_language_field_count=wasmExports.ts_language_field_count)(e),_ts_language_next_state=Module._ts_language_next_state=(e,t,_)=>(_ts_language_next_state=Module._ts_language_next_state=wasmExports.ts_language_next_state)(e,t,_),_ts_language_symbol_name=Module._ts_language_symbol_name=(e,t)=>(_ts_language_symbol_name=Module._ts_language_symbol_name=wasmExports.ts_language_symbol_name)(e,t),_ts_language_symbol_for_name=Module._ts_language_symbol_for_name=(e,t,_,s)=>(_ts_language_symbol_for_name=Module._ts_language_symbol_for_name=wasmExports.ts_language_symbol_for_name)(e,t,_,s),_strncmp=Module._strncmp=(e,t,_)=>(_strncmp=Module._strncmp=wasmExports.strncmp)(e,t,_),_ts_language_symbol_type=Module._ts_language_symbol_type=(e,t)=>(_ts_language_symbol_type=Module._ts_language_symbol_type=wasmExports.ts_language_symbol_type)(e,t),_ts_language_field_name_for_id=Module._ts_language_field_name_for_id=(e,t)=>(_ts_language_field_name_for_id=Module._ts_language_field_name_for_id=wasmExports.ts_language_field_name_for_id)(e,t),_ts_lookahead_iterator_new=Module._ts_lookahead_iterator_new=(e,t)=>(_ts_lookahead_iterator_new=Module._ts_lookahead_iterator_new=wasmExports.ts_lookahead_iterator_new)(e,t),_ts_lookahead_iterator_delete=Module._ts_lookahead_iterator_delete=e=>(_ts_lookahead_iterator_delete=Module._ts_lookahead_iterator_delete=wasmExports.ts_lookahead_iterator_delete)(e),_ts_lookahead_iterator_reset_state=Module._ts_lookahead_iterator_reset_state=(e,t)=>(_ts_lookahead_iterator_reset_state=Module._ts_lookahead_iterator_reset_state=wasmExports.ts_lookahead_iterator_reset_state)(e,t),_ts_lookahead_iterator_reset=Module._ts_lookahead_iterator_reset=(e,t,_)=>(_ts_lookahead_iterator_reset=Module._ts_lookahead_iterator_reset=wasmExports.ts_lookahead_iterator_reset)(e,t,_),_ts_lookahead_iterator_next=Module._ts_lookahead_iterator_next=e=>(_ts_lookahead_iterator_next=Module._ts_lookahead_iterator_next=wasmExports.ts_lookahead_iterator_next)(e),_ts_lookahead_iterator_current_symbol=Module._ts_lookahead_iterator_current_symbol=e=>(_ts_lookahead_iterator_current_symbol=Module._ts_lookahead_iterator_current_symbol=wasmExports.ts_lookahead_iterator_current_symbol)(e),_memset=Module._memset=(e,t,_)=>(_memset=Module._memset=wasmExports.memset)(e,t,_),_memcpy=Module._memcpy=(e,t,_)=>(_memcpy=Module._memcpy=wasmExports.memcpy)(e,t,_),_ts_parser_delete=Module._ts_parser_delete=e=>(_ts_parser_delete=Module._ts_parser_delete=wasmExports.ts_parser_delete)(e),_ts_parser_reset=Module._ts_parser_reset=e=>(_ts_parser_reset=Module._ts_parser_reset=wasmExports.ts_parser_reset)(e),_ts_parser_set_language=Module._ts_parser_set_language=(e,t)=>(_ts_parser_set_language=Module._ts_parser_set_language=wasmExports.ts_parser_set_language)(e,t),_ts_parser_timeout_micros=Module._ts_parser_timeout_micros=e=>(_ts_parser_timeout_micros=Module._ts_parser_timeout_micros=wasmExports.ts_parser_timeout_micros)(e),_ts_parser_set_timeout_micros=Module._ts_parser_set_timeout_micros=(e,t,_)=>(_ts_parser_set_timeout_micros=Module._ts_parser_set_timeout_micros=wasmExports.ts_parser_set_timeout_micros)(e,t,_),_ts_parser_set_included_ranges=Module._ts_parser_set_included_ranges=(e,t,_)=>(_ts_parser_set_included_ranges=Module._ts_parser_set_included_ranges=wasmExports.ts_parser_set_included_ranges)(e,t,_),_memmove=Module._memmove=(e,t,_)=>(_memmove=Module._memmove=wasmExports.memmove)(e,t,_),_memcmp=Module._memcmp=(e,t,_)=>(_memcmp=Module._memcmp=wasmExports.memcmp)(e,t,_),_ts_query_new=Module._ts_query_new=(e,t,_,s,r)=>(_ts_query_new=Module._ts_query_new=wasmExports.ts_query_new)(e,t,_,s,r),_ts_query_delete=Module._ts_query_delete=e=>(_ts_query_delete=Module._ts_query_delete=wasmExports.ts_query_delete)(e),_iswspace=Module._iswspace=e=>(_iswspace=Module._iswspace=wasmExports.iswspace)(e),_iswalnum=Module._iswalnum=e=>(_iswalnum=Module._iswalnum=wasmExports.iswalnum)(e),_ts_query_pattern_count=Module._ts_query_pattern_count=e=>(_ts_query_pattern_count=Module._ts_query_pattern_count=wasmExports.ts_query_pattern_count)(e),_ts_query_capture_count=Module._ts_query_capture_count=e=>(_ts_query_capture_count=Module._ts_query_capture_count=wasmExports.ts_query_capture_count)(e),_ts_query_string_count=Module._ts_query_string_count=e=>(_ts_query_string_count=Module._ts_query_string_count=wasmExports.ts_query_string_count)(e),_ts_query_capture_name_for_id=Module._ts_query_capture_name_for_id=(e,t,_)=>(_ts_query_capture_name_for_id=Module._ts_query_capture_name_for_id=wasmExports.ts_query_capture_name_for_id)(e,t,_),_ts_query_string_value_for_id=Module._ts_query_string_value_for_id=(e,t,_)=>(_ts_query_string_value_for_id=Module._ts_query_string_value_for_id=wasmExports.ts_query_string_value_for_id)(e,t,_),_ts_query_predicates_for_pattern=Module._ts_query_predicates_for_pattern=(e,t,_)=>(_ts_query_predicates_for_pattern=Module._ts_query_predicates_for_pattern=wasmExports.ts_query_predicates_for_pattern)(e,t,_),_ts_query_disable_capture=Module._ts_query_disable_capture=(e,t,_)=>(_ts_query_disable_capture=Module._ts_query_disable_capture=wasmExports.ts_query_disable_capture)(e,t,_),_ts_tree_copy=Module._ts_tree_copy=e=>(_ts_tree_copy=Module._ts_tree_copy=wasmExports.ts_tree_copy)(e),_ts_tree_delete=Module._ts_tree_delete=e=>(_ts_tree_delete=Module._ts_tree_delete=wasmExports.ts_tree_delete)(e),_ts_init=Module._ts_init=()=>(_ts_init=Module._ts_init=wasmExports.ts_init)(),_ts_parser_new_wasm=Module._ts_parser_new_wasm=()=>(_ts_parser_new_wasm=Module._ts_parser_new_wasm=wasmExports.ts_parser_new_wasm)(),_ts_parser_enable_logger_wasm=Module._ts_parser_enable_logger_wasm=(e,t)=>(_ts_parser_enable_logger_wasm=Module._ts_parser_enable_logger_wasm=wasmExports.ts_parser_enable_logger_wasm)(e,t),_ts_parser_parse_wasm=Module._ts_parser_parse_wasm=(e,t,_,s,r)=>(_ts_parser_parse_wasm=Module._ts_parser_parse_wasm=wasmExports.ts_parser_parse_wasm)(e,t,_,s,r),_ts_parser_included_ranges_wasm=Module._ts_parser_included_ranges_wasm=e=>(_ts_parser_included_ranges_wasm=Module._ts_parser_included_ranges_wasm=wasmExports.ts_parser_included_ranges_wasm)(e),_ts_language_type_is_named_wasm=Module._ts_language_type_is_named_wasm=(e,t)=>(_ts_language_type_is_named_wasm=Module._ts_language_type_is_named_wasm=wasmExports.ts_language_type_is_named_wasm)(e,t),_ts_language_type_is_visible_wasm=Module._ts_language_type_is_visible_wasm=(e,t)=>(_ts_language_type_is_visible_wasm=Module._ts_language_type_is_visible_wasm=wasmExports.ts_language_type_is_visible_wasm)(e,t),_ts_tree_root_node_wasm=Module._ts_tree_root_node_wasm=e=>(_ts_tree_root_node_wasm=Module._ts_tree_root_node_wasm=wasmExports.ts_tree_root_node_wasm)(e),_ts_tree_root_node_with_offset_wasm=Module._ts_tree_root_node_with_offset_wasm=e=>(_ts_tree_root_node_with_offset_wasm=Module._ts_tree_root_node_with_offset_wasm=wasmExports.ts_tree_root_node_with_offset_wasm)(e),_ts_tree_edit_wasm=Module._ts_tree_edit_wasm=e=>(_ts_tree_edit_wasm=Module._ts_tree_edit_wasm=wasmExports.ts_tree_edit_wasm)(e),_ts_tree_included_ranges_wasm=Module._ts_tree_included_ranges_wasm=e=>(_ts_tree_included_ranges_wasm=Module._ts_tree_included_ranges_wasm=wasmExports.ts_tree_included_ranges_wasm)(e),_ts_tree_get_changed_ranges_wasm=Module._ts_tree_get_changed_ranges_wasm=(e,t)=>(_ts_tree_get_changed_ranges_wasm=Module._ts_tree_get_changed_ranges_wasm=wasmExports.ts_tree_get_changed_ranges_wasm)(e,t),_ts_tree_cursor_new_wasm=Module._ts_tree_cursor_new_wasm=e=>(_ts_tree_cursor_new_wasm=Module._ts_tree_cursor_new_wasm=wasmExports.ts_tree_cursor_new_wasm)(e),_ts_tree_cursor_delete_wasm=Module._ts_tree_cursor_delete_wasm=e=>(_ts_tree_cursor_delete_wasm=Module._ts_tree_cursor_delete_wasm=wasmExports.ts_tree_cursor_delete_wasm)(e),_ts_tree_cursor_reset_wasm=Module._ts_tree_cursor_reset_wasm=e=>(_ts_tree_cursor_reset_wasm=Module._ts_tree_cursor_reset_wasm=wasmExports.ts_tree_cursor_reset_wasm)(e),_ts_tree_cursor_reset_to_wasm=Module._ts_tree_cursor_reset_to_wasm=(e,t)=>(_ts_tree_cursor_reset_to_wasm=Module._ts_tree_cursor_reset_to_wasm=wasmExports.ts_tree_cursor_reset_to_wasm)(e,t),_ts_tree_cursor_goto_first_child_wasm=Module._ts_tree_cursor_goto_first_child_wasm=e=>(_ts_tree_cursor_goto_first_child_wasm=Module._ts_tree_cursor_goto_first_child_wasm=wasmExports.ts_tree_cursor_goto_first_child_wasm)(e),_ts_tree_cursor_goto_last_child_wasm=Module._ts_tree_cursor_goto_last_child_wasm=e=>(_ts_tree_cursor_goto_last_child_wasm=Module._ts_tree_cursor_goto_last_child_wasm=wasmExports.ts_tree_cursor_goto_last_child_wasm)(e),_ts_tree_cursor_goto_first_child_for_index_wasm=Module._ts_tree_cursor_goto_first_child_for_index_wasm=e=>(_ts_tree_cursor_goto_first_child_for_index_wasm=Module._ts_tree_cursor_goto_first_child_for_index_wasm=wasmExports.ts_tree_cursor_goto_first_child_for_index_wasm)(e),_ts_tree_cursor_goto_first_child_for_position_wasm=Module._ts_tree_cursor_goto_first_child_for_position_wasm=e=>(_ts_tree_cursor_goto_first_child_for_position_wasm=Module._ts_tree_cursor_goto_first_child_for_position_wasm=wasmExports.ts_tree_cursor_goto_first_child_for_position_wasm)(e),_ts_tree_cursor_goto_next_sibling_wasm=Module._ts_tree_cursor_goto_next_sibling_wasm=e=>(_ts_tree_cursor_goto_next_sibling_wasm=Module._ts_tree_cursor_goto_next_sibling_wasm=wasmExports.ts_tree_cursor_goto_next_sibling_wasm)(e),_ts_tree_cursor_goto_previous_sibling_wasm=Module._ts_tree_cursor_goto_previous_sibling_wasm=e=>(_ts_tree_cursor_goto_previous_sibling_wasm=Module._ts_tree_cursor_goto_previous_sibling_wasm=wasmExports.ts_tree_cursor_goto_previous_sibling_wasm)(e),_ts_tree_cursor_goto_descendant_wasm=Module._ts_tree_cursor_goto_descendant_wasm=(e,t)=>(_ts_tree_cursor_goto_descendant_wasm=Module._ts_tree_cursor_goto_descendant_wasm=wasmExports.ts_tree_cursor_goto_descendant_wasm)(e,t),_ts_tree_cursor_goto_parent_wasm=Module._ts_tree_cursor_goto_parent_wasm=e=>(_ts_tree_cursor_goto_parent_wasm=Module._ts_tree_cursor_goto_parent_wasm=wasmExports.ts_tree_cursor_goto_parent_wasm)(e),_ts_tree_cursor_current_node_type_id_wasm=Module._ts_tree_cursor_current_node_type_id_wasm=e=>(_ts_tree_cursor_current_node_type_id_wasm=Module._ts_tree_cursor_current_node_type_id_wasm=wasmExports.ts_tree_cursor_current_node_type_id_wasm)(e),_ts_tree_cursor_current_node_state_id_wasm=Module._ts_tree_cursor_current_node_state_id_wasm=e=>(_ts_tree_cursor_current_node_state_id_wasm=Module._ts_tree_cursor_current_node_state_id_wasm=wasmExports.ts_tree_cursor_current_node_state_id_wasm)(e),_ts_tree_cursor_current_node_is_named_wasm=Module._ts_tree_cursor_current_node_is_named_wasm=e=>(_ts_tree_cursor_current_node_is_named_wasm=Module._ts_tree_cursor_current_node_is_named_wasm=wasmExports.ts_tree_cursor_current_node_is_named_wasm)(e),_ts_tree_cursor_current_node_is_missing_wasm=Module._ts_tree_cursor_current_node_is_missing_wasm=e=>(_ts_tree_cursor_current_node_is_missing_wasm=Module._ts_tree_cursor_current_node_is_missing_wasm=wasmExports.ts_tree_cursor_current_node_is_missing_wasm)(e),_ts_tree_cursor_current_node_id_wasm=Module._ts_tree_cursor_current_node_id_wasm=e=>(_ts_tree_cursor_current_node_id_wasm=Module._ts_tree_cursor_current_node_id_wasm=wasmExports.ts_tree_cursor_current_node_id_wasm)(e),_ts_tree_cursor_start_position_wasm=Module._ts_tree_cursor_start_position_wasm=e=>(_ts_tree_cursor_start_position_wasm=Module._ts_tree_cursor_start_position_wasm=wasmExports.ts_tree_cursor_start_position_wasm)(e),_ts_tree_cursor_end_position_wasm=Module._ts_tree_cursor_end_position_wasm=e=>(_ts_tree_cursor_end_position_wasm=Module._ts_tree_cursor_end_position_wasm=wasmExports.ts_tree_cursor_end_position_wasm)(e),_ts_tree_cursor_start_index_wasm=Module._ts_tree_cursor_start_index_wasm=e=>(_ts_tree_cursor_start_index_wasm=Module._ts_tree_cursor_start_index_wasm=wasmExports.ts_tree_cursor_start_index_wasm)(e),_ts_tree_cursor_end_index_wasm=Module._ts_tree_cursor_end_index_wasm=e=>(_ts_tree_cursor_end_index_wasm=Module._ts_tree_cursor_end_index_wasm=wasmExports.ts_tree_cursor_end_index_wasm)(e),_ts_tree_cursor_current_field_id_wasm=Module._ts_tree_cursor_current_field_id_wasm=e=>(_ts_tree_cursor_current_field_id_wasm=Module._ts_tree_cursor_current_field_id_wasm=wasmExports.ts_tree_cursor_current_field_id_wasm)(e),_ts_tree_cursor_current_depth_wasm=Module._ts_tree_cursor_current_depth_wasm=e=>(_ts_tree_cursor_current_depth_wasm=Module._ts_tree_cursor_current_depth_wasm=wasmExports.ts_tree_cursor_current_depth_wasm)(e),_ts_tree_cursor_current_descendant_index_wasm=Module._ts_tree_cursor_current_descendant_index_wasm=e=>(_ts_tree_cursor_current_descendant_index_wasm=Module._ts_tree_cursor_current_descendant_index_wasm=wasmExports.ts_tree_cursor_current_descendant_index_wasm)(e),_ts_tree_cursor_current_node_wasm=Module._ts_tree_cursor_current_node_wasm=e=>(_ts_tree_cursor_current_node_wasm=Module._ts_tree_cursor_current_node_wasm=wasmExports.ts_tree_cursor_current_node_wasm)(e),_ts_node_symbol_wasm=Module._ts_node_symbol_wasm=e=>(_ts_node_symbol_wasm=Module._ts_node_symbol_wasm=wasmExports.ts_node_symbol_wasm)(e),_ts_node_field_name_for_child_wasm=Module._ts_node_field_name_for_child_wasm=(e,t)=>(_ts_node_field_name_for_child_wasm=Module._ts_node_field_name_for_child_wasm=wasmExports.ts_node_field_name_for_child_wasm)(e,t),_ts_node_children_by_field_id_wasm=Module._ts_node_children_by_field_id_wasm=(e,t)=>(_ts_node_children_by_field_id_wasm=Module._ts_node_children_by_field_id_wasm=wasmExports.ts_node_children_by_field_id_wasm)(e,t),_ts_node_first_child_for_byte_wasm=Module._ts_node_first_child_for_byte_wasm=e=>(_ts_node_first_child_for_byte_wasm=Module._ts_node_first_child_for_byte_wasm=wasmExports.ts_node_first_child_for_byte_wasm)(e),_ts_node_first_named_child_for_byte_wasm=Module._ts_node_first_named_child_for_byte_wasm=e=>(_ts_node_first_named_child_for_byte_wasm=Module._ts_node_first_named_child_for_byte_wasm=wasmExports.ts_node_first_named_child_for_byte_wasm)(e),_ts_node_grammar_symbol_wasm=Module._ts_node_grammar_symbol_wasm=e=>(_ts_node_grammar_symbol_wasm=Module._ts_node_grammar_symbol_wasm=wasmExports.ts_node_grammar_symbol_wasm)(e),_ts_node_child_count_wasm=Module._ts_node_child_count_wasm=e=>(_ts_node_child_count_wasm=Module._ts_node_child_count_wasm=wasmExports.ts_node_child_count_wasm)(e),_ts_node_named_child_count_wasm=Module._ts_node_named_child_count_wasm=e=>(_ts_node_named_child_count_wasm=Module._ts_node_named_child_count_wasm=wasmExports.ts_node_named_child_count_wasm)(e),_ts_node_child_wasm=Module._ts_node_child_wasm=(e,t)=>(_ts_node_child_wasm=Module._ts_node_child_wasm=wasmExports.ts_node_child_wasm)(e,t),_ts_node_named_child_wasm=Module._ts_node_named_child_wasm=(e,t)=>(_ts_node_named_child_wasm=Module._ts_node_named_child_wasm=wasmExports.ts_node_named_child_wasm)(e,t),_ts_node_child_by_field_id_wasm=Module._ts_node_child_by_field_id_wasm=(e,t)=>(_ts_node_child_by_field_id_wasm=Module._ts_node_child_by_field_id_wasm=wasmExports.ts_node_child_by_field_id_wasm)(e,t),_ts_node_next_sibling_wasm=Module._ts_node_next_sibling_wasm=e=>(_ts_node_next_sibling_wasm=Module._ts_node_next_sibling_wasm=wasmExports.ts_node_next_sibling_wasm)(e),_ts_node_prev_sibling_wasm=Module._ts_node_prev_sibling_wasm=e=>(_ts_node_prev_sibling_wasm=Module._ts_node_prev_sibling_wasm=wasmExports.ts_node_prev_sibling_wasm)(e),_ts_node_next_named_sibling_wasm=Module._ts_node_next_named_sibling_wasm=e=>(_ts_node_next_named_sibling_wasm=Module._ts_node_next_named_sibling_wasm=wasmExports.ts_node_next_named_sibling_wasm)(e),_ts_node_prev_named_sibling_wasm=Module._ts_node_prev_named_sibling_wasm=e=>(_ts_node_prev_named_sibling_wasm=Module._ts_node_prev_named_sibling_wasm=wasmExports.ts_node_prev_named_sibling_wasm)(e),_ts_node_descendant_count_wasm=Module._ts_node_descendant_count_wasm=e=>(_ts_node_descendant_count_wasm=Module._ts_node_descendant_count_wasm=wasmExports.ts_node_descendant_count_wasm)(e),_ts_node_parent_wasm=Module._ts_node_parent_wasm=e=>(_ts_node_parent_wasm=Module._ts_node_parent_wasm=wasmExports.ts_node_parent_wasm)(e),_ts_node_descendant_for_index_wasm=Module._ts_node_descendant_for_index_wasm=e=>(_ts_node_descendant_for_index_wasm=Module._ts_node_descendant_for_index_wasm=wasmExports.ts_node_descendant_for_index_wasm)(e),_ts_node_named_descendant_for_index_wasm=Module._ts_node_named_descendant_for_index_wasm=e=>(_ts_node_named_descendant_for_index_wasm=Module._ts_node_named_descendant_for_index_wasm=wasmExports.ts_node_named_descendant_for_index_wasm)(e),_ts_node_descendant_for_position_wasm=Module._ts_node_descendant_for_position_wasm=e=>(_ts_node_descendant_for_position_wasm=Module._ts_node_descendant_for_position_wasm=wasmExports.ts_node_descendant_for_position_wasm)(e),_ts_node_named_descendant_for_position_wasm=Module._ts_node_named_descendant_for_position_wasm=e=>(_ts_node_named_descendant_for_position_wasm=Module._ts_node_named_descendant_for_position_wasm=wasmExports.ts_node_named_descendant_for_position_wasm)(e),_ts_node_start_point_wasm=Module._ts_node_start_point_wasm=e=>(_ts_node_start_point_wasm=Module._ts_node_start_point_wasm=wasmExports.ts_node_start_point_wasm)(e),_ts_node_end_point_wasm=Module._ts_node_end_point_wasm=e=>(_ts_node_end_point_wasm=Module._ts_node_end_point_wasm=wasmExports.ts_node_end_point_wasm)(e),_ts_node_start_index_wasm=Module._ts_node_start_index_wasm=e=>(_ts_node_start_index_wasm=Module._ts_node_start_index_wasm=wasmExports.ts_node_start_index_wasm)(e),_ts_node_end_index_wasm=Module._ts_node_end_index_wasm=e=>(_ts_node_end_index_wasm=Module._ts_node_end_index_wasm=wasmExports.ts_node_end_index_wasm)(e),_ts_node_to_string_wasm=Module._ts_node_to_string_wasm=e=>(_ts_node_to_string_wasm=Module._ts_node_to_string_wasm=wasmExports.ts_node_to_string_wasm)(e),_ts_node_children_wasm=Module._ts_node_children_wasm=e=>(_ts_node_children_wasm=Module._ts_node_children_wasm=wasmExports.ts_node_children_wasm)(e),_ts_node_named_children_wasm=Module._ts_node_named_children_wasm=e=>(_ts_node_named_children_wasm=Module._ts_node_named_children_wasm=wasmExports.ts_node_named_children_wasm)(e),_ts_node_descendants_of_type_wasm=Module._ts_node_descendants_of_type_wasm=(e,t,_,s,r,a,o)=>(_ts_node_descendants_of_type_wasm=Module._ts_node_descendants_of_type_wasm=wasmExports.ts_node_descendants_of_type_wasm)(e,t,_,s,r,a,o),_ts_node_is_named_wasm=Module._ts_node_is_named_wasm=e=>(_ts_node_is_named_wasm=Module._ts_node_is_named_wasm=wasmExports.ts_node_is_named_wasm)(e),_ts_node_has_changes_wasm=Module._ts_node_has_changes_wasm=e=>(_ts_node_has_changes_wasm=Module._ts_node_has_changes_wasm=wasmExports.ts_node_has_changes_wasm)(e),_ts_node_has_error_wasm=Module._ts_node_has_error_wasm=e=>(_ts_node_has_error_wasm=Module._ts_node_has_error_wasm=wasmExports.ts_node_has_error_wasm)(e),_ts_node_is_error_wasm=Module._ts_node_is_error_wasm=e=>(_ts_node_is_error_wasm=Module._ts_node_is_error_wasm=wasmExports.ts_node_is_error_wasm)(e),_ts_node_is_missing_wasm=Module._ts_node_is_missing_wasm=e=>(_ts_node_is_missing_wasm=Module._ts_node_is_missing_wasm=wasmExports.ts_node_is_missing_wasm)(e),_ts_node_is_extra_wasm=Module._ts_node_is_extra_wasm=e=>(_ts_node_is_extra_wasm=Module._ts_node_is_extra_wasm=wasmExports.ts_node_is_extra_wasm)(e),_ts_node_parse_state_wasm=Module._ts_node_parse_state_wasm=e=>(_ts_node_parse_state_wasm=Module._ts_node_parse_state_wasm=wasmExports.ts_node_parse_state_wasm)(e),_ts_node_next_parse_state_wasm=Module._ts_node_next_parse_state_wasm=e=>(_ts_node_next_parse_state_wasm=Module._ts_node_next_parse_state_wasm=wasmExports.ts_node_next_parse_state_wasm)(e),_ts_query_matches_wasm=Module._ts_query_matches_wasm=(e,t,_,s,r,a,o,n,l,d)=>(_ts_query_matches_wasm=Module._ts_query_matches_wasm=wasmExports.ts_query_matches_wasm)(e,t,_,s,r,a,o,n,l,d),_ts_query_captures_wasm=Module._ts_query_captures_wasm=(e,t,_,s,r,a,o,n,l,d)=>(_ts_query_captures_wasm=Module._ts_query_captures_wasm=wasmExports.ts_query_captures_wasm)(e,t,_,s,r,a,o,n,l,d),_iswalpha=Module._iswalpha=e=>(_iswalpha=Module._iswalpha=wasmExports.iswalpha)(e),_iswblank=Module._iswblank=e=>(_iswblank=Module._iswblank=wasmExports.iswblank)(e),_iswdigit=Module._iswdigit=e=>(_iswdigit=Module._iswdigit=wasmExports.iswdigit)(e),_iswlower=Module._iswlower=e=>(_iswlower=Module._iswlower=wasmExports.iswlower)(e),_iswupper=Module._iswupper=e=>(_iswupper=Module._iswupper=wasmExports.iswupper)(e),_iswxdigit=Module._iswxdigit=e=>(_iswxdigit=Module._iswxdigit=wasmExports.iswxdigit)(e),_memchr=Module._memchr=(e,t,_)=>(_memchr=Module._memchr=wasmExports.memchr)(e,t,_),_strlen=Module._strlen=e=>(_strlen=Module._strlen=wasmExports.strlen)(e),_strcmp=Module._strcmp=(e,t)=>(_strcmp=Module._strcmp=wasmExports.strcmp)(e,t),_strncat=Module._strncat=(e,t,_)=>(_strncat=Module._strncat=wasmExports.strncat)(e,t,_),_strncpy=Module._strncpy=(e,t,_)=>(_strncpy=Module._strncpy=wasmExports.strncpy)(e,t,_),_towlower=Module._towlower=e=>(_towlower=Module._towlower=wasmExports.towlower)(e),_towupper=Module._towupper=e=>(_towupper=Module._towupper=wasmExports.towupper)(e),_setThrew=(e,t)=>(_setThrew=wasmExports.setThrew)(e,t),stackSave=()=>(stackSave=wasmExports.stackSave)(),stackRestore=e=>(stackRestore=wasmExports.stackRestore)(e),stackAlloc=e=>(stackAlloc=wasmExports.stackAlloc)(e),dynCall_jiji=Module.dynCall_jiji=(e,t,_,s,r)=>(dynCall_jiji=Module.dynCall_jiji=wasmExports.dynCall_jiji)(e,t,_,s,r),_orig$ts_parser_timeout_micros=Module._orig$ts_parser_timeout_micros=e=>(_orig$ts_parser_timeout_micros=Module._orig$ts_parser_timeout_micros=wasmExports.orig$ts_parser_timeout_micros)(e),_orig$ts_parser_set_timeout_micros=Module._orig$ts_parser_set_timeout_micros=(e,t)=>(_orig$ts_parser_set_timeout_micros=Module._orig$ts_parser_set_timeout_micros=wasmExports.orig$ts_parser_set_timeout_micros)(e,t),calledRun;function callMain(e=[]){var t=resolveGlobalSymbol(\"main\").sym;if(t){e.unshift(thisProgram);var _=e.length,s=stackAlloc(4*(_+1)),r=s;e.forEach((e=>{HEAPU32[r>>2]=stringToUTF8OnStack(e),r+=4})),HEAPU32[r>>2]=0;try{var a=t(_,s);return exitJS(a,!0),a}catch(e){return handleException(e)}}}function run(e=arguments_){function t(){calledRun||(calledRun=!0,Module.calledRun=!0,ABORT||(initRuntime(),preMain(),Module.onRuntimeInitialized&&Module.onRuntimeInitialized(),shouldRunNow&&callMain(e),postRun()))}runDependencies>0||(preRun(),runDependencies>0||(Module.setStatus?(Module.setStatus(\"Running...\"),setTimeout((function(){setTimeout((function(){Module.setStatus(\"\")}),1),t()}),1)):t()))}if(Module.AsciiToString=AsciiToString,Module.stringToUTF16=stringToUTF16,dependenciesFulfilled=function e(){calledRun||run(),calledRun||(dependenciesFulfilled=e)},Module.preInit)for(\"function\"==typeof Module.preInit&&(Module.preInit=[Module.preInit]);Module.preInit.length>0;)Module.preInit.pop()();var shouldRunNow=!0;Module.noInitialRun&&(shouldRunNow=!1),run();const C=Module,INTERNAL={},SIZE_OF_INT=4,SIZE_OF_CURSOR=4*SIZE_OF_INT,SIZE_OF_NODE=5*SIZE_OF_INT,SIZE_OF_POINT=2*SIZE_OF_INT,SIZE_OF_RANGE=2*SIZE_OF_INT+2*SIZE_OF_POINT,ZERO_POINT={row:0,column:0},QUERY_WORD_REGEX=/[\\w-.]*/g,PREDICATE_STEP_TYPE_CAPTURE=1,PREDICATE_STEP_TYPE_STRING=2,LANGUAGE_FUNCTION_REGEX=/^_?tree_sitter_\\w+/;let VERSION,MIN_COMPATIBLE_VERSION,TRANSFER_BUFFER,currentParseCallback,currentLogCallback;class ParserImpl{static init(){TRANSFER_BUFFER=C._ts_init(),VERSION=getValue(TRANSFER_BUFFER,\"i32\"),MIN_COMPATIBLE_VERSION=getValue(TRANSFER_BUFFER+SIZE_OF_INT,\"i32\")}initialize(){C._ts_parser_new_wasm(),this[0]=getValue(TRANSFER_BUFFER,\"i32\"),this[1]=getValue(TRANSFER_BUFFER+SIZE_OF_INT,\"i32\")}delete(){C._ts_parser_delete(this[0]),C._free(this[1]),this[0]=0,this[1]=0}setLanguage(e){let t;if(e){if(e.constructor!==Language)throw new Error(\"Argument must be a Language\");{t=e[0];const _=C._ts_language_version(t);if(_<MIN_COMPATIBLE_VERSION||VERSION<_)throw new Error(`Incompatible language version ${_}. Compatibility range ${MIN_COMPATIBLE_VERSION} through ${VERSION}.`)}}else t=0,e=null;return this.language=e,C._ts_parser_set_language(this[0],t),this}getLanguage(){return this.language}parse(e,t,_){if(\"string\"==typeof e)currentParseCallback=(t,_)=>e.slice(t);else{if(\"function\"!=typeof e)throw new Error(\"Argument must be a string or a function\");currentParseCallback=e}this.logCallback?(currentLogCallback=this.logCallback,C._ts_parser_enable_logger_wasm(this[0],1)):(currentLogCallback=null,C._ts_parser_enable_logger_wasm(this[0],0));let s=0,r=0;if(_?.includedRanges){s=_.includedRanges.length,r=C._calloc(s,SIZE_OF_RANGE);let e=r;for(let t=0;t<s;t++)marshalRange(e,_.includedRanges[t]),e+=SIZE_OF_RANGE}const a=C._ts_parser_parse_wasm(this[0],this[1],t?t[0]:0,r,s);if(!a)throw currentParseCallback=null,currentLogCallback=null,new Error(\"Parsing failed\");const o=new Tree(INTERNAL,a,this.language,currentParseCallback);return currentParseCallback=null,currentLogCallback=null,o}reset(){C._ts_parser_reset(this[0])}getIncludedRanges(){C._ts_parser_included_ranges_wasm(this[0]);const e=getValue(TRANSFER_BUFFER,\"i32\"),t=getValue(TRANSFER_BUFFER+SIZE_OF_INT,\"i32\"),_=new Array(e);if(e>0){let s=t;for(let t=0;t<e;t++)_[t]=unmarshalRange(s),s+=SIZE_OF_RANGE;C._free(t)}return _}getTimeoutMicros(){return C._ts_parser_timeout_micros(this[0])}setTimeoutMicros(e){C._ts_parser_set_timeout_micros(this[0],e)}setLogger(e){if(e){if(\"function\"!=typeof e)throw new Error(\"Logger callback must be a function\")}else e=null;return this.logCallback=e,this}getLogger(){return this.logCallback}}class Tree{constructor(e,t,_,s){assertInternal(e),this[0]=t,this.language=_,this.textCallback=s}copy(){const e=C._ts_tree_copy(this[0]);return new Tree(INTERNAL,e,this.language,this.textCallback)}delete(){C._ts_tree_delete(this[0]),this[0]=0}edit(e){marshalEdit(e),C._ts_tree_edit_wasm(this[0])}get rootNode(){return C._ts_tree_root_node_wasm(this[0]),unmarshalNode(this)}rootNodeWithOffset(e,t){const _=TRANSFER_BUFFER+SIZE_OF_NODE;return setValue(_,e,\"i32\"),marshalPoint(_+SIZE_OF_INT,t),C._ts_tree_root_node_with_offset_wasm(this[0]),unmarshalNode(this)}getLanguage(){return this.language}walk(){return this.rootNode.walk()}getChangedRanges(e){if(e.constructor!==Tree)throw new TypeError(\"Argument must be a Tree\");C._ts_tree_get_changed_ranges_wasm(this[0],e[0]);const t=getValue(TRANSFER_BUFFER,\"i32\"),_=getValue(TRANSFER_BUFFER+SIZE_OF_INT,\"i32\"),s=new Array(t);if(t>0){let e=_;for(let _=0;_<t;_++)s[_]=unmarshalRange(e),e+=SIZE_OF_RANGE;C._free(_)}return s}getIncludedRanges(){C._ts_tree_included_ranges_wasm(this[0]);const e=getValue(TRANSFER_BUFFER,\"i32\"),t=getValue(TRANSFER_BUFFER+SIZE_OF_INT,\"i32\"),_=new Array(e);if(e>0){let s=t;for(let t=0;t<e;t++)_[t]=unmarshalRange(s),s+=SIZE_OF_RANGE;C._free(t)}return _}}class Node{constructor(e,t){assertInternal(e),this.tree=t}get typeId(){return marshalNode(this),C._ts_node_symbol_wasm(this.tree[0])}get grammarId(){return marshalNode(this),C._ts_node_grammar_symbol_wasm(this.tree[0])}get type(){return this.tree.language.types[this.typeId]||\"ERROR\"}get grammarType(){return this.tree.language.types[this.grammarId]||\"ERROR\"}get endPosition(){return marshalNode(this),C._ts_node_end_point_wasm(this.tree[0]),unmarshalPoint(TRANSFER_BUFFER)}get endIndex(){return marshalNode(this),C._ts_node_end_index_wasm(this.tree[0])}get text(){return getText(this.tree,this.startIndex,this.endIndex)}get parseState(){return marshalNode(this),C._ts_node_parse_state_wasm(this.tree[0])}get nextParseState(){return marshalNode(this),C._ts_node_next_parse_state_wasm(this.tree[0])}get isNamed(){return marshalNode(this),1===C._ts_node_is_named_wasm(this.tree[0])}get hasError(){return marshalNode(this),1===C._ts_node_has_error_wasm(this.tree[0])}get hasChanges(){return marshalNode(this),1===C._ts_node_has_changes_wasm(this.tree[0])}get isError(){return marshalNode(this),1===C._ts_node_is_error_wasm(this.tree[0])}get isMissing(){return marshalNode(this),1===C._ts_node_is_missing_wasm(this.tree[0])}get isExtra(){return marshalNode(this),1===C._ts_node_is_extra_wasm(this.tree[0])}equals(e){return this.id===e.id}child(e){return marshalNode(this),C._ts_node_child_wasm(this.tree[0],e),unmarshalNode(this.tree)}namedChild(e){return marshalNode(this),C._ts_node_named_child_wasm(this.tree[0],e),unmarshalNode(this.tree)}childForFieldId(e){return marshalNode(this),C._ts_node_child_by_field_id_wasm(this.tree[0],e),unmarshalNode(this.tree)}childForFieldName(e){const t=this.tree.language.fields.indexOf(e);return-1!==t?this.childForFieldId(t):null}fieldNameForChild(e){marshalNode(this);const t=C._ts_node_field_name_for_child_wasm(this.tree[0],e);if(!t)return null;return AsciiToString(t)}childrenForFieldName(e){const t=this.tree.language.fields.indexOf(e);return-1!==t&&0!==t?this.childrenForFieldId(t):[]}childrenForFieldId(e){marshalNode(this),C._ts_node_children_by_field_id_wasm(this.tree[0],e);const t=getValue(TRANSFER_BUFFER,\"i32\"),_=getValue(TRANSFER_BUFFER+SIZE_OF_INT,\"i32\"),s=new Array(t);if(t>0){let e=_;for(let _=0;_<t;_++)s[_]=unmarshalNode(this.tree,e),e+=SIZE_OF_NODE;C._free(_)}return s}firstChildForIndex(e){marshalNode(this);return setValue(TRANSFER_BUFFER+SIZE_OF_NODE,e,\"i32\"),C._ts_node_first_child_for_byte_wasm(this.tree[0]),unmarshalNode(this.tree)}firstNamedChildForIndex(e){marshalNode(this);return setValue(TRANSFER_BUFFER+SIZE_OF_NODE,e,\"i32\"),C._ts_node_first_named_child_for_byte_wasm(this.tree[0]),unmarshalNode(this.tree)}get childCount(){return marshalNode(this),C._ts_node_child_count_wasm(this.tree[0])}get namedChildCount(){return marshalNode(this),C._ts_node_named_child_count_wasm(this.tree[0])}get firstChild(){return this.child(0)}get firstNamedChild(){return this.namedChild(0)}get lastChild(){return this.child(this.childCount-1)}get lastNamedChild(){return this.namedChild(this.namedChildCount-1)}get children(){if(!this._children){marshalNode(this),C._ts_node_children_wasm(this.tree[0]);const e=getValue(TRANSFER_BUFFER,\"i32\"),t=getValue(TRANSFER_BUFFER+SIZE_OF_INT,\"i32\");if(this._children=new Array(e),e>0){let _=t;for(let t=0;t<e;t++)this._children[t]=unmarshalNode(this.tree,_),_+=SIZE_OF_NODE;C._free(t)}}return this._children}get namedChildren(){if(!this._namedChildren){marshalNode(this),C._ts_node_named_children_wasm(this.tree[0]);const e=getValue(TRANSFER_BUFFER,\"i32\"),t=getValue(TRANSFER_BUFFER+SIZE_OF_INT,\"i32\");if(this._namedChildren=new Array(e),e>0){let _=t;for(let t=0;t<e;t++)this._namedChildren[t]=unmarshalNode(this.tree,_),_+=SIZE_OF_NODE;C._free(t)}}return this._namedChildren}descendantsOfType(e,t,_){Array.isArray(e)||(e=[e]),t||(t=ZERO_POINT),_||(_=ZERO_POINT);const s=[],r=this.tree.language.types;for(let t=0,_=r.length;t<_;t++)e.includes(r[t])&&s.push(t);const a=C._malloc(SIZE_OF_INT*s.length);for(let e=0,t=s.length;e<t;e++)setValue(a+e*SIZE_OF_INT,s[e],\"i32\");marshalNode(this),C._ts_node_descendants_of_type_wasm(this.tree[0],a,s.length,t.row,t.column,_.row,_.column);const o=getValue(TRANSFER_BUFFER,\"i32\"),n=getValue(TRANSFER_BUFFER+SIZE_OF_INT,\"i32\"),l=new Array(o);if(o>0){let e=n;for(let t=0;t<o;t++)l[t]=unmarshalNode(this.tree,e),e+=SIZE_OF_NODE}return C._free(n),C._free(a),l}get nextSibling(){return marshalNode(this),C._ts_node_next_sibling_wasm(this.tree[0]),unmarshalNode(this.tree)}get previousSibling(){return marshalNode(this),C._ts_node_prev_sibling_wasm(this.tree[0]),unmarshalNode(this.tree)}get nextNamedSibling(){return marshalNode(this),C._ts_node_next_named_sibling_wasm(this.tree[0]),unmarshalNode(this.tree)}get previousNamedSibling(){return marshalNode(this),C._ts_node_prev_named_sibling_wasm(this.tree[0]),unmarshalNode(this.tree)}get descendantCount(){return marshalNode(this),C._ts_node_descendant_count_wasm(this.tree[0])}get parent(){return marshalNode(this),C._ts_node_parent_wasm(this.tree[0]),unmarshalNode(this.tree)}descendantForIndex(e,t=e){if(\"number\"!=typeof e||\"number\"!=typeof t)throw new Error(\"Arguments must be numbers\");marshalNode(this);const _=TRANSFER_BUFFER+SIZE_OF_NODE;return setValue(_,e,\"i32\"),setValue(_+SIZE_OF_INT,t,\"i32\"),C._ts_node_descendant_for_index_wasm(this.tree[0]),unmarshalNode(this.tree)}namedDescendantForIndex(e,t=e){if(\"number\"!=typeof e||\"number\"!=typeof t)throw new Error(\"Arguments must be numbers\");marshalNode(this);const _=TRANSFER_BUFFER+SIZE_OF_NODE;return setValue(_,e,\"i32\"),setValue(_+SIZE_OF_INT,t,\"i32\"),C._ts_node_named_descendant_for_index_wasm(this.tree[0]),unmarshalNode(this.tree)}descendantForPosition(e,t=e){if(!isPoint(e)||!isPoint(t))throw new Error(\"Arguments must be {row, column} objects\");marshalNode(this);const _=TRANSFER_BUFFER+SIZE_OF_NODE;return marshalPoint(_,e),marshalPoint(_+SIZE_OF_POINT,t),C._ts_node_descendant_for_position_wasm(this.tree[0]),unmarshalNode(this.tree)}namedDescendantForPosition(e,t=e){if(!isPoint(e)||!isPoint(t))throw new Error(\"Arguments must be {row, column} objects\");marshalNode(this);const _=TRANSFER_BUFFER+SIZE_OF_NODE;return marshalPoint(_,e),marshalPoint(_+SIZE_OF_POINT,t),C._ts_node_named_descendant_for_position_wasm(this.tree[0]),unmarshalNode(this.tree)}walk(){return marshalNode(this),C._ts_tree_cursor_new_wasm(this.tree[0]),new TreeCursor(INTERNAL,this.tree)}toString(){marshalNode(this);const e=C._ts_node_to_string_wasm(this.tree[0]),t=AsciiToString(e);return C._free(e),t}}class TreeCursor{constructor(e,t){assertInternal(e),this.tree=t,unmarshalTreeCursor(this)}delete(){marshalTreeCursor(this),C._ts_tree_cursor_delete_wasm(this.tree[0]),this[0]=this[1]=this[2]=0}reset(e){marshalNode(e),marshalTreeCursor(this,TRANSFER_BUFFER+SIZE_OF_NODE),C._ts_tree_cursor_reset_wasm(this.tree[0]),unmarshalTreeCursor(this)}resetTo(e){marshalTreeCursor(this,TRANSFER_BUFFER),marshalTreeCursor(e,TRANSFER_BUFFER+SIZE_OF_CURSOR),C._ts_tree_cursor_reset_to_wasm(this.tree[0],e.tree[0]),unmarshalTreeCursor(this)}get nodeType(){return this.tree.language.types[this.nodeTypeId]||\"ERROR\"}get nodeTypeId(){return marshalTreeCursor(this),C._ts_tree_cursor_current_node_type_id_wasm(this.tree[0])}get nodeStateId(){return marshalTreeCursor(this),C._ts_tree_cursor_current_node_state_id_wasm(this.tree[0])}get nodeId(){return marshalTreeCursor(this),C._ts_tree_cursor_current_node_id_wasm(this.tree[0])}get nodeIsNamed(){return marshalTreeCursor(this),1===C._ts_tree_cursor_current_node_is_named_wasm(this.tree[0])}get nodeIsMissing(){return marshalTreeCursor(this),1===C._ts_tree_cursor_current_node_is_missing_wasm(this.tree[0])}get nodeText(){marshalTreeCursor(this);const e=C._ts_tree_cursor_start_index_wasm(this.tree[0]),t=C._ts_tree_cursor_end_index_wasm(this.tree[0]);return getText(this.tree,e,t)}get startPosition(){return marshalTreeCursor(this),C._ts_tree_cursor_start_position_wasm(this.tree[0]),unmarshalPoint(TRANSFER_BUFFER)}get endPosition(){return marshalTreeCursor(this),C._ts_tree_cursor_end_position_wasm(this.tree[0]),unmarshalPoint(TRANSFER_BUFFER)}get startIndex(){return marshalTreeCursor(this),C._ts_tree_cursor_start_index_wasm(this.tree[0])}get endIndex(){return marshalTreeCursor(this),C._ts_tree_cursor_end_index_wasm(this.tree[0])}get currentNode(){return marshalTreeCursor(this),C._ts_tree_cursor_current_node_wasm(this.tree[0]),unmarshalNode(this.tree)}get currentFieldId(){return marshalTreeCursor(this),C._ts_tree_cursor_current_field_id_wasm(this.tree[0])}get currentFieldName(){return this.tree.language.fields[this.currentFieldId]}get currentDepth(){return marshalTreeCursor(this),C._ts_tree_cursor_current_depth_wasm(this.tree[0])}get currentDescendantIndex(){return marshalTreeCursor(this),C._ts_tree_cursor_current_descendant_index_wasm(this.tree[0])}gotoFirstChild(){marshalTreeCursor(this);const e=C._ts_tree_cursor_goto_first_child_wasm(this.tree[0]);return unmarshalTreeCursor(this),1===e}gotoLastChild(){marshalTreeCursor(this);const e=C._ts_tree_cursor_goto_last_child_wasm(this.tree[0]);return unmarshalTreeCursor(this),1===e}gotoFirstChildForIndex(e){marshalTreeCursor(this),setValue(TRANSFER_BUFFER+SIZE_OF_CURSOR,e,\"i32\");const t=C._ts_tree_cursor_goto_first_child_for_index_wasm(this.tree[0]);return unmarshalTreeCursor(this),1===t}gotoFirstChildForPosition(e){marshalTreeCursor(this),marshalPoint(TRANSFER_BUFFER+SIZE_OF_CURSOR,e);const t=C._ts_tree_cursor_goto_first_child_for_position_wasm(this.tree[0]);return unmarshalTreeCursor(this),1===t}gotoNextSibling(){marshalTreeCursor(this);const e=C._ts_tree_cursor_goto_next_sibling_wasm(this.tree[0]);return unmarshalTreeCursor(this),1===e}gotoPreviousSibling(){marshalTreeCursor(this);const e=C._ts_tree_cursor_goto_previous_sibling_wasm(this.tree[0]);return unmarshalTreeCursor(this),1===e}gotoDescendant(e){marshalTreeCursor(this),C._ts_tree_cursor_goto_descendant_wasm(this.tree[0],e),unmarshalTreeCursor(this)}gotoParent(){marshalTreeCursor(this);const e=C._ts_tree_cursor_goto_parent_wasm(this.tree[0]);return unmarshalTreeCursor(this),1===e}}class Language{constructor(e,t){assertInternal(e),this[0]=t,this.types=new Array(C._ts_language_symbol_count(this[0]));for(let e=0,t=this.types.length;e<t;e++)C._ts_language_symbol_type(this[0],e)<2&&(this.types[e]=UTF8ToString(C._ts_language_symbol_name(this[0],e)));this.fields=new Array(C._ts_language_field_count(this[0])+1);for(let e=0,t=this.fields.length;e<t;e++){const t=C._ts_language_field_name_for_id(this[0],e);this.fields[e]=0!==t?UTF8ToString(t):null}}get version(){return C._ts_language_version(this[0])}get fieldCount(){return this.fields.length-1}get stateCount(){return C._ts_language_state_count(this[0])}fieldIdForName(e){const t=this.fields.indexOf(e);return-1!==t?t:null}fieldNameForId(e){return this.fields[e]||null}idForNodeType(e,t){const _=lengthBytesUTF8(e),s=C._malloc(_+1);stringToUTF8(e,s,_+1);const r=C._ts_language_symbol_for_name(this[0],s,_,t);return C._free(s),r||null}get nodeTypeCount(){return C._ts_language_symbol_count(this[0])}nodeTypeForId(e){const t=C._ts_language_symbol_name(this[0],e);return t?UTF8ToString(t):null}nodeTypeIsNamed(e){return!!C._ts_language_type_is_named_wasm(this[0],e)}nodeTypeIsVisible(e){return!!C._ts_language_type_is_visible_wasm(this[0],e)}nextState(e,t){return C._ts_language_next_state(this[0],e,t)}lookaheadIterator(e){const t=C._ts_lookahead_iterator_new(this[0],e);return t?new LookaheadIterable(INTERNAL,t,this):null}query(e){const t=lengthBytesUTF8(e),_=C._malloc(t+1);stringToUTF8(e,_,t+1);const s=C._ts_query_new(this[0],_,t,TRANSFER_BUFFER,TRANSFER_BUFFER+SIZE_OF_INT);if(!s){const t=getValue(TRANSFER_BUFFER+SIZE_OF_INT,\"i32\"),s=getValue(TRANSFER_BUFFER,\"i32\"),r=UTF8ToString(_,s).length,a=e.substr(r,100).split(\"\\n\")[0];let o,n=a.match(QUERY_WORD_REGEX)[0];switch(t){case 2:o=new RangeError(`Bad node name '${n}'`);break;case 3:o=new RangeError(`Bad field name '${n}'`);break;case 4:o=new RangeError(`Bad capture name @${n}`);break;case 5:o=new TypeError(`Bad pattern structure at offset ${r}: '${a}'...`),n=\"\";break;default:o=new SyntaxError(`Bad syntax at offset ${r}: '${a}'...`),n=\"\"}throw o.index=r,o.length=n.length,C._free(_),o}const r=C._ts_query_string_count(s),a=C._ts_query_capture_count(s),o=C._ts_query_pattern_count(s),n=new Array(a),l=new Array(r);for(let e=0;e<a;e++){const t=C._ts_query_capture_name_for_id(s,e,TRANSFER_BUFFER),_=getValue(TRANSFER_BUFFER,\"i32\");n[e]=UTF8ToString(t,_)}for(let e=0;e<r;e++){const t=C._ts_query_string_value_for_id(s,e,TRANSFER_BUFFER),_=getValue(TRANSFER_BUFFER,\"i32\");l[e]=UTF8ToString(t,_)}const d=new Array(o),u=new Array(o),m=new Array(o),c=new Array(o),w=new Array(o);for(let e=0;e<o;e++){const t=C._ts_query_predicates_for_pattern(s,e,TRANSFER_BUFFER),_=getValue(TRANSFER_BUFFER,\"i32\");c[e]=[],w[e]=[];const r=[];let a=t;for(let t=0;t<_;t++){const t=getValue(a,\"i32\");a+=SIZE_OF_INT;const _=getValue(a,\"i32\");if(a+=SIZE_OF_INT,t===PREDICATE_STEP_TYPE_CAPTURE)r.push({type:\"capture\",name:n[_]});else if(t===PREDICATE_STEP_TYPE_STRING)r.push({type:\"string\",value:l[_]});else if(r.length>0){if(\"string\"!==r[0].type)throw new Error(\"Predicates must begin with a literal value\");const t=r[0].value;let _,s=!0,a=!0;switch(t){case\"any-not-eq?\":case\"not-eq?\":s=!1;case\"any-eq?\":case\"eq?\":if(3!==r.length)throw new Error(`Wrong number of arguments to \\`#${t}\\` predicate. Expected 2, got ${r.length-1}`);if(\"capture\"!==r[1].type)throw new Error(`First argument of \\`#${t}\\` predicate must be a capture. Got \"${r[1].value}\"`);if(a=!t.startsWith(\"any-\"),\"capture\"===r[2].type){const t=r[1].name,_=r[2].name;w[e].push((e=>{const r=[],o=[];for(const s of e)s.name===t&&r.push(s.node),s.name===_&&o.push(s.node);const n=(e,t,_)=>_?e.text===t.text:e.text!==t.text;return a?r.every((e=>o.some((t=>n(e,t,s))))):r.some((e=>o.some((t=>n(e,t,s)))))}))}else{_=r[1].name;const t=r[2].value,o=e=>e.text===t,n=e=>e.text!==t;w[e].push((e=>{const t=[];for(const s of e)s.name===_&&t.push(s.node);const r=s?o:n;return a?t.every(r):t.some(r)}))}break;case\"any-not-match?\":case\"not-match?\":s=!1;case\"any-match?\":case\"match?\":if(3!==r.length)throw new Error(`Wrong number of arguments to \\`#${t}\\` predicate. Expected 2, got ${r.length-1}.`);if(\"capture\"!==r[1].type)throw new Error(`First argument of \\`#${t}\\` predicate must be a capture. Got \"${r[1].value}\".`);if(\"string\"!==r[2].type)throw new Error(`Second argument of \\`#${t}\\` predicate must be a string. Got @${r[2].value}.`);_=r[1].name;const o=new RegExp(r[2].value);a=!t.startsWith(\"any-\"),w[e].push((e=>{const t=[];for(const s of e)s.name===_&&t.push(s.node.text);const r=(e,t)=>t?o.test(e):!o.test(e);return 0===t.length?!s:a?t.every((e=>r(e,s))):t.some((e=>r(e,s)))}));break;case\"set!\":if(r.length<2||r.length>3)throw new Error(`Wrong number of arguments to \\`#set!\\` predicate. Expected 1 or 2. Got ${r.length-1}.`);if(r.some((e=>\"string\"!==e.type)))throw new Error('Arguments to `#set!` predicate must be a strings.\".');d[e]||(d[e]={}),d[e][r[1].value]=r[2]?r[2].value:null;break;case\"is?\":case\"is-not?\":if(r.length<2||r.length>3)throw new Error(`Wrong number of arguments to \\`#${t}\\` predicate. Expected 1 or 2. Got ${r.length-1}.`);if(r.some((e=>\"string\"!==e.type)))throw new Error(`Arguments to \\`#${t}\\` predicate must be a strings.\".`);const n=\"is?\"===t?u:m;n[e]||(n[e]={}),n[e][r[1].value]=r[2]?r[2].value:null;break;case\"not-any-of?\":s=!1;case\"any-of?\":if(r.length<2)throw new Error(`Wrong number of arguments to \\`#${t}\\` predicate. Expected at least 1. Got ${r.length-1}.`);if(\"capture\"!==r[1].type)throw new Error(`First argument of \\`#${t}\\` predicate must be a capture. Got \"${r[1].value}\".`);for(let e=2;e<r.length;e++)if(\"string\"!==r[e].type)throw new Error(`Arguments to \\`#${t}\\` predicate must be a strings.\".`);_=r[1].name;const l=r.slice(2).map((e=>e.value));w[e].push((e=>{const t=[];for(const s of e)s.name===_&&t.push(s.node.text);return 0===t.length?!s:t.every((e=>l.includes(e)))===s}));break;default:c[e].push({operator:t,operands:r.slice(1)})}r.length=0}}Object.freeze(d[e]),Object.freeze(u[e]),Object.freeze(m[e])}return C._free(_),new Query(INTERNAL,s,n,w,c,Object.freeze(d),Object.freeze(u),Object.freeze(m))}static load(e){let t;if(e instanceof Uint8Array)t=Promise.resolve(e);else{const _=e;if(\"undefined\"!=typeof process&&process.versions&&process.versions.node){const e=require(\"fs\");t=Promise.resolve(e.readFileSync(_))}else t=fetch(_).then((e=>e.arrayBuffer().then((t=>{if(e.ok)return new Uint8Array(t);{const _=new TextDecoder(\"utf-8\").decode(t);throw new Error(`Language.load failed with status ${e.status}.\\n\\n${_}`)}}))))}return t.then((e=>loadWebAssemblyModule(e,{loadAsync:!0}))).then((e=>{const t=Object.keys(e),_=t.find((e=>LANGUAGE_FUNCTION_REGEX.test(e)&&!e.includes(\"external_scanner_\")));_||console.log(`Couldn't find language function in WASM file. Symbols:\\n${JSON.stringify(t,null,2)}`);const s=e[_]();return new Language(INTERNAL,s)}))}}class LookaheadIterable{constructor(e,t,_){assertInternal(e),this[0]=t,this.language=_}get currentTypeId(){return C._ts_lookahead_iterator_current_symbol(this[0])}get currentType(){return this.language.types[this.currentTypeId]||\"ERROR\"}delete(){C._ts_lookahead_iterator_delete(this[0]),this[0]=0}resetState(e){return C._ts_lookahead_iterator_reset_state(this[0],e)}reset(e,t){return!!C._ts_lookahead_iterator_reset(this[0],e[0],t)&&(this.language=e,!0)}[Symbol.iterator](){const e=this;return{next:()=>C._ts_lookahead_iterator_next(e[0])?{done:!1,value:e.currentType}:{done:!0,value:\"\"}}}}class Query{constructor(e,t,_,s,r,a,o,n){assertInternal(e),this[0]=t,this.captureNames=_,this.textPredicates=s,this.predicates=r,this.setProperties=a,this.assertedProperties=o,this.refutedProperties=n,this.exceededMatchLimit=!1}delete(){C._ts_query_delete(this[0]),this[0]=0}matches(e,{startPosition:t=ZERO_POINT,endPosition:_=ZERO_POINT,startIndex:s=0,endIndex:r=0,matchLimit:a=4294967295,maxStartDepth:o=4294967295}={}){if(\"number\"!=typeof a)throw new Error(\"Arguments must be numbers\");marshalNode(e),C._ts_query_matches_wasm(this[0],e.tree[0],t.row,t.column,_.row,_.column,s,r,a,o);const n=getValue(TRANSFER_BUFFER,\"i32\"),l=getValue(TRANSFER_BUFFER+SIZE_OF_INT,\"i32\"),d=getValue(TRANSFER_BUFFER+2*SIZE_OF_INT,\"i32\"),u=new Array(n);this.exceededMatchLimit=Boolean(d);let m=0,c=l;for(let t=0;t<n;t++){const t=getValue(c,\"i32\");c+=SIZE_OF_INT;const _=getValue(c,\"i32\");c+=SIZE_OF_INT;const s=new Array(_);if(c=unmarshalCaptures(this,e.tree,c,s),this.textPredicates[t].every((e=>e(s)))){u[m]={pattern:t,captures:s};const e=this.setProperties[t];e&&(u[m].setProperties=e);const _=this.assertedProperties[t];_&&(u[m].assertedProperties=_);const r=this.refutedProperties[t];r&&(u[m].refutedProperties=r),m++}}return u.length=m,C._free(l),u}captures(e,{startPosition:t=ZERO_POINT,endPosition:_=ZERO_POINT,startIndex:s=0,endIndex:r=0,matchLimit:a=4294967295,maxStartDepth:o=4294967295}={}){if(\"number\"!=typeof a)throw new Error(\"Arguments must be numbers\");marshalNode(e),C._ts_query_captures_wasm(this[0],e.tree[0],t.row,t.column,_.row,_.column,s,r,a,o);const n=getValue(TRANSFER_BUFFER,\"i32\"),l=getValue(TRANSFER_BUFFER+SIZE_OF_INT,\"i32\"),d=getValue(TRANSFER_BUFFER+2*SIZE_OF_INT,\"i32\"),u=[];this.exceededMatchLimit=Boolean(d);const m=[];let c=l;for(let t=0;t<n;t++){const t=getValue(c,\"i32\");c+=SIZE_OF_INT;const _=getValue(c,\"i32\");c+=SIZE_OF_INT;const s=getValue(c,\"i32\");if(c+=SIZE_OF_INT,m.length=_,c=unmarshalCaptures(this,e.tree,c,m),this.textPredicates[t].every((e=>e(m)))){const e=m[s],_=this.setProperties[t];_&&(e.setProperties=_);const r=this.assertedProperties[t];r&&(e.assertedProperties=r);const a=this.refutedProperties[t];a&&(e.refutedProperties=a),u.push(e)}}return C._free(l),u}predicatesForPattern(e){return this.predicates[e]}disableCapture(e){const t=lengthBytesUTF8(e),_=C._malloc(t+1);stringToUTF8(e,_,t+1),C._ts_query_disable_capture(this[0],_,t),C._free(_)}didExceedMatchLimit(){return this.exceededMatchLimit}}function getText(e,t,_){const s=_-t;let r=e.textCallback(t,null,_);for(t+=r.length;t<_;){const s=e.textCallback(t,null,_);if(!(s&&s.length>0))break;t+=s.length,r+=s}return t>_&&(r=r.slice(0,s)),r}function unmarshalCaptures(e,t,_,s){for(let r=0,a=s.length;r<a;r++){const a=getValue(_,\"i32\"),o=unmarshalNode(t,_+=SIZE_OF_INT);_+=SIZE_OF_NODE,s[r]={name:e.captureNames[a],node:o}}return _}function assertInternal(e){if(e!==INTERNAL)throw new Error(\"Illegal constructor\")}function isPoint(e){return e&&\"number\"==typeof e.row&&\"number\"==typeof e.column}function marshalNode(e){let t=TRANSFER_BUFFER;setValue(t,e.id,\"i32\"),t+=SIZE_OF_INT,setValue(t,e.startIndex,\"i32\"),t+=SIZE_OF_INT,setValue(t,e.startPosition.row,\"i32\"),t+=SIZE_OF_INT,setValue(t,e.startPosition.column,\"i32\"),t+=SIZE_OF_INT,setValue(t,e[0],\"i32\")}function unmarshalNode(e,t=TRANSFER_BUFFER){const _=getValue(t,\"i32\");if(0===_)return null;const s=getValue(t+=SIZE_OF_INT,\"i32\"),r=getValue(t+=SIZE_OF_INT,\"i32\"),a=getValue(t+=SIZE_OF_INT,\"i32\"),o=getValue(t+=SIZE_OF_INT,\"i32\"),n=new Node(INTERNAL,e);return n.id=_,n.startIndex=s,n.startPosition={row:r,column:a},n[0]=o,n}function marshalTreeCursor(e,t=TRANSFER_BUFFER){setValue(t+0*SIZE_OF_INT,e[0],\"i32\"),setValue(t+1*SIZE_OF_INT,e[1],\"i32\"),setValue(t+2*SIZE_OF_INT,e[2],\"i32\"),setValue(t+3*SIZE_OF_INT,e[3],\"i32\")}function unmarshalTreeCursor(e){e[0]=getValue(TRANSFER_BUFFER+0*SIZE_OF_INT,\"i32\"),e[1]=getValue(TRANSFER_BUFFER+1*SIZE_OF_INT,\"i32\"),e[2]=getValue(TRANSFER_BUFFER+2*SIZE_OF_INT,\"i32\"),e[3]=getValue(TRANSFER_BUFFER+3*SIZE_OF_INT,\"i32\")}function marshalPoint(e,t){setValue(e,t.row,\"i32\"),setValue(e+SIZE_OF_INT,t.column,\"i32\")}function unmarshalPoint(e){return{row:getValue(e,\"i32\")>>>0,column:getValue(e+SIZE_OF_INT,\"i32\")>>>0}}function marshalRange(e,t){marshalPoint(e,t.startPosition),marshalPoint(e+=SIZE_OF_POINT,t.endPosition),setValue(e+=SIZE_OF_POINT,t.startIndex,\"i32\"),setValue(e+=SIZE_OF_INT,t.endIndex,\"i32\"),e+=SIZE_OF_INT}function unmarshalRange(e){const t={};return t.startPosition=unmarshalPoint(e),e+=SIZE_OF_POINT,t.endPosition=unmarshalPoint(e),e+=SIZE_OF_POINT,t.startIndex=getValue(e,\"i32\")>>>0,e+=SIZE_OF_INT,t.endIndex=getValue(e,\"i32\")>>>0,t}function marshalEdit(e){let t=TRANSFER_BUFFER;marshalPoint(t,e.startPosition),t+=SIZE_OF_POINT,marshalPoint(t,e.oldEndPosition),t+=SIZE_OF_POINT,marshalPoint(t,e.newEndPosition),t+=SIZE_OF_POINT,setValue(t,e.startIndex,\"i32\"),t+=SIZE_OF_INT,setValue(t,e.oldEndIndex,\"i32\"),t+=SIZE_OF_INT,setValue(t,e.newEndIndex,\"i32\"),t+=SIZE_OF_INT}for(const e of Object.getOwnPropertyNames(ParserImpl.prototype))Object.defineProperty(Parser.prototype,e,{value:ParserImpl.prototype[e],enumerable:!1,writable:!1});Parser.Language=Language,Module.onRuntimeInitialized=()=>{ParserImpl.init(),resolveInitPromise()}})))}}return Parser}();\"object\"==typeof exports&&(module.exports=TreeSitter);\n", "/**\n * CommanderError class\n */\nclass CommanderError extends Error {\n /**\n * Constructs the CommanderError class\n * @param {number} exitCode suggested exit code which could be used with process.exit\n * @param {string} code an id string representing the error\n * @param {string} message human-readable description of the error\n */\n constructor(exitCode, code, message) {\n super(message);\n // properly capture stack trace in Node.js\n Error.captureStackTrace(this, this.constructor);\n this.name = this.constructor.name;\n this.code = code;\n this.exitCode = exitCode;\n this.nestedError = undefined;\n }\n}\n\n/**\n * InvalidArgumentError class\n */\nclass InvalidArgumentError extends CommanderError {\n /**\n * Constructs the InvalidArgumentError class\n * @param {string} [message] explanation of why argument is invalid\n */\n constructor(message) {\n super(1, 'commander.invalidArgument', message);\n // properly capture stack trace in Node.js\n Error.captureStackTrace(this, this.constructor);\n this.name = this.constructor.name;\n }\n}\n\nexports.CommanderError = CommanderError;\nexports.InvalidArgumentError = InvalidArgumentError;\n", "const { InvalidArgumentError } = require('./error.js');\n\nclass Argument {\n /**\n * Initialize a new command argument with the given name and description.\n * The default is that the argument is required, and you can explicitly\n * indicate this with <> around the name. Put [] around the name for an optional argument.\n *\n * @param {string} name\n * @param {string} [description]\n */\n\n constructor(name, description) {\n this.description = description || '';\n this.variadic = false;\n this.parseArg = undefined;\n this.defaultValue = undefined;\n this.defaultValueDescription = undefined;\n this.argChoices = undefined;\n\n switch (name[0]) {\n case '<': // e.g. <required>\n this.required = true;\n this._name = name.slice(1, -1);\n break;\n case '[': // e.g. [optional]\n this.required = false;\n this._name = name.slice(1, -1);\n break;\n default:\n this.required = true;\n this._name = name;\n break;\n }\n\n if (this._name.length > 3 && this._name.slice(-3) === '...') {\n this.variadic = true;\n this._name = this._name.slice(0, -3);\n }\n }\n\n /**\n * Return argument name.\n *\n * @return {string}\n */\n\n name() {\n return this._name;\n }\n\n /**\n * @package\n */\n\n _concatValue(value, previous) {\n if (previous === this.defaultValue || !Array.isArray(previous)) {\n return [value];\n }\n\n return previous.concat(value);\n }\n\n /**\n * Set the default value, and optionally supply the description to be displayed in the help.\n *\n * @param {*} value\n * @param {string} [description]\n * @return {Argument}\n */\n\n default(value, description) {\n this.defaultValue = value;\n this.defaultValueDescription = description;\n return this;\n }\n\n /**\n * Set the custom handler for processing CLI command arguments into argument values.\n *\n * @param {Function} [fn]\n * @return {Argument}\n */\n\n argParser(fn) {\n this.parseArg = fn;\n return this;\n }\n\n /**\n * Only allow argument value to be one of choices.\n *\n * @param {string[]} values\n * @return {Argument}\n */\n\n choices(values) {\n this.argChoices = values.slice();\n this.parseArg = (arg, previous) => {\n if (!this.argChoices.includes(arg)) {\n throw new InvalidArgumentError(\n `Allowed choices are ${this.argChoices.join(', ')}.`,\n );\n }\n if (this.variadic) {\n return this._concatValue(arg, previous);\n }\n return arg;\n };\n return this;\n }\n\n /**\n * Make argument required.\n *\n * @returns {Argument}\n */\n argRequired() {\n this.required = true;\n return this;\n }\n\n /**\n * Make argument optional.\n *\n * @returns {Argument}\n */\n argOptional() {\n this.required = false;\n return this;\n }\n}\n\n/**\n * Takes an argument and returns its human readable equivalent for help usage.\n *\n * @param {Argument} arg\n * @return {string}\n * @private\n */\n\nfunction humanReadableArgName(arg) {\n const nameOutput = arg.name() + (arg.variadic === true ? '...' : '');\n\n return arg.required ? '<' + nameOutput + '>' : '[' + nameOutput + ']';\n}\n\nexports.Argument = Argument;\nexports.humanReadableArgName = humanReadableArgName;\n", "const { humanReadableArgName } = require('./argument.js');\n\n/**\n * TypeScript import types for JSDoc, used by Visual Studio Code IntelliSense and `npm run typescript-checkJS`\n * https://www.typescriptlang.org/docs/handbook/jsdoc-supported-types.html#import-types\n * @typedef { import(\"./argument.js\").Argument } Argument\n * @typedef { import(\"./command.js\").Command } Command\n * @typedef { import(\"./option.js\").Option } Option\n */\n\n// Although this is a class, methods are static in style to allow override using subclass or just functions.\nclass Help {\n constructor() {\n this.helpWidth = undefined;\n this.minWidthToWrap = 40;\n this.sortSubcommands = false;\n this.sortOptions = false;\n this.showGlobalOptions = false;\n }\n\n /**\n * prepareContext is called by Commander after applying overrides from `Command.configureHelp()`\n * and just before calling `formatHelp()`.\n *\n * Commander just uses the helpWidth and the rest is provided for optional use by more complex subclasses.\n *\n * @param {{ error?: boolean, helpWidth?: number, outputHasColors?: boolean }} contextOptions\n */\n prepareContext(contextOptions) {\n this.helpWidth = this.helpWidth ?? contextOptions.helpWidth ?? 80;\n }\n\n /**\n * Get an array of the visible subcommands. Includes a placeholder for the implicit help command, if there is one.\n *\n * @param {Command} cmd\n * @returns {Command[]}\n */\n\n visibleCommands(cmd) {\n const visibleCommands = cmd.commands.filter((cmd) => !cmd._hidden);\n const helpCommand = cmd._getHelpCommand();\n if (helpCommand && !helpCommand._hidden) {\n visibleCommands.push(helpCommand);\n }\n if (this.sortSubcommands) {\n visibleCommands.sort((a, b) => {\n // @ts-ignore: because overloaded return type\n return a.name().localeCompare(b.name());\n });\n }\n return visibleCommands;\n }\n\n /**\n * Compare options for sort.\n *\n * @param {Option} a\n * @param {Option} b\n * @returns {number}\n */\n compareOptions(a, b) {\n const getSortKey = (option) => {\n // WYSIWYG for order displayed in help. Short used for comparison if present. No special handling for negated.\n return option.short\n ? option.short.replace(/^-/, '')\n : option.long.replace(/^--/, '');\n };\n return getSortKey(a).localeCompare(getSortKey(b));\n }\n\n /**\n * Get an array of the visible options. Includes a placeholder for the implicit help option, if there is one.\n *\n * @param {Command} cmd\n * @returns {Option[]}\n */\n\n visibleOptions(cmd) {\n const visibleOptions = cmd.options.filter((option) => !option.hidden);\n // Built-in help option.\n const helpOption = cmd._getHelpOption();\n if (helpOption && !helpOption.hidden) {\n // Automatically hide conflicting flags. Bit dubious but a historical behaviour that is convenient for single-command programs.\n const removeShort = helpOption.short && cmd._findOption(helpOption.short);\n const removeLong = helpOption.long && cmd._findOption(helpOption.long);\n if (!removeShort && !removeLong) {\n visibleOptions.push(helpOption); // no changes needed\n } else if (helpOption.long && !removeLong) {\n visibleOptions.push(\n cmd.createOption(helpOption.long, helpOption.description),\n );\n } else if (helpOption.short && !removeShort) {\n visibleOptions.push(\n cmd.createOption(helpOption.short, helpOption.description),\n );\n }\n }\n if (this.sortOptions) {\n visibleOptions.sort(this.compareOptions);\n }\n return visibleOptions;\n }\n\n /**\n * Get an array of the visible global options. (Not including help.)\n *\n * @param {Command} cmd\n * @returns {Option[]}\n */\n\n visibleGlobalOptions(cmd) {\n if (!this.showGlobalOptions) return [];\n\n const globalOptions = [];\n for (\n let ancestorCmd = cmd.parent;\n ancestorCmd;\n ancestorCmd = ancestorCmd.parent\n ) {\n const visibleOptions = ancestorCmd.options.filter(\n (option) => !option.hidden,\n );\n globalOptions.push(...visibleOptions);\n }\n if (this.sortOptions) {\n globalOptions.sort(this.compareOptions);\n }\n return globalOptions;\n }\n\n /**\n * Get an array of the arguments if any have a description.\n *\n * @param {Command} cmd\n * @returns {Argument[]}\n */\n\n visibleArguments(cmd) {\n // Side effect! Apply the legacy descriptions before the arguments are displayed.\n if (cmd._argsDescription) {\n cmd.registeredArguments.forEach((argument) => {\n argument.description =\n argument.description || cmd._argsDescription[argument.name()] || '';\n });\n }\n\n // If there are any arguments with a description then return all the arguments.\n if (cmd.registeredArguments.find((argument) => argument.description)) {\n return cmd.registeredArguments;\n }\n return [];\n }\n\n /**\n * Get the command term to show in the list of subcommands.\n *\n * @param {Command} cmd\n * @returns {string}\n */\n\n subcommandTerm(cmd) {\n // Legacy. Ignores custom usage string, and nested commands.\n const args = cmd.registeredArguments\n .map((arg) => humanReadableArgName(arg))\n .join(' ');\n return (\n cmd._name +\n (cmd._aliases[0] ? '|' + cmd._aliases[0] : '') +\n (cmd.options.length ? ' [options]' : '') + // simplistic check for non-help option\n (args ? ' ' + args : '')\n );\n }\n\n /**\n * Get the option term to show in the list of options.\n *\n * @param {Option} option\n * @returns {string}\n */\n\n optionTerm(option) {\n return option.flags;\n }\n\n /**\n * Get the argument term to show in the list of arguments.\n *\n * @param {Argument} argument\n * @returns {string}\n */\n\n argumentTerm(argument) {\n return argument.name();\n }\n\n /**\n * Get the longest command term length.\n *\n * @param {Command} cmd\n * @param {Help} helper\n * @returns {number}\n */\n\n longestSubcommandTermLength(cmd, helper) {\n return helper.visibleCommands(cmd).reduce((max, command) => {\n return Math.max(\n max,\n this.displayWidth(\n helper.styleSubcommandTerm(helper.subcommandTerm(command)),\n ),\n );\n }, 0);\n }\n\n /**\n * Get the longest option term length.\n *\n * @param {Command} cmd\n * @param {Help} helper\n * @returns {number}\n */\n\n longestOptionTermLength(cmd, helper) {\n return helper.visibleOptions(cmd).reduce((max, option) => {\n return Math.max(\n max,\n this.displayWidth(helper.styleOptionTerm(helper.optionTerm(option))),\n );\n }, 0);\n }\n\n /**\n * Get the longest global option term length.\n *\n * @param {Command} cmd\n * @param {Help} helper\n * @returns {number}\n */\n\n longestGlobalOptionTermLength(cmd, helper) {\n return helper.visibleGlobalOptions(cmd).reduce((max, option) => {\n return Math.max(\n max,\n this.displayWidth(helper.styleOptionTerm(helper.optionTerm(option))),\n );\n }, 0);\n }\n\n /**\n * Get the longest argument term length.\n *\n * @param {Command} cmd\n * @param {Help} helper\n * @returns {number}\n */\n\n longestArgumentTermLength(cmd, helper) {\n return helper.visibleArguments(cmd).reduce((max, argument) => {\n return Math.max(\n max,\n this.displayWidth(\n helper.styleArgumentTerm(helper.argumentTerm(argument)),\n ),\n );\n }, 0);\n }\n\n /**\n * Get the command usage to be displayed at the top of the built-in help.\n *\n * @param {Command} cmd\n * @returns {string}\n */\n\n commandUsage(cmd) {\n // Usage\n let cmdName = cmd._name;\n if (cmd._aliases[0]) {\n cmdName = cmdName + '|' + cmd._aliases[0];\n }\n let ancestorCmdNames = '';\n for (\n let ancestorCmd = cmd.parent;\n ancestorCmd;\n ancestorCmd = ancestorCmd.parent\n ) {\n ancestorCmdNames = ancestorCmd.name() + ' ' + ancestorCmdNames;\n }\n return ancestorCmdNames + cmdName + ' ' + cmd.usage();\n }\n\n /**\n * Get the description for the command.\n *\n * @param {Command} cmd\n * @returns {string}\n */\n\n commandDescription(cmd) {\n // @ts-ignore: because overloaded return type\n return cmd.description();\n }\n\n /**\n * Get the subcommand summary to show in the list of subcommands.\n * (Fallback to description for backwards compatibility.)\n *\n * @param {Command} cmd\n * @returns {string}\n */\n\n subcommandDescription(cmd) {\n // @ts-ignore: because overloaded return type\n return cmd.summary() || cmd.description();\n }\n\n /**\n * Get the option description to show in the list of options.\n *\n * @param {Option} option\n * @return {string}\n */\n\n optionDescription(option) {\n const extraInfo = [];\n\n if (option.argChoices) {\n extraInfo.push(\n // use stringify to match the display of the default value\n `choices: ${option.argChoices.map((choice) => JSON.stringify(choice)).join(', ')}`,\n );\n }\n if (option.defaultValue !== undefined) {\n // default for boolean and negated more for programmer than end user,\n // but show true/false for boolean option as may be for hand-rolled env or config processing.\n const showDefault =\n option.required ||\n option.optional ||\n (option.isBoolean() && typeof option.defaultValue === 'boolean');\n if (showDefault) {\n extraInfo.push(\n `default: ${option.defaultValueDescription || JSON.stringify(option.defaultValue)}`,\n );\n }\n }\n // preset for boolean and negated are more for programmer than end user\n if (option.presetArg !== undefined && option.optional) {\n extraInfo.push(`preset: ${JSON.stringify(option.presetArg)}`);\n }\n if (option.envVar !== undefined) {\n extraInfo.push(`env: ${option.envVar}`);\n }\n if (extraInfo.length > 0) {\n const extraDescription = `(${extraInfo.join(', ')})`;\n if (option.description) {\n return `${option.description} ${extraDescription}`;\n }\n return extraDescription;\n }\n\n return option.description;\n }\n\n /**\n * Get the argument description to show in the list of arguments.\n *\n * @param {Argument} argument\n * @return {string}\n */\n\n argumentDescription(argument) {\n const extraInfo = [];\n if (argument.argChoices) {\n extraInfo.push(\n // use stringify to match the display of the default value\n `choices: ${argument.argChoices.map((choice) => JSON.stringify(choice)).join(', ')}`,\n );\n }\n if (argument.defaultValue !== undefined) {\n extraInfo.push(\n `default: ${argument.defaultValueDescription || JSON.stringify(argument.defaultValue)}`,\n );\n }\n if (extraInfo.length > 0) {\n const extraDescription = `(${extraInfo.join(', ')})`;\n if (argument.description) {\n return `${argument.description} ${extraDescription}`;\n }\n return extraDescription;\n }\n return argument.description;\n }\n\n /**\n * Format a list of items, given a heading and an array of formatted items.\n *\n * @param {string} heading\n * @param {string[]} items\n * @param {Help} helper\n * @returns string[]\n */\n formatItemList(heading, items, helper) {\n if (items.length === 0) return [];\n\n return [helper.styleTitle(heading), ...items, ''];\n }\n\n /**\n * Group items by their help group heading.\n *\n * @param {Command[] | Option[]} unsortedItems\n * @param {Command[] | Option[]} visibleItems\n * @param {Function} getGroup\n * @returns {Map<string, Command[] | Option[]>}\n */\n groupItems(unsortedItems, visibleItems, getGroup) {\n const result = new Map();\n // Add groups in order of appearance in unsortedItems.\n unsortedItems.forEach((item) => {\n const group = getGroup(item);\n if (!result.has(group)) result.set(group, []);\n });\n // Add items in order of appearance in visibleItems.\n visibleItems.forEach((item) => {\n const group = getGroup(item);\n if (!result.has(group)) {\n result.set(group, []);\n }\n result.get(group).push(item);\n });\n return result;\n }\n\n /**\n * Generate the built-in help text.\n *\n * @param {Command} cmd\n * @param {Help} helper\n * @returns {string}\n */\n\n formatHelp(cmd, helper) {\n const termWidth = helper.padWidth(cmd, helper);\n const helpWidth = helper.helpWidth ?? 80; // in case prepareContext() was not called\n\n function callFormatItem(term, description) {\n return helper.formatItem(term, termWidth, description, helper);\n }\n\n // Usage\n let output = [\n `${helper.styleTitle('Usage:')} ${helper.styleUsage(helper.commandUsage(cmd))}`,\n '',\n ];\n\n // Description\n const commandDescription = helper.commandDescription(cmd);\n if (commandDescription.length > 0) {\n output = output.concat([\n helper.boxWrap(\n helper.styleCommandDescription(commandDescription),\n helpWidth,\n ),\n '',\n ]);\n }\n\n // Arguments\n const argumentList = helper.visibleArguments(cmd).map((argument) => {\n return callFormatItem(\n helper.styleArgumentTerm(helper.argumentTerm(argument)),\n helper.styleArgumentDescription(helper.argumentDescription(argument)),\n );\n });\n output = output.concat(\n this.formatItemList('Arguments:', argumentList, helper),\n );\n\n // Options\n const optionGroups = this.groupItems(\n cmd.options,\n helper.visibleOptions(cmd),\n (option) => option.helpGroupHeading ?? 'Options:',\n );\n optionGroups.forEach((options, group) => {\n const optionList = options.map((option) => {\n return callFormatItem(\n helper.styleOptionTerm(helper.optionTerm(option)),\n helper.styleOptionDescription(helper.optionDescription(option)),\n );\n });\n output = output.concat(this.formatItemList(group, optionList, helper));\n });\n\n if (helper.showGlobalOptions) {\n const globalOptionList = helper\n .visibleGlobalOptions(cmd)\n .map((option) => {\n return callFormatItem(\n helper.styleOptionTerm(helper.optionTerm(option)),\n helper.styleOptionDescription(helper.optionDescription(option)),\n );\n });\n output = output.concat(\n this.formatItemList('Global Options:', globalOptionList, helper),\n );\n }\n\n // Commands\n const commandGroups = this.groupItems(\n cmd.commands,\n helper.visibleCommands(cmd),\n (sub) => sub.helpGroup() || 'Commands:',\n );\n commandGroups.forEach((commands, group) => {\n const commandList = commands.map((sub) => {\n return callFormatItem(\n helper.styleSubcommandTerm(helper.subcommandTerm(sub)),\n helper.styleSubcommandDescription(helper.subcommandDescription(sub)),\n );\n });\n output = output.concat(this.formatItemList(group, commandList, helper));\n });\n\n return output.join('\\n');\n }\n\n /**\n * Return display width of string, ignoring ANSI escape sequences. Used in padding and wrapping calculations.\n *\n * @param {string} str\n * @returns {number}\n */\n displayWidth(str) {\n return stripColor(str).length;\n }\n\n /**\n * Style the title for displaying in the help. Called with 'Usage:', 'Options:', etc.\n *\n * @param {string} str\n * @returns {string}\n */\n styleTitle(str) {\n return str;\n }\n\n styleUsage(str) {\n // Usage has lots of parts the user might like to color separately! Assume default usage string which is formed like:\n // command subcommand [options] [command] <foo> [bar]\n return str\n .split(' ')\n .map((word) => {\n if (word === '[options]') return this.styleOptionText(word);\n if (word === '[command]') return this.styleSubcommandText(word);\n if (word[0] === '[' || word[0] === '<')\n return this.styleArgumentText(word);\n return this.styleCommandText(word); // Restrict to initial words?\n })\n .join(' ');\n }\n styleCommandDescription(str) {\n return this.styleDescriptionText(str);\n }\n styleOptionDescription(str) {\n return this.styleDescriptionText(str);\n }\n styleSubcommandDescription(str) {\n return this.styleDescriptionText(str);\n }\n styleArgumentDescription(str) {\n return this.styleDescriptionText(str);\n }\n styleDescriptionText(str) {\n return str;\n }\n styleOptionTerm(str) {\n return this.styleOptionText(str);\n }\n styleSubcommandTerm(str) {\n // This is very like usage with lots of parts! Assume default string which is formed like:\n // subcommand [options] <foo> [bar]\n return str\n .split(' ')\n .map((word) => {\n if (word === '[options]') return this.styleOptionText(word);\n if (word[0] === '[' || word[0] === '<')\n return this.styleArgumentText(word);\n return this.styleSubcommandText(word); // Restrict to initial words?\n })\n .join(' ');\n }\n styleArgumentTerm(str) {\n return this.styleArgumentText(str);\n }\n styleOptionText(str) {\n return str;\n }\n styleArgumentText(str) {\n return str;\n }\n styleSubcommandText(str) {\n return str;\n }\n styleCommandText(str) {\n return str;\n }\n\n /**\n * Calculate the pad width from the maximum term length.\n *\n * @param {Command} cmd\n * @param {Help} helper\n * @returns {number}\n */\n\n padWidth(cmd, helper) {\n return Math.max(\n helper.longestOptionTermLength(cmd, helper),\n helper.longestGlobalOptionTermLength(cmd, helper),\n helper.longestSubcommandTermLength(cmd, helper),\n helper.longestArgumentTermLength(cmd, helper),\n );\n }\n\n /**\n * Detect manually wrapped and indented strings by checking for line break followed by whitespace.\n *\n * @param {string} str\n * @returns {boolean}\n */\n preformatted(str) {\n return /\\n[^\\S\\r\\n]/.test(str);\n }\n\n /**\n * Format the \"item\", which consists of a term and description. Pad the term and wrap the description, indenting the following lines.\n *\n * So \"TTT\", 5, \"DDD DDDD DD DDD\" might be formatted for this.helpWidth=17 like so:\n * TTT DDD DDDD\n * DD DDD\n *\n * @param {string} term\n * @param {number} termWidth\n * @param {string} description\n * @param {Help} helper\n * @returns {string}\n */\n formatItem(term, termWidth, description, helper) {\n const itemIndent = 2;\n const itemIndentStr = ' '.repeat(itemIndent);\n if (!description) return itemIndentStr + term;\n\n // Pad the term out to a consistent width, so descriptions are aligned.\n const paddedTerm = term.padEnd(\n termWidth + term.length - helper.displayWidth(term),\n );\n\n // Format the description.\n const spacerWidth = 2; // between term and description\n const helpWidth = this.helpWidth ?? 80; // in case prepareContext() was not called\n const remainingWidth = helpWidth - termWidth - spacerWidth - itemIndent;\n let formattedDescription;\n if (\n remainingWidth < this.minWidthToWrap ||\n helper.preformatted(description)\n ) {\n formattedDescription = description;\n } else {\n const wrappedDescription = helper.boxWrap(description, remainingWidth);\n formattedDescription = wrappedDescription.replace(\n /\\n/g,\n '\\n' + ' '.repeat(termWidth + spacerWidth),\n );\n }\n\n // Construct and overall indent.\n return (\n itemIndentStr +\n paddedTerm +\n ' '.repeat(spacerWidth) +\n formattedDescription.replace(/\\n/g, `\\n${itemIndentStr}`)\n );\n }\n\n /**\n * Wrap a string at whitespace, preserving existing line breaks.\n * Wrapping is skipped if the width is less than `minWidthToWrap`.\n *\n * @param {string} str\n * @param {number} width\n * @returns {string}\n */\n boxWrap(str, width) {\n if (width < this.minWidthToWrap) return str;\n\n const rawLines = str.split(/\\r\\n|\\n/);\n // split up text by whitespace\n const chunkPattern = /[\\s]*[^\\s]+/g;\n const wrappedLines = [];\n rawLines.forEach((line) => {\n const chunks = line.match(chunkPattern);\n if (chunks === null) {\n wrappedLines.push('');\n return;\n }\n\n let sumChunks = [chunks.shift()];\n let sumWidth = this.displayWidth(sumChunks[0]);\n chunks.forEach((chunk) => {\n const visibleWidth = this.displayWidth(chunk);\n // Accumulate chunks while they fit into width.\n if (sumWidth + visibleWidth <= width) {\n sumChunks.push(chunk);\n sumWidth += visibleWidth;\n return;\n }\n wrappedLines.push(sumChunks.join(''));\n\n const nextChunk = chunk.trimStart(); // trim space at line break\n sumChunks = [nextChunk];\n sumWidth = this.displayWidth(nextChunk);\n });\n wrappedLines.push(sumChunks.join(''));\n });\n\n return wrappedLines.join('\\n');\n }\n}\n\n/**\n * Strip style ANSI escape sequences from the string. In particular, SGR (Select Graphic Rendition) codes.\n *\n * @param {string} str\n * @returns {string}\n * @package\n */\n\nfunction stripColor(str) {\n // eslint-disable-next-line no-control-regex\n const sgrPattern = /\\x1b\\[\\d*(;\\d*)*m/g;\n return str.replace(sgrPattern, '');\n}\n\nexports.Help = Help;\nexports.stripColor = stripColor;\n", "const { InvalidArgumentError } = require('./error.js');\n\nclass Option {\n /**\n * Initialize a new `Option` with the given `flags` and `description`.\n *\n * @param {string} flags\n * @param {string} [description]\n */\n\n constructor(flags, description) {\n this.flags = flags;\n this.description = description || '';\n\n this.required = flags.includes('<'); // A value must be supplied when the option is specified.\n this.optional = flags.includes('['); // A value is optional when the option is specified.\n // variadic test ignores <value,...> et al which might be used to describe custom splitting of single argument\n this.variadic = /\\w\\.\\.\\.[>\\]]$/.test(flags); // The option can take multiple values.\n this.mandatory = false; // The option must have a value after parsing, which usually means it must be specified on command line.\n const optionFlags = splitOptionFlags(flags);\n this.short = optionFlags.shortFlag; // May be a short flag, undefined, or even a long flag (if option has two long flags).\n this.long = optionFlags.longFlag;\n this.negate = false;\n if (this.long) {\n this.negate = this.long.startsWith('--no-');\n }\n this.defaultValue = undefined;\n this.defaultValueDescription = undefined;\n this.presetArg = undefined;\n this.envVar = undefined;\n this.parseArg = undefined;\n this.hidden = false;\n this.argChoices = undefined;\n this.conflictsWith = [];\n this.implied = undefined;\n this.helpGroupHeading = undefined; // soft initialised when option added to command\n }\n\n /**\n * Set the default value, and optionally supply the description to be displayed in the help.\n *\n * @param {*} value\n * @param {string} [description]\n * @return {Option}\n */\n\n default(value, description) {\n this.defaultValue = value;\n this.defaultValueDescription = description;\n return this;\n }\n\n /**\n * Preset to use when option used without option-argument, especially optional but also boolean and negated.\n * The custom processing (parseArg) is called.\n *\n * @example\n * new Option('--color').default('GREYSCALE').preset('RGB');\n * new Option('--donate [amount]').preset('20').argParser(parseFloat);\n *\n * @param {*} arg\n * @return {Option}\n */\n\n preset(arg) {\n this.presetArg = arg;\n return this;\n }\n\n /**\n * Add option name(s) that conflict with this option.\n * An error will be displayed if conflicting options are found during parsing.\n *\n * @example\n * new Option('--rgb').conflicts('cmyk');\n * new Option('--js').conflicts(['ts', 'jsx']);\n *\n * @param {(string | string[])} names\n * @return {Option}\n */\n\n conflicts(names) {\n this.conflictsWith = this.conflictsWith.concat(names);\n return this;\n }\n\n /**\n * Specify implied option values for when this option is set and the implied options are not.\n *\n * The custom processing (parseArg) is not called on the implied values.\n *\n * @example\n * program\n * .addOption(new Option('--log', 'write logging information to file'))\n * .addOption(new Option('--trace', 'log extra details').implies({ log: 'trace.txt' }));\n *\n * @param {object} impliedOptionValues\n * @return {Option}\n */\n implies(impliedOptionValues) {\n let newImplied = impliedOptionValues;\n if (typeof impliedOptionValues === 'string') {\n // string is not documented, but easy mistake and we can do what user probably intended.\n newImplied = { [impliedOptionValues]: true };\n }\n this.implied = Object.assign(this.implied || {}, newImplied);\n return this;\n }\n\n /**\n * Set environment variable to check for option value.\n *\n * An environment variable is only used if when processed the current option value is\n * undefined, or the source of the current value is 'default' or 'config' or 'env'.\n *\n * @param {string} name\n * @return {Option}\n */\n\n env(name) {\n this.envVar = name;\n return this;\n }\n\n /**\n * Set the custom handler for processing CLI option arguments into option values.\n *\n * @param {Function} [fn]\n * @return {Option}\n */\n\n argParser(fn) {\n this.parseArg = fn;\n return this;\n }\n\n /**\n * Whether the option is mandatory and must have a value after parsing.\n *\n * @param {boolean} [mandatory=true]\n * @return {Option}\n */\n\n makeOptionMandatory(mandatory = true) {\n this.mandatory = !!mandatory;\n return this;\n }\n\n /**\n * Hide option in help.\n *\n * @param {boolean} [hide=true]\n * @return {Option}\n */\n\n hideHelp(hide = true) {\n this.hidden = !!hide;\n return this;\n }\n\n /**\n * @package\n */\n\n _concatValue(value, previous) {\n if (previous === this.defaultValue || !Array.isArray(previous)) {\n return [value];\n }\n\n return previous.concat(value);\n }\n\n /**\n * Only allow option value to be one of choices.\n *\n * @param {string[]} values\n * @return {Option}\n */\n\n choices(values) {\n this.argChoices = values.slice();\n this.parseArg = (arg, previous) => {\n if (!this.argChoices.includes(arg)) {\n throw new InvalidArgumentError(\n `Allowed choices are ${this.argChoices.join(', ')}.`,\n );\n }\n if (this.variadic) {\n return this._concatValue(arg, previous);\n }\n return arg;\n };\n return this;\n }\n\n /**\n * Return option name.\n *\n * @return {string}\n */\n\n name() {\n if (this.long) {\n return this.long.replace(/^--/, '');\n }\n return this.short.replace(/^-/, '');\n }\n\n /**\n * Return option name, in a camelcase format that can be used\n * as an object attribute key.\n *\n * @return {string}\n */\n\n attributeName() {\n if (this.negate) {\n return camelcase(this.name().replace(/^no-/, ''));\n }\n return camelcase(this.name());\n }\n\n /**\n * Set the help group heading.\n *\n * @param {string} heading\n * @return {Option}\n */\n helpGroup(heading) {\n this.helpGroupHeading = heading;\n return this;\n }\n\n /**\n * Check if `arg` matches the short or long flag.\n *\n * @param {string} arg\n * @return {boolean}\n * @package\n */\n\n is(arg) {\n return this.short === arg || this.long === arg;\n }\n\n /**\n * Return whether a boolean option.\n *\n * Options are one of boolean, negated, required argument, or optional argument.\n *\n * @return {boolean}\n * @package\n */\n\n isBoolean() {\n return !this.required && !this.optional && !this.negate;\n }\n}\n\n/**\n * This class is to make it easier to work with dual options, without changing the existing\n * implementation. We support separate dual options for separate positive and negative options,\n * like `--build` and `--no-build`, which share a single option value. This works nicely for some\n * use cases, but is tricky for others where we want separate behaviours despite\n * the single shared option value.\n */\nclass DualOptions {\n /**\n * @param {Option[]} options\n */\n constructor(options) {\n this.positiveOptions = new Map();\n this.negativeOptions = new Map();\n this.dualOptions = new Set();\n options.forEach((option) => {\n if (option.negate) {\n this.negativeOptions.set(option.attributeName(), option);\n } else {\n this.positiveOptions.set(option.attributeName(), option);\n }\n });\n this.negativeOptions.forEach((value, key) => {\n if (this.positiveOptions.has(key)) {\n this.dualOptions.add(key);\n }\n });\n }\n\n /**\n * Did the value come from the option, and not from possible matching dual option?\n *\n * @param {*} value\n * @param {Option} option\n * @returns {boolean}\n */\n valueFromOption(value, option) {\n const optionKey = option.attributeName();\n if (!this.dualOptions.has(optionKey)) return true;\n\n // Use the value to deduce if (probably) came from the option.\n const preset = this.negativeOptions.get(optionKey).presetArg;\n const negativeValue = preset !== undefined ? preset : false;\n return option.negate === (negativeValue === value);\n }\n}\n\n/**\n * Convert string from kebab-case to camelCase.\n *\n * @param {string} str\n * @return {string}\n * @private\n */\n\nfunction camelcase(str) {\n return str.split('-').reduce((str, word) => {\n return str + word[0].toUpperCase() + word.slice(1);\n });\n}\n\n/**\n * Split the short and long flag out of something like '-m,--mixed <value>'\n *\n * @private\n */\n\nfunction splitOptionFlags(flags) {\n let shortFlag;\n let longFlag;\n // short flag, single dash and single character\n const shortFlagExp = /^-[^-]$/;\n // long flag, double dash and at least one character\n const longFlagExp = /^--[^-]/;\n\n const flagParts = flags.split(/[ |,]+/).concat('guard');\n // Normal is short and/or long.\n if (shortFlagExp.test(flagParts[0])) shortFlag = flagParts.shift();\n if (longFlagExp.test(flagParts[0])) longFlag = flagParts.shift();\n // Long then short. Rarely used but fine.\n if (!shortFlag && shortFlagExp.test(flagParts[0]))\n shortFlag = flagParts.shift();\n // Allow two long flags, like '--ws, --workspace'\n // This is the supported way to have a shortish option flag.\n if (!shortFlag && longFlagExp.test(flagParts[0])) {\n shortFlag = longFlag;\n longFlag = flagParts.shift();\n }\n\n // Check for unprocessed flag. Fail noisily rather than silently ignore.\n if (flagParts[0].startsWith('-')) {\n const unsupportedFlag = flagParts[0];\n const baseError = `option creation failed due to '${unsupportedFlag}' in option flags '${flags}'`;\n if (/^-[^-][^-]/.test(unsupportedFlag))\n throw new Error(\n `${baseError}\n- a short flag is a single dash and a single character\n - either use a single dash and a single character (for a short flag)\n - or use a double dash for a long option (and can have two, like '--ws, --workspace')`,\n );\n if (shortFlagExp.test(unsupportedFlag))\n throw new Error(`${baseError}\n- too many short flags`);\n if (longFlagExp.test(unsupportedFlag))\n throw new Error(`${baseError}\n- too many long flags`);\n\n throw new Error(`${baseError}\n- unrecognised flag format`);\n }\n if (shortFlag === undefined && longFlag === undefined)\n throw new Error(\n `option creation failed due to no flags found in '${flags}'.`,\n );\n\n return { shortFlag, longFlag };\n}\n\nexports.Option = Option;\nexports.DualOptions = DualOptions;\n", "const maxDistance = 3;\n\nfunction editDistance(a, b) {\n // https://en.wikipedia.org/wiki/Damerau\u2013Levenshtein_distance\n // Calculating optimal string alignment distance, no substring is edited more than once.\n // (Simple implementation.)\n\n // Quick early exit, return worst case.\n if (Math.abs(a.length - b.length) > maxDistance)\n return Math.max(a.length, b.length);\n\n // distance between prefix substrings of a and b\n const d = [];\n\n // pure deletions turn a into empty string\n for (let i = 0; i <= a.length; i++) {\n d[i] = [i];\n }\n // pure insertions turn empty string into b\n for (let j = 0; j <= b.length; j++) {\n d[0][j] = j;\n }\n\n // fill matrix\n for (let j = 1; j <= b.length; j++) {\n for (let i = 1; i <= a.length; i++) {\n let cost = 1;\n if (a[i - 1] === b[j - 1]) {\n cost = 0;\n } else {\n cost = 1;\n }\n d[i][j] = Math.min(\n d[i - 1][j] + 1, // deletion\n d[i][j - 1] + 1, // insertion\n d[i - 1][j - 1] + cost, // substitution\n );\n // transposition\n if (i > 1 && j > 1 && a[i - 1] === b[j - 2] && a[i - 2] === b[j - 1]) {\n d[i][j] = Math.min(d[i][j], d[i - 2][j - 2] + 1);\n }\n }\n }\n\n return d[a.length][b.length];\n}\n\n/**\n * Find close matches, restricted to same number of edits.\n *\n * @param {string} word\n * @param {string[]} candidates\n * @returns {string}\n */\n\nfunction suggestSimilar(word, candidates) {\n if (!candidates || candidates.length === 0) return '';\n // remove possible duplicates\n candidates = Array.from(new Set(candidates));\n\n const searchingOptions = word.startsWith('--');\n if (searchingOptions) {\n word = word.slice(2);\n candidates = candidates.map((candidate) => candidate.slice(2));\n }\n\n let similar = [];\n let bestDistance = maxDistance;\n const minSimilarity = 0.4;\n candidates.forEach((candidate) => {\n if (candidate.length <= 1) return; // no one character guesses\n\n const distance = editDistance(word, candidate);\n const length = Math.max(word.length, candidate.length);\n const similarity = (length - distance) / length;\n if (similarity > minSimilarity) {\n if (distance < bestDistance) {\n // better edit distance, throw away previous worse matches\n bestDistance = distance;\n similar = [candidate];\n } else if (distance === bestDistance) {\n similar.push(candidate);\n }\n }\n });\n\n similar.sort((a, b) => a.localeCompare(b));\n if (searchingOptions) {\n similar = similar.map((candidate) => `--${candidate}`);\n }\n\n if (similar.length > 1) {\n return `\\n(Did you mean one of ${similar.join(', ')}?)`;\n }\n if (similar.length === 1) {\n return `\\n(Did you mean ${similar[0]}?)`;\n }\n return '';\n}\n\nexports.suggestSimilar = suggestSimilar;\n", "const EventEmitter = require('node:events').EventEmitter;\nconst childProcess = require('node:child_process');\nconst path = require('node:path');\nconst fs = require('node:fs');\nconst process = require('node:process');\n\nconst { Argument, humanReadableArgName } = require('./argument.js');\nconst { CommanderError } = require('./error.js');\nconst { Help, stripColor } = require('./help.js');\nconst { Option, DualOptions } = require('./option.js');\nconst { suggestSimilar } = require('./suggestSimilar');\n\nclass Command extends EventEmitter {\n /**\n * Initialize a new `Command`.\n *\n * @param {string} [name]\n */\n\n constructor(name) {\n super();\n /** @type {Command[]} */\n this.commands = [];\n /** @type {Option[]} */\n this.options = [];\n this.parent = null;\n this._allowUnknownOption = false;\n this._allowExcessArguments = false;\n /** @type {Argument[]} */\n this.registeredArguments = [];\n this._args = this.registeredArguments; // deprecated old name\n /** @type {string[]} */\n this.args = []; // cli args with options removed\n this.rawArgs = [];\n this.processedArgs = []; // like .args but after custom processing and collecting variadic\n this._scriptPath = null;\n this._name = name || '';\n this._optionValues = {};\n this._optionValueSources = {}; // default, env, cli etc\n this._storeOptionsAsProperties = false;\n this._actionHandler = null;\n this._executableHandler = false;\n this._executableFile = null; // custom name for executable\n this._executableDir = null; // custom search directory for subcommands\n this._defaultCommandName = null;\n this._exitCallback = null;\n this._aliases = [];\n this._combineFlagAndOptionalValue = true;\n this._description = '';\n this._summary = '';\n this._argsDescription = undefined; // legacy\n this._enablePositionalOptions = false;\n this._passThroughOptions = false;\n this._lifeCycleHooks = {}; // a hash of arrays\n /** @type {(boolean | string)} */\n this._showHelpAfterError = false;\n this._showSuggestionAfterError = true;\n this._savedState = null; // used in save/restoreStateBeforeParse\n\n // see configureOutput() for docs\n this._outputConfiguration = {\n writeOut: (str) => process.stdout.write(str),\n writeErr: (str) => process.stderr.write(str),\n outputError: (str, write) => write(str),\n getOutHelpWidth: () =>\n process.stdout.isTTY ? process.stdout.columns : undefined,\n getErrHelpWidth: () =>\n process.stderr.isTTY ? process.stderr.columns : undefined,\n getOutHasColors: () =>\n useColor() ?? (process.stdout.isTTY && process.stdout.hasColors?.()),\n getErrHasColors: () =>\n useColor() ?? (process.stderr.isTTY && process.stderr.hasColors?.()),\n stripColor: (str) => stripColor(str),\n };\n\n this._hidden = false;\n /** @type {(Option | null | undefined)} */\n this._helpOption = undefined; // Lazy created on demand. May be null if help option is disabled.\n this._addImplicitHelpCommand = undefined; // undecided whether true or false yet, not inherited\n /** @type {Command} */\n this._helpCommand = undefined; // lazy initialised, inherited\n this._helpConfiguration = {};\n /** @type {string | undefined} */\n this._helpGroupHeading = undefined; // soft initialised when added to parent\n /** @type {string | undefined} */\n this._defaultCommandGroup = undefined;\n /** @type {string | undefined} */\n this._defaultOptionGroup = undefined;\n }\n\n /**\n * Copy settings that are useful to have in common across root command and subcommands.\n *\n * (Used internally when adding a command using `.command()` so subcommands inherit parent settings.)\n *\n * @param {Command} sourceCommand\n * @return {Command} `this` command for chaining\n */\n copyInheritedSettings(sourceCommand) {\n this._outputConfiguration = sourceCommand._outputConfiguration;\n this._helpOption = sourceCommand._helpOption;\n this._helpCommand = sourceCommand._helpCommand;\n this._helpConfiguration = sourceCommand._helpConfiguration;\n this._exitCallback = sourceCommand._exitCallback;\n this._storeOptionsAsProperties = sourceCommand._storeOptionsAsProperties;\n this._combineFlagAndOptionalValue =\n sourceCommand._combineFlagAndOptionalValue;\n this._allowExcessArguments = sourceCommand._allowExcessArguments;\n this._enablePositionalOptions = sourceCommand._enablePositionalOptions;\n this._showHelpAfterError = sourceCommand._showHelpAfterError;\n this._showSuggestionAfterError = sourceCommand._showSuggestionAfterError;\n\n return this;\n }\n\n /**\n * @returns {Command[]}\n * @private\n */\n\n _getCommandAndAncestors() {\n const result = [];\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n for (let command = this; command; command = command.parent) {\n result.push(command);\n }\n return result;\n }\n\n /**\n * Define a command.\n *\n * There are two styles of command: pay attention to where to put the description.\n *\n * @example\n * // Command implemented using action handler (description is supplied separately to `.command`)\n * program\n * .command('clone <source> [destination]')\n * .description('clone a repository into a newly created directory')\n * .action((source, destination) => {\n * console.log('clone command called');\n * });\n *\n * // Command implemented using separate executable file (description is second parameter to `.command`)\n * program\n * .command('start <service>', 'start named service')\n * .command('stop [service]', 'stop named service, or all if no name supplied');\n *\n * @param {string} nameAndArgs - command name and arguments, args are `<required>` or `[optional]` and last may also be `variadic...`\n * @param {(object | string)} [actionOptsOrExecDesc] - configuration options (for action), or description (for executable)\n * @param {object} [execOpts] - configuration options (for executable)\n * @return {Command} returns new command for action handler, or `this` for executable command\n */\n\n command(nameAndArgs, actionOptsOrExecDesc, execOpts) {\n let desc = actionOptsOrExecDesc;\n let opts = execOpts;\n if (typeof desc === 'object' && desc !== null) {\n opts = desc;\n desc = null;\n }\n opts = opts || {};\n const [, name, args] = nameAndArgs.match(/([^ ]+) *(.*)/);\n\n const cmd = this.createCommand(name);\n if (desc) {\n cmd.description(desc);\n cmd._executableHandler = true;\n }\n if (opts.isDefault) this._defaultCommandName = cmd._name;\n cmd._hidden = !!(opts.noHelp || opts.hidden); // noHelp is deprecated old name for hidden\n cmd._executableFile = opts.executableFile || null; // Custom name for executable file, set missing to null to match constructor\n if (args) cmd.arguments(args);\n this._registerCommand(cmd);\n cmd.parent = this;\n cmd.copyInheritedSettings(this);\n\n if (desc) return this;\n return cmd;\n }\n\n /**\n * Factory routine to create a new unattached command.\n *\n * See .command() for creating an attached subcommand, which uses this routine to\n * create the command. You can override createCommand to customise subcommands.\n *\n * @param {string} [name]\n * @return {Command} new command\n */\n\n createCommand(name) {\n return new Command(name);\n }\n\n /**\n * You can customise the help with a subclass of Help by overriding createHelp,\n * or by overriding Help properties using configureHelp().\n *\n * @return {Help}\n */\n\n createHelp() {\n return Object.assign(new Help(), this.configureHelp());\n }\n\n /**\n * You can customise the help by overriding Help properties using configureHelp(),\n * or with a subclass of Help by overriding createHelp().\n *\n * @param {object} [configuration] - configuration options\n * @return {(Command | object)} `this` command for chaining, or stored configuration\n */\n\n configureHelp(configuration) {\n if (configuration === undefined) return this._helpConfiguration;\n\n this._helpConfiguration = configuration;\n return this;\n }\n\n /**\n * The default output goes to stdout and stderr. You can customise this for special\n * applications. You can also customise the display of errors by overriding outputError.\n *\n * The configuration properties are all functions:\n *\n * // change how output being written, defaults to stdout and stderr\n * writeOut(str)\n * writeErr(str)\n * // change how output being written for errors, defaults to writeErr\n * outputError(str, write) // used for displaying errors and not used for displaying help\n * // specify width for wrapping help\n * getOutHelpWidth()\n * getErrHelpWidth()\n * // color support, currently only used with Help\n * getOutHasColors()\n * getErrHasColors()\n * stripColor() // used to remove ANSI escape codes if output does not have colors\n *\n * @param {object} [configuration] - configuration options\n * @return {(Command | object)} `this` command for chaining, or stored configuration\n */\n\n configureOutput(configuration) {\n if (configuration === undefined) return this._outputConfiguration;\n\n this._outputConfiguration = Object.assign(\n {},\n this._outputConfiguration,\n configuration,\n );\n return this;\n }\n\n /**\n * Display the help or a custom message after an error occurs.\n *\n * @param {(boolean|string)} [displayHelp]\n * @return {Command} `this` command for chaining\n */\n showHelpAfterError(displayHelp = true) {\n if (typeof displayHelp !== 'string') displayHelp = !!displayHelp;\n this._showHelpAfterError = displayHelp;\n return this;\n }\n\n /**\n * Display suggestion of similar commands for unknown commands, or options for unknown options.\n *\n * @param {boolean} [displaySuggestion]\n * @return {Command} `this` command for chaining\n */\n showSuggestionAfterError(displaySuggestion = true) {\n this._showSuggestionAfterError = !!displaySuggestion;\n return this;\n }\n\n /**\n * Add a prepared subcommand.\n *\n * See .command() for creating an attached subcommand which inherits settings from its parent.\n *\n * @param {Command} cmd - new subcommand\n * @param {object} [opts] - configuration options\n * @return {Command} `this` command for chaining\n */\n\n addCommand(cmd, opts) {\n if (!cmd._name) {\n throw new Error(`Command passed to .addCommand() must have a name\n- specify the name in Command constructor or using .name()`);\n }\n\n opts = opts || {};\n if (opts.isDefault) this._defaultCommandName = cmd._name;\n if (opts.noHelp || opts.hidden) cmd._hidden = true; // modifying passed command due to existing implementation\n\n this._registerCommand(cmd);\n cmd.parent = this;\n cmd._checkForBrokenPassThrough();\n\n return this;\n }\n\n /**\n * Factory routine to create a new unattached argument.\n *\n * See .argument() for creating an attached argument, which uses this routine to\n * create the argument. You can override createArgument to return a custom argument.\n *\n * @param {string} name\n * @param {string} [description]\n * @return {Argument} new argument\n */\n\n createArgument(name, description) {\n return new Argument(name, description);\n }\n\n /**\n * Define argument syntax for command.\n *\n * The default is that the argument is required, and you can explicitly\n * indicate this with <> around the name. Put [] around the name for an optional argument.\n *\n * @example\n * program.argument('<input-file>');\n * program.argument('[output-file]');\n *\n * @param {string} name\n * @param {string} [description]\n * @param {(Function|*)} [parseArg] - custom argument processing function or default value\n * @param {*} [defaultValue]\n * @return {Command} `this` command for chaining\n */\n argument(name, description, parseArg, defaultValue) {\n const argument = this.createArgument(name, description);\n if (typeof parseArg === 'function') {\n argument.default(defaultValue).argParser(parseArg);\n } else {\n argument.default(parseArg);\n }\n this.addArgument(argument);\n return this;\n }\n\n /**\n * Define argument syntax for command, adding multiple at once (without descriptions).\n *\n * See also .argument().\n *\n * @example\n * program.arguments('<cmd> [env]');\n *\n * @param {string} names\n * @return {Command} `this` command for chaining\n */\n\n arguments(names) {\n names\n .trim()\n .split(/ +/)\n .forEach((detail) => {\n this.argument(detail);\n });\n return this;\n }\n\n /**\n * Define argument syntax for command, adding a prepared argument.\n *\n * @param {Argument} argument\n * @return {Command} `this` command for chaining\n */\n addArgument(argument) {\n const previousArgument = this.registeredArguments.slice(-1)[0];\n if (previousArgument && previousArgument.variadic) {\n throw new Error(\n `only the last argument can be variadic '${previousArgument.name()}'`,\n );\n }\n if (\n argument.required &&\n argument.defaultValue !== undefined &&\n argument.parseArg === undefined\n ) {\n throw new Error(\n `a default value for a required argument is never used: '${argument.name()}'`,\n );\n }\n this.registeredArguments.push(argument);\n return this;\n }\n\n /**\n * Customise or override default help command. By default a help command is automatically added if your command has subcommands.\n *\n * @example\n * program.helpCommand('help [cmd]');\n * program.helpCommand('help [cmd]', 'show help');\n * program.helpCommand(false); // suppress default help command\n * program.helpCommand(true); // add help command even if no subcommands\n *\n * @param {string|boolean} enableOrNameAndArgs - enable with custom name and/or arguments, or boolean to override whether added\n * @param {string} [description] - custom description\n * @return {Command} `this` command for chaining\n */\n\n helpCommand(enableOrNameAndArgs, description) {\n if (typeof enableOrNameAndArgs === 'boolean') {\n this._addImplicitHelpCommand = enableOrNameAndArgs;\n if (enableOrNameAndArgs && this._defaultCommandGroup) {\n // make the command to store the group\n this._initCommandGroup(this._getHelpCommand());\n }\n return this;\n }\n\n const nameAndArgs = enableOrNameAndArgs ?? 'help [command]';\n const [, helpName, helpArgs] = nameAndArgs.match(/([^ ]+) *(.*)/);\n const helpDescription = description ?? 'display help for command';\n\n const helpCommand = this.createCommand(helpName);\n helpCommand.helpOption(false);\n if (helpArgs) helpCommand.arguments(helpArgs);\n if (helpDescription) helpCommand.description(helpDescription);\n\n this._addImplicitHelpCommand = true;\n this._helpCommand = helpCommand;\n // init group unless lazy create\n if (enableOrNameAndArgs || description) this._initCommandGroup(helpCommand);\n\n return this;\n }\n\n /**\n * Add prepared custom help command.\n *\n * @param {(Command|string|boolean)} helpCommand - custom help command, or deprecated enableOrNameAndArgs as for `.helpCommand()`\n * @param {string} [deprecatedDescription] - deprecated custom description used with custom name only\n * @return {Command} `this` command for chaining\n */\n addHelpCommand(helpCommand, deprecatedDescription) {\n // If not passed an object, call through to helpCommand for backwards compatibility,\n // as addHelpCommand was originally used like helpCommand is now.\n if (typeof helpCommand !== 'object') {\n this.helpCommand(helpCommand, deprecatedDescription);\n return this;\n }\n\n this._addImplicitHelpCommand = true;\n this._helpCommand = helpCommand;\n this._initCommandGroup(helpCommand);\n return this;\n }\n\n /**\n * Lazy create help command.\n *\n * @return {(Command|null)}\n * @package\n */\n _getHelpCommand() {\n const hasImplicitHelpCommand =\n this._addImplicitHelpCommand ??\n (this.commands.length &&\n !this._actionHandler &&\n !this._findCommand('help'));\n\n if (hasImplicitHelpCommand) {\n if (this._helpCommand === undefined) {\n this.helpCommand(undefined, undefined); // use default name and description\n }\n return this._helpCommand;\n }\n return null;\n }\n\n /**\n * Add hook for life cycle event.\n *\n * @param {string} event\n * @param {Function} listener\n * @return {Command} `this` command for chaining\n */\n\n hook(event, listener) {\n const allowedValues = ['preSubcommand', 'preAction', 'postAction'];\n if (!allowedValues.includes(event)) {\n throw new Error(`Unexpected value for event passed to hook : '${event}'.\nExpecting one of '${allowedValues.join(\"', '\")}'`);\n }\n if (this._lifeCycleHooks[event]) {\n this._lifeCycleHooks[event].push(listener);\n } else {\n this._lifeCycleHooks[event] = [listener];\n }\n return this;\n }\n\n /**\n * Register callback to use as replacement for calling process.exit.\n *\n * @param {Function} [fn] optional callback which will be passed a CommanderError, defaults to throwing\n * @return {Command} `this` command for chaining\n */\n\n exitOverride(fn) {\n if (fn) {\n this._exitCallback = fn;\n } else {\n this._exitCallback = (err) => {\n if (err.code !== 'commander.executeSubCommandAsync') {\n throw err;\n } else {\n // Async callback from spawn events, not useful to throw.\n }\n };\n }\n return this;\n }\n\n /**\n * Call process.exit, and _exitCallback if defined.\n *\n * @param {number} exitCode exit code for using with process.exit\n * @param {string} code an id string representing the error\n * @param {string} message human-readable description of the error\n * @return never\n * @private\n */\n\n _exit(exitCode, code, message) {\n if (this._exitCallback) {\n this._exitCallback(new CommanderError(exitCode, code, message));\n // Expecting this line is not reached.\n }\n process.exit(exitCode);\n }\n\n /**\n * Register callback `fn` for the command.\n *\n * @example\n * program\n * .command('serve')\n * .description('start service')\n * .action(function() {\n * // do work here\n * });\n *\n * @param {Function} fn\n * @return {Command} `this` command for chaining\n */\n\n action(fn) {\n const listener = (args) => {\n // The .action callback takes an extra parameter which is the command or options.\n const expectedArgsCount = this.registeredArguments.length;\n const actionArgs = args.slice(0, expectedArgsCount);\n if (this._storeOptionsAsProperties) {\n actionArgs[expectedArgsCount] = this; // backwards compatible \"options\"\n } else {\n actionArgs[expectedArgsCount] = this.opts();\n }\n actionArgs.push(this);\n\n return fn.apply(this, actionArgs);\n };\n this._actionHandler = listener;\n return this;\n }\n\n /**\n * Factory routine to create a new unattached option.\n *\n * See .option() for creating an attached option, which uses this routine to\n * create the option. You can override createOption to return a custom option.\n *\n * @param {string} flags\n * @param {string} [description]\n * @return {Option} new option\n */\n\n createOption(flags, description) {\n return new Option(flags, description);\n }\n\n /**\n * Wrap parseArgs to catch 'commander.invalidArgument'.\n *\n * @param {(Option | Argument)} target\n * @param {string} value\n * @param {*} previous\n * @param {string} invalidArgumentMessage\n * @private\n */\n\n _callParseArg(target, value, previous, invalidArgumentMessage) {\n try {\n return target.parseArg(value, previous);\n } catch (err) {\n if (err.code === 'commander.invalidArgument') {\n const message = `${invalidArgumentMessage} ${err.message}`;\n this.error(message, { exitCode: err.exitCode, code: err.code });\n }\n throw err;\n }\n }\n\n /**\n * Check for option flag conflicts.\n * Register option if no conflicts found, or throw on conflict.\n *\n * @param {Option} option\n * @private\n */\n\n _registerOption(option) {\n const matchingOption =\n (option.short && this._findOption(option.short)) ||\n (option.long && this._findOption(option.long));\n if (matchingOption) {\n const matchingFlag =\n option.long && this._findOption(option.long)\n ? option.long\n : option.short;\n throw new Error(`Cannot add option '${option.flags}'${this._name && ` to command '${this._name}'`} due to conflicting flag '${matchingFlag}'\n- already used by option '${matchingOption.flags}'`);\n }\n\n this._initOptionGroup(option);\n this.options.push(option);\n }\n\n /**\n * Check for command name and alias conflicts with existing commands.\n * Register command if no conflicts found, or throw on conflict.\n *\n * @param {Command} command\n * @private\n */\n\n _registerCommand(command) {\n const knownBy = (cmd) => {\n return [cmd.name()].concat(cmd.aliases());\n };\n\n const alreadyUsed = knownBy(command).find((name) =>\n this._findCommand(name),\n );\n if (alreadyUsed) {\n const existingCmd = knownBy(this._findCommand(alreadyUsed)).join('|');\n const newCmd = knownBy(command).join('|');\n throw new Error(\n `cannot add command '${newCmd}' as already have command '${existingCmd}'`,\n );\n }\n\n this._initCommandGroup(command);\n this.commands.push(command);\n }\n\n /**\n * Add an option.\n *\n * @param {Option} option\n * @return {Command} `this` command for chaining\n */\n addOption(option) {\n this._registerOption(option);\n\n const oname = option.name();\n const name = option.attributeName();\n\n // store default value\n if (option.negate) {\n // --no-foo is special and defaults foo to true, unless a --foo option is already defined\n const positiveLongFlag = option.long.replace(/^--no-/, '--');\n if (!this._findOption(positiveLongFlag)) {\n this.setOptionValueWithSource(\n name,\n option.defaultValue === undefined ? true : option.defaultValue,\n 'default',\n );\n }\n } else if (option.defaultValue !== undefined) {\n this.setOptionValueWithSource(name, option.defaultValue, 'default');\n }\n\n // handler for cli and env supplied values\n const handleOptionValue = (val, invalidValueMessage, valueSource) => {\n // val is null for optional option used without an optional-argument.\n // val is undefined for boolean and negated option.\n if (val == null && option.presetArg !== undefined) {\n val = option.presetArg;\n }\n\n // custom processing\n const oldValue = this.getOptionValue(name);\n if (val !== null && option.parseArg) {\n val = this._callParseArg(option, val, oldValue, invalidValueMessage);\n } else if (val !== null && option.variadic) {\n val = option._concatValue(val, oldValue);\n }\n\n // Fill-in appropriate missing values. Long winded but easy to follow.\n if (val == null) {\n if (option.negate) {\n val = false;\n } else if (option.isBoolean() || option.optional) {\n val = true;\n } else {\n val = ''; // not normal, parseArg might have failed or be a mock function for testing\n }\n }\n this.setOptionValueWithSource(name, val, valueSource);\n };\n\n this.on('option:' + oname, (val) => {\n const invalidValueMessage = `error: option '${option.flags}' argument '${val}' is invalid.`;\n handleOptionValue(val, invalidValueMessage, 'cli');\n });\n\n if (option.envVar) {\n this.on('optionEnv:' + oname, (val) => {\n const invalidValueMessage = `error: option '${option.flags}' value '${val}' from env '${option.envVar}' is invalid.`;\n handleOptionValue(val, invalidValueMessage, 'env');\n });\n }\n\n return this;\n }\n\n /**\n * Internal implementation shared by .option() and .requiredOption()\n *\n * @return {Command} `this` command for chaining\n * @private\n */\n _optionEx(config, flags, description, fn, defaultValue) {\n if (typeof flags === 'object' && flags instanceof Option) {\n throw new Error(\n 'To add an Option object use addOption() instead of option() or requiredOption()',\n );\n }\n const option = this.createOption(flags, description);\n option.makeOptionMandatory(!!config.mandatory);\n if (typeof fn === 'function') {\n option.default(defaultValue).argParser(fn);\n } else if (fn instanceof RegExp) {\n // deprecated\n const regex = fn;\n fn = (val, def) => {\n const m = regex.exec(val);\n return m ? m[0] : def;\n };\n option.default(defaultValue).argParser(fn);\n } else {\n option.default(fn);\n }\n\n return this.addOption(option);\n }\n\n /**\n * Define option with `flags`, `description`, and optional argument parsing function or `defaultValue` or both.\n *\n * The `flags` string contains the short and/or long flags, separated by comma, a pipe or space. A required\n * option-argument is indicated by `<>` and an optional option-argument by `[]`.\n *\n * See the README for more details, and see also addOption() and requiredOption().\n *\n * @example\n * program\n * .option('-p, --pepper', 'add pepper')\n * .option('--pt, --pizza-type <TYPE>', 'type of pizza') // required option-argument\n * .option('-c, --cheese [CHEESE]', 'add extra cheese', 'mozzarella') // optional option-argument with default\n * .option('-t, --tip <VALUE>', 'add tip to purchase cost', parseFloat) // custom parse function\n *\n * @param {string} flags\n * @param {string} [description]\n * @param {(Function|*)} [parseArg] - custom option processing function or default value\n * @param {*} [defaultValue]\n * @return {Command} `this` command for chaining\n */\n\n option(flags, description, parseArg, defaultValue) {\n return this._optionEx({}, flags, description, parseArg, defaultValue);\n }\n\n /**\n * Add a required option which must have a value after parsing. This usually means\n * the option must be specified on the command line. (Otherwise the same as .option().)\n *\n * The `flags` string contains the short and/or long flags, separated by comma, a pipe or space.\n *\n * @param {string} flags\n * @param {string} [description]\n * @param {(Function|*)} [parseArg] - custom option processing function or default value\n * @param {*} [defaultValue]\n * @return {Command} `this` command for chaining\n */\n\n requiredOption(flags, description, parseArg, defaultValue) {\n return this._optionEx(\n { mandatory: true },\n flags,\n description,\n parseArg,\n defaultValue,\n );\n }\n\n /**\n * Alter parsing of short flags with optional values.\n *\n * @example\n * // for `.option('-f,--flag [value]'):\n * program.combineFlagAndOptionalValue(true); // `-f80` is treated like `--flag=80`, this is the default behaviour\n * program.combineFlagAndOptionalValue(false) // `-fb` is treated like `-f -b`\n *\n * @param {boolean} [combine] - if `true` or omitted, an optional value can be specified directly after the flag.\n * @return {Command} `this` command for chaining\n */\n combineFlagAndOptionalValue(combine = true) {\n this._combineFlagAndOptionalValue = !!combine;\n return this;\n }\n\n /**\n * Allow unknown options on the command line.\n *\n * @param {boolean} [allowUnknown] - if `true` or omitted, no error will be thrown for unknown options.\n * @return {Command} `this` command for chaining\n */\n allowUnknownOption(allowUnknown = true) {\n this._allowUnknownOption = !!allowUnknown;\n return this;\n }\n\n /**\n * Allow excess command-arguments on the command line. Pass false to make excess arguments an error.\n *\n * @param {boolean} [allowExcess] - if `true` or omitted, no error will be thrown for excess arguments.\n * @return {Command} `this` command for chaining\n */\n allowExcessArguments(allowExcess = true) {\n this._allowExcessArguments = !!allowExcess;\n return this;\n }\n\n /**\n * Enable positional options. Positional means global options are specified before subcommands which lets\n * subcommands reuse the same option names, and also enables subcommands to turn on passThroughOptions.\n * The default behaviour is non-positional and global options may appear anywhere on the command line.\n *\n * @param {boolean} [positional]\n * @return {Command} `this` command for chaining\n */\n enablePositionalOptions(positional = true) {\n this._enablePositionalOptions = !!positional;\n return this;\n }\n\n /**\n * Pass through options that come after command-arguments rather than treat them as command-options,\n * so actual command-options come before command-arguments. Turning this on for a subcommand requires\n * positional options to have been enabled on the program (parent commands).\n * The default behaviour is non-positional and options may appear before or after command-arguments.\n *\n * @param {boolean} [passThrough] for unknown options.\n * @return {Command} `this` command for chaining\n */\n passThroughOptions(passThrough = true) {\n this._passThroughOptions = !!passThrough;\n this._checkForBrokenPassThrough();\n return this;\n }\n\n /**\n * @private\n */\n\n _checkForBrokenPassThrough() {\n if (\n this.parent &&\n this._passThroughOptions &&\n !this.parent._enablePositionalOptions\n ) {\n throw new Error(\n `passThroughOptions cannot be used for '${this._name}' without turning on enablePositionalOptions for parent command(s)`,\n );\n }\n }\n\n /**\n * Whether to store option values as properties on command object,\n * or store separately (specify false). In both cases the option values can be accessed using .opts().\n *\n * @param {boolean} [storeAsProperties=true]\n * @return {Command} `this` command for chaining\n */\n\n storeOptionsAsProperties(storeAsProperties = true) {\n if (this.options.length) {\n throw new Error('call .storeOptionsAsProperties() before adding options');\n }\n if (Object.keys(this._optionValues).length) {\n throw new Error(\n 'call .storeOptionsAsProperties() before setting option values',\n );\n }\n this._storeOptionsAsProperties = !!storeAsProperties;\n return this;\n }\n\n /**\n * Retrieve option value.\n *\n * @param {string} key\n * @return {object} value\n */\n\n getOptionValue(key) {\n if (this._storeOptionsAsProperties) {\n return this[key];\n }\n return this._optionValues[key];\n }\n\n /**\n * Store option value.\n *\n * @param {string} key\n * @param {object} value\n * @return {Command} `this` command for chaining\n */\n\n setOptionValue(key, value) {\n return this.setOptionValueWithSource(key, value, undefined);\n }\n\n /**\n * Store option value and where the value came from.\n *\n * @param {string} key\n * @param {object} value\n * @param {string} source - expected values are default/config/env/cli/implied\n * @return {Command} `this` command for chaining\n */\n\n setOptionValueWithSource(key, value, source) {\n if (this._storeOptionsAsProperties) {\n this[key] = value;\n } else {\n this._optionValues[key] = value;\n }\n this._optionValueSources[key] = source;\n return this;\n }\n\n /**\n * Get source of option value.\n * Expected values are default | config | env | cli | implied\n *\n * @param {string} key\n * @return {string}\n */\n\n getOptionValueSource(key) {\n return this._optionValueSources[key];\n }\n\n /**\n * Get source of option value. See also .optsWithGlobals().\n * Expected values are default | config | env | cli | implied\n *\n * @param {string} key\n * @return {string}\n */\n\n getOptionValueSourceWithGlobals(key) {\n // global overwrites local, like optsWithGlobals\n let source;\n this._getCommandAndAncestors().forEach((cmd) => {\n if (cmd.getOptionValueSource(key) !== undefined) {\n source = cmd.getOptionValueSource(key);\n }\n });\n return source;\n }\n\n /**\n * Get user arguments from implied or explicit arguments.\n * Side-effects: set _scriptPath if args included script. Used for default program name, and subcommand searches.\n *\n * @private\n */\n\n _prepareUserArgs(argv, parseOptions) {\n if (argv !== undefined && !Array.isArray(argv)) {\n throw new Error('first parameter to parse must be array or undefined');\n }\n parseOptions = parseOptions || {};\n\n // auto-detect argument conventions if nothing supplied\n if (argv === undefined && parseOptions.from === undefined) {\n if (process.versions?.electron) {\n parseOptions.from = 'electron';\n }\n // check node specific options for scenarios where user CLI args follow executable without scriptname\n const execArgv = process.execArgv ?? [];\n if (\n execArgv.includes('-e') ||\n execArgv.includes('--eval') ||\n execArgv.includes('-p') ||\n execArgv.includes('--print')\n ) {\n parseOptions.from = 'eval'; // internal usage, not documented\n }\n }\n\n // default to using process.argv\n if (argv === undefined) {\n argv = process.argv;\n }\n this.rawArgs = argv.slice();\n\n // extract the user args and scriptPath\n let userArgs;\n switch (parseOptions.from) {\n case undefined:\n case 'node':\n this._scriptPath = argv[1];\n userArgs = argv.slice(2);\n break;\n case 'electron':\n // @ts-ignore: because defaultApp is an unknown property\n if (process.defaultApp) {\n this._scriptPath = argv[1];\n userArgs = argv.slice(2);\n } else {\n userArgs = argv.slice(1);\n }\n break;\n case 'user':\n userArgs = argv.slice(0);\n break;\n case 'eval':\n userArgs = argv.slice(1);\n break;\n default:\n throw new Error(\n `unexpected parse option { from: '${parseOptions.from}' }`,\n );\n }\n\n // Find default name for program from arguments.\n if (!this._name && this._scriptPath)\n this.nameFromFilename(this._scriptPath);\n this._name = this._name || 'program';\n\n return userArgs;\n }\n\n /**\n * Parse `argv`, setting options and invoking commands when defined.\n *\n * Use parseAsync instead of parse if any of your action handlers are async.\n *\n * Call with no parameters to parse `process.argv`. Detects Electron and special node options like `node --eval`. Easy mode!\n *\n * Or call with an array of strings to parse, and optionally where the user arguments start by specifying where the arguments are `from`:\n * - `'node'`: default, `argv[0]` is the application and `argv[1]` is the script being run, with user arguments after that\n * - `'electron'`: `argv[0]` is the application and `argv[1]` varies depending on whether the electron application is packaged\n * - `'user'`: just user arguments\n *\n * @example\n * program.parse(); // parse process.argv and auto-detect electron and special node flags\n * program.parse(process.argv); // assume argv[0] is app and argv[1] is script\n * program.parse(my-args, { from: 'user' }); // just user supplied arguments, nothing special about argv[0]\n *\n * @param {string[]} [argv] - optional, defaults to process.argv\n * @param {object} [parseOptions] - optionally specify style of options with from: node/user/electron\n * @param {string} [parseOptions.from] - where the args are from: 'node', 'user', 'electron'\n * @return {Command} `this` command for chaining\n */\n\n parse(argv, parseOptions) {\n this._prepareForParse();\n const userArgs = this._prepareUserArgs(argv, parseOptions);\n this._parseCommand([], userArgs);\n\n return this;\n }\n\n /**\n * Parse `argv`, setting options and invoking commands when defined.\n *\n * Call with no parameters to parse `process.argv`. Detects Electron and special node options like `node --eval`. Easy mode!\n *\n * Or call with an array of strings to parse, and optionally where the user arguments start by specifying where the arguments are `from`:\n * - `'node'`: default, `argv[0]` is the application and `argv[1]` is the script being run, with user arguments after that\n * - `'electron'`: `argv[0]` is the application and `argv[1]` varies depending on whether the electron application is packaged\n * - `'user'`: just user arguments\n *\n * @example\n * await program.parseAsync(); // parse process.argv and auto-detect electron and special node flags\n * await program.parseAsync(process.argv); // assume argv[0] is app and argv[1] is script\n * await program.parseAsync(my-args, { from: 'user' }); // just user supplied arguments, nothing special about argv[0]\n *\n * @param {string[]} [argv]\n * @param {object} [parseOptions]\n * @param {string} parseOptions.from - where the args are from: 'node', 'user', 'electron'\n * @return {Promise}\n */\n\n async parseAsync(argv, parseOptions) {\n this._prepareForParse();\n const userArgs = this._prepareUserArgs(argv, parseOptions);\n await this._parseCommand([], userArgs);\n\n return this;\n }\n\n _prepareForParse() {\n if (this._savedState === null) {\n this.saveStateBeforeParse();\n } else {\n this.restoreStateBeforeParse();\n }\n }\n\n /**\n * Called the first time parse is called to save state and allow a restore before subsequent calls to parse.\n * Not usually called directly, but available for subclasses to save their custom state.\n *\n * This is called in a lazy way. Only commands used in parsing chain will have state saved.\n */\n saveStateBeforeParse() {\n this._savedState = {\n // name is stable if supplied by author, but may be unspecified for root command and deduced during parsing\n _name: this._name,\n // option values before parse have default values (including false for negated options)\n // shallow clones\n _optionValues: { ...this._optionValues },\n _optionValueSources: { ...this._optionValueSources },\n };\n }\n\n /**\n * Restore state before parse for calls after the first.\n * Not usually called directly, but available for subclasses to save their custom state.\n *\n * This is called in a lazy way. Only commands used in parsing chain will have state restored.\n */\n restoreStateBeforeParse() {\n if (this._storeOptionsAsProperties)\n throw new Error(`Can not call parse again when storeOptionsAsProperties is true.\n- either make a new Command for each call to parse, or stop storing options as properties`);\n\n // clear state from _prepareUserArgs\n this._name = this._savedState._name;\n this._scriptPath = null;\n this.rawArgs = [];\n // clear state from setOptionValueWithSource\n this._optionValues = { ...this._savedState._optionValues };\n this._optionValueSources = { ...this._savedState._optionValueSources };\n // clear state from _parseCommand\n this.args = [];\n // clear state from _processArguments\n this.processedArgs = [];\n }\n\n /**\n * Throw if expected executable is missing. Add lots of help for author.\n *\n * @param {string} executableFile\n * @param {string} executableDir\n * @param {string} subcommandName\n */\n _checkForMissingExecutable(executableFile, executableDir, subcommandName) {\n if (fs.existsSync(executableFile)) return;\n\n const executableDirMessage = executableDir\n ? `searched for local subcommand relative to directory '${executableDir}'`\n : 'no directory for search for local subcommand, use .executableDir() to supply a custom directory';\n const executableMissing = `'${executableFile}' does not exist\n - if '${subcommandName}' is not meant to be an executable command, remove description parameter from '.command()' and use '.description()' instead\n - if the default executable name is not suitable, use the executableFile option to supply a custom name or path\n - ${executableDirMessage}`;\n throw new Error(executableMissing);\n }\n\n /**\n * Execute a sub-command executable.\n *\n * @private\n */\n\n _executeSubCommand(subcommand, args) {\n args = args.slice();\n let launchWithNode = false; // Use node for source targets so do not need to get permissions correct, and on Windows.\n const sourceExt = ['.js', '.ts', '.tsx', '.mjs', '.cjs'];\n\n function findFile(baseDir, baseName) {\n // Look for specified file\n const localBin = path.resolve(baseDir, baseName);\n if (fs.existsSync(localBin)) return localBin;\n\n // Stop looking if candidate already has an expected extension.\n if (sourceExt.includes(path.extname(baseName))) return undefined;\n\n // Try all the extensions.\n const foundExt = sourceExt.find((ext) =>\n fs.existsSync(`${localBin}${ext}`),\n );\n if (foundExt) return `${localBin}${foundExt}`;\n\n return undefined;\n }\n\n // Not checking for help first. Unlikely to have mandatory and executable, and can't robustly test for help flags in external command.\n this._checkForMissingMandatoryOptions();\n this._checkForConflictingOptions();\n\n // executableFile and executableDir might be full path, or just a name\n let executableFile =\n subcommand._executableFile || `${this._name}-${subcommand._name}`;\n let executableDir = this._executableDir || '';\n if (this._scriptPath) {\n let resolvedScriptPath; // resolve possible symlink for installed npm binary\n try {\n resolvedScriptPath = fs.realpathSync(this._scriptPath);\n } catch {\n resolvedScriptPath = this._scriptPath;\n }\n executableDir = path.resolve(\n path.dirname(resolvedScriptPath),\n executableDir,\n );\n }\n\n // Look for a local file in preference to a command in PATH.\n if (executableDir) {\n let localFile = findFile(executableDir, executableFile);\n\n // Legacy search using prefix of script name instead of command name\n if (!localFile && !subcommand._executableFile && this._scriptPath) {\n const legacyName = path.basename(\n this._scriptPath,\n path.extname(this._scriptPath),\n );\n if (legacyName !== this._name) {\n localFile = findFile(\n executableDir,\n `${legacyName}-${subcommand._name}`,\n );\n }\n }\n executableFile = localFile || executableFile;\n }\n\n launchWithNode = sourceExt.includes(path.extname(executableFile));\n\n let proc;\n if (process.platform !== 'win32') {\n if (launchWithNode) {\n args.unshift(executableFile);\n // add executable arguments to spawn\n args = incrementNodeInspectorPort(process.execArgv).concat(args);\n\n proc = childProcess.spawn(process.argv[0], args, { stdio: 'inherit' });\n } else {\n proc = childProcess.spawn(executableFile, args, { stdio: 'inherit' });\n }\n } else {\n this._checkForMissingExecutable(\n executableFile,\n executableDir,\n subcommand._name,\n );\n args.unshift(executableFile);\n // add executable arguments to spawn\n args = incrementNodeInspectorPort(process.execArgv).concat(args);\n proc = childProcess.spawn(process.execPath, args, { stdio: 'inherit' });\n }\n\n if (!proc.killed) {\n // testing mainly to avoid leak warnings during unit tests with mocked spawn\n const signals = ['SIGUSR1', 'SIGUSR2', 'SIGTERM', 'SIGINT', 'SIGHUP'];\n signals.forEach((signal) => {\n process.on(signal, () => {\n if (proc.killed === false && proc.exitCode === null) {\n // @ts-ignore because signals not typed to known strings\n proc.kill(signal);\n }\n });\n });\n }\n\n // By default terminate process when spawned process terminates.\n const exitCallback = this._exitCallback;\n proc.on('close', (code) => {\n code = code ?? 1; // code is null if spawned process terminated due to a signal\n if (!exitCallback) {\n process.exit(code);\n } else {\n exitCallback(\n new CommanderError(\n code,\n 'commander.executeSubCommandAsync',\n '(close)',\n ),\n );\n }\n });\n proc.on('error', (err) => {\n // @ts-ignore: because err.code is an unknown property\n if (err.code === 'ENOENT') {\n this._checkForMissingExecutable(\n executableFile,\n executableDir,\n subcommand._name,\n );\n // @ts-ignore: because err.code is an unknown property\n } else if (err.code === 'EACCES') {\n throw new Error(`'${executableFile}' not executable`);\n }\n if (!exitCallback) {\n process.exit(1);\n } else {\n const wrappedError = new CommanderError(\n 1,\n 'commander.executeSubCommandAsync',\n '(error)',\n );\n wrappedError.nestedError = err;\n exitCallback(wrappedError);\n }\n });\n\n // Store the reference to the child process\n this.runningCommand = proc;\n }\n\n /**\n * @private\n */\n\n _dispatchSubcommand(commandName, operands, unknown) {\n const subCommand = this._findCommand(commandName);\n if (!subCommand) this.help({ error: true });\n\n subCommand._prepareForParse();\n let promiseChain;\n promiseChain = this._chainOrCallSubCommandHook(\n promiseChain,\n subCommand,\n 'preSubcommand',\n );\n promiseChain = this._chainOrCall(promiseChain, () => {\n if (subCommand._executableHandler) {\n this._executeSubCommand(subCommand, operands.concat(unknown));\n } else {\n return subCommand._parseCommand(operands, unknown);\n }\n });\n return promiseChain;\n }\n\n /**\n * Invoke help directly if possible, or dispatch if necessary.\n * e.g. help foo\n *\n * @private\n */\n\n _dispatchHelpCommand(subcommandName) {\n if (!subcommandName) {\n this.help();\n }\n const subCommand = this._findCommand(subcommandName);\n if (subCommand && !subCommand._executableHandler) {\n subCommand.help();\n }\n\n // Fallback to parsing the help flag to invoke the help.\n return this._dispatchSubcommand(\n subcommandName,\n [],\n [this._getHelpOption()?.long ?? this._getHelpOption()?.short ?? '--help'],\n );\n }\n\n /**\n * Check this.args against expected this.registeredArguments.\n *\n * @private\n */\n\n _checkNumberOfArguments() {\n // too few\n this.registeredArguments.forEach((arg, i) => {\n if (arg.required && this.args[i] == null) {\n this.missingArgument(arg.name());\n }\n });\n // too many\n if (\n this.registeredArguments.length > 0 &&\n this.registeredArguments[this.registeredArguments.length - 1].variadic\n ) {\n return;\n }\n if (this.args.length > this.registeredArguments.length) {\n this._excessArguments(this.args);\n }\n }\n\n /**\n * Process this.args using this.registeredArguments and save as this.processedArgs!\n *\n * @private\n */\n\n _processArguments() {\n const myParseArg = (argument, value, previous) => {\n // Extra processing for nice error message on parsing failure.\n let parsedValue = value;\n if (value !== null && argument.parseArg) {\n const invalidValueMessage = `error: command-argument value '${value}' is invalid for argument '${argument.name()}'.`;\n parsedValue = this._callParseArg(\n argument,\n value,\n previous,\n invalidValueMessage,\n );\n }\n return parsedValue;\n };\n\n this._checkNumberOfArguments();\n\n const processedArgs = [];\n this.registeredArguments.forEach((declaredArg, index) => {\n let value = declaredArg.defaultValue;\n if (declaredArg.variadic) {\n // Collect together remaining arguments for passing together as an array.\n if (index < this.args.length) {\n value = this.args.slice(index);\n if (declaredArg.parseArg) {\n value = value.reduce((processed, v) => {\n return myParseArg(declaredArg, v, processed);\n }, declaredArg.defaultValue);\n }\n } else if (value === undefined) {\n value = [];\n }\n } else if (index < this.args.length) {\n value = this.args[index];\n if (declaredArg.parseArg) {\n value = myParseArg(declaredArg, value, declaredArg.defaultValue);\n }\n }\n processedArgs[index] = value;\n });\n this.processedArgs = processedArgs;\n }\n\n /**\n * Once we have a promise we chain, but call synchronously until then.\n *\n * @param {(Promise|undefined)} promise\n * @param {Function} fn\n * @return {(Promise|undefined)}\n * @private\n */\n\n _chainOrCall(promise, fn) {\n // thenable\n if (promise && promise.then && typeof promise.then === 'function') {\n // already have a promise, chain callback\n return promise.then(() => fn());\n }\n // callback might return a promise\n return fn();\n }\n\n /**\n *\n * @param {(Promise|undefined)} promise\n * @param {string} event\n * @return {(Promise|undefined)}\n * @private\n */\n\n _chainOrCallHooks(promise, event) {\n let result = promise;\n const hooks = [];\n this._getCommandAndAncestors()\n .reverse()\n .filter((cmd) => cmd._lifeCycleHooks[event] !== undefined)\n .forEach((hookedCommand) => {\n hookedCommand._lifeCycleHooks[event].forEach((callback) => {\n hooks.push({ hookedCommand, callback });\n });\n });\n if (event === 'postAction') {\n hooks.reverse();\n }\n\n hooks.forEach((hookDetail) => {\n result = this._chainOrCall(result, () => {\n return hookDetail.callback(hookDetail.hookedCommand, this);\n });\n });\n return result;\n }\n\n /**\n *\n * @param {(Promise|undefined)} promise\n * @param {Command} subCommand\n * @param {string} event\n * @return {(Promise|undefined)}\n * @private\n */\n\n _chainOrCallSubCommandHook(promise, subCommand, event) {\n let result = promise;\n if (this._lifeCycleHooks[event] !== undefined) {\n this._lifeCycleHooks[event].forEach((hook) => {\n result = this._chainOrCall(result, () => {\n return hook(this, subCommand);\n });\n });\n }\n return result;\n }\n\n /**\n * Process arguments in context of this command.\n * Returns action result, in case it is a promise.\n *\n * @private\n */\n\n _parseCommand(operands, unknown) {\n const parsed = this.parseOptions(unknown);\n this._parseOptionsEnv(); // after cli, so parseArg not called on both cli and env\n this._parseOptionsImplied();\n operands = operands.concat(parsed.operands);\n unknown = parsed.unknown;\n this.args = operands.concat(unknown);\n\n if (operands && this._findCommand(operands[0])) {\n return this._dispatchSubcommand(operands[0], operands.slice(1), unknown);\n }\n if (\n this._getHelpCommand() &&\n operands[0] === this._getHelpCommand().name()\n ) {\n return this._dispatchHelpCommand(operands[1]);\n }\n if (this._defaultCommandName) {\n this._outputHelpIfRequested(unknown); // Run the help for default command from parent rather than passing to default command\n return this._dispatchSubcommand(\n this._defaultCommandName,\n operands,\n unknown,\n );\n }\n if (\n this.commands.length &&\n this.args.length === 0 &&\n !this._actionHandler &&\n !this._defaultCommandName\n ) {\n // probably missing subcommand and no handler, user needs help (and exit)\n this.help({ error: true });\n }\n\n this._outputHelpIfRequested(parsed.unknown);\n this._checkForMissingMandatoryOptions();\n this._checkForConflictingOptions();\n\n // We do not always call this check to avoid masking a \"better\" error, like unknown command.\n const checkForUnknownOptions = () => {\n if (parsed.unknown.length > 0) {\n this.unknownOption(parsed.unknown[0]);\n }\n };\n\n const commandEvent = `command:${this.name()}`;\n if (this._actionHandler) {\n checkForUnknownOptions();\n this._processArguments();\n\n let promiseChain;\n promiseChain = this._chainOrCallHooks(promiseChain, 'preAction');\n promiseChain = this._chainOrCall(promiseChain, () =>\n this._actionHandler(this.processedArgs),\n );\n if (this.parent) {\n promiseChain = this._chainOrCall(promiseChain, () => {\n this.parent.emit(commandEvent, operands, unknown); // legacy\n });\n }\n promiseChain = this._chainOrCallHooks(promiseChain, 'postAction');\n return promiseChain;\n }\n if (this.parent && this.parent.listenerCount(commandEvent)) {\n checkForUnknownOptions();\n this._processArguments();\n this.parent.emit(commandEvent, operands, unknown); // legacy\n } else if (operands.length) {\n if (this._findCommand('*')) {\n // legacy default command\n return this._dispatchSubcommand('*', operands, unknown);\n }\n if (this.listenerCount('command:*')) {\n // skip option check, emit event for possible misspelling suggestion\n this.emit('command:*', operands, unknown);\n } else if (this.commands.length) {\n this.unknownCommand();\n } else {\n checkForUnknownOptions();\n this._processArguments();\n }\n } else if (this.commands.length) {\n checkForUnknownOptions();\n // This command has subcommands and nothing hooked up at this level, so display help (and exit).\n this.help({ error: true });\n } else {\n checkForUnknownOptions();\n this._processArguments();\n // fall through for caller to handle after calling .parse()\n }\n }\n\n /**\n * Find matching command.\n *\n * @private\n * @return {Command | undefined}\n */\n _findCommand(name) {\n if (!name) return undefined;\n return this.commands.find(\n (cmd) => cmd._name === name || cmd._aliases.includes(name),\n );\n }\n\n /**\n * Return an option matching `arg` if any.\n *\n * @param {string} arg\n * @return {Option}\n * @package\n */\n\n _findOption(arg) {\n return this.options.find((option) => option.is(arg));\n }\n\n /**\n * Display an error message if a mandatory option does not have a value.\n * Called after checking for help flags in leaf subcommand.\n *\n * @private\n */\n\n _checkForMissingMandatoryOptions() {\n // Walk up hierarchy so can call in subcommand after checking for displaying help.\n this._getCommandAndAncestors().forEach((cmd) => {\n cmd.options.forEach((anOption) => {\n if (\n anOption.mandatory &&\n cmd.getOptionValue(anOption.attributeName()) === undefined\n ) {\n cmd.missingMandatoryOptionValue(anOption);\n }\n });\n });\n }\n\n /**\n * Display an error message if conflicting options are used together in this.\n *\n * @private\n */\n _checkForConflictingLocalOptions() {\n const definedNonDefaultOptions = this.options.filter((option) => {\n const optionKey = option.attributeName();\n if (this.getOptionValue(optionKey) === undefined) {\n return false;\n }\n return this.getOptionValueSource(optionKey) !== 'default';\n });\n\n const optionsWithConflicting = definedNonDefaultOptions.filter(\n (option) => option.conflictsWith.length > 0,\n );\n\n optionsWithConflicting.forEach((option) => {\n const conflictingAndDefined = definedNonDefaultOptions.find((defined) =>\n option.conflictsWith.includes(defined.attributeName()),\n );\n if (conflictingAndDefined) {\n this._conflictingOption(option, conflictingAndDefined);\n }\n });\n }\n\n /**\n * Display an error message if conflicting options are used together.\n * Called after checking for help flags in leaf subcommand.\n *\n * @private\n */\n _checkForConflictingOptions() {\n // Walk up hierarchy so can call in subcommand after checking for displaying help.\n this._getCommandAndAncestors().forEach((cmd) => {\n cmd._checkForConflictingLocalOptions();\n });\n }\n\n /**\n * Parse options from `argv` removing known options,\n * and return argv split into operands and unknown arguments.\n *\n * Side effects: modifies command by storing options. Does not reset state if called again.\n *\n * Examples:\n *\n * argv => operands, unknown\n * --known kkk op => [op], []\n * op --known kkk => [op], []\n * sub --unknown uuu op => [sub], [--unknown uuu op]\n * sub -- --unknown uuu op => [sub --unknown uuu op], []\n *\n * @param {string[]} argv\n * @return {{operands: string[], unknown: string[]}}\n */\n\n parseOptions(argv) {\n const operands = []; // operands, not options or values\n const unknown = []; // first unknown option and remaining unknown args\n let dest = operands;\n const args = argv.slice();\n\n function maybeOption(arg) {\n return arg.length > 1 && arg[0] === '-';\n }\n\n const negativeNumberArg = (arg) => {\n // return false if not a negative number\n if (!/^-\\d*\\.?\\d+(e[+-]?\\d+)?$/.test(arg)) return false;\n // negative number is ok unless digit used as an option in command hierarchy\n return !this._getCommandAndAncestors().some((cmd) =>\n cmd.options\n .map((opt) => opt.short)\n .some((short) => /^-\\d$/.test(short)),\n );\n };\n\n // parse options\n let activeVariadicOption = null;\n while (args.length) {\n const arg = args.shift();\n\n // literal\n if (arg === '--') {\n if (dest === unknown) dest.push(arg);\n dest.push(...args);\n break;\n }\n\n if (\n activeVariadicOption &&\n (!maybeOption(arg) || negativeNumberArg(arg))\n ) {\n this.emit(`option:${activeVariadicOption.name()}`, arg);\n continue;\n }\n activeVariadicOption = null;\n\n if (maybeOption(arg)) {\n const option = this._findOption(arg);\n // recognised option, call listener to assign value with possible custom processing\n if (option) {\n if (option.required) {\n const value = args.shift();\n if (value === undefined) this.optionMissingArgument(option);\n this.emit(`option:${option.name()}`, value);\n } else if (option.optional) {\n let value = null;\n // historical behaviour is optional value is following arg unless an option\n if (\n args.length > 0 &&\n (!maybeOption(args[0]) || negativeNumberArg(args[0]))\n ) {\n value = args.shift();\n }\n this.emit(`option:${option.name()}`, value);\n } else {\n // boolean flag\n this.emit(`option:${option.name()}`);\n }\n activeVariadicOption = option.variadic ? option : null;\n continue;\n }\n }\n\n // Look for combo options following single dash, eat first one if known.\n if (arg.length > 2 && arg[0] === '-' && arg[1] !== '-') {\n const option = this._findOption(`-${arg[1]}`);\n if (option) {\n if (\n option.required ||\n (option.optional && this._combineFlagAndOptionalValue)\n ) {\n // option with value following in same argument\n this.emit(`option:${option.name()}`, arg.slice(2));\n } else {\n // boolean option, emit and put back remainder of arg for further processing\n this.emit(`option:${option.name()}`);\n args.unshift(`-${arg.slice(2)}`);\n }\n continue;\n }\n }\n\n // Look for known long flag with value, like --foo=bar\n if (/^--[^=]+=/.test(arg)) {\n const index = arg.indexOf('=');\n const option = this._findOption(arg.slice(0, index));\n if (option && (option.required || option.optional)) {\n this.emit(`option:${option.name()}`, arg.slice(index + 1));\n continue;\n }\n }\n\n // Not a recognised option by this command.\n // Might be a command-argument, or subcommand option, or unknown option, or help command or option.\n\n // An unknown option means further arguments also classified as unknown so can be reprocessed by subcommands.\n // A negative number in a leaf command is not an unknown option.\n if (\n dest === operands &&\n maybeOption(arg) &&\n !(this.commands.length === 0 && negativeNumberArg(arg))\n ) {\n dest = unknown;\n }\n\n // If using positionalOptions, stop processing our options at subcommand.\n if (\n (this._enablePositionalOptions || this._passThroughOptions) &&\n operands.length === 0 &&\n unknown.length === 0\n ) {\n if (this._findCommand(arg)) {\n operands.push(arg);\n if (args.length > 0) unknown.push(...args);\n break;\n } else if (\n this._getHelpCommand() &&\n arg === this._getHelpCommand().name()\n ) {\n operands.push(arg);\n if (args.length > 0) operands.push(...args);\n break;\n } else if (this._defaultCommandName) {\n unknown.push(arg);\n if (args.length > 0) unknown.push(...args);\n break;\n }\n }\n\n // If using passThroughOptions, stop processing options at first command-argument.\n if (this._passThroughOptions) {\n dest.push(arg);\n if (args.length > 0) dest.push(...args);\n break;\n }\n\n // add arg\n dest.push(arg);\n }\n\n return { operands, unknown };\n }\n\n /**\n * Return an object containing local option values as key-value pairs.\n *\n * @return {object}\n */\n opts() {\n if (this._storeOptionsAsProperties) {\n // Preserve original behaviour so backwards compatible when still using properties\n const result = {};\n const len = this.options.length;\n\n for (let i = 0; i < len; i++) {\n const key = this.options[i].attributeName();\n result[key] =\n key === this._versionOptionName ? this._version : this[key];\n }\n return result;\n }\n\n return this._optionValues;\n }\n\n /**\n * Return an object containing merged local and global option values as key-value pairs.\n *\n * @return {object}\n */\n optsWithGlobals() {\n // globals overwrite locals\n return this._getCommandAndAncestors().reduce(\n (combinedOptions, cmd) => Object.assign(combinedOptions, cmd.opts()),\n {},\n );\n }\n\n /**\n * Display error message and exit (or call exitOverride).\n *\n * @param {string} message\n * @param {object} [errorOptions]\n * @param {string} [errorOptions.code] - an id string representing the error\n * @param {number} [errorOptions.exitCode] - used with process.exit\n */\n error(message, errorOptions) {\n // output handling\n this._outputConfiguration.outputError(\n `${message}\\n`,\n this._outputConfiguration.writeErr,\n );\n if (typeof this._showHelpAfterError === 'string') {\n this._outputConfiguration.writeErr(`${this._showHelpAfterError}\\n`);\n } else if (this._showHelpAfterError) {\n this._outputConfiguration.writeErr('\\n');\n this.outputHelp({ error: true });\n }\n\n // exit handling\n const config = errorOptions || {};\n const exitCode = config.exitCode || 1;\n const code = config.code || 'commander.error';\n this._exit(exitCode, code, message);\n }\n\n /**\n * Apply any option related environment variables, if option does\n * not have a value from cli or client code.\n *\n * @private\n */\n _parseOptionsEnv() {\n this.options.forEach((option) => {\n if (option.envVar && option.envVar in process.env) {\n const optionKey = option.attributeName();\n // Priority check. Do not overwrite cli or options from unknown source (client-code).\n if (\n this.getOptionValue(optionKey) === undefined ||\n ['default', 'config', 'env'].includes(\n this.getOptionValueSource(optionKey),\n )\n ) {\n if (option.required || option.optional) {\n // option can take a value\n // keep very simple, optional always takes value\n this.emit(`optionEnv:${option.name()}`, process.env[option.envVar]);\n } else {\n // boolean\n // keep very simple, only care that envVar defined and not the value\n this.emit(`optionEnv:${option.name()}`);\n }\n }\n }\n });\n }\n\n /**\n * Apply any implied option values, if option is undefined or default value.\n *\n * @private\n */\n _parseOptionsImplied() {\n const dualHelper = new DualOptions(this.options);\n const hasCustomOptionValue = (optionKey) => {\n return (\n this.getOptionValue(optionKey) !== undefined &&\n !['default', 'implied'].includes(this.getOptionValueSource(optionKey))\n );\n };\n this.options\n .filter(\n (option) =>\n option.implied !== undefined &&\n hasCustomOptionValue(option.attributeName()) &&\n dualHelper.valueFromOption(\n this.getOptionValue(option.attributeName()),\n option,\n ),\n )\n .forEach((option) => {\n Object.keys(option.implied)\n .filter((impliedKey) => !hasCustomOptionValue(impliedKey))\n .forEach((impliedKey) => {\n this.setOptionValueWithSource(\n impliedKey,\n option.implied[impliedKey],\n 'implied',\n );\n });\n });\n }\n\n /**\n * Argument `name` is missing.\n *\n * @param {string} name\n * @private\n */\n\n missingArgument(name) {\n const message = `error: missing required argument '${name}'`;\n this.error(message, { code: 'commander.missingArgument' });\n }\n\n /**\n * `Option` is missing an argument.\n *\n * @param {Option} option\n * @private\n */\n\n optionMissingArgument(option) {\n const message = `error: option '${option.flags}' argument missing`;\n this.error(message, { code: 'commander.optionMissingArgument' });\n }\n\n /**\n * `Option` does not have a value, and is a mandatory option.\n *\n * @param {Option} option\n * @private\n */\n\n missingMandatoryOptionValue(option) {\n const message = `error: required option '${option.flags}' not specified`;\n this.error(message, { code: 'commander.missingMandatoryOptionValue' });\n }\n\n /**\n * `Option` conflicts with another option.\n *\n * @param {Option} option\n * @param {Option} conflictingOption\n * @private\n */\n _conflictingOption(option, conflictingOption) {\n // The calling code does not know whether a negated option is the source of the\n // value, so do some work to take an educated guess.\n const findBestOptionFromValue = (option) => {\n const optionKey = option.attributeName();\n const optionValue = this.getOptionValue(optionKey);\n const negativeOption = this.options.find(\n (target) => target.negate && optionKey === target.attributeName(),\n );\n const positiveOption = this.options.find(\n (target) => !target.negate && optionKey === target.attributeName(),\n );\n if (\n negativeOption &&\n ((negativeOption.presetArg === undefined && optionValue === false) ||\n (negativeOption.presetArg !== undefined &&\n optionValue === negativeOption.presetArg))\n ) {\n return negativeOption;\n }\n return positiveOption || option;\n };\n\n const getErrorMessage = (option) => {\n const bestOption = findBestOptionFromValue(option);\n const optionKey = bestOption.attributeName();\n const source = this.getOptionValueSource(optionKey);\n if (source === 'env') {\n return `environment variable '${bestOption.envVar}'`;\n }\n return `option '${bestOption.flags}'`;\n };\n\n const message = `error: ${getErrorMessage(option)} cannot be used with ${getErrorMessage(conflictingOption)}`;\n this.error(message, { code: 'commander.conflictingOption' });\n }\n\n /**\n * Unknown option `flag`.\n *\n * @param {string} flag\n * @private\n */\n\n unknownOption(flag) {\n if (this._allowUnknownOption) return;\n let suggestion = '';\n\n if (flag.startsWith('--') && this._showSuggestionAfterError) {\n // Looping to pick up the global options too\n let candidateFlags = [];\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n let command = this;\n do {\n const moreFlags = command\n .createHelp()\n .visibleOptions(command)\n .filter((option) => option.long)\n .map((option) => option.long);\n candidateFlags = candidateFlags.concat(moreFlags);\n command = command.parent;\n } while (command && !command._enablePositionalOptions);\n suggestion = suggestSimilar(flag, candidateFlags);\n }\n\n const message = `error: unknown option '${flag}'${suggestion}`;\n this.error(message, { code: 'commander.unknownOption' });\n }\n\n /**\n * Excess arguments, more than expected.\n *\n * @param {string[]} receivedArgs\n * @private\n */\n\n _excessArguments(receivedArgs) {\n if (this._allowExcessArguments) return;\n\n const expected = this.registeredArguments.length;\n const s = expected === 1 ? '' : 's';\n const forSubcommand = this.parent ? ` for '${this.name()}'` : '';\n const message = `error: too many arguments${forSubcommand}. Expected ${expected} argument${s} but got ${receivedArgs.length}.`;\n this.error(message, { code: 'commander.excessArguments' });\n }\n\n /**\n * Unknown command.\n *\n * @private\n */\n\n unknownCommand() {\n const unknownName = this.args[0];\n let suggestion = '';\n\n if (this._showSuggestionAfterError) {\n const candidateNames = [];\n this.createHelp()\n .visibleCommands(this)\n .forEach((command) => {\n candidateNames.push(command.name());\n // just visible alias\n if (command.alias()) candidateNames.push(command.alias());\n });\n suggestion = suggestSimilar(unknownName, candidateNames);\n }\n\n const message = `error: unknown command '${unknownName}'${suggestion}`;\n this.error(message, { code: 'commander.unknownCommand' });\n }\n\n /**\n * Get or set the program version.\n *\n * This method auto-registers the \"-V, --version\" option which will print the version number.\n *\n * You can optionally supply the flags and description to override the defaults.\n *\n * @param {string} [str]\n * @param {string} [flags]\n * @param {string} [description]\n * @return {(this | string | undefined)} `this` command for chaining, or version string if no arguments\n */\n\n version(str, flags, description) {\n if (str === undefined) return this._version;\n this._version = str;\n flags = flags || '-V, --version';\n description = description || 'output the version number';\n const versionOption = this.createOption(flags, description);\n this._versionOptionName = versionOption.attributeName();\n this._registerOption(versionOption);\n\n this.on('option:' + versionOption.name(), () => {\n this._outputConfiguration.writeOut(`${str}\\n`);\n this._exit(0, 'commander.version', str);\n });\n return this;\n }\n\n /**\n * Set the description.\n *\n * @param {string} [str]\n * @param {object} [argsDescription]\n * @return {(string|Command)}\n */\n description(str, argsDescription) {\n if (str === undefined && argsDescription === undefined)\n return this._description;\n this._description = str;\n if (argsDescription) {\n this._argsDescription = argsDescription;\n }\n return this;\n }\n\n /**\n * Set the summary. Used when listed as subcommand of parent.\n *\n * @param {string} [str]\n * @return {(string|Command)}\n */\n summary(str) {\n if (str === undefined) return this._summary;\n this._summary = str;\n return this;\n }\n\n /**\n * Set an alias for the command.\n *\n * You may call more than once to add multiple aliases. Only the first alias is shown in the auto-generated help.\n *\n * @param {string} [alias]\n * @return {(string|Command)}\n */\n\n alias(alias) {\n if (alias === undefined) return this._aliases[0]; // just return first, for backwards compatibility\n\n /** @type {Command} */\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n let command = this;\n if (\n this.commands.length !== 0 &&\n this.commands[this.commands.length - 1]._executableHandler\n ) {\n // assume adding alias for last added executable subcommand, rather than this\n command = this.commands[this.commands.length - 1];\n }\n\n if (alias === command._name)\n throw new Error(\"Command alias can't be the same as its name\");\n const matchingCommand = this.parent?._findCommand(alias);\n if (matchingCommand) {\n // c.f. _registerCommand\n const existingCmd = [matchingCommand.name()]\n .concat(matchingCommand.aliases())\n .join('|');\n throw new Error(\n `cannot add alias '${alias}' to command '${this.name()}' as already have command '${existingCmd}'`,\n );\n }\n\n command._aliases.push(alias);\n return this;\n }\n\n /**\n * Set aliases for the command.\n *\n * Only the first alias is shown in the auto-generated help.\n *\n * @param {string[]} [aliases]\n * @return {(string[]|Command)}\n */\n\n aliases(aliases) {\n // Getter for the array of aliases is the main reason for having aliases() in addition to alias().\n if (aliases === undefined) return this._aliases;\n\n aliases.forEach((alias) => this.alias(alias));\n return this;\n }\n\n /**\n * Set / get the command usage `str`.\n *\n * @param {string} [str]\n * @return {(string|Command)}\n */\n\n usage(str) {\n if (str === undefined) {\n if (this._usage) return this._usage;\n\n const args = this.registeredArguments.map((arg) => {\n return humanReadableArgName(arg);\n });\n return []\n .concat(\n this.options.length || this._helpOption !== null ? '[options]' : [],\n this.commands.length ? '[command]' : [],\n this.registeredArguments.length ? args : [],\n )\n .join(' ');\n }\n\n this._usage = str;\n return this;\n }\n\n /**\n * Get or set the name of the command.\n *\n * @param {string} [str]\n * @return {(string|Command)}\n */\n\n name(str) {\n if (str === undefined) return this._name;\n this._name = str;\n return this;\n }\n\n /**\n * Set/get the help group heading for this subcommand in parent command's help.\n *\n * @param {string} [heading]\n * @return {Command | string}\n */\n\n helpGroup(heading) {\n if (heading === undefined) return this._helpGroupHeading ?? '';\n this._helpGroupHeading = heading;\n return this;\n }\n\n /**\n * Set/get the default help group heading for subcommands added to this command.\n * (This does not override a group set directly on the subcommand using .helpGroup().)\n *\n * @example\n * program.commandsGroup('Development Commands:);\n * program.command('watch')...\n * program.command('lint')...\n * ...\n *\n * @param {string} [heading]\n * @returns {Command | string}\n */\n commandsGroup(heading) {\n if (heading === undefined) return this._defaultCommandGroup ?? '';\n this._defaultCommandGroup = heading;\n return this;\n }\n\n /**\n * Set/get the default help group heading for options added to this command.\n * (This does not override a group set directly on the option using .helpGroup().)\n *\n * @example\n * program\n * .optionsGroup('Development Options:')\n * .option('-d, --debug', 'output extra debugging')\n * .option('-p, --profile', 'output profiling information')\n *\n * @param {string} [heading]\n * @returns {Command | string}\n */\n optionsGroup(heading) {\n if (heading === undefined) return this._defaultOptionGroup ?? '';\n this._defaultOptionGroup = heading;\n return this;\n }\n\n /**\n * @param {Option} option\n * @private\n */\n _initOptionGroup(option) {\n if (this._defaultOptionGroup && !option.helpGroupHeading)\n option.helpGroup(this._defaultOptionGroup);\n }\n\n /**\n * @param {Command} cmd\n * @private\n */\n _initCommandGroup(cmd) {\n if (this._defaultCommandGroup && !cmd.helpGroup())\n cmd.helpGroup(this._defaultCommandGroup);\n }\n\n /**\n * Set the name of the command from script filename, such as process.argv[1],\n * or require.main.filename, or __filename.\n *\n * (Used internally and public although not documented in README.)\n *\n * @example\n * program.nameFromFilename(require.main.filename);\n *\n * @param {string} filename\n * @return {Command}\n */\n\n nameFromFilename(filename) {\n this._name = path.basename(filename, path.extname(filename));\n\n return this;\n }\n\n /**\n * Get or set the directory for searching for executable subcommands of this command.\n *\n * @example\n * program.executableDir(__dirname);\n * // or\n * program.executableDir('subcommands');\n *\n * @param {string} [path]\n * @return {(string|null|Command)}\n */\n\n executableDir(path) {\n if (path === undefined) return this._executableDir;\n this._executableDir = path;\n return this;\n }\n\n /**\n * Return program help documentation.\n *\n * @param {{ error: boolean }} [contextOptions] - pass {error:true} to wrap for stderr instead of stdout\n * @return {string}\n */\n\n helpInformation(contextOptions) {\n const helper = this.createHelp();\n const context = this._getOutputContext(contextOptions);\n helper.prepareContext({\n error: context.error,\n helpWidth: context.helpWidth,\n outputHasColors: context.hasColors,\n });\n const text = helper.formatHelp(this, helper);\n if (context.hasColors) return text;\n return this._outputConfiguration.stripColor(text);\n }\n\n /**\n * @typedef HelpContext\n * @type {object}\n * @property {boolean} error\n * @property {number} helpWidth\n * @property {boolean} hasColors\n * @property {function} write - includes stripColor if needed\n *\n * @returns {HelpContext}\n * @private\n */\n\n _getOutputContext(contextOptions) {\n contextOptions = contextOptions || {};\n const error = !!contextOptions.error;\n let baseWrite;\n let hasColors;\n let helpWidth;\n if (error) {\n baseWrite = (str) => this._outputConfiguration.writeErr(str);\n hasColors = this._outputConfiguration.getErrHasColors();\n helpWidth = this._outputConfiguration.getErrHelpWidth();\n } else {\n baseWrite = (str) => this._outputConfiguration.writeOut(str);\n hasColors = this._outputConfiguration.getOutHasColors();\n helpWidth = this._outputConfiguration.getOutHelpWidth();\n }\n const write = (str) => {\n if (!hasColors) str = this._outputConfiguration.stripColor(str);\n return baseWrite(str);\n };\n return { error, write, hasColors, helpWidth };\n }\n\n /**\n * Output help information for this command.\n *\n * Outputs built-in help, and custom text added using `.addHelpText()`.\n *\n * @param {{ error: boolean } | Function} [contextOptions] - pass {error:true} to write to stderr instead of stdout\n */\n\n outputHelp(contextOptions) {\n let deprecatedCallback;\n if (typeof contextOptions === 'function') {\n deprecatedCallback = contextOptions;\n contextOptions = undefined;\n }\n\n const outputContext = this._getOutputContext(contextOptions);\n /** @type {HelpTextEventContext} */\n const eventContext = {\n error: outputContext.error,\n write: outputContext.write,\n command: this,\n };\n\n this._getCommandAndAncestors()\n .reverse()\n .forEach((command) => command.emit('beforeAllHelp', eventContext));\n this.emit('beforeHelp', eventContext);\n\n let helpInformation = this.helpInformation({ error: outputContext.error });\n if (deprecatedCallback) {\n helpInformation = deprecatedCallback(helpInformation);\n if (\n typeof helpInformation !== 'string' &&\n !Buffer.isBuffer(helpInformation)\n ) {\n throw new Error('outputHelp callback must return a string or a Buffer');\n }\n }\n outputContext.write(helpInformation);\n\n if (this._getHelpOption()?.long) {\n this.emit(this._getHelpOption().long); // deprecated\n }\n this.emit('afterHelp', eventContext);\n this._getCommandAndAncestors().forEach((command) =>\n command.emit('afterAllHelp', eventContext),\n );\n }\n\n /**\n * You can pass in flags and a description to customise the built-in help option.\n * Pass in false to disable the built-in help option.\n *\n * @example\n * program.helpOption('-?, --help' 'show help'); // customise\n * program.helpOption(false); // disable\n *\n * @param {(string | boolean)} flags\n * @param {string} [description]\n * @return {Command} `this` command for chaining\n */\n\n helpOption(flags, description) {\n // Support enabling/disabling built-in help option.\n if (typeof flags === 'boolean') {\n if (flags) {\n if (this._helpOption === null) this._helpOption = undefined; // reenable\n if (this._defaultOptionGroup) {\n // make the option to store the group\n this._initOptionGroup(this._getHelpOption());\n }\n } else {\n this._helpOption = null; // disable\n }\n return this;\n }\n\n // Customise flags and description.\n this._helpOption = this.createOption(\n flags ?? '-h, --help',\n description ?? 'display help for command',\n );\n // init group unless lazy create\n if (flags || description) this._initOptionGroup(this._helpOption);\n\n return this;\n }\n\n /**\n * Lazy create help option.\n * Returns null if has been disabled with .helpOption(false).\n *\n * @returns {(Option | null)} the help option\n * @package\n */\n _getHelpOption() {\n // Lazy create help option on demand.\n if (this._helpOption === undefined) {\n this.helpOption(undefined, undefined);\n }\n return this._helpOption;\n }\n\n /**\n * Supply your own option to use for the built-in help option.\n * This is an alternative to using helpOption() to customise the flags and description etc.\n *\n * @param {Option} option\n * @return {Command} `this` command for chaining\n */\n addHelpOption(option) {\n this._helpOption = option;\n this._initOptionGroup(option);\n return this;\n }\n\n /**\n * Output help information and exit.\n *\n * Outputs built-in help, and custom text added using `.addHelpText()`.\n *\n * @param {{ error: boolean }} [contextOptions] - pass {error:true} to write to stderr instead of stdout\n */\n\n help(contextOptions) {\n this.outputHelp(contextOptions);\n let exitCode = Number(process.exitCode ?? 0); // process.exitCode does allow a string or an integer, but we prefer just a number\n if (\n exitCode === 0 &&\n contextOptions &&\n typeof contextOptions !== 'function' &&\n contextOptions.error\n ) {\n exitCode = 1;\n }\n // message: do not have all displayed text available so only passing placeholder.\n this._exit(exitCode, 'commander.help', '(outputHelp)');\n }\n\n /**\n * // Do a little typing to coordinate emit and listener for the help text events.\n * @typedef HelpTextEventContext\n * @type {object}\n * @property {boolean} error\n * @property {Command} command\n * @property {function} write\n */\n\n /**\n * Add additional text to be displayed with the built-in help.\n *\n * Position is 'before' or 'after' to affect just this command,\n * and 'beforeAll' or 'afterAll' to affect this command and all its subcommands.\n *\n * @param {string} position - before or after built-in help\n * @param {(string | Function)} text - string to add, or a function returning a string\n * @return {Command} `this` command for chaining\n */\n\n addHelpText(position, text) {\n const allowedValues = ['beforeAll', 'before', 'after', 'afterAll'];\n if (!allowedValues.includes(position)) {\n throw new Error(`Unexpected value for position to addHelpText.\nExpecting one of '${allowedValues.join(\"', '\")}'`);\n }\n\n const helpEvent = `${position}Help`;\n this.on(helpEvent, (/** @type {HelpTextEventContext} */ context) => {\n let helpStr;\n if (typeof text === 'function') {\n helpStr = text({ error: context.error, command: context.command });\n } else {\n helpStr = text;\n }\n // Ignore falsy value when nothing to output.\n if (helpStr) {\n context.write(`${helpStr}\\n`);\n }\n });\n return this;\n }\n\n /**\n * Output help information if help flags specified\n *\n * @param {Array} args - array of options to search for help flags\n * @private\n */\n\n _outputHelpIfRequested(args) {\n const helpOption = this._getHelpOption();\n const helpRequested = helpOption && args.find((arg) => helpOption.is(arg));\n if (helpRequested) {\n this.outputHelp();\n // (Do not have all displayed text available so only passing placeholder.)\n this._exit(0, 'commander.helpDisplayed', '(outputHelp)');\n }\n }\n}\n\n/**\n * Scan arguments and increment port number for inspect calls (to avoid conflicts when spawning new command).\n *\n * @param {string[]} args - array of arguments from node.execArgv\n * @returns {string[]}\n * @private\n */\n\nfunction incrementNodeInspectorPort(args) {\n // Testing for these options:\n // --inspect[=[host:]port]\n // --inspect-brk[=[host:]port]\n // --inspect-port=[host:]port\n return args.map((arg) => {\n if (!arg.startsWith('--inspect')) {\n return arg;\n }\n let debugOption;\n let debugHost = '127.0.0.1';\n let debugPort = '9229';\n let match;\n if ((match = arg.match(/^(--inspect(-brk)?)$/)) !== null) {\n // e.g. --inspect\n debugOption = match[1];\n } else if (\n (match = arg.match(/^(--inspect(-brk|-port)?)=([^:]+)$/)) !== null\n ) {\n debugOption = match[1];\n if (/^\\d+$/.test(match[3])) {\n // e.g. --inspect=1234\n debugPort = match[3];\n } else {\n // e.g. --inspect=localhost\n debugHost = match[3];\n }\n } else if (\n (match = arg.match(/^(--inspect(-brk|-port)?)=([^:]+):(\\d+)$/)) !== null\n ) {\n // e.g. --inspect=localhost:1234\n debugOption = match[1];\n debugHost = match[3];\n debugPort = match[4];\n }\n\n if (debugOption && debugPort !== '0') {\n return `${debugOption}=${debugHost}:${parseInt(debugPort) + 1}`;\n }\n return arg;\n });\n}\n\n/**\n * @returns {boolean | undefined}\n * @package\n */\nfunction useColor() {\n // Test for common conventions.\n // NB: the observed behaviour is in combination with how author adds color! For example:\n // - we do not test NODE_DISABLE_COLORS, but util:styletext does\n // - we do test NO_COLOR, but Chalk does not\n //\n // References:\n // https://no-color.org\n // https://bixense.com/clicolors/\n // https://github.com/nodejs/node/blob/0a00217a5f67ef4a22384cfc80eb6dd9a917fdc1/lib/internal/tty.js#L109\n // https://github.com/chalk/supports-color/blob/c214314a14bcb174b12b3014b2b0a8de375029ae/index.js#L33\n // (https://force-color.org recent web page from 2023, does not match major javascript implementations)\n\n if (\n process.env.NO_COLOR ||\n process.env.FORCE_COLOR === '0' ||\n process.env.FORCE_COLOR === 'false'\n )\n return false;\n if (process.env.FORCE_COLOR || process.env.CLICOLOR_FORCE !== undefined)\n return true;\n return undefined;\n}\n\nexports.Command = Command;\nexports.useColor = useColor; // exporting for tests\n", "const { Argument } = require('./lib/argument.js');\nconst { Command } = require('./lib/command.js');\nconst { CommanderError, InvalidArgumentError } = require('./lib/error.js');\nconst { Help } = require('./lib/help.js');\nconst { Option } = require('./lib/option.js');\n\nexports.program = new Command();\n\nexports.createCommand = (name) => new Command(name);\nexports.createOption = (flags, description) => new Option(flags, description);\nexports.createArgument = (name, description) => new Argument(name, description);\n\n/**\n * Expose classes\n */\n\nexports.Command = Command;\nexports.Option = Option;\nexports.Argument = Argument;\nexports.Help = Help;\n\nexports.CommanderError = CommanderError;\nexports.InvalidArgumentError = InvalidArgumentError;\nexports.InvalidOptionArgumentError = InvalidArgumentError; // Deprecated\n", "// CTCode/src/autocompletion/v2/CodeSnippets.ts\n// Default implementation of code snippets collection and related operations\n\nimport { ISnippetMeta, ICodeSnippets, IFileMeta } from \"./types\"\n\nexport class CodeSnippets implements ICodeSnippets {\n\tprivate _nextId = 0\n\tprivate _idMap: Map<number, ISnippetMeta> = new Map()\n\n\tprivate _byName: Map<string, Set<number>> = new Map()\n\tprivate _fileIndex: Map<string, { allIds: Set<number>; byName: Map<string, Set<number>> }> = new Map()\n\n\t// \u57FA\u4E8E\u7ED3\u6784\u5316\u4FE1\u606F\u7684\u7D22\u5F15\n\tprivate _byDefinitionType: Map<string, Set<number>> = new Map() // \u6309\u5B9A\u4E49\u7C7B\u578B\u7D22\u5F15\n\tprivate _bySignature: Map<string, Set<number>> = new Map() // \u6309\u7B7E\u540D\u7D22\u5F15\n\n\tsnippets: ISnippetMeta[] = []\n\n\tfilesHash: Map<string, string> = new Map()\n\n\tprivate _addToIndices(id: number, snippet: ISnippetMeta) {\n\t\t// byName\n\t\tif (!this._byName.has(snippet.name)) this._byName.set(snippet.name, new Set())\n\t\tthis._byName.get(snippet.name)!.add(id)\n\n\t\t// fileIndex\n\t\tif (!this._fileIndex.has(snippet.filePath)) {\n\t\t\tthis._fileIndex.set(snippet.filePath, {\n\t\t\t\tallIds: new Set(),\n\t\t\t\tbyName: new Map(),\n\t\t\t})\n\t\t}\n\t\tconst bucket = this._fileIndex.get(snippet.filePath)!\n\t\tbucket.allIds.add(id)\n\n\t\tif (!bucket.byName.has(snippet.name)) bucket.byName.set(snippet.name, new Set())\n\t\tbucket.byName.get(snippet.name)!.add(id)\n\n\t\t// \u7ED3\u6784\u5316\u4FE1\u606F\u7D22\u5F15\n\t\tthis._addToStructuredIndices(id, snippet)\n\t}\n\n\tprivate _removeFromIndices(id: number, snippet: ISnippetMeta) {\n\t\t// byName\n\t\tconst nameSet = this._byName.get(snippet.name)\n\t\tif (nameSet) {\n\t\t\tnameSet.delete(id)\n\t\t\tif (nameSet.size === 0) this._byName.delete(snippet.name)\n\t\t}\n\n\t\t// fileIndex\n\t\tconst bucket = this._fileIndex.get(snippet.filePath)\n\t\tif (bucket) {\n\t\t\tbucket.allIds.delete(id)\n\t\t\tconst nameSetInFile = bucket.byName.get(snippet.name)\n\t\t\tif (nameSetInFile) {\n\t\t\t\tnameSetInFile.delete(id)\n\t\t\t\tif (nameSetInFile.size === 0) bucket.byName.delete(snippet.name)\n\t\t\t}\n\t\t\tif (bucket.allIds.size === 0) this._fileIndex.delete(snippet.filePath)\n\t\t}\n\n\t\t// \u79FB\u9664\u7ED3\u6784\u5316\u4FE1\u606F\u7D22\u5F15\n\t\tthis._removeFromStructuredIndices(id, snippet)\n\t}\n\n\t/**\n\t * \u6DFB\u52A0\u7ED3\u6784\u5316\u4FE1\u606F\u7D22\u5F15\n\t */\n\tprivate _addToStructuredIndices(id: number, snippet: ISnippetMeta) {\n\t\t// \u6309\u5B9A\u4E49\u7C7B\u578B\u7D22\u5F15\n\t\tif (snippet.definition?.type) {\n\t\t\tif (!this._byDefinitionType.has(snippet.definition.type)) {\n\t\t\t\tthis._byDefinitionType.set(snippet.definition.type, new Set())\n\t\t\t}\n\t\t\tthis._byDefinitionType.get(snippet.definition.type)!.add(id)\n\t\t}\n\n\t\t// \u6309\u7B7E\u540D\u7D22\u5F15\n\t\tif (snippet.signature) {\n\t\t\tif (!this._bySignature.has(snippet.signature)) {\n\t\t\t\tthis._bySignature.set(snippet.signature, new Set())\n\t\t\t}\n\t\t\tthis._bySignature.get(snippet.signature)!.add(id)\n\t\t}\n\t}\n\n\t/**\n\t * \u79FB\u9664\u7ED3\u6784\u5316\u4FE1\u606F\u7D22\u5F15\n\t */\n\tprivate _removeFromStructuredIndices(id: number, snippet: ISnippetMeta) {\n\t\t// \u6309\u5B9A\u4E49\u7C7B\u578B\u7D22\u5F15\n\t\tif (snippet.definition?.type) {\n\t\t\tconst typeSet = this._byDefinitionType.get(snippet.definition.type)\n\t\t\tif (typeSet) {\n\t\t\t\ttypeSet.delete(id)\n\t\t\t\tif (typeSet.size === 0) this._byDefinitionType.delete(snippet.definition.type)\n\t\t\t}\n\t\t}\n\n\t\t// \u6309\u7B7E\u540D\u7D22\u5F15\n\t\tif (snippet.signature) {\n\t\t\tconst signatureSet = this._bySignature.get(snippet.signature)\n\t\t\tif (signatureSet) {\n\t\t\t\tsignatureSet.delete(id)\n\t\t\t\tif (signatureSet.size === 0) this._bySignature.delete(snippet.signature)\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * \u6309\u540D\u79F0\u67E5\u627E\u5355\u4E2A\u7247\u6BB5\n\t */\n\tasync findByName(name: string): Promise<ISnippetMeta | undefined> {\n\t\tconst results = await this.find({ name })\n\t\treturn results.length > 0 ? results[0] : undefined\n\t}\n\n\t/**\n\t * \u6309\u6587\u4EF6\u67E5\u627E\u7247\u6BB5\n\t */\n\tasync findByFile(filePath: string): Promise<ISnippetMeta[]> {\n\t\treturn await this.find({ filePath })\n\t}\n\n\t/**\n\t * \u6309\u5B9A\u4E49\u7C7B\u578B\u67E5\u627E\u7247\u6BB5\n\t */\n\tasync findByDefinitionType(definitionType: string): Promise<ISnippetMeta[]> {\n\t\tconst ids = this._byDefinitionType.get(definitionType) ?? new Set<number>()\n\t\treturn Array.from(ids).map((id) => this._idMap.get(id)!)\n\t}\n\n\t/**\n\t * \u6309\u7B7E\u540D\u67E5\u627E\u7247\u6BB5\n\t */\n\tasync findBySignature(signature: string): Promise<ISnippetMeta[]> {\n\t\tconst ids = this._bySignature.get(signature) ?? new Set<number>()\n\t\treturn Array.from(ids).map((id) => this._idMap.get(id)!)\n\t}\n\n\t/**\n\t * \u67E5\u627E\u5177\u6709\u7279\u5B9A\u53C2\u6570\u7C7B\u578B\u7684\u51FD\u6570\n\t */\n\tasync findFunctionsWithParameterTypes(paramTypes: string[]): Promise<ISnippetMeta[]> {\n\t\tconst results: ISnippetMeta[] = []\n\n\t\tfor (const snippet of this.snippets) {\n\t\t\tif (snippet.parameters && snippet.parameters.length >= paramTypes.length) {\n\t\t\t\tlet match = true\n\t\t\t\tfor (let i = 0; i < paramTypes.length; i++) {\n\t\t\t\t\tif (snippet.parameters[i]?.type !== paramTypes[i]) {\n\t\t\t\t\t\tmatch = false\n\t\t\t\t\t\tbreak\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (match) {\n\t\t\t\t\tresults.push(snippet)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn results\n\t}\n\n\tasync merge(codeSnippets: ICodeSnippets): Promise<void> {\n\t\tif (codeSnippets && codeSnippets.snippets) {\n\t\t\tawait this.insert(codeSnippets.snippets)\n\t\t}\n\t}\n\n\t/**\n\t * \u83B7\u53D6\u7EDF\u8BA1\u4FE1\u606F\n\t */\n\tgetStats(): {\n\t\ttotalSnippets: number\n\t\tfileCount: number\n\t\ttypeDistribution: Record<string, number>\n\t\tdefinitionTypeDistribution: Record<string, number>\n\t\tavgLinesPerSnippet: number\n\t} {\n\t\tconst typeDistribution: Record<string, number> = {}\n\t\tconst definitionTypeDistribution: Record<string, number> = {}\n\t\tlet totalLines = 0\n\n\t\tfor (const snippet of this.snippets) {\n\t\t\t// \u7EDF\u8BA1\u7C7B\u578B\u5206\u5E03\n\t\t\ttypeDistribution[snippet.type] = (typeDistribution[snippet.type] || 0) + 1\n\n\t\t\t// \u7EDF\u8BA1\u5B9A\u4E49\u7C7B\u578B\u5206\u5E03\n\t\t\tif (snippet.definition?.type) {\n\t\t\t\tdefinitionTypeDistribution[snippet.definition.type] =\n\t\t\t\t\t(definitionTypeDistribution[snippet.definition.type] || 0) + 1\n\t\t\t}\n\n\t\t\t// \u7EDF\u8BA1\u603B\u884C\u6570\n\t\t\ttotalLines += snippet.endLine - snippet.startLine + 1\n\t\t}\n\n\t\tconst files = new Set(this.snippets.map((s) => s.filePath))\n\n\t\treturn {\n\t\t\ttotalSnippets: this.snippets.length,\n\t\t\tfileCount: files.size,\n\t\t\ttypeDistribution,\n\t\t\tdefinitionTypeDistribution,\n\t\t\tavgLinesPerSnippet: this.snippets.length > 0 ? totalLines / this.snippets.length : 0,\n\t\t}\n\t}\n\n\t/**\n\t * Find snippets by partial information\n\t */\n\tasync find(query: Partial<ISnippetMeta>): Promise<ISnippetMeta[]> {\n\t\t// filePath + name\n\t\tif (query.filePath && query.name) {\n\t\t\tconst bucket = this._fileIndex.get(query.filePath)\n\t\t\tconst ids = bucket?.byName.get(query.name) ?? new Set<number>()\n\t\t\tlet res = Array.from(ids).map((id) => this._idMap.get(id)!)\n\t\t\tif (query.type) res = res.filter((s) => s.type === query.type)\n\t\t\tif (query.field) {\n\t\t\t\tres = res.filter((s) => s.field === query.field)\n\t\t\t} else {\n\t\t\t\tres = res.filter((s) => s.field === undefined || s.field === null || s.field === \"\")\n\t\t\t}\n\t\t\treturn res\n\t\t}\n\n\t\t// name\n\t\tif (query.name) {\n\t\t\tconst ids = this._byName.get(query.name) ?? new Set<number>()\n\t\t\treturn Array.from(ids).map((id) => this._idMap.get(id)!)\n\t\t}\n\n\t\t// filePath\n\t\tif (query.filePath) {\n\t\t\tconst bucket = this._fileIndex.get(query.filePath)\n\t\t\tconst ids = bucket?.allIds ?? new Set<number>()\n\t\t\treturn Array.from(ids).map((id) => this._idMap.get(id)!)\n\t\t}\n\n\t\treturn Array.from(this._idMap.values())\n\t}\n\n\t/**\n\t * Delete all snippets from a specific file\n\t */\n\tasync deleteByFile(filePath: string): Promise<ISnippetMeta[]> {\n\t\tconst bucket = this._fileIndex.get(filePath)\n\t\tif (!bucket) return []\n\n\t\tconst deleted: ISnippetMeta[] = []\n\t\tfor (const id of Array.from(bucket.allIds)) {\n\t\t\tconst snippet = this._idMap.get(id)!\n\t\t\tthis._removeFromIndices(id, snippet)\n\t\t\tthis._idMap.delete(id)\n\t\t\tdeleted.push(snippet)\n\t\t}\n\n\t\tif (deleted.length) {\n\t\t\tthis.snippets = this.snippets.filter((s) => s.filePath !== filePath)\n\t\t}\n\t\treturn deleted\n\t}\n\n\t/**\n\t * Insert snippets in batch\n\t */\n\tasync insert(snippets: ISnippetMeta[]): Promise<number> {\n\t\tfor (const snippet of snippets) {\n\t\t\tconst id = ++this._nextId\n\t\t\tthis._idMap.set(id, snippet)\n\t\t\tthis._addToIndices(id, snippet)\n\t\t\tthis.snippets.push(snippet)\n\n\t\t\t// \u66F4\u65B0\u6587\u4EF6hash\u6620\u5C04\n\t\t\tif (snippet.fileHash && snippet.filePath) {\n\t\t\t\tthis.filesHash.set(snippet.filePath, snippet.fileHash)\n\t\t\t}\n\t\t}\n\t\treturn snippets.length\n\t}\n\n\t/**\n\t * Update a single snippet\n\t */\n\tasync update(snippet: ISnippetMeta): Promise<boolean> {\n\t\t// \u901A\u8FC7 filePath + name + type \u7CBE\u786E\u5B9A\u4F4D\n\t\tif (snippet.filePath && snippet.name && snippet.type) {\n\t\t\tconst bucket = this._fileIndex.get(snippet.filePath)\n\t\t\tif (!bucket) return false\n\n\t\t\tconst candidateIds = bucket.byName.get(snippet.name) ?? new Set<number>()\n\t\t\tfor (const id of candidateIds) {\n\t\t\t\tconst old = this._idMap.get(id)!\n\t\t\t\tif (old.type === snippet.type) {\n\t\t\t\t\t// \u627E\u5230\u5339\u914D\u7684\u7247\u6BB5\uFF0C\u8FDB\u884C\u66F4\u65B0\n\t\t\t\t\tthis._removeFromIndices(id, old)\n\t\t\t\t\tthis._idMap.set(id, snippet)\n\t\t\t\t\tthis._addToIndices(id, snippet)\n\n\t\t\t\t\t// \u66F4\u65B0\u516C\u5F00\u6570\u7EC4\n\t\t\t\t\tconst idx = this.snippets.indexOf(old)\n\t\t\t\t\tif (idx > -1) this.snippets[idx] = snippet\n\t\t\t\t\treturn true\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// \u5982\u679C type \u4E0D\u5339\u914D\u6216\u4FE1\u606F\u4E0D\u5B8C\u6574\uFF0C\u5C1D\u8BD5\u53EA\u901A\u8FC7 filePath + name \u67E5\u627E\n\t\tif (snippet.filePath && snippet.name) {\n\t\t\tconst bucket = this._fileIndex.get(snippet.filePath)\n\t\t\tif (!bucket) return false\n\n\t\t\tconst candidateIds = bucket.byName.get(snippet.name) ?? new Set<number>()\n\t\t\tif (candidateIds.size > 0) {\n\t\t\t\t// \u53D6\u7B2C\u4E00\u4E2A\u5339\u914D\u7684\u7247\u6BB5\u8FDB\u884C\u66F4\u65B0\n\t\t\t\tconst id = Array.from(candidateIds)[0]\n\t\t\t\tconst old = this._idMap.get(id)!\n\n\t\t\t\tthis._removeFromIndices(id, old)\n\t\t\t\tthis._idMap.set(id, snippet)\n\t\t\t\tthis._addToIndices(id, snippet)\n\n\t\t\t\t// \u66F4\u65B0\u516C\u5F00\u6570\u7EC4\n\t\t\t\tconst idx = this.snippets.indexOf(old)\n\t\t\t\tif (idx > -1) this.snippets[idx] = snippet\n\t\t\t\treturn true\n\t\t\t}\n\t\t}\n\n\t\treturn false\n\t}\n\n\tasync updateByFile(file: IFileMeta, snippets: CodeSnippets): Promise<boolean> {\n\t\tawait this.deleteByFile(file.filePath)\n\t\tawait this.merge(snippets)\n\n\t\t// \u66F4\u65B0\u6587\u4EF6hash\n\t\tconst fileHash = file.fileHash || (file as any).hash\n\t\tif (fileHash) {\n\t\t\tthis.filesHash.set(file.filePath, fileHash)\n\t\t}\n\n\t\treturn true\n\t}\n\n\t/**\n\t * Clear all snippets\n\t */\n\tclear(): void {\n\t\tthis._nextId = 0\n\t\tthis._idMap.clear()\n\t\tthis._byName.clear()\n\t\tthis._fileIndex.clear()\n\t\tthis._byDefinitionType.clear()\n\t\tthis._bySignature.clear()\n\n\t\tthis.snippets = []\n\t}\n\n\t/**\n\t * Filter snippets by condition\n\t */\n\tasync filter(predicate: (snippet: ISnippetMeta) => boolean): Promise<ICodeSnippets> {\n\t\tconst result = new CodeSnippets()\n\t\tfor (const snippet of this._idMap.values()) {\n\t\t\tif (predicate(snippet)) await result.insert([snippet])\n\t\t}\n\t\treturn result as ICodeSnippets\n\t}\n\n\t/**\n\t * Check if a code file's index is up to date\n\t * @param file The file to check\n\t * @returns true if the file needs to be updated (index is NOT latest), false if index is current\n\t */\n\tisCodeFileLatestIndex(file: IFileMeta): boolean {\n\t\tconst storedHash = this.filesHash.get(file.filePath)\n\t\tif (!storedHash) {\n\t\t\t// No stored hash means file is not indexed yet, needs update\n\t\t\treturn true\n\t\t}\n\n\t\t// Compare current file hash with stored hash\n\t\t// If hashes don't match, file needs update\n\t\tconst currentHash = file.fileHash || (file as any).hash\n\t\treturn currentHash !== storedHash\n\t}\n\n\tgetSnippets(): ISnippetMeta[] {\n\t\treturn this.snippets\n\t}\n}\n", "// CTCode/src/autocompletion/v2/types.ts\n// \u6240\u6709\u6838\u5FC3\u7C7B\u578B\u548C\u63A5\u53E3\u5B9A\u4E49\uFF0C\u4F9B\u591A\u4EBA\u534F\u4F5C\u5B9E\u73B0\n\nexport enum CodeLanguageType {\n\tPython = \"python\",\n\tJava = \"java\",\n\tJavaScript = \"javascript\",\n\tTypeScript = \"typescript\",\n\tJSX = \"jsx\",\n\tTSX = \"tsx\",\n\tGo = \"go\",\n\tSwift = \"swift\",\n\tCSS = \"css\",\n\tHTML = \"html\",\n\tKotlin = \"kotlin\",\n\tPHP = \"php\",\n\tRust = \"rust\",\n\tC = \"c\",\n\tCPP = \"cpp\",\n\tUnknown = \"unknown\",\n}\n\nexport const CodeLanguageTypeSupport = [\n\tCodeLanguageType.Python,\n\tCodeLanguageType.Java,\n\tCodeLanguageType.JavaScript,\n\tCodeLanguageType.TypeScript,\n\tCodeLanguageType.JSX,\n\tCodeLanguageType.TSX,\n\tCodeLanguageType.Go,\n\tCodeLanguageType.Swift,\n\tCodeLanguageType.CSS,\n\tCodeLanguageType.HTML,\n\tCodeLanguageType.Kotlin,\n\tCodeLanguageType.PHP,\n\tCodeLanguageType.Rust,\n\tCodeLanguageType.C,\n\tCodeLanguageType.CPP,\n]\n\nexport const FileExtensionLanguageMap = {\n\t\".py\": CodeLanguageType.Python,\n\t\".java\": CodeLanguageType.Java,\n\t\".js\": CodeLanguageType.JavaScript,\n\t\".mjs\": CodeLanguageType.JavaScript,\n\t\".ts\": CodeLanguageType.TypeScript,\n\t\".tsx\": CodeLanguageType.TSX,\n\t\".jsx\": CodeLanguageType.JSX,\n\t\".go\": CodeLanguageType.Go,\n\t\".swift\": CodeLanguageType.Swift,\n\t\".css\": CodeLanguageType.CSS,\n\t\".html\": CodeLanguageType.HTML,\n\t\".kt\": CodeLanguageType.Kotlin,\n\t\".kts\": CodeLanguageType.Kotlin,\n\t\".php\": CodeLanguageType.PHP,\n\t\".rs\": CodeLanguageType.Rust,\n\t\".c\": CodeLanguageType.C,\n\t\".h\": CodeLanguageType.C,\n\t\".cpp\": CodeLanguageType.CPP,\n\t\".cxx\": CodeLanguageType.CPP,\n\t\".cc\": CodeLanguageType.CPP,\n\t\".hpp\": CodeLanguageType.CPP,\n\t\".hxx\": CodeLanguageType.CPP,\n}\n\nexport const LanguageFileExtensionMap = Object.entries(FileExtensionLanguageMap).reduce(\n\t(acc, [extension, language]) => {\n\t\tif (!acc[language]) acc[language] = []\n\t\tacc[language].push(extension)\n\t\treturn acc\n\t},\n\t{} as Record<CodeLanguageType, string[]>,\n)\n\n// \u7247\u6BB5\u7C7B\u578B/\u6765\u6E90\u679A\u4E3E\nexport enum SnippetType {\n\tImportOrInclude = \"import_or_include\",\n\tFunctionOrMethod = \"function_or_method\",\n\tClassOrInterfaceOrStructOrEnum = \"class_or_interface_or_struct\",\n\tVariableOrConstant = \"variable_or_constant\",\n}\n\nexport type Point = {\n\trow: number\n\tcolumn: number\n}\n\n// \u4EE3\u7801\u7247\u6BB5\u5143\u4FE1\u606F\u7ED3\u6784\nexport interface ISnippetMeta {\n\tname: string // \u7B26\u53F7\u540D\u79F0\n\ttype: SnippetType // \u7247\u6BB5\u7C7B\u578B/\u6765\u6E90\n\tfilePath: string // \u6240\u5728\u6587\u4EF6\u8DEF\u5F84\n\tstartLine: number // \u8D77\u59CB\u884C\u53F7\n\tendLine: number // \u7ED3\u675F\u884C\u53F7\n\tstartPosition?: Point // \u8D77\u59CB\u4F4D\u7F6E\n\tendPosition?: Point // \u7ED3\u675F\u4F4D\u7F6E\n\trangeText: string // \u7247\u6BB5\u539F\u59CB\u6355\u83B7\u4EE3\u7801\u5185\u5BB9\n\tfileHash: string // \u6240\u5C5E\u6587\u4EF6\u5185\u5BB9 hash\n\tstartColumn?: number // \u6DFB\u52A0\u8D77\u59CB\u5217\n\tendColumn?: number // \u6DFB\u52A0\u7ED3\u675F\u5217\n\n\tlanguage?: CodeLanguageType // \u8BED\u8A00\u7C7B\u578B\n\tfield?: string // \u6240\u5904\u7684class/struct\u540D\u79F0\n\tnamespace?: string // \u6240\u5904\u7684namespace\u540D\u79F0\n\n\t// \u7ED3\u6784\u5316\u4FE1\u606F\n\tdefinition?: {\n\t\tname: string // \u5B9A\u4E49\u540D\u79F0\uFF08\u51FD\u6570\u540D\u3001\u7C7B\u540D\u3001\u53D8\u91CF\u540D\u7B49\uFF09\n\t\ttype: string // \u5B9A\u4E49\u7C7B\u578B\uFF08function, class, interface, variable, method\u7B49\uFF09\n\t\tparameters?: ParameterInfo[] // \u53C2\u6570\u4FE1\u606F\uFF08\u4EC5\u5BF9\u51FD\u6570/\u65B9\u6CD5\u6709\u6548\uFF09\n\t\treturnType?: string // \u8FD4\u56DE\u7C7B\u578B\uFF08\u4EC5\u5BF9\u51FD\u6570/\u65B9\u6CD5\u6709\u6548\uFF09\n\t\tvisibility?: string // \u53EF\u89C1\u6027\uFF08public, private, protected\u7B49\uFF09\n\t\tisStatic?: boolean // \u662F\u5426\u4E3A\u9759\u6001\u6210\u5458\n\t\tisAsync?: boolean // \u662F\u5426\u4E3A\u5F02\u6B65\u51FD\u6570\n\t}\n\n\t// \u53C2\u6570\u4FE1\u606F\u7ED3\u6784\n\tparameters?: ParameterInfo[]\n\n\t// \u7B7E\u540D\u4FE1\u606F\uFF08\u7528\u4E8E\u5FEB\u901F\u5339\u914D\u548Cprompt\u751F\u6210\uFF09\n\tsignature?: string // \u51FD\u6570/\u65B9\u6CD5\u7B7E\u540D\uFF0C\u5982 \"add(a: number, b: number): number\"\n\tdefinitionText?: string // \u5B9A\u4E49\u6587\u672C\uFF0C\u7528\u4E8E\u63D0\u4F9B\u5B9A\u4E49\u53C2\u8003\n\timplementText?: string // \u5B9E\u73B0\u6587\u672C\uFF0C\u7528\u4E8E\u63D0\u4F9B\u5B9E\u73B0\u53C2\u8003\n\n\t// \u53EF\u9009: score, source, extraMeta \u7B49\n\tscope?: string[] // \u4F5C\u7528\u57DF\u94FE\n\tid?: string // \u552F\u4E00\u6807\u8BC6\n\tdependencies?: string[]\n}\n\n// \u53C2\u6570\u4FE1\u606F\u63A5\u53E3\nexport interface ParameterInfo {\n\tname: string // \u53C2\u6570\u540D\u79F0\n\ttype?: string // \u53C2\u6570\u7C7B\u578B\n\tdefaultValue?: string // \u9ED8\u8BA4\u503C\n\tisOptional?: boolean // \u662F\u5426\u4E3A\u53EF\u9009\u53C2\u6570\n\tisRest?: boolean // \u662F\u5426\u4E3A\u5269\u4F59\u53C2\u6570\uFF08...args\uFF09\n\tdescription?: string // \u53C2\u6570\u63CF\u8FF0\n}\n\n// \u5355\u4E2A\u6E90\u6587\u4EF6\u7684\u5143\u4FE1\u606F\u7ED3\u6784\nexport interface IFileMeta {\n\tfilePath: string\n\tfileExtension?: string\n\tlanguage?: CodeLanguageType // \u8BED\u8A00\u7C7B\u578B\uFF08\u53EF\u9009\uFF09\n\tsnippetMetas?: ISnippetMeta[] // \u4EE3\u7801\u7247\u6BB5\uFF08\u53EF\u9009\uFF09\n\tprojectRoot?: string // \u9879\u76EE\u6839\u76EE\u5F55\uFF08\u53EF\u9009\uFF09\n\tfileHash?: string // \u6587\u4EF6\u54C8\u5E0C\uFF08\u53EF\u9009\uFF09\n\tcontent?: string // \u6587\u4EF6\u5185\u5BB9\uFF08\u53EF\u9009\uFF09\n\tread?(): Promise<string | null> // \u5F02\u6B65\u8BFB\u53D6\u6587\u4EF6\u5185\u5BB9\uFF08\u53EF\u9009\uFF09\n}\n\n// \u591A\u6587\u4EF6\u5143\u4FE1\u606F\u96C6\u5408\nexport interface ICodeFiles {\n\tfiles: IFileMeta[]\n}\n\n// \u4EE3\u7801\u7247\u6BB5\u96C6\u5408\u53CA\u76F8\u5173\u64CD\u4F5C\u63A5\u53E3\nexport interface ICodeSnippets {\n\tsnippets: ISnippetMeta[]\n\tmerge(globalContext: ICodeSnippets): Promise<void>\n\tfind(query: Partial<ISnippetMeta>): Promise<ISnippetMeta[]>\n\tdeleteByFile(filePath: string): Promise<ISnippetMeta[]>\n\tupdateByFile(file: IFileMeta, snippets: ICodeSnippets): Promise<boolean>\n\tinsert(snippets: ISnippetMeta[]): Promise<number>\n\tupdate(snippet: ISnippetMeta): Promise<boolean>\n\tmerge(codeSnippets: ICodeSnippets): Promise<void>\n\tclear(): void\n\tfilter(predicate: (snippet: ISnippetMeta) => boolean): Promise<ICodeSnippets>\n\tisCodeFileLatestIndex(file: IFileMeta): boolean\n}\n\n// \u7C7B\u578B\u5B9A\u4E49\nexport interface ChunkOptions {\n\tfile: IFileMeta\n\tsnippetTypes?: SnippetType[]\n\tmaxSnippetLines?: number\n\tminSnippetLines?: number\n}\n\n// \u4EE3\u7801\u4E0A\u4E0B\u6587\u7BA1\u7406\u4E3B\u63A5\u53E3\nexport interface ICodeContext {\n\tchunk(codeText: string, options: ChunkOptions): Promise<ICodeSnippets>\n\tindex(codeFiles: ICodeFiles, options: any): Promise<ICodeSnippets>\n\tretriveRelates(\n\t\tcodeText: string,\n\t\tline: number,\n\t\tcolumn: number,\n\t\tfile: IFileMeta,\n\t\tglobalContext?: ICodeSnippets,\n\t): Promise<ICodeSnippets>\n}\n\n// \u7ED3\u6784\u5316\u8865\u5168\u8BF7\u6C42\u4F53\nexport interface ICompletionContext {\n\tsnippets: ISnippetMeta[]\n\toverview?: string // \u6587\u4EF6\u6982\u89C8\n\tprefix: string\n\tsuffix: string\n\tfilePath?: string\n\tfileHash?: string\n\tgitUrl?: string\n\t// \u5176\u4ED6\u5168\u5C40\u4FE1\u606F\n}\n\n// \u5171\u4EAB\u7684\u6587\u6863\u548C\u4F4D\u7F6E\u4FE1\u606F\u63A5\u53E3\nexport interface DocumentInfo {\n\tfile: IFileMeta\n\tcontent: string\n\tlineCount: number\n\tlanguage: string\n\tgetLineText(line: number): string\n}\n\nexport interface PositionInfo {\n\tline: number\n\tcharacter: number\n}\n\nexport enum ModelType {\n\tDeepSeek = \"deepseek\",\n\tQwen = \"qwen\",\n}\n\nexport enum IContextSectionType {\n\tRepoTreeView = \"RepoTreeView\",\n\tFileInfo = \"FileInfo\",\n\tFileCodeOverview = \"FileCodeOverview\",\n\tRelatedFunctionDefinition = \"RelatedFunctionDefinition\",\n\tRelatedFuntionImplement = \"RelatedFuntionImplement\",\n\tEndContextPrompt = \"EndContextPrompt\",\n}\n\nexport interface IContextSection {\n\ttype: IContextSectionType\n\tcontent: string\n}\n\nexport interface CompletionResponse {\n\tcompletion: string\n\tid: string\n}\n\nexport interface ICodeModel {\n\tmodelType: ModelType\n\tmodelId: string\n\tbaseUrl: string\n\tapiKey: string\n\tcommonStops?: string[]\n\tgenerateCompletion(prompt: string, languageType: CodeLanguageType | undefined): Promise<CompletionResponse>\n\tbuildCompletionPrompt(prefix: string, suffix: string, extraContexts: IContextSection[], file: IFileMeta): string\n}\n\nexport interface IPreprocessOptions {\n\tmaxContextLength: number\n\tcodeFile: IFileMeta\n\teditCursor: PositionInfo\n\trecentOpenFiles: IFileMeta[]\n}\n\nexport interface IPreprocessResult {\n\tprefix: string\n\tsuffix: string\n\textraContexts: IContextSection[]\n\tshouldSkipCompletion?: boolean\n}\n\nexport interface PostProcessOptions {\n\tprompt: string\n\tprefix: string\n\tsuffix: string\n\tmodelType: ModelType\n}\n\nexport interface ICodeContextOptions {\n\tnumLinesAsContext: number\n\tnumLinesAsContextSuffix: number\n\tnumImplementContexts: number\n}\n\nexport enum LogLevel {\n\tDebug = \"DEBUG\",\n\tInfo = \"INFO\",\n\tWarn = \"WARN\",\n\tError = \"ERROR\",\n}\n\nexport interface ILogger {\n\tprefix: string\n\tlevel: LogLevel\n\twith(prefix: string): ILogger\n\tdebug(message?: any, ...optionalParams: any[]): void\n\tinfo(message?: any, ...optionalParams: any[]): void\n\twarn(message?: any, ...optionalParams: any[]): void\n\terror(message?: any, ...optionalParams: any[]): void\n}\n", "// CTCode/src/autocompletion/v2/CodeContext.ts\n// \u4EE3\u7801\u4E0A\u4E0B\u6587\u7BA1\u7406\u4E3B\u7C7B\u7684\u9ED8\u8BA4\u5B9E\u73B0\n// \u4E13\u6CE8\u4E8E\u4EE3\u7801\u7247\u6BB5\u7684\u63D0\u53D6\u3001\u7D22\u5F15\u3001\u641C\u7D22\u548C\u9884\u5904\u7406\uFF0C\u4E0D\u6D89\u53CA LLM \u8C03\u7528\n\nimport * as path from \"path\"\nimport * as crypto from \"crypto\"\nimport Parser from \"web-tree-sitter\"\nimport { loadRequiredLanguageParsers } from \"../../../../src/services/CT-tree-sitter/languageParser\"\nimport { CodeSnippets } from \"./CodeSnippets\"\nimport {\n\tISnippetMeta,\n\tSnippetType,\n\tICodeSnippets,\n\tICodeFiles,\n\tICodeContext,\n\tDocumentInfo,\n\tPositionInfo,\n\tPostProcessOptions,\n\tModelType,\n\tChunkOptions,\n\tICodeContextOptions,\n\tCodeLanguageType,\n\tCodeLanguageTypeSupport,\n\tIFileMeta,\n\tICompletionContext,\n\tILogger,\n\tIPreprocessOptions,\n\tIPreprocessResult,\n\tPoint,\n\tIContextSection,\n\tIContextSectionType,\n} from \"./types\"\nimport { postProcessCompletionSynthesis, findFirstMatchingCloseSymbol } from \"./utils/processUtils\"\nimport * as capturesProcess from \"./capturesProcess\"\nimport { isInsideWord } from \"./utils/processUtils\"\nimport * as dependenciesProcess from \"./dependenciesProcess\"\nimport { formatCodeWithLanguageWithLineComment } from \"./utils/languageCommentUtils\"\nimport { treeView } from \"./utils/treeUtils\"\nimport { Logger } from \"./Logger\"\n\nexport class CodeContext implements ICodeContext {\n\tprivate _options: ICodeContextOptions\n\tprivate logger: ILogger\n\n\tget options(): ICodeContextOptions {\n\t\treturn this._options\n\t}\n\n\tconstructor(options?: ICodeContextOptions, logger?: ILogger) {\n\t\tthis._options = {\n\t\t\tnumLinesAsContext: 128,\n\t\t\tnumLinesAsContextSuffix: 32,\n\t\t\tnumImplementContexts: 3,\n\t\t}\n\t\tthis.logger = logger?.with(\"[CodeContext]\") || Logger.getDefaultLogger().with(\"[CodeContext]\")\n\t\ttry {\n\t\t\tif (options && typeof options === \"object\") {\n\t\t\t\tfor (const key in options) {\n\t\t\t\t\tif (options[key as keyof ICodeContextOptions] === undefined) {\n\t\t\t\t\t\tthrow new Error(`Option ${key} is not defined`)\n\t\t\t\t\t}\n\t\t\t\t\tthis._options[key as keyof ICodeContextOptions] = options[key as keyof ICodeContextOptions]\n\t\t\t\t}\n\t\t\t}\n\t\t} catch (error) {\n\t\t\tthis.logger.error(`Error checking options: ${error}, using default options`)\n\t\t}\n\t}\n\n\tasync capture(codeText: string, file: IFileMeta): Promise<Parser.QueryCapture[] | null> {\n\t\t// \u52A0\u8F7D\u8BED\u8A00\u89E3\u6790\u5668\n\t\tconst languageParsers = await loadRequiredLanguageParsers([file.filePath])\n\t\tconst languageParser = languageParsers[file.fileExtension as keyof typeof languageParsers]\n\t\t\n\t\tif (!languageParser) {\n\t\t\tthis.logger.warn(`No languageParser available for extension: ${file.fileExtension}`)\n\t\t\treturn null\n\t\t}\n\n\t\t// 1. \u89E3\u6790 AST \u6811\n\t\tconst parser = languageParser.parser\n\t\tconst query = languageParser.query\n\n\t\tif (!parser || !query) {\n\t\t\tthis.logger.warn(`No parser or query available for extension: ${file.fileExtension}`)\n\t\t\treturn null\n\t\t}\n\n\t\tconst tree = parser.parse(codeText)\n\n\t\tthis.logger.info(`Successfully parsed AST for: ${path.basename(file.filePath)}`)\n\n\t\tconst captures = query.captures(tree.rootNode)\n\n\t\treturn captures\n\t}\n\n\tasync captureDependencies(codeText: string, file: IFileMeta): Promise<Parser.QueryCapture[] | null> {\n\t\tconst queryText = dependenciesProcess.dependenciesCapturesQueries[file.language as CodeLanguageType]\n\t\tif (!queryText) {\n\t\t\tthis.logger.warn(`No query available for extension: ${file.fileExtension}`)\n\t\t\treturn null\n\t\t}\n\n\t\t// \u52A0\u8F7D\u8BED\u8A00\u89E3\u6790\u5668\n\t\tconst languageParsers = await loadRequiredLanguageParsers([file.filePath])\n\t\tconst languageParser = languageParsers[file.fileExtension as keyof typeof languageParsers]\n\n\t\tif (!languageParser) {\n\t\t\tthis.logger.warn(`No languageParser available for extension: ${file.fileExtension}`)\n\t\t\treturn null\n\t\t}\n\n\t\t// 1. \u89E3\u6790 AST \u6811\n\t\tconst parser = languageParser.parser\n\t\tconst query = parser.getLanguage().query(queryText)\n\n\t\tif (!parser || !query) {\n\t\t\tthis.logger.warn(`No parser or query available for extension: ${file.fileExtension}`)\n\t\t\treturn null\n\t\t}\n\n\t\tconst tree = parser.parse(codeText)\n\n\t\tthis.logger.info(`Successfully parsed AST for: ${path.basename(file.filePath)}`)\n\n\t\tconst captures = query.captures(tree.rootNode)\n\n\t\treturn captures\n\t}\n\n\t/**\n\t * \u5207\u5206\u4EE3\u7801\u4E3A CodeSnippets\n\t * \u4F7F\u7528 tree-sitter \u8FDB\u884C\u8BED\u4E49\u5207\u5206\uFF0C\u63D0\u53D6\u5B8C\u6574\u7684\u51FD\u6570\u3001\u7C7B\u3001\u65B9\u6CD5\u7B49\u5B9A\u4E49\n\t */\n\tasync chunk(codeText: string, options: ChunkOptions): Promise<ICodeSnippets> {\n\t\tconst { file, snippetTypes = [], maxSnippetLines = 50, minSnippetLines = 3 } = options\n\n\t\tconst codeSnippets = new CodeSnippets()\n\n\t\ttry {\n\t\t\t// \u8BA1\u7B97\u6587\u4EF6\u5185\u5BB9\u7684 hash\n\t\t\tconst fileHash = this.calculateFileHash(codeText)\n\n\t\t\t// \u68C0\u67E5\u8BED\u8A00\u662F\u5426\u652F\u6301 tree-sitter\n\t\t\tif (!this.isSupportedLanguage(file.language as CodeLanguageType)) {\n\t\t\t\tif (file.language === CodeLanguageType.Unknown) {\n\t\t\t\t\tthis.logger.info(`Language ${file.language} not supported now`)\n\t\t\t\t} else {\n\t\t\t\t\tthis.logger.warn(`Language ${file.language} not supported now`)\n\t\t\t\t}\n\t\t\t\treturn codeSnippets\n\t\t\t}\n\n\t\t\tconst captures = await this.capture(codeText, file)\n\n\t\t\tif (!captures || captures.length === 0) {\n\t\t\t\tthis.logger.warn(`No captures found`)\n\t\t\t\treturn codeSnippets\n\t\t\t}\n\n\t\t\t// 2. \u4F7F\u7528 Query \u63D0\u53D6\u4EE3\u7801\u7247\u6BB5\n\t\t\tconst extractSnippetsFromCapturesFunc =\n\t\t\t\tcapturesProcess.extractSnippetsFromCaptures[file.language as CodeLanguageType]\n\n\t\t\ttry {\n\t\t\t\tif (!extractSnippetsFromCapturesFunc) {\n\t\t\t\t\tthis.logger.info(`No extractSnippetsFromCapturesFunc available for language: ${file.language}`)\n\t\t\t\t\treturn codeSnippets\n\t\t\t\t}\n\n\t\t\t\tconst snippets = await extractSnippetsFromCapturesFunc(\n\t\t\t\t\tcaptures,\n\t\t\t\t\tcodeText,\n\t\t\t\t\tfile.filePath,\n\t\t\t\t\tfileHash,\n\t\t\t\t\tsnippetTypes,\n\t\t\t\t\t{\n\t\t\t\t\t\tmaxSnippetLines,\n\t\t\t\t\t\tminSnippetLines,\n\t\t\t\t\t},\n\t\t\t\t)\n\n\t\t\t\tthis.logger.info(`Extracted ${snippets.length} snippets total`)\n\n\t\t\t\tif (snippets && snippets.length > 0) {\n\t\t\t\t\tawait codeSnippets.insert(snippets)\n\t\t\t\t}\n\t\t\t} catch (error) {\n\t\t\t\tthis.logger.warn(`Error extracting snippets for ${file.filePath}:`, error)\n\t\t\t}\n\n\t\t\treturn codeSnippets\n\t\t} catch (error) {\n\t\t\tthis.logger.error(`Error parsing AST for ${file.filePath}:`, error)\n\t\t\treturn codeSnippets\n\t\t}\n\t}\n\n\tasync extractDependencies(codeText: string, file: IFileMeta): Promise<ISnippetMeta[]> {\n\t\tconst captures = await this.captureDependencies(codeText, file)\n\t\tif (!captures || captures.length === 0) {\n\t\t\tthis.logger.warn(`No captures found`)\n\t\t\treturn []\n\t\t}\n\n\t\tconst processor = dependenciesProcess.dependenciesProcessors[file.language as CodeLanguageType]\n\t\tif (!processor) {\n\t\t\tthis.logger.warn(`No processor available for language: ${file.language}`)\n\t\t\treturn []\n\t\t}\n\n\t\ttry {\n\t\t\tconst dependencies = processor(captures)\n\t\t\tif (!dependencies || dependencies.length === 0) {\n\t\t\t\tthis.logger.warn(`No dependencies found`)\n\t\t\t\treturn []\n\t\t\t}\n\t\t\treturn dependencies\n\t\t} catch (error) {\n\t\t\tthis.logger.warn(`Error extracting dependencies for ${file.filePath}:`, error)\n\t\t\treturn []\n\t\t}\n\t}\n\n\t/**\n\t * \u7D22\u5F15\u6587\u4EF6\u96C6\u5408\uFF0C\u63D0\u53D6\u6240\u6709\u6587\u4EF6\u7684\u4EE3\u7801\u7247\u6BB5\n\t */\n\tasync index(codeFiles: ICodeFiles, options: any): Promise<ICodeSnippets> {\n\t\tconst { maxSnippetLines = 50, minSnippetLines = 3, snippetTypes = [], includeFileTypes = [] } = options || {}\n\n\t\tconst allSnippets = new CodeSnippets()\n\n\t\tthis.logger.info(`Indexing ${codeFiles.files?.length || 0} files`)\n\n\t\t// \u5E76\u884C\u5904\u7406\u6587\u4EF6\u4EE5\u63D0\u9AD8\u6027\u80FD\n\t\tconst indexPromises = (codeFiles.files || []).map(async (fileMeta) => {\n\t\t\ttry {\n\t\t\t\tconst fileExtension = path.extname(fileMeta.filePath).toLowerCase().slice(1)\n\n\t\t\t\t// \u68C0\u67E5\u6587\u4EF6\u7C7B\u578B\u662F\u5426\u9700\u8981\u7D22\u5F15\n\t\t\t\tif (!includeFileTypes.includes(fileExtension)) {\n\t\t\t\t\treturn new CodeSnippets()\n\t\t\t\t}\n\n\t\t\t\t// \u8BFB\u53D6\u6587\u4EF6\u5185\u5BB9\n\t\t\t\tconst content = await fileMeta.read?.()\n\t\t\t\tif (!content) {\n\t\t\t\t\tthis.logger.warn(`Could not read content for file: ${fileMeta.filePath}`)\n\t\t\t\t\treturn new CodeSnippets()\n\t\t\t\t}\n\n\t\t\t\t// \u5BF9\u6BCF\u4E2A\u6587\u4EF6\u8FDB\u884C chunk\n\t\t\t\tconst fileSnippets = await this.chunk(content, {\n\t\t\t\t\tfile: fileMeta,\n\t\t\t\t\tsnippetTypes,\n\t\t\t\t\tmaxSnippetLines,\n\t\t\t\t\tminSnippetLines,\n\t\t\t\t})\n\n\t\t\t\tthis.logger.info(\n\t\t\t\t\t`Indexed ${fileSnippets.snippets.length} snippets from ${path.basename(fileMeta.filePath)}`,\n\t\t\t\t)\n\t\t\t\treturn fileSnippets\n\t\t\t} catch (error) {\n\t\t\t\tthis.logger.error(`Error indexing file ${fileMeta.filePath}:`, error)\n\t\t\t\treturn new CodeSnippets()\n\t\t\t}\n\t\t})\n\n\t\t// \u7B49\u5F85\u6240\u6709\u6587\u4EF6\u5904\u7406\u5B8C\u6210\n\t\tconst fileSnippetsArray = await Promise.all(indexPromises)\n\n\t\t// \u5408\u5E76\u6240\u6709\u7247\u6BB5\n\t\tfor (const fileSnippets of fileSnippetsArray) {\n\t\t\tawait allSnippets.merge(fileSnippets)\n\t\t}\n\n\t\tthis.logger.info(`Total indexed snippets: ${allSnippets.snippets.length}`)\n\t\treturn allSnippets\n\t}\n\n\tasync getFunctionOrMethodSurroundingCursor(\n\t\tcodeSnippets: ICodeSnippets,\n\t\tcursorPosition: Point,\n\t\tfile: IFileMeta,\n\t): Promise<ISnippetMeta | null> {\n\t\t// find the function or method that contains the cursor position using startLine and endLine\n\t\tconst snippets = await codeSnippets.filter((snippet) => {\n\t\t\treturn cursorPosition.row >= snippet.startLine && cursorPosition.row <= snippet.endLine\n\t\t})\n\n\t\tif (!snippets || snippets.snippets.length === 0) {\n\t\t\tthis.logger.warn(`No snippets found for file: ${file.filePath}`)\n\t\t\treturn null\n\t\t}\n\n\t\treturn snippets.snippets[0]\n\t}\n\n\t/**\n\t * \u68C0\u7D22\u4E0E\u5F53\u524D\u4F4D\u7F6E\u76F8\u5173\u7684\u4EE3\u7801\u7247\u6BB5 - \u667A\u80FD\u4E0A\u4E0B\u6587\u7B56\u7565\n\t */\n\t/**\n\t * \u68C0\u7D22\u4E0E\u5F53\u524D\u4F4D\u7F6E\u76F8\u5173\u7684\u4EE3\u7801\u7247\u6BB5 - \u4F7F\u7528 capture \u673A\u5236\uFF0C\u76F4\u63A5\u8FD4\u56DE\u6587\u4EF6\u539F\u6587\n\t */\n\tasync retriveRelates(\n\t\tcodeText: string,\n\t\tline: number,\n\t\tcolumn: number,\n\t\tfile: IFileMeta,\n\t\tglobalContext?: ICodeSnippets,\n\t): Promise<ICodeSnippets> {\n\t\tconst relatedSnippets = new CodeSnippets()\n\n\t\tif (!globalContext) {\n\t\t\tthis.logger.warn(`No global context provided`)\n\t\t\treturn relatedSnippets\n\t\t}\n\n\t\tthis.logger.info(`Retrieving related snippets for line ${line}, column ${column}`)\n\n\t\tconst functionOrMethod = await this.getFunctionOrMethodSurroundingCursor(\n\t\t\tglobalContext,\n\t\t\t{ row: line, column },\n\t\t\tfile,\n\t\t)\n\t\tif (!functionOrMethod) {\n\t\t\tthis.logger.warn(`No function or method found for line ${line}, column ${column}`)\n\t\t\treturn relatedSnippets\n\t\t}\n\n\t\tif (!functionOrMethod.implementText) {\n\t\t\tthis.logger.warn(`No implementText available for function or method: ${functionOrMethod.name}`)\n\t\t\treturn relatedSnippets\n\t\t}\n\n\t\t// search for dependencies of the function or method\n\t\tconst dependencies = await this.extractDependencies(functionOrMethod.implementText, file)\n\t\tif (!dependencies || dependencies.length === 0) {\n\t\t\tthis.logger.warn(`No dependencies found`)\n\t\t\treturn relatedSnippets\n\t\t}\n\n\t\t// find from globalContext\n\t\tlet relatedSnippetsWithDependencies: ISnippetMeta[] = []\n\n\t\t// sort dependencies by position, if surrounding cursor is in the dependency, it should be the first\n\t\tdependencies.sort((a, b) => {\n\t\t\treturn (\n\t\t\t\tMath.abs(functionOrMethod.startLine + a.startLine - line) -\n\t\t\t\tMath.abs(functionOrMethod.startLine + b.startLine - line)\n\t\t\t)\n\t\t})\n\n\t\tfor (const dependency of dependencies) {\n\t\t\tif (relatedSnippetsWithDependencies.length >= this.options.numImplementContexts) {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\trelatedSnippetsWithDependencies = relatedSnippetsWithDependencies.concat(\n\t\t\t\tawait globalContext.find({\n\t\t\t\t\tfilePath: file.filePath,\n\t\t\t\t\tname: dependency.name,\n\t\t\t\t\ttype: dependency.type,\n\t\t\t\t\tfield: dependency.field,\n\t\t\t\t}),\n\t\t\t)\n\t\t}\n\n\t\t// merge dependencies to relatedSnippets\n\t\tawait relatedSnippets.insert(relatedSnippetsWithDependencies)\n\n\t\treturn relatedSnippets\n\t}\n\n\t/**\n\t * \u540E\u5904\u7406 LLM \u751F\u6210\u7684\u8865\u5168\u6587\u672C\n\t * \u4F7F\u7528 getStringBeforeCloseSymbol \u5904\u7406\u7B26\u53F7\u95ED\u5408\n\t */\n\tpostprocess(completion: string, options?: PostProcessOptions): string {\n\t\tif (!completion || completion.trim() === \"\") {\n\t\t\treturn \"\"\n\t\t}\n\n\t\tthis.logger.info(`Postprocessing completion: \"${completion.substring(0, 100)}...\"`)\n\n\t\tlet processedCompletion = completion\n\n\t\t// \u57FA\u672C\u6E05\u7406\uFF1A\u79FB\u9664\u672B\u5C3E\u591A\u4F59\u7684\u7A7A\u767D\u5B57\u7B26\n\t\tprocessedCompletion = processedCompletion.trimEnd()\n\n\t\tif (options && options.modelType === ModelType.Qwen) {\n\t\t\tlet { closeSymbol, suffixPrefix } = findFirstMatchingCloseSymbol(options.prompt, \"<|fim_suffix|>\")\n\t\t\tprocessedCompletion = postProcessCompletionSynthesis(\n\t\t\t\tprocessedCompletion,\n\t\t\t\toptions.prefix,\n\t\t\t\toptions.suffix,\n\t\t\t\tcloseSymbol,\n\t\t\t\tsuffixPrefix,\n\t\t\t)\n\t\t}\n\n\t\tthis.logger.info(`Postprocessed result: \"${processedCompletion.substring(0, 100)}...\"`)\n\n\t\treturn processedCompletion\n\t}\n\n\t/**\n\t * \u83B7\u53D6\u4EE3\u7801\u8865\u5168\u6240\u9700\u7684\u5B8C\u6574\u4E0A\u4E0B\u6587\n\t */\n\tasync getCompletionContext(\n\t\tdocumentInfo: DocumentInfo,\n\t\tpositionInfo: PositionInfo,\n\t\tglobalContext?: ICodeSnippets,\n\t): Promise<ICompletionContext> {\n\t\tthis.logger.info(\n\t\t\t`Getting completion context for line ${positionInfo.line}, character ${positionInfo.character}`,\n\t\t)\n\n\t\t// 1. \u6784\u5EFA\u524D\u7F00\u548C\u540E\u7F00\n\t\tconst { prefix, suffix } = await this.getCurrentContext(documentInfo, positionInfo)\n\n\t\tthis.logger.info(`Prefix: \"${prefix.substring(prefix.length - 50)}...\"`)\n\t\tthis.logger.info(`Suffix: \"${suffix.substring(0, 50)}...\"`)\n\n\t\t// 2. \u83B7\u53D6\u6587\u4EF6\u6982\u89C8\n\t\tconst generateOverViewFromSnippetsFunc =\n\t\t\tcapturesProcess.generateOverViewFromSnippets[documentInfo.file.language as CodeLanguageType]\n\t\tlet overview: string | undefined = undefined\n\t\tif (typeof generateOverViewFromSnippetsFunc === \"function\" && documentInfo.file.snippetMetas) {\n\t\t\toverview = generateOverViewFromSnippetsFunc(documentInfo.file.snippetMetas || [])\n\t\t}\n\n\t\t// 3. \u83B7\u53D6\u76F8\u5173\u4E0A\u4E0B\u6587\n\t\tconst relatedSnippets = await this.retriveRelates(\n\t\t\tdocumentInfo.content,\n\t\t\tpositionInfo.line + 1, // \u8F6C\u6362\u4E3A 1-based\n\t\t\tpositionInfo.character,\n\t\t\tdocumentInfo.file,\n\t\t\tglobalContext,\n\t\t)\n\n\t\tthis.logger.info(`Found ${relatedSnippets.snippets.length} related snippets`)\n\n\t\treturn {\n\t\t\tprefix,\n\t\t\tsuffix,\n\t\t\tsnippets: relatedSnippets.snippets,\n\t\t\toverview,\n\t\t\tfilePath: documentInfo.file.filePath,\n\t\t\tfileHash: documentInfo.file.fileHash,\n\t\t\tgitUrl: \"\",\n\t\t}\n\t}\n\n\t/**\n\t * \u9884\u5904\u7406\u4E0A\u4E0B\u6587 - \u8F93\u51FA3\u4E2A\u5B57\u7B26\u4E32\n\t */\n\tasync preprocess(completionContext: ICompletionContext, options: IPreprocessOptions): Promise<IPreprocessResult> {\n\t\t// \u68C0\u67E5\u5149\u6807\u662F\u5426\u5728\u5355\u8BCD\u5185\u90E8 - \u5982\u679C\u662F\u5219\u8BBE\u7F6E\u8DF3\u8FC7\u6807\u5FD7\n\t\tif (isInsideWord(completionContext.prefix, completionContext.suffix, (msg) => this.logger.info(msg))) {\n\t\t\treturn {\n\t\t\t\tprefix: completionContext.prefix,\n\t\t\t\tsuffix: completionContext.suffix,\n\t\t\t\textraContexts: [],\n\t\t\t\tshouldSkipCompletion: false,\n\t\t\t}\n\t\t}\n\n\t\tconst extraContexts: IContextSection[] = []\n\n\t\tconst recentOpenFiles = options.recentOpenFiles\n\t\t\t.filter((file) => file.language === options.codeFile.language)\n\t\t\t.map((file) => file.filePath)\n\n\t\t// type: IContextSectionType.RepoTreeView\n\t\tif (options.codeFile.projectRoot) {\n\t\t\ttry {\n\t\t\t\t// filter recentOpenFiles by language\n\t\t\t\tconst treeViewText = await treeView(options.codeFile.projectRoot, recentOpenFiles, 10, 10)\n\t\t\t\textraContexts.push({\n\t\t\t\t\ttype: IContextSectionType.RepoTreeView,\n\t\t\t\t\tcontent: `## Repo Tree View\\n${treeViewText}`,\n\t\t\t\t})\n\t\t\t} catch (error) {\n\t\t\t\tthis.logger.warn(`Error getting repo tree view: ${error}`)\n\t\t\t}\n\t\t}\n\n\t\t// type: IContextSectionType.FileInfo\n\t\textraContexts.push({\n\t\t\ttype: IContextSectionType.FileInfo,\n\t\t\tcontent: `## Description\\n\\tThis is a ${options.codeFile.language} file.`,\n\t\t})\n\n\t\tif (completionContext.overview) {\n\t\t\t// type: IContextSectionType.FileOverview\n\t\t\textraContexts.push({\n\t\t\t\ttype: IContextSectionType.FileCodeOverview,\n\t\t\t\tcontent: `## File Overview\\n${completionContext.overview}`,\n\t\t\t})\n\t\t}\n\n\t\tif (completionContext.snippets.length > 0) {\n\t\t\t// type: IContextSectionType.RelatedFunctionDefinition\n\t\t\textraContexts.push({\n\t\t\t\ttype: IContextSectionType.RelatedFunctionDefinition,\n\t\t\t\tcontent: `## Related Function Definitions\\n${completionContext.snippets.map((snippet) => snippet.definitionText).join(\"\\n\")}`,\n\t\t\t})\n\t\t}\n\n\t\tif (this.options.numImplementContexts > 0 && completionContext.snippets.length > 0) {\n\t\t\t// type: IContextSectionType.RelatedFunctionImplement\n\t\t\textraContexts.push({\n\t\t\t\ttype: IContextSectionType.RelatedFuntionImplement,\n\t\t\t\tcontent: `## Related Function Implementations\\n${completionContext.snippets.map((snippet) => snippet.implementText).join(\"\\n\")}`,\n\t\t\t})\n\t\t}\n\n\t\t// \u6DFB\u52A0\u5F00\u653E\u6807\u7B7E\u9875\u7684\u7B26\u53F7\u4FE1\u606F - \u6309\u8BED\u8A00\u7C7B\u578B\u8FC7\u6EE4\uFF0C\u5E76\u6392\u9664\u5F53\u524D\u6587\u4EF6\n\t\tif (options.recentOpenFiles && options.recentOpenFiles.length > 0) {\n\t\t\tconst sameLanguageFiles = options.recentOpenFiles.filter(\n\t\t\t\t(file) =>\n\t\t\t\t\tfile.language === options.codeFile.language && file.filePath !== options.codeFile.filePath,\n\t\t\t)\n\n\t\t\tif (sameLanguageFiles.length > 0) {\n\t\t\t\t// \u4E3A\u6BCF\u4E2A\u540C\u8BED\u8A00\u7684\u6587\u4EF6\u83B7\u53D6\u7B26\u53F7\u6982\u8981\n\t\t\t\tconst symbolOverviews: string[] = []\n\n\t\t\t\tfor (const file of sameLanguageFiles) {\n\t\t\t\t\tif (file.snippetMetas && file.snippetMetas.length > 0) {\n\t\t\t\t\t\tconst generateOverViewFunc =\n\t\t\t\t\t\t\tcapturesProcess.generateOverViewFromSnippets[file.language as CodeLanguageType]\n\t\t\t\t\t\tif (typeof generateOverViewFunc === \"function\") {\n\t\t\t\t\t\t\tconst overview = generateOverViewFunc(file.snippetMetas)\n\t\t\t\t\t\t\tif (overview.trim()) {\n\t\t\t\t\t\t\t\tsymbolOverviews.push(`### ${file.filePath}\\n${overview}`)\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (symbolOverviews.length > 0) {\n\t\t\t\t\textraContexts.push({\n\t\t\t\t\t\ttype: IContextSectionType.RelatedFunctionDefinition,\n\t\t\t\t\t\tcontent: `## Open Tabs Symbol Overview\\n${symbolOverviews.join(\"\\n\\n\")}`,\n\t\t\t\t\t})\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// type: IContextSectionType.EndContextPrompt\n\t\textraContexts.push({\n\t\t\ttype: IContextSectionType.EndContextPrompt,\n\t\t\tcontent: `## Recent Open Files\\n${recentOpenFiles.join(\", \")}\\n\\n End of Context, Above is the context of the current file. You are editing the file at line ${options.editCursor.line}, character ${options.editCursor.character}, Starting Coding.`,\n\t\t})\n\n\t\tfor (const extraContext of extraContexts) {\n\t\t\textraContext.content = formatCodeWithLanguageWithLineComment(\n\t\t\t\textraContext.content,\n\t\t\t\toptions.codeFile.language as CodeLanguageType,\n\t\t\t)\n\t\t}\n\n\t\treturn {\n\t\t\tprefix: completionContext.prefix,\n\t\t\tsuffix: completionContext.suffix,\n\t\t\textraContexts: extraContexts,\n\t\t\tshouldSkipCompletion: false,\n\t\t}\n\t}\n\n\t/**\n\t * \u83B7\u53D6\u5F53\u524D\u5149\u6807\u4F4D\u7F6E\u7684\u4E0A\u4E0B\u6587 - \u57FA\u4E8E\u51FD\u6570\u7EA7\u522B\u800C\u975E\u884C\u7D1A\u5225\n\t */\n\tprivate async getCurrentContext(\n\t\tdocumentInfo: DocumentInfo,\n\t\tpositionInfo: PositionInfo,\n\t): Promise<{\n\t\tprefix: string\n\t\tsuffix: string\n\t}> {\n\t\t// find current function from file snippets where position is in\n\t\tconst currentFunction = documentInfo.file.snippetMetas?.filter((snippet) => {\n\t\t\tif (snippet.startLine && snippet.endLine) {\n\t\t\t\treturn positionInfo.line >= snippet.startLine && positionInfo.line <= snippet.endLine\n\t\t\t}\n\t\t\treturn false\n\t\t})[0]\n\t\tif (currentFunction) {\n\t\t\tthis.logger.info(\n\t\t\t\t`Found function: ${currentFunction.name} at lines ${currentFunction.startLine}-${currentFunction.endLine}`,\n\t\t\t)\n\n\t\t\t// 3. \u83B7\u53D6\u51FD\u6570\u7684\u5B8C\u6574\u6587\u672C\n\t\t\tif (!currentFunction.implementText) {\n\t\t\t\tthis.logger.warn(`No implementText available for function: ${currentFunction.name}`)\n\t\t\t\treturn this.getSurroundingCodeContextSimple(documentInfo, positionInfo)\n\t\t\t}\n\n\t\t\tconst originalTextLines = documentInfo.content.split(\"\\n\")\n\n\t\t\tlet startLine = Math.max(1, currentFunction.startLine)\n\t\t\tconst functionLines = currentFunction.implementText.split(\"\\n\")\n\t\t\tlet endLine = Math.min(startLine + functionLines.length, documentInfo.lineCount)\n\n\t\t\tconst remainsLinesCount = this.options.numLinesAsContext - (endLine - startLine)\n\n\t\t\tif (remainsLinesCount > 0) {\n\t\t\t\t// extend startLine and endLine\n\t\t\t\tconst halfRemainsLinesCount = Math.floor(remainsLinesCount / 2)\n\t\t\t\tstartLine = Math.max(1, startLine - halfRemainsLinesCount)\n\t\t\t\tendLine = Math.min(documentInfo.lineCount, endLine + halfRemainsLinesCount)\n\t\t\t}\n\n\t\t\tconst startIndex = startLine - 1\n\t\t\tconst endIndex = endLine - 1\n\n\t\t\tif (\n\t\t\t\tstartIndex < 0 ||\n\t\t\t\tstartIndex > originalTextLines.length ||\n\t\t\t\tendIndex < 0 ||\n\t\t\t\tendIndex > originalTextLines.length\n\t\t\t) {\n\t\t\t\tthis.logger.warn(`Invalid startIndex or endIndex: ${startIndex}, ${endIndex}`)\n\t\t\t\treturn this.getSurroundingCodeContextSimple(documentInfo, positionInfo)\n\t\t\t}\n\n\t\t\tlet prefix = originalTextLines.slice(startIndex, positionInfo.line).join(\"\\n\")\n\t\t\tlet suffix = \"\"\n\n\t\t\tif (positionInfo.line < originalTextLines.length) {\n\t\t\t\tsuffix =\n\t\t\t\t\toriginalTextLines[positionInfo.line].substring(positionInfo.character) +\n\t\t\t\t\t\"\\n\" +\n\t\t\t\t\toriginalTextLines.slice(positionInfo.line + 1, endIndex + 1).join(\"\\n\")\n\t\t\t}\n\n\t\t\tif (positionInfo.line >= 0 && positionInfo.line < originalTextLines.length) {\n\t\t\t\tprefix += \"\\n\" + originalTextLines[positionInfo.line].substring(0, positionInfo.character)\n\t\t\t}\n\n\t\t\tthis.logger.info(`Function-level context - Prefix: ${prefix.length} chars, Suffix: ${suffix.length} chars`)\n\n\t\t\treturn { prefix, suffix }\n\t\t} else {\n\t\t\tthis.logger.info(`No function found at position, using line-level context`)\n\t\t\treturn this.getSurroundingCodeContextSimple(documentInfo, positionInfo)\n\t\t}\n\t}\n\n\tpublic isSimpleContextEnough(documentInfo: DocumentInfo, positionInfo: PositionInfo): boolean {\n\t\tconst { startLine, endLine } = this.getSurroundingCodeContextSimpleStartAndEnd(documentInfo, positionInfo)\n\t\treturn startLine <= 0 && endLine >= documentInfo.lineCount - 1\n\t}\n\n\tprivate getSurroundingCodeContextSimpleStartAndEnd(\n\t\tdocumentInfo: DocumentInfo,\n\t\tpositionInfo: PositionInfo,\n\t): { startLine: number; endLine: number } {\n\t\tconst line = positionInfo.line\n\t\tconst startLine = Math.max(0, line - this.options.numLinesAsContext)\n\t\tconst endLine = Math.min(documentInfo.lineCount - 1, line + this.options.numLinesAsContextSuffix)\n\n\t\treturn { startLine, endLine }\n\t}\n\n\tprivate getSurroundingCodeContextSimple(\n\t\tdocumentInfo: DocumentInfo,\n\t\tpositionInfo: PositionInfo,\n\t): { prefix: string; suffix: string } {\n\t\tconst line = positionInfo.line\n\t\tconst { startLine, endLine } = this.getSurroundingCodeContextSimpleStartAndEnd(documentInfo, positionInfo)\n\n\t\tconst lines = documentInfo.content.split(\"\\n\")\n\t\tlet prefix = lines.slice(startLine, line).join(\"\\n\")\n\t\tlet suffix = \"\"\n\t\tif (line < lines.length) {\n\t\t\tsuffix = lines[line].substring(positionInfo.character) + \"\\n\" + lines.slice(line + 1, endLine).join(\"\\n\")\n\t\t}\n\t\tif (line >= 0 && line < lines.length) {\n\t\t\tprefix += \"\\n\" + lines[line].substring(0, positionInfo.character)\n\t\t}\n\t\treturn { prefix, suffix }\n\t}\n\n\t// ==================== \u8F85\u52A9\u65B9\u6CD5 ====================\n\n\tprivate calculateFileHash(content: string): string {\n\t\treturn crypto.createHash(\"md5\").update(content).digest(\"hex\")\n\t}\n\n\tprivate isSupportedLanguage(language: CodeLanguageType): boolean {\n\t\treturn CodeLanguageTypeSupport.includes(language)\n\t}\n}\n", "import * as path from \"path\"\nimport Parser from \"web-tree-sitter\"\nimport {\n\tjavascriptQuery,\n\tjsxQuery,\n\ttypescriptQuery,\n\ttsxQuery,\n\tpythonQuery,\n\trustQuery,\n\tgoQuery,\n\tcppQuery,\n\tcQuery,\n\tcsharpQuery,\n\trubyQuery,\n\tjavaQuery,\n\tphpQuery,\n\thtmlQuery,\n\tswiftQuery,\n\tkotlinQuery,\n\tcssQuery,\n\tocamlQuery,\n\tsolidityQuery,\n\ttomlQuery,\n\tvueQuery,\n\tluaQuery,\n\tsystemrdlQuery,\n\ttlaPlusQuery,\n\tzigQuery,\n\tembeddedTemplateQuery,\n\telispQuery,\n\telixirQuery,\n} from \"./queries\"\n\nexport interface LanguageParser {\n\t[key: string]: {\n\t\tparser: Parser\n\t\tquery: Parser.Query\n\t}\n}\n\nasync function loadLanguage(langName: string) {\n\treturn await Parser.Language.load(path.join(__dirname, `tree-sitter-${langName}.wasm`))\n}\n\nlet isParserInitialized = false\n\nasync function initializeParser() {\n\tif (!isParserInitialized) {\n\t\tawait Parser.init()\n\t\tisParserInitialized = true\n\t}\n}\n\n/*\nUsing node bindings for tree-sitter is problematic in vscode extensions \nbecause of incompatibility with electron. Going the .wasm route has the \nadvantage of not having to build for multiple architectures.\n\nWe use web-tree-sitter and tree-sitter-wasms which provides auto-updating prebuilt WASM binaries for tree-sitter's language parsers.\n\nThis function loads WASM modules for relevant language parsers based on input files:\n1. Extracts unique file extensions\n2. Maps extensions to language names\n3. Loads corresponding WASM files (containing grammar rules)\n4. Uses WASM modules to initialize tree-sitter parsers\n\nThis approach optimizes performance by loading only necessary parsers once for all relevant files.\n\nSources:\n- https://github.com/tree-sitter/node-tree-sitter/issues/169\n- https://github.com/tree-sitter/node-tree-sitter/issues/168\n- https://github.com/Gregoor/tree-sitter-wasms/blob/main/README.md\n- https://github.com/tree-sitter/tree-sitter/blob/master/lib/binding_web/README.md\n- https://github.com/tree-sitter/tree-sitter/blob/master/lib/binding_web/test/query-test.js\n*/\nexport async function loadRequiredLanguageParsers(filesToParse: string[]): Promise<LanguageParser> {\n\tawait initializeParser()\n\tconst extensionsToLoad = new Set(filesToParse.map((file) => path.extname(file).toLowerCase().slice(1)))\n\tconst parsers: LanguageParser = {}\n\tfor (const ext of extensionsToLoad) {\n\t\tlet language: Parser.Language\n\t\tlet query: Parser.Query\n\t\tlet parserKey = ext // Default to using extension as key\n\t\tswitch (ext) {\n\t\t\tcase \"js\":\n\t\t\tcase \"json\":\n\t\t\t\tlanguage = await loadLanguage(\"javascript\")\n\t\t\t\tquery = language.query(javascriptQuery)\n\t\t\t\tbreak\n\t\t\tcase \"jsx\":\n\t\t\t\tlanguage = await loadLanguage(\"javascript\")\n\t\t\t\tquery = language.query(jsxQuery)\n\t\t\t\tbreak\n\t\t\tcase \"ts\":\n\t\t\t\tlanguage = await loadLanguage(\"typescript\")\n\t\t\t\tquery = language.query(typescriptQuery)\n\t\t\t\tbreak\n\t\t\tcase \"tsx\":\n\t\t\t\tlanguage = await loadLanguage(\"tsx\")\n\t\t\t\tquery = language.query(tsxQuery)\n\t\t\t\tbreak\n\t\t\tcase \"py\":\n\t\t\t\tlanguage = await loadLanguage(\"python\")\n\t\t\t\tquery = language.query(pythonQuery)\n\t\t\t\tbreak\n\t\t\tcase \"rs\":\n\t\t\t\tlanguage = await loadLanguage(\"rust\")\n\t\t\t\tquery = language.query(rustQuery)\n\t\t\t\tbreak\n\t\t\tcase \"go\":\n\t\t\t\tlanguage = await loadLanguage(\"go\")\n\t\t\t\tquery = language.query(goQuery)\n\t\t\t\tbreak\n\t\t\tcase \"cpp\":\n\t\t\tcase \"hpp\":\n\t\t\t\tlanguage = await loadLanguage(\"cpp\")\n\t\t\t\tquery = language.query(cppQuery)\n\t\t\t\tbreak\n\t\t\tcase \"c\":\n\t\t\tcase \"h\":\n\t\t\t\tlanguage = await loadLanguage(\"c\")\n\t\t\t\tquery = language.query(cQuery)\n\t\t\t\tbreak\n\t\t\tcase \"cs\":\n\t\t\t\tlanguage = await loadLanguage(\"c_sharp\")\n\t\t\t\tquery = language.query(csharpQuery)\n\t\t\t\tbreak\n\t\t\tcase \"rb\":\n\t\t\t\tlanguage = await loadLanguage(\"ruby\")\n\t\t\t\tquery = language.query(rubyQuery)\n\t\t\t\tbreak\n\t\t\tcase \"java\":\n\t\t\t\tlanguage = await loadLanguage(\"java\")\n\t\t\t\tquery = language.query(javaQuery)\n\t\t\t\tbreak\n\t\t\tcase \"php\":\n\t\t\t\tlanguage = await loadLanguage(\"php\")\n\t\t\t\tquery = language.query(phpQuery)\n\t\t\t\tbreak\n\t\t\tcase \"swift\":\n\t\t\t\tlanguage = await loadLanguage(\"swift\")\n\t\t\t\tquery = language.query(swiftQuery)\n\t\t\t\tbreak\n\t\t\tcase \"kt\":\n\t\t\tcase \"kts\":\n\t\t\t\tlanguage = await loadLanguage(\"kotlin\")\n\t\t\t\tquery = language.query(kotlinQuery)\n\t\t\t\tbreak\n\t\t\tcase \"css\":\n\t\t\t\tlanguage = await loadLanguage(\"css\")\n\t\t\t\tquery = language.query(cssQuery)\n\t\t\t\tbreak\n\t\t\tcase \"html\":\n\t\t\t\tlanguage = await loadLanguage(\"html\")\n\t\t\t\tquery = language.query(htmlQuery)\n\t\t\t\tbreak\n\t\t\tcase \"ml\":\n\t\t\tcase \"mli\":\n\t\t\t\tlanguage = await loadLanguage(\"ocaml\")\n\t\t\t\tquery = language.query(ocamlQuery)\n\t\t\t\tbreak\n\t\t\tcase \"scala\":\n\t\t\t\tlanguage = await loadLanguage(\"scala\")\n\t\t\t\tquery = language.query(luaQuery) // Temporarily use Lua query until Scala is implemented\n\t\t\t\tbreak\n\t\t\tcase \"sol\":\n\t\t\t\tlanguage = await loadLanguage(\"solidity\")\n\t\t\t\tquery = language.query(solidityQuery)\n\t\t\t\tbreak\n\t\t\tcase \"toml\":\n\t\t\t\tlanguage = await loadLanguage(\"toml\")\n\t\t\t\tquery = language.query(tomlQuery)\n\t\t\t\tbreak\n\t\t\tcase \"vue\":\n\t\t\t\tlanguage = await loadLanguage(\"vue\")\n\t\t\t\tquery = language.query(vueQuery)\n\t\t\t\tbreak\n\t\t\tcase \"lua\":\n\t\t\t\tlanguage = await loadLanguage(\"lua\")\n\t\t\t\tquery = language.query(luaQuery)\n\t\t\t\tbreak\n\t\t\tcase \"rdl\":\n\t\t\t\tlanguage = await loadLanguage(\"systemrdl\")\n\t\t\t\tquery = language.query(systemrdlQuery)\n\t\t\t\tbreak\n\t\t\tcase \"tla\":\n\t\t\t\tlanguage = await loadLanguage(\"tlaplus\")\n\t\t\t\tquery = language.query(tlaPlusQuery)\n\t\t\t\tbreak\n\t\t\tcase \"zig\":\n\t\t\t\tlanguage = await loadLanguage(\"zig\")\n\t\t\t\tquery = language.query(zigQuery)\n\t\t\t\tbreak\n\t\t\tcase \"ejs\":\n\t\t\tcase \"erb\":\n\t\t\t\tlanguage = await loadLanguage(\"embedded_template\")\n\t\t\t\tparserKey = \"embedded_template\" // Use same key for both extensions\n\t\t\t\tquery = language.query(embeddedTemplateQuery)\n\t\t\t\tbreak\n\t\t\tcase \"el\":\n\t\t\t\tlanguage = await loadLanguage(\"elisp\")\n\t\t\t\tquery = language.query(elispQuery)\n\t\t\t\tbreak\n\t\t\tcase \"ex\":\n\t\t\tcase \"exs\":\n\t\t\t\tlanguage = await loadLanguage(\"elixir\")\n\t\t\t\tquery = language.query(elixirQuery)\n\t\t\t\tbreak\n\t\t\tdefault:\n\t\t\t\tthrow new Error(`Unsupported language: ${ext}`)\n\t\t}\n\t\tconst parser = new Parser()\n\t\tparser.setLanguage(language)\n\t\tparsers[parserKey] = { parser, query }\n\t}\n\treturn parsers\n}\n", "export const solidityQuery = `\n; Contract declarations\n(contract_declaration\n name: (identifier) @name.definition.contract) @definition.contract\n\n(interface_declaration\n name: (identifier) @name.definition.interface) @definition.interface\n\n(library_declaration\n name: (identifier) @name.definition.library) @definition.library\n\n; Function declarations\n(function_definition\n name: (identifier) @name.definition.function) @definition.function\n\n(modifier_definition\n name: (identifier) @name.definition.modifier) @definition.modifier\n\n(constructor_definition) @definition.constructor\n\n(fallback_receive_definition\n (visibility)\n (state_mutability)) @definition.fallback\n\n; Type declarations\n(struct_declaration\n name: (identifier) @name.definition.struct) @definition.struct\n\n(enum_declaration\n name: (identifier) @name.definition.enum) @definition.enum\n\n(event_definition\n name: (identifier) @name.definition.event) @definition.event\n\n(error_declaration\n name: (identifier) @name.definition.error) @definition.error\n\n; Variable declarations\n(state_variable_declaration\n name: (identifier) @name.definition.variable) @definition.variable\n\n; Using directives\n(using_directive\n (type_alias) @name.definition.using) @definition.using`\n", "/*\nPHP Tree-sitter Query - Standardized Version\n\nThis query file captures PHP language constructs for code navigation and analysis.\nEach query pattern is organized by construct type and includes clear comments.\n\nSUPPORTED LANGUAGE CONSTRUCTS:\n------------------------------\n1. CLASS DEFINITIONS\n - Regular classes\n - Abstract classes\n - Final classes\n - Readonly classes (PHP 8.2+)\n\n2. INTERFACE & TRAIT DEFINITIONS\n - Interfaces\n - Traits\n - Enums (PHP 8.1+)\n\n3. FUNCTION & METHOD DEFINITIONS\n - Global functions\n - Class methods\n - Static methods\n - Abstract methods\n - Final methods\n - Arrow functions (PHP 7.4+)\n\n4. PROPERTY DEFINITIONS\n - Regular properties\n - Static properties\n - Readonly properties (PHP 8.1+)\n - Constructor property promotion (PHP 8.0+)\n\n5. OTHER LANGUAGE CONSTRUCTS\n - Constants\n - Namespaces\n - Use statements (imports)\n - Anonymous classes\n - Attributes (PHP 8.0+)\n - Match expressions (PHP 8.0+)\n - Heredoc and nowdoc syntax\n*/\nexport default `\n;--------------------------\n; 1. CLASS DEFINITIONS\n;--------------------------\n; Regular classes\n(class_declaration\n name: (name) @name.definition.class) @definition.class\n\n; Abstract classes\n(class_declaration\n (abstract_modifier)\n name: (name) @name.definition.abstract_class) @definition.abstract_class\n\n; Final classes\n(class_declaration\n (final_modifier)\n name: (name) @name.definition.final_class) @definition.final_class\n\n; Readonly classes (PHP 8.2+)\n(class_declaration\n (readonly_modifier)\n name: (name) @name.definition.readonly_class) @definition.readonly_class\n\n;--------------------------\n; 2. INTERFACE & TRAIT DEFINITIONS\n;--------------------------\n; Interfaces\n(interface_declaration\n name: (name) @name.definition.interface) @definition.interface\n\n; Traits\n(trait_declaration\n name: (name) @name.definition.trait) @definition.trait\n\n; Enums (PHP 8.1+)\n(enum_declaration\n name: (name) @name.definition.enum) @definition.enum\n\n;--------------------------\n; 3. FUNCTION & METHOD DEFINITIONS\n;--------------------------\n; Global functions\n(function_definition\n name: (name) @name.definition.function\n parameters: (formal_parameters) @parameters.definition.function\n body: (compound_statement) @body.definition.function) @definition.function\n\n; Regular methods\n(method_declaration\n name: (name) @name.definition.method\n parameters: (formal_parameters) @parameters.definition.method) @definition.method\n\n; Static methods\n(method_declaration\n (static_modifier)\n name: (name) @name.definition.static_method\n parameters: (formal_parameters) @parameters.definition.static_method) @definition.static_method\n\n; Abstract methods\n(method_declaration\n (abstract_modifier)\n name: (name) @name.definition.abstract_method\n parameters: (formal_parameters) @parameters.definition.abstract_method) @definition.abstract_method\n\n; Final methods\n(method_declaration\n (final_modifier)\n name: (name) @name.definition.final_method\n parameters: (formal_parameters) @parameters.definition.final_method) @definition.final_method\n\n; Arrow functions (PHP 7.4+)\n(arrow_function) @definition.arrow_function\n\n;--------------------------\n; 4. PROPERTY DEFINITIONS\n;--------------------------\n; Regular properties\n(property_declaration\n (property_element\n (variable_name\n (name) @name.definition.property))) @definition.property\n\n; Static properties\n(property_declaration\n (static_modifier)\n (property_element\n (variable_name\n (name) @name.definition.static_property))) @definition.static_property\n\n; Readonly properties (PHP 8.1+)\n(property_declaration\n (readonly_modifier)\n (property_element\n (variable_name\n (name) @name.definition.readonly_property))) @definition.readonly_property\n\n; Constructor property promotion (PHP 8.0+)\n(property_promotion_parameter\n name: (variable_name\n (name) @name.definition.promoted_property)) @definition.promoted_property\n\n;--------------------------\n; 5. OTHER LANGUAGE CONSTRUCTS\n;--------------------------\n; Constants\n(const_declaration\n (const_element\n (name) @name.definition.constant)) @definition.constant\n\n; Namespaces\n(namespace_definition\n name: (namespace_name) @name.definition.namespace) @definition.namespace\n\n; Use statements (imports)\n(namespace_use_declaration\n (namespace_use_clause\n (qualified_name) @name.definition.use)) @definition.use\n\n; Anonymous classes\n(object_creation_expression\n (declaration_list)) @definition.anonymous_class\n\n; Attributes (PHP 8.0+)\n(attribute_group\n (attribute\n (name) @name.definition.attribute)) @definition.attribute\n\n; Match expressions (PHP 8.0+)\n(match_expression) @definition.match_expression\n\n; Heredoc syntax\n(heredoc) @definition.heredoc\n\n; Nowdoc syntax\n(nowdoc) @definition.nowdoc\n`\n", "export const vueQuery = `\n; Top-level structure\n(component) @component.definition\n\n; Template section\n(template_element) @template.definition\n(template_element\n (element\n (start_tag\n (tag_name) @element.name.definition))\n (element\n (start_tag\n (attribute\n (attribute_name) @attribute.name.definition)))\n (element\n (start_tag\n (directive_attribute\n (directive_name) @directive.name.definition))))\n\n; Script section\n(script_element) @script.definition\n(script_element\n (raw_text) @script.content.definition)\n\n; Style section\n(style_element) @style.definition\n(style_element\n (raw_text) @style.content.definition)\n`\n", "/*\nTypeScript Tree-sitter Query Patterns\n*/\nexport default `\n; === Import Declarations ===\n(import_statement\n (import_clause\n (named_imports\n (import_specifier\n name: (identifier) @name.import)))) @definition.import\n\n; === Default Imports ===\n(import_statement\n (import_clause\n (identifier) @name.import)) @definition.import\n\n; === Class Declarations ===\n(class_declaration\n name: (type_identifier) @name.class) @definition.class\n\n; === Abstract Class Declarations ===\n(abstract_class_declaration\n name: (type_identifier) @name.class) @definition.class\n\n; === Interface Declarations ===\n(interface_declaration\n name: (type_identifier) @name.interface) @definition.interface\n\n; === Type Alias Declarations ===\n(type_alias_declaration\n name: (type_identifier) @name.type_alias) @definition.type_alias\n\n; === Enum Declarations ===\n(enum_declaration\n name: (identifier) @name.enum) @definition.enum\n\n; === Function Declarations ===\n(function_declaration\n name: (identifier) @name.function\n parameters: (formal_parameters) @parameters.function\n body: (statement_block) @body.function) @definition.function\n\n; === Generator Function Declarations ===\n(generator_function_declaration\n name: (identifier) @name.function\n parameters: (formal_parameters) @parameters.function\n body: (statement_block) @body.function) @definition.function\n\n; === Method Definitions in Classes ===\n(method_definition\n name: (property_identifier) @name.method\n parameters: (formal_parameters) @parameters.method\n body: (statement_block) @body.method) @definition.method\n\n; === Variable Declarations ===\n(variable_declaration\n (variable_declarator\n name: (identifier) @name.variable)) @definition.variable\n\n; === Lexical Declarations (const, let) ===\n(lexical_declaration\n (variable_declarator\n name: (identifier) @name.variable)) @definition.variable\n\n; === Property Signatures in Interfaces ===\n(property_signature\n name: (property_identifier) @name.property) @definition.property\n\n; === Method Signatures in Interfaces ===\n(method_signature\n name: (property_identifier) @name.method\n parameters: (formal_parameters) @parameters.method) @definition.method\n\n; === Arrow Functions assigned to variables ===\n(lexical_declaration\n (variable_declarator\n name: (identifier) @name.function\n value: (arrow_function\n parameters: (formal_parameters) @parameters.function))) @definition.function\n\n(variable_declaration\n (variable_declarator\n name: (identifier) @name.function\n value: (arrow_function\n parameters: (formal_parameters) @parameters.function))) @definition.function\n\n; === Function Expressions assigned to variables ===\n(lexical_declaration\n (variable_declarator\n name: (identifier) @name.function\n value: (function_expression\n parameters: (formal_parameters) @parameters.function))) @definition.function\n\n(variable_declaration\n (variable_declarator\n name: (identifier) @name.function\n value: (function_expression\n parameters: (formal_parameters) @parameters.function))) @definition.function\n`\n", "import typescriptQuery from \"./typescript\"\n\n/**\n * Tree-sitter Query for TSX Files\n *\n * This query captures React component definitions in TSX files:\n * - Function Components\n * - Class Components\n * - Higher Order Components\n * - Type Definitions\n * - Props Interfaces\n * - State Definitions\n * - Generic Components\n */\n\nexport default `${typescriptQuery}\n\n; Function Components - Both function declarations and arrow functions\n(function_declaration\n name: (identifier) @name) @definition.component\n\n; Arrow Function Components\n(variable_declaration\n (variable_declarator\n name: (identifier) @name\n value: (arrow_function))) @definition.component\n\n; Export Statement Components\n(export_statement\n (variable_declaration\n (variable_declarator\n name: (identifier) @name\n value: (arrow_function)))) @definition.component\n\n; Class Components\n(class_declaration\n name: (type_identifier) @name) @definition.class_component\n\n; Interface Declarations\n(interface_declaration\n name: (type_identifier) @name) @definition.interface\n\n; Type Alias Declarations\n(type_alias_declaration\n name: (type_identifier) @name) @definition.type\n\n; HOC Components\n(variable_declaration\n (variable_declarator\n name: (identifier) @name\n value: (call_expression\n function: (identifier)))) @definition.component\n\n; JSX Component Usage - Capture all components in JSX\n(jsx_element\n open_tag: (jsx_opening_element\n name: [(identifier) @component (member_expression) @component])) @definition.jsx_element\n\n; Self-closing JSX elements\n(jsx_self_closing_element\n name: [(identifier) @component (member_expression) @component]) @definition.jsx_self_closing_element\n\n; Capture all identifiers in JSX expressions that start with capital letters\n(jsx_expression\n (identifier) @jsx_component) @definition.jsx_component\n\n; Capture all member expressions in JSX\n(member_expression\n object: (identifier) @object\n property: (property_identifier) @property) @definition.member_component\n\n; Capture components in conditional expressions\n(ternary_expression\n consequence: (parenthesized_expression\n (jsx_element\n open_tag: (jsx_opening_element\n name: (identifier) @component)))) @definition.conditional_component\n\n(ternary_expression\n alternative: (jsx_self_closing_element\n name: (identifier) @component)) @definition.conditional_component\n\n; Generic Components\n(function_declaration\n name: (identifier) @name\n type_parameters: (type_parameters)) @definition.generic_component\n`\n", "/*\nPython Tree-sitter Query Patterns\n*/\nexport default `\n; Class definitions (including decorated)\n(class_definition\n name: (identifier) @name.definition.class) @definition.class\n\n(decorated_definition\n definition: (class_definition\n name: (identifier) @name.definition.class)) @definition.class\n\n; Function definitions with parameters and body (including async and decorated)\n(function_definition\n name: (identifier) @name.definition.function\n parameters: (parameters) @parameters.definition.function\n body: (block) @body.definition.function) @definition.function\n\n(decorated_definition\n definition: (function_definition\n name: (identifier) @name.definition.function\n parameters: (parameters) @parameters.definition.function)) @definition.function\n\n; Assignment statements for variables\n(assignment\n left: (identifier) @name.definition.variable) @definition.variable\n\n; Multiple assignment (tuple unpacking) - capture each identifier separately\n(assignment\n left: (pattern_list\n (identifier) @name.definition.variable)) @definition.variable\n\n; Augmented assignment (+=, -=, etc.)\n(augmented_assignment\n left: (identifier) @name.definition.variable) @definition.variable\n\n; Annotated assignment (with type hints)\n(expression_statement\n (assignment\n left: (identifier) @name.definition.variable\n type: (type))) @definition.variable\n\n; Attribute assignments (self.attribute = value) - capture the attribute name\n(assignment\n left: (attribute\n object: (identifier)\n attribute: (identifier) @name.definition.member_variable)) @definition.variable\n\n; Lambda expressions\n(expression_statement\n (assignment\n left: (identifier) @name.definition.lambda\n right: (parenthesized_expression\n (lambda)))) @definition.lambda\n\n; Generator functions (functions containing yield)\n(function_definition\n name: (identifier) @name.definition.generator\n body: (block\n (expression_statement\n (yield)))) @definition.generator\n\n; Comprehensions\n(expression_statement\n (assignment\n left: (identifier) @name.definition.comprehension\n right: [\n (list_comprehension)\n (dictionary_comprehension)\n (set_comprehension)\n ])) @definition.comprehension\n\n; With statements\n(with_statement) @definition.with_statement\n\n; Try statements\n(try_statement) @definition.try_statement\n\n; Import statements\n(import_statement\n name: (dotted_name) @name.definition.import) @definition.import\n\n(import_from_statement\n module_name: (dotted_name) @name.definition.import) @definition.import\n\n(import_from_statement\n name: (dotted_name) @name.definition.import) @definition.import\n\n; Global/Nonlocal statements\n(function_definition\n body: (block\n [(global_statement) (nonlocal_statement)])) @definition.scope\n\n; Match case statements\n(function_definition\n body: (block\n (match_statement))) @definition.match_case\n\n; Type annotations\n(typed_parameter\n type: (type)) @definition.type_annotation\n\n(expression_statement\n (assignment\n left: (identifier) @name.definition.type\n type: (type))) @definition.type_annotation\n`\n", "/*\n- class definitions\n- method definitions (including decorated methods)\n- named function declarations\n- arrow functions and function expressions assigned to variables\n- variable declarations (global and class member variables)\n- JSON object and array definitions (for JSON files)\n- decorators and decorated elements\n*/\nexport default `\n(\n (comment)* @doc\n .\n (method_definition\n name: (property_identifier) @name\n parameters: (formal_parameters) @parameters.definition.method) @definition.method\n (#not-eq? @name \"constructor\")\n (#strip! @doc \"^[\\\\s\\\\*/]+|^[\\\\s\\\\*/]$\")\n (#select-adjacent! @doc @definition.method)\n)\n\n(\n (comment)* @doc\n .\n [\n (class\n name: (_) @name.definition.class)\n (class_declaration\n name: (_) @name.definition.class)\n ] @definition.class\n (#strip! @doc \"^[\\\\s\\\\*/]+|^[\\\\s\\\\*/]$\")\n (#select-adjacent! @doc @definition.class)\n)\n\n(\n (comment)* @doc\n .\n [\n (function_declaration\n name: (identifier) @name.definition.function\n parameters: (formal_parameters) @parameters.definition.function\n body: (statement_block) @body.definition.function) @definition.function\n (generator_function_declaration\n name: (identifier) @name.definition.function\n parameters: (formal_parameters) @parameters.definition.function) @definition.function\n ]\n (#strip! @doc \"^[\\\\s\\\\*/]+|^[\\\\s\\\\*/]$\")\n (#select-adjacent! @doc @definition.function)\n)\n\n(\n (comment)* @doc\n .\n (lexical_declaration\n (variable_declarator\n name: (identifier) @name\n value: [\n (arrow_function\n parameters: (formal_parameters) @parameters.definition.function)\n (function_expression\n parameters: (formal_parameters) @parameters.definition.function)\n ]) @definition.function)\n (#strip! @doc \"^[\\\\s\\\\*/]+|^[\\\\s\\\\*/]$\")\n (#select-adjacent! @doc @definition.function)\n)\n\n(\n (comment)* @doc\n .\n (variable_declaration\n (variable_declarator\n name: (identifier) @name\n value: [\n (arrow_function\n parameters: (formal_parameters) @parameters.definition.function)\n (function_expression\n parameters: (formal_parameters) @parameters.definition.function)\n ]) @definition.function)\n (#strip! @doc \"^[\\\\s\\\\*/]+|^[\\\\s\\\\*/]$\")\n (#select-adjacent! @doc @definition.function)\n)\n\n; Variable declarations (let, const, var) - capture each declarator separately\n(variable_declarator\n name: (identifier) @name.definition.variable) @definition.variable\n\n; Also capture from parent declarations for context\n(variable_declaration\n (variable_declarator\n name: (identifier) @name.definition.variable)) @definition.variable\n\n(lexical_declaration\n (variable_declarator\n name: (identifier) @name.definition.variable)) @definition.variable\n\n; Destructuring assignments - capture all identifiers in destructuring patterns\n(shorthand_property_identifier_pattern) @name.definition.variable @definition.variable\n\n; Array destructuring - capture the whole pattern for manual processing\n(lexical_declaration\n (variable_declarator\n name: (array_pattern) @array_pattern)) @definition.variable\n\n(variable_declaration\n (variable_declarator\n name: (array_pattern) @array_pattern)) @definition.variable\n\n; Class field declarations\n(field_definition\n property: (property_identifier) @name.definition.member_variable) @definition.variable\n\n; Assignment expressions for member variables (this.property = value)\n(assignment_expression\n left: (member_expression\n object: (this)\n property: (property_identifier) @name.definition.member_variable)) @definition.variable\n\n; Object property assignments\n(assignment_expression\n left: (member_expression\n property: (property_identifier) @name.definition.member_variable)) @definition.variable\n\n; JSON object definitions\n(object) @object.definition\n\n; JSON object key-value pairs\n(pair\n key: (string) @property.name.definition\n value: [\n (object) @object.value\n (array) @array.value\n (string) @string.value\n (number) @number.value\n (true) @boolean.value\n (false) @boolean.value\n (null) @null.value\n ]\n) @property.definition\n\n; JSON array definitions\n(array) @array.definition\n\n; Decorated method definitions\n(\n [\n (method_definition\n decorator: (decorator)\n name: (property_identifier) @name\n parameters: (formal_parameters) @parameters.definition.method) @definition.method\n (method_definition\n decorator: (decorator\n (call_expression\n function: (identifier) @decorator_name))\n name: (property_identifier) @name\n parameters: (formal_parameters) @parameters.definition.method) @definition.method\n ]\n (#not-eq? @name \"constructor\")\n)\n\n; Decorated class definitions\n(\n [\n (class\n decorator: (decorator)\n name: (_) @name.definition.class) @definition.class\n (class_declaration\n decorator: (decorator)\n name: (_) @name.definition.class) @definition.class\n ]\n)\n\n; Capture method names in decorated classes\n(\n (class_declaration\n decorator: (decorator)\n body: (class_body\n (method_definition\n name: (property_identifier) @name\n parameters: (formal_parameters) @parameters.definition.method) @definition.method))\n (#not-eq? @name \"constructor\")\n)\n`\n", "import javascriptQuery from \"./javascript\"\n\n/*\nJSX Tree-sitter Query Patterns\nBased on JavaScript tree-sitter patterns but extended for React/JSX\n*/\n\nexport default `${javascriptQuery}\n\n; === React Function Components (override JavaScript base patterns) ===\n\n(\n (comment)* @doc\n .\n (function_declaration\n name: (identifier) @name.definition.function\n parameters: (formal_parameters) @parameters.definition.function\n body: (statement_block) @body.definition.function) @definition.function\n (#strip! @doc \"^[\\\\s\\\\*/]+|^[\\\\s\\\\*/]$\")\n (#select-adjacent! @doc @definition.function)\n)\n\n(\n (comment)* @doc\n .\n (lexical_declaration\n (variable_declarator\n name: (identifier) @name.definition.function\n value: (arrow_function\n parameters: (formal_parameters) @parameters.definition.function\n )\n )\n ) @definition.function\n (#strip! @doc \"^[\\\\s\\\\*/]+|^[\\\\s\\\\*/]$\")\n (#select-adjacent! @doc @definition.function)\n)\n\n(\n (comment)* @doc\n .\n (variable_declaration\n (variable_declarator\n name: (identifier) @name.definition.function\n value: (arrow_function\n parameters: (formal_parameters) @parameters.definition.function\n )\n )\n ) @definition.function\n (#strip! @doc \"^[\\\\s\\\\*/]+|^[\\\\s\\\\*/]$\")\n (#select-adjacent! @doc @definition.function)\n)\n\n; === JSX Elements ===\n\n(jsx_element\n open_tag: (jsx_opening_element\n name: (identifier) @name.jsx_element)) @definition.jsx_element\n\n(jsx_self_closing_element\n name: (identifier) @name.jsx_element) @definition.jsx_element\n\n; === Array pattern destructuring (for useState hooks) ===\n\n(lexical_declaration\n (variable_declarator\n name: (array_pattern) @array_pattern)) @definition.variable\n\n(variable_declaration\n (variable_declarator\n name: (array_pattern) @array_pattern)) @definition.variable\n\n; === Function calls (for hooks like useEffect) ===\n\n(call_expression\n function: (identifier) @name.definition.function) @definition.function_call\n`\n", "/*\nJava Tree-sitter Query Patterns\n- import declarations\n- package declarations\n- class declarations (including abstract)\n- interface declarations\n- enum declarations\n- record declarations\n- annotation type declarations\n- method declarations\n- constructor declarations\n- field declarations\n- variable declarations (excluding local variables inside methods)\n*/\nexport default `\n; Import declarations\n(import_declaration\n (scoped_identifier) @name.definition.import) @definition.import\n\n; Package declarations\n(package_declaration\n (scoped_identifier) @name.definition.package) @definition.package\n\n; Class declarations\n(class_declaration\n name: (identifier) @name.definition.class) @definition.class\n\n; Interface declarations\n(interface_declaration\n name: (identifier) @name.definition.interface) @definition.interface\n\n; Enum declarations\n(enum_declaration\n name: (identifier) @name.definition.enum) @definition.enum\n\n; Record declarations\n(record_declaration\n name: (identifier) @name.definition.record) @definition.record\n\n; Annotation type declarations\n(annotation_type_declaration\n name: (identifier) @name.definition.annotation) @definition.annotation\n\n; Annotation type element declarations (annotation methods)\n(annotation_type_element_declaration\n name: (identifier) @name.definition.method) @definition.method\n\n; Method declarations with parameters and body\n(method_declaration\n name: (identifier) @name.definition.method\n parameters: (formal_parameters) @parameters.definition.method\n body: (block) @body.definition.method) @definition.method\n\n; Abstract method declarations (interface methods without body)\n(method_declaration\n name: (identifier) @name.definition.method\n parameters: (formal_parameters) @parameters.definition.method) @definition.method\n\n; Constructor declarations\n(constructor_declaration\n name: (identifier) @name.definition.constructor\n parameters: (formal_parameters) @parameters.definition.constructor\n body: (constructor_body) @body.definition.constructor) @definition.constructor\n\n; Field declarations - handle multiple declarators\n(field_declaration\n declarator: (variable_declarator\n name: (identifier) @name.definition.field)) @definition.field\n\n; Enum constant declarations\n(enum_declaration\n body: (enum_body\n (enum_constant\n name: (identifier) @name.definition.enum_constant))) @definition.enum_constant\n\n; Static initializers\n(static_initializer) @definition.static_initializer\n\n; Instance initializers\n(block) @definition.instance_initializer\n`\n", "/*\nRust language structures for tree-sitter parsing\nCaptures all required constructs for code completion and analysis\n*/\nexport default `\n; Function definitions\n(function_item\n name: (identifier) @name.definition.function\n parameters: (parameters) @parameters.definition.function\n body: (block) @body.definition.function) @definition.function\n\n; Struct definitions and their fields\n(struct_item\n name: (type_identifier) @name.definition.struct\n body: (field_declaration_list\n (field_declaration\n name: (field_identifier) @name.definition.struct_field)*)) @definition.struct\n\n; Tuple struct definitions\n(struct_item\n name: (type_identifier) @name.definition.struct\n body: (ordered_field_declaration_list)*) @definition.struct\n\n; Unit struct definitions\n(struct_item\n name: (type_identifier) @name.definition.struct) @definition.struct\n\n; Enum definitions with variants\n(enum_item\n name: (type_identifier) @name.definition.enum\n body: (enum_variant_list\n (enum_variant\n name: (identifier) @name.definition.enum_variant)*)) @definition.enum\n\n; Trait definitions and their methods\n(trait_item\n name: (type_identifier) @name.definition.trait\n body: (declaration_list\n (function_signature_item\n name: (identifier) @name.definition.trait_method)*)) @definition.trait\n\n; Impl blocks (inherent implementation) and their methods\n(impl_item\n type: (type_identifier) @name.definition.impl\n body: (declaration_list\n (function_item\n name: (identifier) @name.definition.method\n parameters: (parameters) @parameters.definition.method\n body: (block) @body.definition.method)*)) @definition.impl\n\n; Trait implementations and their methods\n(impl_item\n trait: (type_identifier) @name.definition.impl_trait\n type: (type_identifier) @name.definition.impl_for\n body: (declaration_list\n (function_item\n name: (identifier) @name.definition.method\n parameters: (parameters) @parameters.definition.method\n body: (block) @body.definition.method)*)) @definition.impl_trait\n\n; Module definitions\n(mod_item\n name: (identifier) @name.definition.module) @definition.module\n\n; Macro definitions (macro_rules!)\n(macro_definition\n name: (identifier) @name.definition.macro) @definition.macro\n\n; Type aliases\n(type_item\n name: (type_identifier) @name.definition.type_alias) @definition.type_alias\n\n; Constants\n(const_item\n name: (identifier) @name.definition.constant) @definition.constant\n\n; Static items\n(static_item\n name: (identifier) @name.definition.static) @definition.static\n\n; Use declarations (imports)\n(use_declaration) @definition.use_declaration\n\n; Let bindings (local variables)\n(let_declaration\n pattern: (identifier) @name.definition.variable) @definition.variable\n\n; Associated functions and methods in impl blocks\n(impl_item\n body: (declaration_list)*) @definition.method_container\n\n; Function parameters capture\n(function_item\n parameters: (parameters\n (parameter\n pattern: (identifier) @name.definition.parameter)*))\n\n; Associated types in traits\n(trait_item\n body: (declaration_list\n (associated_type\n name: (type_identifier) @name.definition.associated_type)*))\n\n; Associated constants in traits and impls\n(trait_item\n body: (declaration_list\n (const_item\n name: (identifier) @name.definition.trait_constant)*))\n\n(impl_item\n body: (declaration_list\n (const_item\n name: (identifier) @name.definition.impl_constant)*))\n`\n", "/*\n- method definitions (including singleton methods and aliases, with associated comments)\n- class definitions (including singleton classes, with associated comments)\n- module definitions\n- constants\n- global variables\n- instance variables\n- class variables\n- symbols\n- blocks, procs, and lambdas\n- mixins (include, extend, prepend)\n- metaprogramming constructs (define_method, method_missing)\n- attribute accessors (attr_reader, attr_writer, attr_accessor)\n- class macros (has_many, belongs_to, etc. in Rails-like code)\n- exception handling (begin/rescue/ensure)\n- keyword arguments\n- splat operators\n- hash rocket and JSON-style hashes\n- string interpolation\n- regular expressions\n- Ruby 2.7+ pattern matching\n- Ruby 3.0+ endless methods\n- Ruby 3.1+ pin operator and shorthand hash syntax\n*/\nexport default `\n; Method definitions\n(method\n name: (identifier) @name.definition.method) @definition.method\n\n; Singleton methods\n(singleton_method\n object: (_)\n name: (identifier) @name.definition.method) @definition.method\n\n; Method aliases\n(alias\n name: (_) @name.definition.method) @definition.method\n\n; Class definitions\n(class\n name: [\n (constant) @name.definition.class\n (scope_resolution\n name: (_) @name.definition.class)\n ]) @definition.class\n\n; Singleton classes\n(singleton_class\n value: [\n (constant) @name.definition.class\n (scope_resolution\n name: (_) @name.definition.class)\n ]) @definition.class\n\n; Module definitions\n(module\n name: [\n (constant) @name.definition.module\n (scope_resolution\n name: (_) @name.definition.module)\n ]) @definition.module\n\n; Constants\n(assignment\n left: (constant) @name.definition.constant) @definition.constant\n\n; Global variables\n(global_variable) @definition.global_variable\n\n; Instance variables\n(instance_variable) @definition.instance_variable\n\n; Class variables\n(class_variable) @definition.class_variable\n\n; Symbols\n(simple_symbol) @definition.symbol\n(hash_key_symbol) @definition.symbol\n\n; Blocks\n(block) @definition.block\n(do_block) @definition.block\n\n; Basic mixin statements - capture all include/extend/prepend calls\n(call\n method: (identifier) @_mixin_method\n arguments: (argument_list\n (constant) @name.definition.mixin)\n (#match? @_mixin_method \"^(include|extend|prepend)$\")) @definition.mixin\n\n; Mixin module definition\n(module\n name: (constant) @name.definition.mixin_module\n (#match? @name.definition.mixin_module \".*Module$\")) @definition.mixin_module\n\n; Mixin-related methods\n(method\n name: (identifier) @name.definition.mixin_method\n (#match? @name.definition.mixin_method \"(included|extended|prepended)_method\")) @definition.mixin_method\n\n; Singleton class blocks\n(singleton_class) @definition.singleton_class\n\n; Class methods in singleton context\n(singleton_method\n object: (self)\n name: (identifier) @name.definition.singleton_method) @definition.singleton_method\n\n; Attribute accessors\n(call\n method: (identifier) @_attr_accessor\n arguments: (argument_list\n (_) @name.definition.attr_accessor)\n (#eq? @_attr_accessor \"attr_accessor\")) @definition.attr_accessor\n\n(call\n method: (identifier) @_attr_reader\n arguments: (argument_list\n (_) @name.definition.attr_reader)\n (#eq? @_attr_reader \"attr_reader\")) @definition.attr_reader\n\n(call\n method: (identifier) @_attr_writer\n arguments: (argument_list\n (_) @name.definition.attr_writer)\n (#eq? @_attr_writer \"attr_writer\")) @definition.attr_writer\n\n; Class macros (Rails-like)\n(call\n method: (identifier) @_macro_name\n arguments: (argument_list\n (_) @name.definition.class_macro)\n (#match? @_macro_name \"^(has_many|belongs_to|has_one|validates|scope|before_action|after_action)$\")) @definition.class_macro\n\n; Exception handling\n(begin) @definition.begin\n(rescue) @definition.rescue\n(ensure) @definition.ensure\n\n; Keyword arguments\n(keyword_parameter\n name: (identifier) @name.definition.keyword_parameter) @definition.keyword_parameter\n\n; Splat operators\n(splat_parameter) @definition.splat_parameter\n(splat_argument) @definition.splat_argument\n\n; Hash syntax variants\n(pair\n key: (_) @name.definition.hash_key) @definition.hash_pair\n\n; String interpolation - capture the string with interpolation and surrounding context\n(assignment\n left: (identifier) @name.definition.string_var\n right: (string\n (interpolation))) @definition.string_interpolation\n\n; Regular expressions - capture the regex pattern and assignment\n(assignment\n left: (identifier) @name.definition.regex_var\n right: (regex)) @definition.regex_assignment\n\n; Pattern matching - capture the entire case_match structure\n(case_match) @definition.case_match\n\n; Pattern matching - capture in_clause with hash pattern\n(in_clause\n pattern: (hash_pattern)) @definition.hash_pattern_clause\n\n; Endless methods - capture the method definition with name and surrounding context\n(comment) @_endless_method_comment\n(#match? @_endless_method_comment \"Ruby 3.0\\\\+ endless method\")\n(method\n name: (identifier) @name.definition.endless_method\n body: (binary\n operator: \"=\")) @definition.endless_method\n\n; Pin operator - capture the entire in_clause with variable_reference_pattern\n(in_clause\n pattern: (variable_reference_pattern)) @definition.pin_pattern_clause\n\n; Shorthand hash syntax - capture the method containing shorthand hash\n(comment) @_shorthand_hash_comment\n(#match? @_shorthand_hash_comment \"Ruby 3.1\\\\+ shorthand hash syntax\")\n(method\n name: (identifier) @name.definition.shorthand_method) @definition.shorthand_method\n\n; Shorthand hash syntax - capture the hash with shorthand syntax\n(hash\n (pair\n (hash_key_symbol)\n \":\")) @definition.shorthand_hash\n\n; Capture larger contexts for features that need at least 4 lines\n\n; Capture the entire program to include all comments and code\n(program) @definition.program\n\n; Capture all comments\n(comment) @definition.comment\n\n; Capture all method definitions\n(method) @definition.method_all\n`\n", "/*\nC Language Constructs Supported by Tree-Sitter Parser:\n\n1. Class-like Constructs:\n- struct definitions (with fields)\n- union definitions (with variants)\n- enum definitions (with values)\n- anonymous unions/structs\n- aligned structs\n\n2. Function-related Constructs:\n- function definitions (with parameters)\n- function declarations (prototypes)\n- static functions\n- function pointers\n\n3. Type Definitions:\n- typedef declarations (all types)\n- function pointer typedefs\n- struct/union typedefs\n\n4. Variable Declarations:\n- global variables\n- static variables\n- array declarations\n- pointer declarations\n\n5. Preprocessor Constructs:\n- function-like macros\n- object-like macros\n- conditional compilation\n- include directives\n*/\n\nexport default `\n; Include directives\n(preproc_include\n path: (_) @name.definition.include) @definition.include\n\n; Function definitions\n(function_definition\n declarator: (function_declarator\n declarator: (identifier) @name.definition.function\n parameters: (parameter_list) @parameters.definition.function)\n body: (compound_statement) @body.definition.function) @definition.function\n\n; Function declarations (prototypes)\n(declaration\n declarator: (function_declarator\n declarator: (identifier) @name.definition.function\n parameters: (parameter_list) @parameters.definition.function)) @definition.function\n\n; Struct definitions with fields\n(struct_specifier\n name: (type_identifier) @name.definition.struct\n body: (field_declaration_list) @body.definition.struct) @definition.struct\n\n; Union definitions with fields\n(union_specifier\n name: (type_identifier) @name.definition.union\n body: (field_declaration_list) @body.definition.union) @definition.union\n\n; Enum definitions with values\n(enum_specifier\n name: (type_identifier) @name.definition.enum\n body: (enumerator_list) @body.definition.enum) @definition.enum\n\n; Typedef declarations\n(type_definition\n declarator: (type_identifier) @name.definition.type) @definition.type\n\n; Global variables\n(declaration\n declarator: (identifier) @name.definition.variable) @definition.variable\n\n(declaration\n declarator: (init_declarator\n declarator: (identifier) @name.definition.variable)) @definition.variable\n\n(declaration\n declarator: (init_declarator\n declarator: (array_declarator\n declarator: (identifier) @name.definition.variable))) @definition.variable\n\n(declaration\n declarator: (pointer_declarator\n declarator: (identifier) @name.definition.variable)) @definition.variable\n\n(declaration\n declarator: (pointer_declarator\n declarator: (pointer_declarator\n declarator: (identifier) @name.definition.variable))) @definition.variable\n\n(declaration\n declarator: (init_declarator\n declarator: (pointer_declarator\n declarator: (identifier) @name.definition.variable))) @definition.variable\n\n(declaration\n declarator: (function_declarator\n declarator: (parenthesized_declarator\n (pointer_declarator\n declarator: (identifier) @name.definition.variable)))) @definition.variable\n\n(declaration\n declarator: (array_declarator\n declarator: (identifier) @name.definition.variable)) @definition.variable\n\n(declaration\n declarator: (array_declarator\n declarator: (array_declarator\n declarator: (identifier) @name.definition.variable))) @definition.variable\n\n(declaration\n declarator: (array_declarator\n declarator: (array_declarator\n declarator: (array_declarator\n declarator: (identifier) @name.definition.variable)))) @definition.variable\n\n; Static variables\n(declaration\n (storage_class_specifier) @storage\n declarator: (identifier) @name.definition.variable) @definition.variable\n\n(declaration\n (storage_class_specifier) @storage\n declarator: (init_declarator\n declarator: (identifier) @name.definition.variable)) @definition.variable\n\n(declaration\n (storage_class_specifier) @storage\n declarator: (array_declarator\n declarator: (identifier) @name.definition.variable)) @definition.variable\n\n(declaration\n (storage_class_specifier) @storage\n declarator: (pointer_declarator\n declarator: (identifier) @name.definition.variable)) @definition.variable\n\n; Object-like macros\n(preproc_def\n name: (identifier) @name.definition.macro) @definition.macro\n\n; Function-like macros\n(preproc_function_def\n name: (identifier) @name.definition.macro\n parameters: (preproc_params) @parameters.definition.macro) @definition.macro\n\n; Field declarations (members)\n(field_declaration\n declarator: (field_identifier) @name.definition.field) @definition.field\n\n; Enum values/enumerators\n(enumerator\n name: (identifier) @name.definition.enumerator) @definition.enumerator\n\n; Parameter declarations\n(parameter_declaration\n declarator: (identifier) @name.definition.parameter) @definition.parameter\n\n; C++ specific constructs\n\n; Destructor definitions\n(function_definition\n declarator: (function_declarator\n declarator: (destructor_name) @name.definition.destructor\n parameters: (parameter_list) @parameters.definition.destructor)\n body: (compound_statement) @body.definition.destructor) @definition.destructor\n\n; Operator overloading\n(function_definition\n declarator: (function_declarator\n declarator: (operator_name) @name.definition.operator\n parameters: (parameter_list) @parameters.definition.operator)\n body: (compound_statement) @body.definition.operator) @definition.operator\n\n; Method definitions (class/struct members)\n(function_definition\n declarator: (function_declarator\n declarator: (field_identifier) @name.definition.method\n parameters: (parameter_list) @parameters.definition.method)\n body: (compound_statement) @body.definition.method) @definition.method\n\n; Class definitions\n(class_specifier\n name: (type_identifier) @name.definition.class\n body: (field_declaration_list) @body.definition.class) @definition.class\n\n; Namespace definitions\n(namespace_definition\n name: (namespace_identifier) @name.definition.namespace\n body: (declaration_list) @body.definition.namespace) @definition.namespace\n\n; Template declarations\n(template_declaration\n parameters: (template_parameter_list) @parameters.definition.template\n (class_specifier\n name: (type_identifier) @name.definition.template.class)) @definition.template\n\n; Template function declarations\n(template_declaration\n parameters: (template_parameter_list) @parameters.definition.template\n (function_definition\n declarator: (function_declarator\n declarator: (identifier) @name.definition.template.function))) @definition.template\n\n; Typedef declarations\n(type_definition\n declarator: (type_identifier) @name.definition.typedef) @definition.typedef\n\n; Using declarations \n(using_declaration) @definition.using\n\n; More variable patterns for pointers and references\n(declaration\n declarator: (init_declarator\n declarator: (identifier) @name.definition.variable\n value: (_))) @definition.variable\n\n; Additional pointer declarator patterns\n(declaration\n type: (_)\n declarator: (pointer_declarator\n declarator: (identifier) @name.definition.variable)) @definition.variable\n\n; Reference variables (using & in type)\n(declaration\n type: (_)\n declarator: (identifier) @name.definition.variable) @definition.variable\n`\n", "/*\nC Language Constructs Supported by Tree-Sitter Parser:\n\n1. Class-like Constructs:\n- struct definitions (with fields)\n- union definitions (with variants)\n- enum definitions (with values)\n- anonymous unions/structs\n- aligned structs\n\n2. Function-related Constructs:\n- function definitions (with parameters)\n- function declarations (prototypes)\n- static functions\n- function pointers\n\n3. Type Definitions:\n- typedef declarations (all types)\n- function pointer typedefs\n- struct/union typedefs\n\n4. Variable Declarations:\n- global variables\n- static variables\n- array declarations\n- pointer declarations\n\n5. Preprocessor Constructs:\n- function-like macros\n- object-like macros\n- conditional compilation\n- include directives\n*/\n\nexport default `\n; Include directives\n(preproc_include\n path: (_) @name.definition.include) @definition.include\n\n; Function definitions\n(function_definition\n declarator: (function_declarator\n declarator: (identifier) @name.definition.function\n parameters: (parameter_list) @parameters.definition.function)\n body: (compound_statement) @body.definition.function) @definition.function\n\n; Function declarations (prototypes)\n(declaration\n declarator: (function_declarator\n declarator: (identifier) @name.definition.function\n parameters: (parameter_list) @parameters.definition.function)) @definition.function\n\n; Struct definitions with fields\n(struct_specifier\n name: (type_identifier) @name.definition.struct\n body: (field_declaration_list) @body.definition.struct) @definition.struct\n\n; Union definitions with fields\n(union_specifier\n name: (type_identifier) @name.definition.union\n body: (field_declaration_list) @body.definition.union) @definition.union\n\n; Enum definitions with values\n(enum_specifier\n name: (type_identifier) @name.definition.enum\n body: (enumerator_list) @body.definition.enum) @definition.enum\n\n; Typedef declarations\n(type_definition\n declarator: (type_identifier) @name.definition.type) @definition.type\n\n; Global variables\n(declaration\n declarator: (identifier) @name.definition.variable) @definition.variable\n\n(declaration\n declarator: (init_declarator\n declarator: (identifier) @name.definition.variable)) @definition.variable\n\n(declaration\n declarator: (init_declarator\n declarator: (array_declarator\n declarator: (identifier) @name.definition.variable))) @definition.variable\n\n(declaration\n declarator: (pointer_declarator\n declarator: (identifier) @name.definition.variable)) @definition.variable\n\n(declaration\n declarator: (pointer_declarator\n declarator: (pointer_declarator\n declarator: (identifier) @name.definition.variable))) @definition.variable\n\n(declaration\n declarator: (init_declarator\n declarator: (pointer_declarator\n declarator: (identifier) @name.definition.variable))) @definition.variable\n\n(declaration\n declarator: (function_declarator\n declarator: (parenthesized_declarator\n (pointer_declarator\n declarator: (identifier) @name.definition.variable)))) @definition.variable\n\n(declaration\n declarator: (array_declarator\n declarator: (identifier) @name.definition.variable)) @definition.variable\n\n(declaration\n declarator: (array_declarator\n declarator: (array_declarator\n declarator: (identifier) @name.definition.variable))) @definition.variable\n\n(declaration\n declarator: (array_declarator\n declarator: (array_declarator\n declarator: (array_declarator\n declarator: (identifier) @name.definition.variable)))) @definition.variable\n\n; Static variables\n(declaration\n (storage_class_specifier) @storage\n declarator: (identifier) @name.definition.variable) @definition.variable\n\n(declaration\n (storage_class_specifier) @storage\n declarator: (init_declarator\n declarator: (identifier) @name.definition.variable)) @definition.variable\n\n(declaration\n (storage_class_specifier) @storage\n declarator: (array_declarator\n declarator: (identifier) @name.definition.variable)) @definition.variable\n\n(declaration\n (storage_class_specifier) @storage\n declarator: (pointer_declarator\n declarator: (identifier) @name.definition.variable)) @definition.variable\n\n; Object-like macros\n(preproc_def\n name: (identifier) @name.definition.macro) @definition.macro\n\n; Function-like macros\n(preproc_function_def\n name: (identifier) @name.definition.macro\n parameters: (preproc_params) @parameters.definition.macro) @definition.macro\n\n; Field declarations (members)\n(field_declaration\n declarator: (field_identifier) @name.definition.field) @definition.field\n\n; Enum values/enumerators\n(enumerator\n name: (identifier) @name.definition.enumerator) @definition.enumerator\n\n; Parameter declarations\n(parameter_declaration\n declarator: (identifier) @name.definition.parameter) @definition.parameter\n`\n", "/*\nC# Tree-Sitter Query Patterns\n*/\nexport default `\n; Using directives\n(using_directive) @name.definition.using\n\n; Namespace declarations (including file-scoped)\n(namespace_declaration\n name: (identifier) @name.definition.namespace)\n(file_scoped_namespace_declaration\n name: (identifier) @name.definition.namespace)\n\n; Class declarations (including generic, static, abstract, partial, nested)\n(class_declaration\n name: (identifier) @name.definition.class)\n\n; Interface declarations\n(interface_declaration\n name: (identifier) @name.definition.interface)\n\n; Struct declarations\n(struct_declaration\n name: (identifier) @name.definition.struct)\n\n; Enum declarations\n(enum_declaration\n name: (identifier) @name.definition.enum)\n\n; Record declarations\n(record_declaration\n name: (identifier) @name.definition.record)\n\n; Method declarations (including async, static, generic)\n(method_declaration\n name: (identifier) @name.definition.method\n parameter_list: (parameter_list) @parameters.definition.method\n body: (block) @body.definition.method) @definition.method\n\n; Property declarations\n(property_declaration\n name: (identifier) @name.definition.property)\n\n; Event declarations\n(event_declaration\n name: (identifier) @name.definition.event)\n\n; Delegate declarations\n(delegate_declaration\n name: (identifier) @name.definition.delegate)\n\n; Attribute declarations\n(class_declaration\n (attribute_list\n (attribute\n name: (identifier) @name.definition.attribute)))\n\n; Generic type parameters\n(type_parameter_list\n (type_parameter\n name: (identifier) @name.definition.type_parameter))\n\n; LINQ expressions\n(query_expression) @name.definition.linq_expression\n`\n", "/*\nGo Tree-Sitter Query Patterns\n*/\nexport default `\n; Package declarations\n(package_clause\n (package_identifier) @name.definition.package)\n\n; Import declarations\n(import_declaration\n (import_spec_list\n (import_spec path: (_) @name.definition.import)))\n\n; Const declarations\n(const_declaration) @definition.const\n(const_declaration\n (const_spec name: (identifier) @name.definition.const))\n\n; Var declarations\n(var_declaration) @definition.var\n(var_declaration\n (var_spec name: (identifier) @name.definition.var))\n\n; Interface declarations\n(type_declaration) @definition.interface\n(type_declaration\n (type_spec\n name: (type_identifier) @name.definition.interface\n type: (interface_type)))\n\n; Struct declarations\n(type_declaration) @definition.struct\n(type_declaration\n (type_spec\n name: (type_identifier) @name.definition.struct\n type: (struct_type)))\n\n; Type declarations\n(type_declaration) @definition.type\n(type_declaration\n (type_spec\n name: (type_identifier) @name.definition.type))\n\n; Function declarations with result (parameter_list)\n(function_declaration\n name: (identifier) @name.definition.function\n parameters: (parameter_list) @parameters.definition.function\n result: (parameter_list) @result.definition.function\n body: (block) @body.definition.function) @definition.function\n\n; Function declarations with result (type_identifier)\n(function_declaration\n name: (identifier) @name.definition.function\n parameters: (parameter_list) @parameters.definition.function\n result: (type_identifier) @result.definition.function\n body: (block) @body.definition.function) @definition.function\n\n; Function declarations without result\n(function_declaration\n name: (identifier) @name.definition.function\n parameters: (parameter_list) @parameters.definition.function\n body: (block) @body.definition.function) @definition.function\n\n; Method declarations with result (parameter_list)\n(method_declaration\n receiver: (parameter_list\n \t(parameter_declaration\n \t(pointer_type\n \t(type_identifier) @class.definition.method\n )\n )\n ) @self.definition.method\n name: (field_identifier) @name.definition.method\n parameters: (parameter_list) @parameters.definition.method\n result: (parameter_list) @result.definition.method\n body: (block) @body.definition.method) @definition.method\n\n; Method declarations with result (type_identifier)\n(method_declaration\n receiver: (parameter_list\n \t(parameter_declaration\n \t(pointer_type\n \t(type_identifier) @class.definition.method\n )\n )\n ) @self.definition.method\n name: (field_identifier) @name.definition.method\n parameters: (parameter_list) @parameters.definition.method\n result: (type_identifier) @result.definition.method\n body: (block) @body.definition.method) @definition.method\n\n; Method declarations without result\n(method_declaration\n receiver: (parameter_list\n \t(parameter_declaration\n \t(pointer_type\n \t(type_identifier) @class.definition.method\n )\n )\n ) @self.definition.method\n name: (field_identifier) @name.definition.method\n parameters: (parameter_list) @parameters.definition.method\n body: (block) @body.definition.method) @definition.method\n\n; Channel operations\n(channel_type) @name.definition.channel\n\n; Goroutine declarations\n(go_statement) @name.definition.goroutine\n\n; Defer statements\n(defer_statement) @name.definition.defer\n\n; Select statements\n(select_statement) @name.definition.select\n`\n", "/*\nSwift Tree-Sitter Query Patterns\n\nSimplified Swift language constructs that work with tree-sitter\n*/\nexport default `\n; Import declarations\n(import_declaration) @definition.import\n(import_declaration\n (identifier) @name.definition.import)\n\n; Class declarations (includes class, struct, enum, extension)\n(class_declaration) @definition.class\n\n; Class name capture (for class, struct, enum)\n(class_declaration\n (type_identifier) @name.definition.class)\n\n; Extension name capture (extension extends user_type)\n(class_declaration\n \"extension\"\n (user_type\n (type_identifier) @name.definition.class))\n\n; Protocol declarations\n(protocol_declaration\n (type_identifier) @name.definition.protocol) @definition.protocol\n\n; Function declarations (both methods and global functions)\n(function_declaration\n (simple_identifier) @name.definition.method) @definition.method\n\n; Property declarations (all property declarations)\n(property_declaration\n (pattern\n (simple_identifier) @name.definition.property)) @definition.property\n\n; Computed properties (property declarations with computed_property body)\n(property_declaration\n (pattern\n (simple_identifier) @name.definition.computed_property)\n (computed_property)) @definition.computed_property\n\n; Global variables and constants (property_declaration at top level)\n(source_file\n (property_declaration\n (pattern\n (simple_identifier) @name.definition.global_var)) @definition.global_var)\n\n; Initializers\n(init_declaration\n \"init\" @name.definition.initializer) @definition.initializer\n\n; Deinitializers\n(deinit_declaration\n \"deinit\" @name.definition.deinitializer) @definition.deinitializer\n\n; Type alias\n(typealias_declaration\n (type_identifier) @name.definition.type_alias) @definition.type_alias\n\n; Protocol function declarations\n(protocol_function_declaration\n (simple_identifier) @name.definition.protocol_method) @definition.protocol_method\n`\n", "/*\nKotlin Tree-sitter Query Patterns\n\u57FA\u4E8Etree-sitter-kotlin\u7684\u8BED\u6CD5\u6811\u7ED3\u6784\uFF0C\u652F\u6301Kotlin\u8BED\u8A00\u7684\u4E3B\u8981\u6784\u9020\n\u652F\u6301\u7C7B\u3001\u63A5\u53E3\u3001\u679A\u4E3E\u3001\u51FD\u6570\u3001\u5C5E\u6027\u3001\u53D8\u91CF\u3001\u5BFC\u5165\u3001\u5305\u58F0\u660E\u7B49\n*/\nexport default `\n; Based on actual tree-sitter-kotlin grammar\n; Package declarations\n(package_header\n (identifier) @name.definition.package) @definition.package\n\n; Import declarations - capture the full import path including wildcards\n(import_header) @definition.import\n(import_header\n (identifier) @name.definition.import)\n\n; Class declarations (includes all types: class, interface, object, enum, etc.)\n(class_declaration\n (type_identifier) @name.definition.class) @definition.class\n\n; Object declarations (try alternative naming)\n(object_declaration\n (type_identifier) @name.definition.object) @definition.object\n\n; Function declarations\n(function_declaration\n (simple_identifier) @name.definition.function) @definition.function\n\n; Property declarations\n(property_declaration\n (variable_declaration\n (simple_identifier) @name.definition.property)\n) @definition.property\n\n; Type alias declarations\n(type_alias\n (type_identifier) @name.definition.type_alias) @definition.type_alias\n\n`\n", "/*\nCSS Tree-Sitter Query Patterns\n\u4E3ACSS\u6587\u4EF6\u63D0\u4F9B\u57FA\u4E8Etree-sitter\u7684\u4EE3\u7801\u8865\u5168\u652F\u6301\n\u652F\u6301\u7C7B\u9009\u62E9\u5668\u3001ID\u9009\u62E9\u5668\u3001CSS\u53D8\u91CF\u3001\u5173\u952E\u5E27\u52A8\u753B\u3001@\u89C4\u5219\u7B49\n*/\nexport default `\n; CSS\u89C4\u5219\u96C6\uFF08\u5305\u542B\u6240\u6709\u7C7B\u578B\u7684\u9009\u62E9\u5668\uFF09\n(rule_set\n (selectors) @selectors.definition.rule\n (block) @body.definition.rule) @definition.rule\n\n; CSS\u58F0\u660E\uFF08\u5C5E\u6027\uFF09- \u5904\u7406\u591A\u79CD\u503C\u7C7B\u578B\n(declaration\n (property_name) @property.definition.declaration\n (plain_value) @value.definition.declaration) @definition.declaration\n\n(declaration\n (property_name) @property.definition.declaration\n (color_value) @value.definition.declaration) @definition.declaration\n\n(declaration\n (property_name) @property.definition.declaration\n (integer_value) @value.definition.declaration) @definition.declaration\n\n; @import\u8BED\u53E5 - \u5B57\u7B26\u4E32\u5F62\u5F0F\n(import_statement\n (string_value) @name.definition.import) @definition.import\n\n; @import\u8BED\u53E5 - url()\u51FD\u6570\u5F62\u5F0F\n(import_statement\n (call_expression\n (function_name) @func.definition.import\n (arguments\n (string_value) @name.definition.import))) @definition.import\n\n; CSS\u51FD\u6570\u8C03\u7528\uFF08\u5728\u58F0\u660E\u503C\u4E2D\uFF09\n(declaration\n (property_name) @property.definition.function\n (call_expression\n (function_name) @name.definition.function\n (arguments) @args.definition.function)) @definition.function\n\n; @keyframes\u52A8\u753B\n(keyframes_statement\n (keyframes_name) @name.definition.keyframes\n (keyframe_block_list) @body.definition.keyframes) @definition.keyframes\n\n; @media\u67E5\u8BE2 - \u652F\u6301\u4E0D\u540C\u7C7B\u578B\u7684\u67E5\u8BE2\n(media_statement\n (binary_query) @query.definition.media\n (block) @body.definition.media) @definition.media\n\n(media_statement\n (feature_query) @query.definition.media\n (block) @body.definition.media) @definition.media\n\n(media_statement\n (keyword_query) @query.definition.media\n (block) @body.definition.media) @definition.media\n`\n", "export default String.raw`\n; Module, Protocol, and Implementation definitions\n(call\n target: (identifier) @function\n (arguments) @args\n (do_block)?\n (#match? @function \"^(defmodule|defprotocol|defimpl)$\")) @definition.module\n\n; Function definitions\n(call\n target: (identifier) @function\n (arguments) @args\n (do_block)?\n (#eq? @function \"def\")) @definition.function\n\n; Macro definitions\n(call\n target: (identifier) @function\n (arguments) @args\n (do_block)?\n (#eq? @function \"defmacro\")) @definition.macro\n\n; Struct definitions\n(call\n target: (identifier) @function\n (arguments (list))\n (#eq? @function \"defstruct\")) @definition.struct\n\n; Guard definitions\n(call\n target: (identifier) @function\n (arguments) @args\n (#eq? @function \"defguard\")) @definition.guard\n\n; Behaviour callback definitions\n(call\n target: (identifier) @function\n (arguments) @args\n (#eq? @function \"@callback\")) @definition.behaviour\n\n; Sigils\n(sigil\n (sigil_name)\n (quoted_content)) @definition.sigil\n\n; Module attributes\n(unary_operator\n operator: \"@\"\n operand: (call)) @definition.attribute\n\n; Test definitions with string name and map args\n(call\n target: (identifier) @function\n (arguments\n (string)\n (map))\n (#eq? @function \"test\")) @definition.test\n\n; Pipeline operator usage\n(binary_operator\n operator: \"|>\"\n left: (_) @left\n right: (_) @right) @definition.pipeline\n\n; For comprehensions with generator and filter clauses\n(call\n target: (identifier) @function\n (arguments) @args\n (do_block)?\n (#eq? @function \"for\")) @definition.for_comprehension`\n", "export default `\n; Document structure\n(document) @definition.document\n\n; Void elements (self-closing) - using explicit element names for better readability\n; Area element\n(element\n (start_tag\n (tag_name) @name.definition.void\n (#eq? @name.definition.void \"area\"))\n (#not-has? end_tag)) @definition.void_element\n\n; Base element \n(element\n (start_tag\n (tag_name) @name.definition.void\n (#eq? @name.definition.void \"base\"))\n (#not-has? end_tag)) @definition.void_element\n\n; Line break element\n(element\n (start_tag\n (tag_name) @name.definition.void\n (#eq? @name.definition.void \"br\"))\n (#not-has? end_tag)) @definition.void_element\n\n; Column element\n(element\n (start_tag\n (tag_name) @name.definition.void\n (#eq? @name.definition.void \"col\"))\n (#not-has? end_tag)) @definition.void_element\n\n; Embed element\n(element\n (start_tag\n (tag_name) @name.definition.void\n (#eq? @name.definition.void \"embed\"))\n (#not-has? end_tag)) @definition.void_element\n\n; Horizontal rule element\n(element\n (start_tag\n (tag_name) @name.definition.void\n (#eq? @name.definition.void \"hr\"))\n (#not-has? end_tag)) @definition.void_element\n\n; Image element\n(element\n (start_tag\n (tag_name) @name.definition.void\n (#eq? @name.definition.void \"img\"))\n (#not-has? end_tag)) @definition.void_element\n\n; Input element \n(element\n (start_tag\n (tag_name) @name.definition.void\n (#eq? @name.definition.void \"input\"))\n (#not-has? end_tag)) @definition.void_element\n\n; Link element\n(element\n (start_tag\n (tag_name) @name.definition.void\n (#eq? @name.definition.void \"link\"))\n (#not-has? end_tag)) @definition.void_element\n\n; Meta element\n(element\n (start_tag\n (tag_name) @name.definition.void\n (#eq? @name.definition.void \"meta\"))\n (#not-has? end_tag)) @definition.void_element\n\n; Parameter element\n(element\n (start_tag\n (tag_name) @name.definition.void\n (#eq? @name.definition.void \"param\"))\n (#not-has? end_tag)) @definition.void_element\n\n; Source element\n(element\n (start_tag\n (tag_name) @name.definition.void\n (#eq? @name.definition.void \"source\"))\n (#not-has? end_tag)) @definition.void_element\n\n; Track element\n(element\n (start_tag\n (tag_name) @name.definition.void\n (#eq? @name.definition.void \"track\"))\n (#not-has? end_tag)) @definition.void_element\n\n; Word break opportunity element\n(element\n (start_tag\n (tag_name) @name.definition.void\n (#eq? @name.definition.void \"wbr\"))\n (#not-has? end_tag)) @definition.void_element\n\n; Elements with content (exclude script and style)\n(element\n (start_tag\n (tag_name) @name.definition)\n (#not-eq? @name.definition \"script\")\n (#not-eq? @name.definition \"style\")) @definition.element\n\n; Script elements\n(script_element\n (start_tag\n (tag_name) @name.definition)) @definition.script\n\n; Style elements\n(style_element\n (start_tag\n (tag_name) @name.definition)) @definition.style\n\n; Attributes\n(attribute\n (attribute_name) @name.definition) @definition.attribute\n\n; Comments\n(comment) @definition.comment\n\n; Text content\n(text) @definition.text\n\n; Raw text content\n(raw_text) @definition.raw_text\n\n; Self-closing tags\n(self_closing_tag\n (tag_name) @name.definition) @definition.self_closing_tag\n\n; Doctype declarations\n(doctype) @definition.doctype\n\n; Multiple elements (parent with children)\n(element\n (element)+) @definition.nested_elements\n`\n", "/*\nSupported Lua structures:\n- function definitions (global, local, and method)\n- table constructors\n- variable declarations\n- class-like structures\n*/\nexport default String.raw`\n; Function definitions\n(function_definition_statement\n name: (identifier) @name.definition.function\n parameters: (parameters) @parameters.definition.function\n body: (block) @body.definition.function) @definition.function\n\n(function_definition_statement\n name: (variable\n table: (identifier)\n field: (identifier) @name.definition.method)) @definition.method\n\n(local_function_definition_statement\n name: (identifier) @name.definition.function) @definition.function\n\n; Table constructors (class-like structures)\n(local_variable_declaration\n (variable_list\n (variable name: (identifier) @name.definition.table))\n (expression_list\n value: (table))) @definition.table\n\n; Variable declarations\n(variable_assignment\n (variable_list\n (variable name: (identifier) @name.definition.variable))) @definition.variable\n\n; Local variable declarations\n(local_variable_declaration\n (variable_list\n (variable name: (identifier) @name.definition.variable))) @definition.variable\n`\n", "export const ocamlQuery = `\n; Captures module definitions\n(module_definition\n (module_binding\n name: (module_name) @name.definition)) @definition.module\n\n; Captures type definitions\n(type_definition\n (type_binding\n name: (type_constructor) @name.definition)) @definition.type\n\n; Captures function definitions\n(value_definition\n (let_binding\n pattern: (value_name) @name.definition\n (parameter))) @definition.function\n\n; Captures class definitions\n(class_definition\n (class_binding\n name: (class_name) @name.definition)) @definition.class\n\n; Captures method definitions\n(method_definition\n name: (method_name) @name.definition) @definition.method\n\n; Captures value bindings\n(value_definition\n (let_binding\n pattern: (value_name) @name.definition)) @definition.value\n`\n", "// Query patterns for TOML syntax elements\nexport const tomlQuery = `\n; Tables - capture the entire table node\n(table) @definition\n\n; Array tables - capture the entire array table node\n(table_array_element) @definition\n\n; Key-value pairs - capture the entire pair\n(pair) @definition\n\n; Arrays and inline tables\n(array) @definition\n(inline_table) @definition\n\n; Basic values\n(string) @definition\n(integer) @definition\n(float) @definition\n(boolean) @definition\n(offset_date_time) @definition\n(local_date) @definition\n(local_time) @definition\n`\n", "/*\nSupported SystemRDL structures:\n- component declarations\n- field declarations\n- property assignments\n- parameter declarations\n- enum declarations\n*/\nexport default `\n; Component declarations\n(component_named_def\n type: (component_type)\n id: (id) @name.definition.component) @definition.component\n\n; Field declarations\n(component_anon_def\n type: (component_type (component_primary_type))\n body: (component_body\n (component_body_elem\n (property_assignment)))) @definition.field\n\n; Property declarations\n(property_definition\n (id) @name.definition.property) @definition.property\n\n; Parameter declarations\n(component_inst\n id: (id) @name.definition.parameter) @definition.parameter\n\n; Enum declarations\n(enum_def\n (id) @name.definition.enum) @definition.enum\n`\n", "/*\nSupported TLA+ structures:\n- modules with header, extends, constants, variables\n- operator definitions with parameters and bodies\n- function definitions with quantifier bounds\n- let expressions with operator definitions\n- case expressions with multiple arms\n- variable and constant declarations\n*/\nexport default `\n; Module declarations\n(module\n name: (identifier) @name.definition.module) @definition.module\n\n; Operator definitions with optional parameters\n(operator_definition\n name: (identifier) @name.definition.operator\n parameter: (identifier)?) @definition.operator\n\n; Function definitions with bounds\n(function_definition\n name: (identifier) @name.definition.function\n (quantifier_bound)?) @definition.function\n\n; Variable declarations\n(variable_declaration\n (identifier) @name.definition.variable) @definition.variable\n\n; Constant declarations\n(constant_declaration\n (identifier) @name.definition.constant) @definition.constant\n`\n", "export const zigQuery = `\n; Functions\n(function_declaration) @function.definition\n\n; Structs and containers\n(variable_declaration\n (identifier) @name\n (struct_declaration)\n) @container.definition\n\n; Enums\n(variable_declaration\n (identifier) @name\n (enum_declaration)\n) @container.definition\n\n; Variables and constants\n(variable_declaration\n (identifier) @name\n) @variable.definition\n`\n", "/*\nSupported Embedded Template structures:\n- Code blocks (class, module, method definitions)\n- Output blocks (expressions)\n- Comments\n*/\nexport default `\n; Code blocks - class, module, method definitions\n(directive\n (code) @name.definition.code) @definition.directive\n\n; Output blocks - expressions\n(output_directive\n (code) @output.content) @output\n\n; Comments - documentation and section markers\n(comment_directive\n (comment) @name.definition.comment) @definition.comment\n`\n", "// Query patterns for Emacs Lisp\nexport const elispQuery = `\n; Function definitions - capture only name and actual function node\n((function_definition\n name: (symbol) @name.definition.function) @_func\n (#match? @name.definition.function \"^[^;]\"))\n\n; Macro definitions - capture only name and actual macro node\n((macro_definition\n name: (symbol) @name.definition.macro) @_macro\n (#match? @name.definition.macro \"^[^;]\"))\n\n; Custom forms - match defcustom specifically and avoid comments\n((list\n . (symbol) @_def\n . (symbol) @name.definition.custom) @_custom\n (#eq? @_def \"defcustom\")\n (#match? @name.definition.custom \"^[^;]\"))\n\n; Face definitions - match defface specifically and avoid comments\n((list\n . (symbol) @_def\n . (symbol) @name.definition.face) @_face\n (#eq? @_def \"defface\")\n (#match? @name.definition.face \"^[^;]\"))\n\n; Group definitions - match defgroup specifically and avoid comments\n((list\n . (symbol) @_def\n . (symbol) @name.definition.group) @_group\n (#eq? @_def \"defgroup\")\n (#match? @name.definition.group \"^[^;]\"))\n\n; Advice definitions - match defadvice specifically and avoid comments\n((list\n . (symbol) @_def\n . (symbol) @name.definition.advice) @_advice\n (#eq? @_def \"defadvice\")\n (#match? @name.definition.advice \"^[^;]\"))\n`\n", "const symbolPairs: Record<string, string> = {\n\t\"(\": \")\",\n\t\"[\": \"]\",\n\t\"{\": \"}\",\n\t// '<': '>',\n\t\"'\": \"'\",\n\t'\"': '\"',\n\t\"`\": \"`\",\n}\nconst openSymbols = new Set(Object.keys(symbolPairs))\nconst closeSymbols = new Set(Object.values(symbolPairs))\n\n/**\n * splitStr \u5C06 fullStr \u5206\u4E3A A \u548C B \u4E24\u4E2A\u5B57\u7B26\u4E32\uFF0C\n * \u8D1F\u8D23\u67E5\u627E B \u90E8\u5206\u4E2D\u7B2C\u4E00\u4E2A\u4E0E A \u90E8\u5206\u6700\u540E\u4E00\u4E2A\u5165\u6808\u7B26\u53F7\u5339\u914D\u7684\u95ED\u5408\u7B26\u53F7\n * @param fullStr \u5B8C\u6574\u5B57\u7B26\u4E32\n * @param splitStr \u5206\u5272\u5B57\u7B26\u4E32\n * @returns B\u90E8\u5206\u4E2D\u7B2C\u4E00\u4E2A\u5339\u914D\u7684\u95ED\u5408\u7B26\u53F7\uFF0CB \u90E8\u5206\u4E2D\u8BE5\u7B26\u53F7\u524D\u7684\u5B57\u7B26\u4E32\n */\nexport function findFirstMatchingCloseSymbol(\n\tfullStr: string,\n\tsplitStr: string,\n): { closeSymbol: string; suffixPrefix: string } {\n\tconst splitIndex = fullStr.indexOf(splitStr)\n\tif (splitIndex === -1) {\n\t\treturn { closeSymbol: \"\", suffixPrefix: \"\" }\n\t}\n\n\tconst partA = fullStr.substring(0, splitIndex)\n\tconst partB = fullStr.substring(splitIndex + splitStr.length)\n\tconst stackA: string[] = []\n\n\t// \u5904\u7406A\u90E8\u5206\u7684\u7B26\u53F7\u5165\u6808\n\tfor (let i = 0; i < partA.length; i++) {\n\t\tconst char = partA[i]\n\n\t\t// \u5904\u7406\u8F6C\u4E49\u5B57\u7B26\n\t\tif (char === \"\\\\\") {\n\t\t\ti++ // \u8DF3\u8FC7\u4E0B\u4E00\u4E2A\u5B57\u7B26\n\t\t\tcontinue\n\t\t}\n\n\t\tif (openSymbols.has(char)) {\n\t\t\t// \u5BF9\u4E8E\u5355\u5B57\u7B26\u5F15\u53F7\uFF0C\u9700\u8981\u68C0\u67E5\u6808\u9876\u662F\u5426\u5DF2\u7ECF\u662F\u76F8\u540C\u7684\u5F15\u53F7\uFF08\u8868\u793A\u95ED\u5408\uFF09\n\t\t\tif (\n\t\t\t\t(char === \"'\" || char === '\"' || char === \"`\") &&\n\t\t\t\tstackA.length > 0 &&\n\t\t\t\tstackA[stackA.length - 1] === char\n\t\t\t) {\n\t\t\t\tstackA.pop() // \u5339\u914D\u5230\u95ED\u5408\u5F15\u53F7\n\t\t\t} else {\n\t\t\t\tstackA.push(char) // \u538B\u5165\u65B0\u7684\u5F00\u7B26\u53F7\n\t\t\t}\n\t\t} else if (closeSymbols.has(char)) {\n\t\t\tif (stackA.length === 0) continue\n\t\t\tconst lastOpen = stackA[stackA.length - 1]\n\t\t\tif (symbolPairs[lastOpen] === char) {\n\t\t\t\tstackA.pop() // \u5339\u914D\u5230\u95ED\u5408\u7B26\u53F7\n\t\t\t}\n\t\t}\n\t}\n\n\tif (stackA.length === 0) {\n\t\treturn { closeSymbol: \"\", suffixPrefix: \"\" }\n\t}\n\n\tconst lastOpenSymbol = stackA[stackA.length - 1]\n\tconst expectedCloseSymbol = symbolPairs[lastOpenSymbol]\n\tconst stackB: string[] = []\n\n\t// \u5728B\u90E8\u5206\u67E5\u627E\u7B2C\u4E00\u4E2A\u5339\u914D\u7684\u95ED\u5408\u7B26\u53F7\n\tfor (let i = 0; i < partB.length; i++) {\n\t\tconst char = partB[i]\n\n\t\t// \u5904\u7406\u8F6C\u4E49\u5B57\u7B26\n\t\tif (char === \"\\\\\") {\n\t\t\ti++ // \u8DF3\u8FC7\u4E0B\u4E00\u4E2A\u5B57\u7B26\n\t\t\tcontinue\n\t\t}\n\t\t// \u68C0\u67E5\u5355\u5B57\u7B26\u95ED\u5408\u7B26\u53F7\n\t\tif (stackB.length === 0 && char === expectedCloseSymbol) {\n\t\t\treturn { closeSymbol: char, suffixPrefix: partB.slice(0, i) }\n\t\t}\n\t\tif (openSymbols.has(char)) {\n\t\t\t// \u5BF9\u4E8E\u5355\u5B57\u7B26\u5F15\u53F7\uFF0C\u9700\u8981\u68C0\u67E5\u6808\u9876\u662F\u5426\u5DF2\u7ECF\u662F\u76F8\u540C\u7684\u5F15\u53F7\uFF08\u8868\u793A\u95ED\u5408\uFF09\n\t\t\tif (\n\t\t\t\t(char === \"'\" || char === '\"' || char === \"`\") &&\n\t\t\t\tstackB.length > 0 &&\n\t\t\t\tstackB[stackB.length - 1] === char\n\t\t\t) {\n\t\t\t\tstackB.pop() // \u5339\u914D\u5230\u95ED\u5408\u5F15\u53F7\n\t\t\t} else {\n\t\t\t\tstackB.push(char) // \u538B\u5165\u65B0\u7684\u5F00\u7B26\u53F7\n\t\t\t}\n\t\t} else if (closeSymbols.has(char)) {\n\t\t\tif (stackB.length === 0) continue\n\t\t\tconst lastOpen = stackB[stackB.length - 1]\n\t\t\tif (symbolPairs[lastOpen] === char) {\n\t\t\t\tstackB.pop() // \u5339\u914D\u5230\u95ED\u5408\u7B26\u53F7\n\t\t\t}\n\t\t}\n\t}\n\n\treturn { closeSymbol: \"\", suffixPrefix: \"\" }\n}\n\n/**\n * \u67E5\u627E str1 \u7684\u540E\u7F00\u4E2D\u4E0E str2 \u7684\u524D\u7F00\u4E2D\u7684\u6700\u5927\u76F8\u540C\u5B57\u7B26\u4E32\n * @param str1 \u7B2C\u4E00\u4E2A\u5B57\u7B26\u4E32\n * @param str2 \u7B2C\u4E8C\u4E2A\u5B57\u7B26\u4E32\n * @returns \u6700\u5927\u7684\u516C\u5171\u5B50\u4E32\uFF0C\u5982\u679C\u6CA1\u6709\u5219\u8FD4\u56DE\u7A7A\u5B57\u7B26\u4E32\n */\nexport function findMaxOverlap(str1: string, str2: string): string {\n\t// \u5982\u679C\u4EFB\u4E00\u5B57\u7B26\u4E32\u4E3A\u7A7A\uFF0C\u76F4\u63A5\u8FD4\u56DE\u7A7A\u5B57\u7B26\u4E32\n\tif (str1 === \"\" || str2 === \"\") return \"\"\n\n\tlet maxOverlap = \"\"\n\n\t// \u4ECE\u53EF\u80FD\u7684\u6700\u5927\u957F\u5EA6\u5F00\u59CB\u9012\u51CF\u904D\u5386\uFF08\u6700\u5927\u4E3A min(a.length, b.length)\uFF09\n\tfor (let len = Math.min(str1.length, str2.length); len > 0; len--) {\n\t\tconst suffix = str1.substring(str1.length - len)\n\t\tconst prefix = str2.substring(0, len)\n\n\t\t// \u5982\u679C\u540E\u7F00\u7B49\u4E8E\u524D\u7F00\uFF0C\u5219\u627E\u5230\u6709\u6548\u91CD\u53E0\n\t\tif (suffix === prefix) {\n\t\t\tmaxOverlap = suffix\n\t\t\tbreak // \u627E\u5230\u6700\u5927\u91CD\u53E0\u540E\u7ACB\u5373\u9000\u51FA\u5FAA\u73AF\n\t\t}\n\t}\n\n\t// \u5982\u679C\u76F4\u63A5\u5339\u914D\u5931\u8D25\uFF0C\u5C1D\u8BD5\u53BB\u9664str2\u524D\u5BFC\u7A7A\u683C\u540E\u5339\u914D\uFF08\u4FEE\u590D\u7A7A\u683C\u5DEE\u5F02\u95EE\u9898\uFF09\n\tif (maxOverlap === \"\") {\n\t\tconst str2Trimmed = str2.trimStart()\n\n\t\tfor (let len = Math.min(str1.length, str2Trimmed.length); len > 0; len--) {\n\t\t\tconst suffix = str1.substring(str1.length - len)\n\t\t\tconst prefix = str2Trimmed.substring(0, len)\n\n\t\t\tif (suffix === prefix) {\n\t\t\t\tmaxOverlap = suffix\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}\n\n\treturn maxOverlap\n}\n\n/**\n * \u83B7\u53D6\u5B57\u7B26\u4E32\u4E2D\u5728\u6307\u5B9A\u95ED\u5408\u7B26\u53F7\u524D\u7684\u5185\u5BB9\uFF0C\u5904\u7406\u7B26\u53F7\u5D4C\u5957\n * @param str \u8F93\u5165\u5B57\u7B26\u4E32\n * @param closeSymbol \u8981\u67E5\u627E\u7684\u95ED\u5408\u7B26\u53F7\n * @returns \u95ED\u5408\u7B26\u53F7\u524D\u7684\u5185\u5BB9\n */\nexport function getStringBeforeCloseSymbol(str: string, closeSymbol: string): string {\n\tif (!closeSymbols.has(closeSymbol)) {\n\t\treturn \"\"\n\t}\n\n\tconst stack: string[] = []\n\tlet result = \"\"\n\n\tfor (let i = 0; i < str.length; i++) {\n\t\tconst char = str[i]\n\n\t\t// \u5904\u7406\u8F6C\u4E49\u5B57\u7B26\n\t\tif (char === \"\\\\\") {\n\t\t\tresult += char\n\t\t\tif (i + 1 < str.length) {\n\t\t\t\tresult += str[++i]\n\t\t\t}\n\t\t\tcontinue\n\t\t}\n\n\t\t// \u68C0\u67E5\u662F\u5426\u5339\u914D\u76EE\u6807\u95ED\u5408\u7B26\u53F7\n\t\tif (stack.length === 0 && char === closeSymbol) {\n\t\t\treturn result\n\t\t}\n\n\t\t// \u5904\u7406\u5F00\u7B26\u53F7\n\t\tif (openSymbols.has(char)) {\n\t\t\t// \u5BF9\u4E8E\u5355\u5B57\u7B26\u5F15\u53F7\uFF0C\u68C0\u67E5\u6808\u9876\u662F\u5426\u76F8\u540C\n\t\t\tif (\n\t\t\t\t(char === \"'\" || char === '\"' || char === \"`\") &&\n\t\t\t\tstack.length > 0 &&\n\t\t\t\tstack[stack.length - 1] === char\n\t\t\t) {\n\t\t\t\tstack.pop()\n\t\t\t} else {\n\t\t\t\tstack.push(char)\n\t\t\t}\n\t\t}\n\t\t// \u5904\u7406\u95ED\u7B26\u53F7\n\t\telse if (closeSymbols.has(char)) {\n\t\t\tif (stack.length > 0) {\n\t\t\t\tconst lastOpen = stack[stack.length - 1]\n\t\t\t\tif (symbolPairs[lastOpen] === char) {\n\t\t\t\t\tstack.pop()\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tresult += char\n\t}\n\n\treturn result\n}\n\nexport function postProcessCompletionSynthesis(\n\tcompletion: string,\n\tprefix: string,\n\tsuffix: string,\n\tcloseSymbolChar: string,\n\tsuffixPrefixString: string,\n): string {\n\t// TODO: \u6682\u65F6\u6CE8\u91CA\u6389\u622A\u65AD\u5230\u4E00\u884C\u7684\u5B9E\u73B0\uFF0C\u6C38\u8FDC\u4FDD\u6301\u591A\u884C\n\t// \u68C0\u67E5\u662F\u5426\u9700\u8981\u622A\u65AD\u5230\u4E00\u884C\n\t// const lastLineBeforeCursor = prefix.split(\"\\n\").pop() || \"\"\n\t// const hasValidCharBeforeCursor = /\\S/.test(lastLineBeforeCursor)\n\n\t// \u5982\u679C\u6362\u884C\u524D\u6709\u6709\u6548\u5B57\u7B26\uFF0C\u622A\u65AD\u5230\u4E00\u884C\n\t// if (hasValidCharBeforeCursor) {\n\t// \t// \u5982\u679Ccompletion\u4EE5\u6362\u884C\u7B26\u5F00\u5934\uFF0C\u5148\u53BB\u6389\u5F00\u5934\u7684\u6362\u884C\u7B26\u548C\u7A7A\u767D\u5B57\u7B26\n\t// \tlet processedCompletion = completion\n\t// \tif (processedCompletion.startsWith(\"\\n\")) {\n\t// \t\tprocessedCompletion = processedCompletion.substring(1)\n\t// \t\t// \u53BB\u6389\u5F00\u5934\u7684\u7F29\u8FDB\u7A7A\u767D\uFF0C\u4F46\u4FDD\u7559\u7B2C\u4E00\u4E2A\u975E\u7A7A\u767D\u5B57\u7B26\u540E\u7684\u5185\u5BB9\n\t// \t\tprocessedCompletion = processedCompletion.replace(/^\\s*/, \"\")\n\t// \t}\n\t//\n\t// \t// \u622A\u65AD\u5230\u7B2C\u4E00\u4E2A\u6362\u884C\u7B26\n\t// \tconst firstLineIndex = processedCompletion.indexOf(\"\\n\")\n\t// \tif (firstLineIndex !== -1) {\n\t// \t\t// this.outputChannel.appendLine(\"\u622A\u65AD\u591A\u884C\u8865\u5168\u5230\u5355\u884C\")\n\t// \t\tconst truncatedCompletion = processedCompletion.substring(0, firstLineIndex)\n\t// \t\tcompletion = truncatedCompletion\n\t// \t} else {\n\t// \t\tcompletion = processedCompletion\n\t// \t}\n\t// }\n\n\t// \u4FDD\u6301\u591A\u884Ccompletion\uFF0C\u53EA\u5904\u7406\u7B26\u53F7\u5339\u914D\u548C\u91CD\u53E0\u90E8\u5206\n\tif (closeSymbolChar && closeSymbolChar.length > 0) {\n\t\tlet cutCompletion = getStringBeforeCloseSymbol(completion, closeSymbolChar)\n\t\tlet commonSubstring = findMaxOverlap(cutCompletion, suffixPrefixString)\n\t\tcompletion = cutCompletion.slice(0, cutCompletion.length - commonSubstring.length)\n\t} else {\n\t\tlet commonSubstring = findMaxOverlap(completion, suffix)\n\t\tif (commonSubstring.length >= 10) {\n\t\t\tcompletion = completion.slice(0, completion.length - commonSubstring.length)\n\t\t}\n\t}\n\treturn completion\n}\n\n/**\n * \u5224\u65AD\u5149\u6807\u662F\u5426\u5728\u5355\u8BCD\u5185\u90E8\n * @param prefix \u5149\u6807\u524D\u7684\u6587\u672C\n * @param suffix \u5149\u6807\u540E\u7684\u6587\u672C\n * @param logCallback \u53EF\u9009\u7684\u65E5\u5FD7\u56DE\u8C03\u51FD\u6570\n * @returns \u5982\u679C\u5728\u5355\u8BCD\u5185\u90E8\u8FD4\u56DEtrue\uFF0C\u5426\u5219\u8FD4\u56DEfalse\n */\nexport function isInsideWord(prefix: string, suffix: string, logCallback?: (message: string) => void): boolean {\n\t// \u4ECE prefix \u7684\u672B\u5C3E\u83B7\u53D6\u5149\u6807\u524D\u7684\u5B57\u7B26\n\tconst charBefore = prefix.length > 0 ? prefix[prefix.length - 1] : \"\"\n\t// \u4ECE suffix \u7684\u5F00\u5934\u83B7\u53D6\u5149\u6807\u540E\u7684\u6587\u672C\n\tconst charAfter = suffix.length > 0 ? suffix[0] : \"\"\n\n\t// \u68C0\u67E5\u662F\u5426\u90FD\u662F\u82F1\u6587\u5B57\u6BCD\uFF08\u5927\u5C0F\u5199\uFF09 - \u4F7F\u7528\u5B57\u7B26\u7F16\u7801\u5224\u65AD\n\tconst isLetter = (char: string): boolean => {\n\t\tif (char.length !== 1) return false\n\t\tconst code = char.charCodeAt(0)\n\t\treturn (\n\t\t\t(code >= 65 && code <= 90) || // A-Z\n\t\t\t(code >= 97 && code <= 122)\n\t\t) // a-z\n\t}\n\n\tconst hasLetterBefore = isLetter(charBefore)\n\tconst hasLetterAfter = isLetter(charAfter)\n\n\t// \u5982\u679C\u524D\u540E\u90FD\u662F\u5B57\u6BCD\uFF0C\u8BF4\u660E\u5728\u5355\u8BCD\u5185\u90E8\n\tif (hasLetterBefore && hasLetterAfter) {\n\t\tif (logCallback) {\n\t\t\tlogCallback(`Skipping completion: cursor inside word (${charBefore}|${charAfter})`)\n\t\t}\n\t\treturn true\n\t}\n\n\treturn false\n}\n", "import { SnippetType, ISnippetMeta } from \"../types\"\nimport Parser from \"web-tree-sitter\"\nimport path from \"path\"\nimport crypto from \"crypto\"\nimport { Logger } from \"../Logger\"\n\nexport function isFunctionNode(node: Parser.SyntaxNode): boolean {\n\tconst functionTypes = [\n\t\t\"function_declaration\",\n\t\t\"function_definition\", // Go\n\t\t\"method_declaration\", // Go methods\n\t\t\"method_definition\", // Class methods\n\t\t\"arrow_function\",\n\t\t\"function_expression\",\n\t]\n\treturn functionTypes.includes(node.type)\n}\n\nexport function isClassNode(node: Parser.SyntaxNode): boolean {\n\tconst classTypes = [\n\t\t\"class_declaration\",\n\t\t\"class_definition\",\n\t\t\"interface_declaration\",\n\t\t\"struct_specifier\", // C++ structs\n\t]\n\treturn classTypes.includes(node.type)\n}\n\nexport function findIdentifierInNode(node: Parser.SyntaxNode): Parser.SyntaxNode | null {\n\tconst identifierTypes = new Set([\n\t\t\"identifier\",\n\t\t\"name\",\n\t\t\"property_identifier\",\n\t\t\"field_identifier\",\n\t\t\"method_name\",\n\t\t\"function_name\",\n\t\t\"class_name\",\n\t\t\"type_identifier\",\n\t])\n\n\tfor (let i = 0; i < node.childCount; i++) {\n\t\tconst child = node.child(i)\n\t\tif (child && identifierTypes.has(child.type)) {\n\t\t\treturn child\n\t\t}\n\t}\n\n\tfor (let i = 0; i < node.childCount; i++) {\n\t\tconst child = node.child(i)\n\t\tif (child) {\n\t\t\tconst found = findIdentifierInNode(child)\n\t\t\tif (found) return found\n\t\t}\n\t}\n\n\treturn null\n}\n\nexport function isScopeNode(node: Parser.SyntaxNode): boolean {\n\tconst scopeTypes = new Set([\n\t\t\"function_declaration\",\n\t\t\"method_definition\",\n\t\t\"arrow_function\",\n\t\t\"function_expression\",\n\t\t\"class_declaration\",\n\t\t\"interface_declaration\",\n\t\t\"namespace_declaration\",\n\t\t\"module_declaration\",\n\t\t\"function_definition\",\n\t\t\"class_definition\",\n\t])\n\treturn scopeTypes.has(node.type)\n}\n\nexport function extractScopeName(node: Parser.SyntaxNode): string | null {\n\tconst identifierNode = findIdentifierInNode(node)\n\tif (identifierNode) {\n\t\treturn node.text.substring(\n\t\t\tidentifierNode.startIndex - node.startIndex,\n\t\t\tidentifierNode.endIndex - node.startIndex,\n\t\t)\n\t}\n\treturn node.type\n}\n\nexport function generateSnippetHash(filePath: string, startLine: number, endLine: number, rangeText: string): string {\n\tconst content = `${filePath}:${startLine}-${endLine}:${rangeText.substring(0, 100)}`\n\treturn crypto.createHash(\"sha256\").update(content).digest(\"hex\").substring(0, 16)\n}\n\nexport function extractSymbolName(node: Parser.SyntaxNode, sourceCode: string): string {\n\tconst identifierNode = findIdentifierInNode(node)\n\tif (identifierNode) {\n\t\treturn sourceCode.substring(identifierNode.startIndex, identifierNode.endIndex)\n\t}\n\treturn `${node.type}_${node.startPosition.row + 1}`\n}\n\nexport function buildScopeChain(node: Parser.SyntaxNode): string[] {\n\tconst scope: string[] = []\n\tlet current = node.parent\n\n\twhile (current) {\n\t\tif (isScopeNode(current)) {\n\t\t\tconst scopeName = extractScopeName(current)\n\t\t\tif (scopeName) {\n\t\t\t\tscope.unshift(scopeName)\n\t\t\t}\n\t\t}\n\t\tcurrent = current.parent\n\t}\n\n\treturn scope\n}\n\n/**\n * \u6839\u636E Query \u6355\u83B7\u786E\u5B9A snippet \u7C7B\u578B\n */\nexport function determineSnippetTypeFromCapture(\n\tcapture: Parser.QueryCapture,\n\tallowedTypes: SnippetType[],\n): SnippetType {\n\t// \u6839\u636E capture \u540D\u79F0\u6620\u5C04\u7C7B\u578B\n\tconst captureTypeMap: Record<string, SnippetType> = {\n\t\timport: SnippetType.ImportOrInclude,\n\t\t\"import.statement\": SnippetType.ImportOrInclude,\n\t\t\"function.definition\": SnippetType.FunctionOrMethod,\n\t\t\"class.definition\": SnippetType.ClassOrInterfaceOrStructOrEnum,\n\t\t\"method.definition\": SnippetType.FunctionOrMethod,\n\t\t\"variable.definition\": SnippetType.VariableOrConstant,\n\t}\n\n\tconst mappedType = captureTypeMap[capture.name]\n\tif (mappedType && allowedTypes.includes(mappedType)) {\n\t\treturn mappedType\n\t}\n\n\t// \u6839\u636E\u8282\u70B9\u7C7B\u578B\u5224\u65AD\n\tif (capture.node.type.includes(\"import\") && allowedTypes.includes(SnippetType.ImportOrInclude)) {\n\t\treturn SnippetType.ImportOrInclude\n\t}\n\n\tif (isFunctionNode(capture.node) && allowedTypes.includes(SnippetType.FunctionOrMethod)) {\n\t\treturn SnippetType.FunctionOrMethod\n\t}\n\n\tif (isClassNode(capture.node) && allowedTypes.includes(SnippetType.ClassOrInterfaceOrStructOrEnum)) {\n\t\treturn SnippetType.ClassOrInterfaceOrStructOrEnum\n\t}\n\n\t// \u9ED8\u8BA4\u4F7F\u7528\u7B2C\u4E00\u4E2A\u5141\u8BB8\u7684\u7C7B\u578B\n\treturn allowedTypes[0]\n}\n\nexport function createSnippetFromQueryCapture(\n\tcapture: Parser.QueryCapture,\n\tallCaptures: Parser.QueryCapture[],\n\tsourceCode: string,\n\tlines: string[],\n\tfilePath: string,\n\tfileHash: string,\n\tsnippetTypes: SnippetType[],\n\toptions: { maxSnippetLines: number; minSnippetLines: number },\n\tseenHashes: Set<string>,\n): ISnippetMeta | null {\n\tconst node = capture.node\n\tconst startLine = node.startPosition.row + 1\n\tconst endLine = node.endPosition.row + 1\n\tconst startColumn = node.startPosition.column\n\tconst endColumn = node.endPosition.column\n\tconst lineCount = endLine - startLine + 1\n\n\tif (lineCount < Math.max(1, options.minSnippetLines - 2) || lineCount > options.maxSnippetLines * 2) {\n\t\treturn null\n\t}\n\n\tconst rangeText = sourceCode.substring(node.startIndex, node.endIndex)\n\n\tconst snippetHash = generateSnippetHash(filePath, startLine, endLine, rangeText)\n\tif (seenHashes.has(snippetHash)) {\n\t\treturn null\n\t}\n\tseenHashes.add(snippetHash)\n\n\tconst name = extractSymbolName(node, sourceCode)\n\tconst scope = buildScopeChain(node)\n\n\t// \uD83D\uDD27 \u6839\u636E capture \u540D\u79F0\u548C\u8282\u70B9\u7C7B\u578B\u786E\u5B9A snippet \u7C7B\u578B\n\tconst snippetType = determineSnippetTypeFromCapture(capture, snippetTypes)\n\n\treturn {\n\t\tname,\n\t\ttype: snippetType,\n\t\tfilePath,\n\t\tstartLine,\n\t\tendLine,\n\t\tstartColumn,\n\t\tendColumn,\n\t\trangeText,\n\t\tscope,\n\t\tfileHash,\n\t}\n}\n\nexport async function extractSnippetsFromCapturesForGeneral(\n\tcaptures: Parser.QueryCapture[],\n\tsourceCode: string,\n\tfilePath: string,\n\tfileHash: string,\n\tsnippetTypes: SnippetType[],\n\toptions: { maxSnippetLines: number; minSnippetLines: number },\n): Promise<ISnippetMeta[]> {\n\tconst logger = Logger.getDefaultLogger().with(\"[extractSnippetsFromCapturesForGeneral]\")\n\tconst snippets: ISnippetMeta[] = []\n\tconst seenHashes = new Set<string>()\n\tconst lines = sourceCode.split(\"\\n\")\n\n\ttry {\n\t\tlogger.info(`[CodeContext] Starting query execution for: ${path.basename(filePath)}`)\n\n\t\t// const captures = query.captures(tree.rootNode)\n\t\tlogger.info(`[CodeContext] Query found ${captures.length} captures`)\n\n\t\t// \u6309\u6355\u83B7\u7C7B\u578B\u5206\u7EC4\n\t\tconst capturesByType = new Map<string, Parser.QueryCapture[]>()\n\t\tcaptures.forEach((capture) => {\n\t\t\tconst captureType = capture.name\n\t\t\tif (!capturesByType.has(captureType)) {\n\t\t\t\tcapturesByType.set(captureType, [])\n\t\t\t}\n\t\t\tcapturesByType.get(captureType)!.push(capture)\n\t\t})\n\n\t\tlogger.info(`[CodeContext] Capture types found:`, Array.from(capturesByType.keys()))\n\n\t\t// \u5904\u7406\u6240\u6709\u627E\u5230\u7684\u6355\u83B7\n\t\tfor (const [captureType, captureList] of capturesByType) {\n\t\t\tlogger.info(`[CodeContext] Processing ${captureList.length} ${captureType} captures`)\n\n\t\t\tfor (const capture of captureList) {\n\t\t\t\tconst snippet = createSnippetFromQueryCapture(\n\t\t\t\t\tcapture,\n\t\t\t\t\tcaptures,\n\t\t\t\t\tsourceCode,\n\t\t\t\t\tlines,\n\t\t\t\t\tfilePath,\n\t\t\t\t\tfileHash,\n\t\t\t\t\tsnippetTypes,\n\t\t\t\t\toptions,\n\t\t\t\t\tseenHashes,\n\t\t\t\t)\n\n\t\t\t\tif (snippet) {\n\t\t\t\t\tsnippets.push(snippet)\n\t\t\t\t\tlogger.info(\n\t\t\t\t\t\t`\"[CodeContext] Created snippet: ${snippet.name} (${snippet.startLine}-${snippet.endLine}) from ${captureType}`,\n\t\t\t\t\t)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tlogger.info(`[CodeContext] Total snippets extracted: ${snippets.length}`)\n\t} catch (error) {\n\t\tlogger.error(`[CodeContext] Error executing query:`, error)\n\t}\n\n\treturn snippets\n}\n", "import { ILogger, LogLevel } from \"./types\"\n\nconst logLevelPriorityMap = {\n\t[LogLevel.Debug]: 0,\n\t[LogLevel.Info]: 1,\n\t[LogLevel.Warn]: 2,\n\t[LogLevel.Error]: 3,\n}\n\nexport class Logger implements ILogger {\n\tprivate static _instance: Logger | null = null\n\tprefix: string = \"\"\n\tlevel: LogLevel = LogLevel.Warn\n\n\tconstructor(prefix?: string, level?: LogLevel) {\n\t\tif (prefix) {\n\t\t\tthis.prefix = prefix\n\t\t}\n\t\tif (level) {\n\t\t\tthis.level = level\n\t\t}\n\t}\n\n\tstatic getDefaultLogger(): ILogger {\n\t\tif (!Logger._instance) {\n\t\t\tLogger._instance = new Logger()\n\t\t}\n\t\treturn Logger._instance\n\t}\n\n\tstatic setDefaultLogger(logger: ILogger) {\n\t\tLogger._instance = logger\n\t}\n\n\tdebug(message?: any, ...optionalParams: any[]): void {\n\t\tif (logLevelPriorityMap[this.level] <= logLevelPriorityMap[LogLevel.Debug]) {\n\t\t\tconsole.debug(`${this.prefix}${message} ${optionalParams.join(\" \")}`)\n\t\t}\n\t}\n\tinfo(message?: any, ...optionalParams: any[]): void {\n\t\tif (logLevelPriorityMap[this.level] <= logLevelPriorityMap[LogLevel.Info]) {\n\t\t\tconsole.log(`${this.prefix}${message} ${optionalParams.join(\" \")}`)\n\t\t}\n\t}\n\twarn(message?: any, ...optionalParams: any[]): void {\n\t\tif (logLevelPriorityMap[this.level] <= logLevelPriorityMap[LogLevel.Warn]) {\n\t\t\tconsole.warn(`${this.prefix}${message} ${optionalParams.join(\" \")}`)\n\t\t}\n\t}\n\terror(message?: any, ...optionalParams: any[]): void {\n\t\tif (logLevelPriorityMap[this.level] <= logLevelPriorityMap[LogLevel.Error]) {\n\t\t\tconsole.error(`${this.prefix}${message} ${optionalParams.join(\" \")}`)\n\t\t}\n\t}\n\twith(prefix: string): ILogger {\n\t\treturn new Logger(this.prefix + prefix + \" \")\n\t}\n}\n", "import { SnippetType, ISnippetMeta, ParameterInfo, CodeLanguageType } from \"../types\"\nimport Parser from \"web-tree-sitter\"\nimport { generateSnippetHash, buildScopeChain } from \"./general\"\nimport { Logger } from \"../Logger\"\n\nexport async function extractSnippetsFromCapturesForGo(\n\tcaptures: Parser.QueryCapture[],\n\tsourceCode: string,\n\tfilePath: string,\n\tfileHash: string,\n\tsnippetTypes: SnippetType[],\n\toptions: { maxSnippetLines: number; minSnippetLines: number },\n): Promise<ISnippetMeta[]> {\n\tconst logger = Logger.getDefaultLogger().with(\"[extractSnippetsFromCapturesForGo]\")\n\n\tconst snippets: ISnippetMeta[] = []\n\tconst seenHashes = new Set<string>()\n\n\tif (snippetTypes.length === 0) {\n\t\tlogger.warn(`No snippet types provided, skipping`)\n\t\treturn snippets\n\t}\n\n\tconst functionCaptureNames = new Set([\n\t\t\"name.definition.function\",\n\t\t\"name.definition.method\",\n\t\t\"parameters.definition.function\",\n\t\t\"body.definition.function\",\n\t\t\"definition.function\",\n\t])\n\tconst functionNodeMap = new Map<string, Parser.QueryCapture>()\n\n\tcaptures.forEach((capture) => {\n\t\tif (functionCaptureNames.has(capture.name)) {\n\t\t\tconst node = capture.node\n\t\t\tconst key = `${node.startIndex}:${node.endIndex}`\n\t\t\tif (!functionNodeMap.has(key)) {\n\t\t\t\tfunctionNodeMap.set(key, capture)\n\t\t\t}\n\t\t}\n\t})\n\n\t// \u5904\u7406 import\n\tcaptures.forEach((capture) => {\n\t\tif (capture.name === \"name.definition.import\") {\n\t\t\tconst node = capture.node\n\t\t\tconst startLine = node.startPosition.row + 1\n\t\t\tconst endLine = node.endPosition.row + 1\n\t\t\tconst rangeText = sourceCode.substring(node.startIndex, node.endIndex)\n\t\t\tconst snippetHash = generateSnippetHash(filePath, startLine, endLine, rangeText)\n\t\t\tif (seenHashes.has(snippetHash)) return\n\t\t\tseenHashes.add(snippetHash)\n\t\t\tconst name = sourceCode.substring(node.startIndex, node.endIndex)\n\t\t\tconst scope = buildScopeChain(node)\n\t\t\tsnippets.push({\n\t\t\t\tname,\n\t\t\t\ttype: SnippetType.ImportOrInclude,\n\t\t\t\tfilePath,\n\t\t\t\tstartLine,\n\t\t\t\tendLine,\n\t\t\t\trangeText,\n\t\t\t\tdefinitionText: rangeText,\n\t\t\t\tscope,\n\t\t\t\tfileHash,\n\t\t\t})\n\t\t}\n\t})\n\n\t// \u5904\u7406 function/method\n\tfor (const capture of captures) {\n\t\tif (capture.name !== \"definition.function\" && capture.name !== \"definition.method\") continue\n\t\tconst node = capture.node\n\t\tconst startLine = node.startPosition.row + 1\n\t\tconst endLine = node.endPosition.row + 1\n\n\t\t// \u5224\u65AD\u662F function \u8FD8\u662F method\n\t\tconst isMethod = capture.name === \"definition.method\"\n\t\tconst nameCap = captures.find(\n\t\t\t(c) =>\n\t\t\t\tc.name === (isMethod ? \"name.definition.method\" : \"name.definition.function\") &&\n\t\t\t\tc.node.startIndex >= node.startIndex &&\n\t\t\t\tc.node.endIndex <= node.endIndex,\n\t\t)\n\t\tif (!nameCap) continue\n\t\tconst name = sourceCode.substring(nameCap.node.startIndex, nameCap.node.endIndex)\n\n\t\tconst paramCaps = captures.filter(\n\t\t\t(c) =>\n\t\t\t\tc.name === (isMethod ? \"parameters.definition.method\" : \"parameters.definition.function\") &&\n\t\t\t\tc.node.startIndex >= node.startIndex &&\n\t\t\t\tc.node.endIndex <= node.endIndex,\n\t\t)\n\t\tconst parameters: ParameterInfo[] = paramCaps.map((paramCap) => ({\n\t\t\tname: sourceCode.substring(paramCap.node.startIndex, paramCap.node.endIndex),\n\t\t}))\n\n\t\tconst bodyCap = captures.find(\n\t\t\t(c) =>\n\t\t\t\tc.name === (isMethod ? \"body.definition.method\" : \"body.definition.function\") &&\n\t\t\t\tc.node.startIndex >= node.startIndex &&\n\t\t\t\tc.node.endIndex <= node.endIndex,\n\t\t)\n\n\t\tlet rangeText: string\n\t\tlet implementText: string | undefined = undefined\n\t\tif (bodyCap) {\n\t\t\trangeText = sourceCode.substring(node.startIndex, bodyCap.node.startIndex).trimEnd()\n\t\t\timplementText = sourceCode.substring(node.startIndex, node.endIndex)\n\t\t} else {\n\t\t\trangeText = sourceCode.substring(node.startIndex, node.endIndex)\n\t\t}\n\n\t\tconst snippetHash = generateSnippetHash(filePath, startLine, endLine, rangeText)\n\t\tif (seenHashes.has(snippetHash)) continue\n\t\tseenHashes.add(snippetHash)\n\n\t\t// \u67E5\u627E returnType\uFF08result.definition.function/method\uFF09\n\t\tconst resultCap = captures.find(\n\t\t\t(c) =>\n\t\t\t\tc.name === (isMethod ? \"result.definition.method\" : \"result.definition.function\") &&\n\t\t\t\tc.node.startIndex >= node.startIndex &&\n\t\t\t\tc.node.endIndex <= node.endIndex,\n\t\t)\n\t\tlet returnType = \"\"\n\t\tif (resultCap) {\n\t\t\treturnType = sourceCode.substring(resultCap.node.startIndex, resultCap.node.endIndex).trim()\n\t\t}\n\n\t\tconst paramStr = parameters.map((p) => p.name).join(\", \")\n\t\tconst signature = `${name}(${paramStr})`\n\t\tconst scope = buildScopeChain(node)\n\n\t\t// \u63D0\u53D6 field/class \u540D\u79F0\uFF08\u4EC5 method \u6709\uFF09\n\t\tlet field: string | undefined = undefined\n\t\tif (isMethod) {\n\t\t\tconst selfCap = captures.find(\n\t\t\t\t(c) =>\n\t\t\t\t\tc.name === \"self.definition.method\" &&\n\t\t\t\t\tc.node.startIndex >= node.startIndex &&\n\t\t\t\t\tc.node.endIndex <= node.endIndex,\n\t\t\t)\n\t\t\tif (selfCap) {\n\t\t\t\t// Go query: (type_identifier) @class.definition.method\n\t\t\t\tconst classCap = captures.find(\n\t\t\t\t\t(c) =>\n\t\t\t\t\t\tc.name === \"class.definition.method\" &&\n\t\t\t\t\t\tc.node.startIndex >= selfCap.node.startIndex &&\n\t\t\t\t\t\tc.node.endIndex <= selfCap.node.endIndex,\n\t\t\t\t)\n\t\t\t\tif (classCap) {\n\t\t\t\t\tfield = sourceCode.substring(classCap.node.startIndex, classCap.node.endIndex)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tsnippets.push({\n\t\t\tname,\n\t\t\ttype: SnippetType.FunctionOrMethod,\n\t\t\tfilePath,\n\t\t\tstartLine,\n\t\t\tendLine,\n\t\t\trangeText,\n\t\t\tdefinitionText: rangeText,\n\t\t\tscope,\n\t\t\tfileHash,\n\t\t\tfield,\n\t\t\tdefinition: {\n\t\t\t\tname,\n\t\t\t\ttype: node.type,\n\t\t\t\tparameters,\n\t\t\t\treturnType,\n\t\t\t},\n\t\t\tparameters,\n\t\t\tsignature,\n\t\t\tlanguage: CodeLanguageType.Go,\n\t\t\t...(implementText ? { implementText } : {}),\n\t\t})\n\t}\n\n\t// \u5904\u7406 struct/interface/type\n\tconst typeDefs = [\n\t\t{ capture: \"name.definition.struct\", outlineType: \"struct\" },\n\t\t{ capture: \"name.definition.interface\", outlineType: \"interface\" },\n\t\t{ capture: \"name.definition.type\", outlineType: \"type\" },\n\t]\n\tfor (const { capture, outlineType } of typeDefs) {\n\t\tconst defCaptureName = `definition.${outlineType}`\n\t\tfor (const cap of captures.filter((c) => c.name === capture)) {\n\t\t\tconst node = cap.node\n\t\t\t// \u5224\u65AD\u662F\u5426\u5728\u51FD\u6570/\u65B9\u6CD5\u5185\n\t\t\tconst isInFunc = captures.some(\n\t\t\t\t(fc) =>\n\t\t\t\t\t(fc.name === \"definition.function\" || fc.name === \"definition.method\") &&\n\t\t\t\t\tfc.node.startIndex < node.startIndex &&\n\t\t\t\t\tnode.endIndex < fc.node.endIndex,\n\t\t\t)\n\t\t\tif (isInFunc) continue\n\t\t\t// \u4F18\u5148\u7528 @definition.xxx \u533A\u95F4\n\t\t\tconst defCap = captures.find(\n\t\t\t\t(c) =>\n\t\t\t\t\tc.name === defCaptureName &&\n\t\t\t\t\tc.node.startIndex <= node.startIndex &&\n\t\t\t\t\tnode.endIndex <= c.node.endIndex,\n\t\t\t)\n\t\t\tconst rangeText = defCap\n\t\t\t\t? sourceCode.substring(defCap.node.startIndex, defCap.node.endIndex)\n\t\t\t\t: sourceCode.substring(node.startIndex, node.endIndex)\n\t\t\tconst startLine = node.startPosition.row + 1\n\t\t\tconst endLine = node.endPosition.row + 1\n\t\t\tconst snippetHash = generateSnippetHash(filePath, startLine, endLine, rangeText)\n\t\t\tif (seenHashes.has(snippetHash)) continue\n\t\t\tseenHashes.add(snippetHash)\n\t\t\tconst name = sourceCode.substring(node.startIndex, node.endIndex)\n\t\t\tsnippets.push({\n\t\t\t\tname,\n\t\t\t\ttype: SnippetType.ClassOrInterfaceOrStructOrEnum,\n\t\t\t\tfilePath,\n\t\t\t\tstartLine,\n\t\t\t\tendLine,\n\t\t\t\trangeText,\n\t\t\t\tdefinitionText: rangeText,\n\t\t\t\timplementText: rangeText,\n\t\t\t\tscope: [],\n\t\t\t\tfileHash,\n\t\t\t\tfield: \"\",\n\t\t\t\tdefinition: { name, type: outlineType },\n\t\t\t\tlanguage: CodeLanguageType.Go,\n\t\t\t})\n\t\t}\n\t}\n\n\t// \u5904\u7406 const/var\uFF08\u5168\u5C40\u53D8\u91CF/\u5E38\u91CF\uFF09\n\tconst varDefs = [\n\t\t{ capture: \"name.definition.const\", outlineType: \"const\" },\n\t\t{ capture: \"name.definition.var\", outlineType: \"var\" },\n\t]\n\tfor (const { capture, outlineType } of varDefs) {\n\t\tconst defCaptureName = `definition.${outlineType}`\n\t\tfor (const cap of captures.filter((c) => c.name === capture)) {\n\t\t\tconst node = cap.node\n\t\t\t// \u5224\u65AD\u662F\u5426\u5728\u51FD\u6570/\u65B9\u6CD5\u5185\n\t\t\tconst isInFunc = captures.some(\n\t\t\t\t(fc) =>\n\t\t\t\t\t(fc.name === \"definition.function\" || fc.name === \"definition.method\") &&\n\t\t\t\t\tfc.node.startIndex < node.startIndex &&\n\t\t\t\t\tnode.endIndex < fc.node.endIndex,\n\t\t\t)\n\t\t\tif (isInFunc) continue\n\t\t\t// \u4F18\u5148\u7528 @definition.xxx \u533A\u95F4\n\t\t\tconst defCap = captures.find(\n\t\t\t\t(c) =>\n\t\t\t\t\tc.name === defCaptureName &&\n\t\t\t\t\tc.node.startIndex <= node.startIndex &&\n\t\t\t\t\tnode.endIndex <= c.node.endIndex,\n\t\t\t)\n\t\t\tconst rangeText = defCap\n\t\t\t\t? sourceCode.substring(defCap.node.startIndex, defCap.node.endIndex)\n\t\t\t\t: sourceCode.substring(node.startIndex, node.endIndex)\n\t\t\tconst startLine = node.startPosition.row + 1\n\t\t\tconst endLine = node.endPosition.row + 1\n\t\t\tconst snippetHash = generateSnippetHash(filePath, startLine, endLine, rangeText)\n\t\t\tif (seenHashes.has(snippetHash)) continue\n\t\t\tseenHashes.add(snippetHash)\n\t\t\tconst name = sourceCode.substring(node.startIndex, node.endIndex)\n\t\t\tsnippets.push({\n\t\t\t\tname,\n\t\t\t\ttype: SnippetType.VariableOrConstant,\n\t\t\t\tfilePath,\n\t\t\t\tstartLine,\n\t\t\t\tendLine,\n\t\t\t\trangeText,\n\t\t\t\tdefinitionText: rangeText,\n\t\t\t\timplementText: rangeText,\n\t\t\t\tscope: [],\n\t\t\t\tfileHash,\n\t\t\t\tfield: \"\",\n\t\t\t\tdefinition: { name, type: outlineType },\n\t\t\t\tlanguage: CodeLanguageType.Go,\n\t\t\t})\n\t\t}\n\t}\n\n\t// filter snippets by snippetTypes\n\treturn snippets.filter((snippet) => snippetTypes.includes(snippet.type)).sort((a, b) => a.startLine - b.startLine)\n}\n\n// VSCode Outline Entry \u7C7B\u578B\nexport interface OutlineEntry {\n\ttype: string\n\tname: string\n\tfile: string // \u8868\u793A\u5F53\u524D\u6587\u4EF6\n\tfield?: string // \u7A7A\u5B57\u7B26\u4E32\u4EE3\u8868\u5F53\u524D\u6587\u4EF6\u7684global\n\tdescription?: string\n}\n\n/**\n * \u6839\u636E Go \u6587\u4EF6\u7684\u6240\u6709 snippet \u751F\u6210\u5927\u7EB2\uFF08Outline\uFF09\uFF0C\u652F\u6301 import\u3001const\u3001var\u3001function\u3001method\uFF08\u5E26 field\uFF09\u3001\u5168\u5C40\u53D8\u91CF\n */\nexport function buildSummaryFromSnippets(snippets: ISnippetMeta[]): OutlineEntry[] {\n\tconst outline: OutlineEntry[] = []\n\n\t// \u53EA\u4FDD\u7559\u5168\u5C40\u5B9A\u4E49\uFF08scope \u4E3A\u7A7A\u6216\u5168\u4E3A \"\"\uFF09\n\tconst isGlobal = (s: ISnippetMeta) => !s.scope || s.scope.length === 0 || s.scope.every((x) => !x)\n\n\tfor (const s of snippets) {\n\t\tif (!isGlobal(s)) continue\n\t\tif (s.type === SnippetType.ImportOrInclude) {\n\t\t\toutline.push({\n\t\t\t\ttype: \"import\",\n\t\t\t\tname: s.name,\n\t\t\t\tfile: s.filePath,\n\t\t\t\tfield: \"\",\n\t\t\t\tdescription: s.definitionText,\n\t\t\t})\n\t\t} else if (s.type === SnippetType.FunctionOrMethod) {\n\t\t\tif (s.field) {\n\t\t\t\toutline.push({\n\t\t\t\t\ttype: \"method\",\n\t\t\t\t\tname: s.name,\n\t\t\t\t\tfile: s.filePath,\n\t\t\t\t\tfield: s.field,\n\t\t\t\t\tdescription: s.definitionText,\n\t\t\t\t})\n\t\t\t} else {\n\t\t\t\toutline.push({\n\t\t\t\t\ttype: \"function\",\n\t\t\t\t\tname: s.name,\n\t\t\t\t\tfile: s.filePath,\n\t\t\t\t\tfield: \"\",\n\t\t\t\t\tdescription: s.definitionText,\n\t\t\t\t})\n\t\t\t}\n\t\t} else if (s.type === SnippetType.VariableOrConstant) {\n\t\t\tconst t = s.definition?.type === \"const\" ? \"const\" : \"var\"\n\t\t\toutline.push({\n\t\t\t\ttype: t,\n\t\t\t\tname: s.name,\n\t\t\t\tfile: s.filePath,\n\t\t\t\tfield: \"\",\n\t\t\t\tdescription: s.definitionText,\n\t\t\t})\n\t\t} else if (s.type === SnippetType.ClassOrInterfaceOrStructOrEnum) {\n\t\t\tconst t = s.definition?.type || \"type\"\n\t\t\toutline.push({\n\t\t\t\ttype: t,\n\t\t\t\tname: s.name,\n\t\t\t\tfile: s.filePath,\n\t\t\t\tfield: \"\",\n\t\t\t\tdescription: s.definitionText,\n\t\t\t})\n\t\t}\n\t\t// \u53EF\u6269\u5C55 channel/goroutine \u7B49\n\t}\n\n\treturn outline\n}\n\n/**\n * \u5C06 OutlineEntry[] \u683C\u5F0F\u5316\u4E3A\u6587\u672C\uFF0C\u540C\u4E00\u4E2A field \u7684\u653E\u5728\u4E00\u8D77\u3002\n * @param outline OutlineEntry[]\n * @returns string\n */\nexport function formatOutlineText(outline: OutlineEntry[]): string {\n\t// \u6309 field \u5206\u7EC4\n\tconst groups: Record<string, OutlineEntry[]> = {}\n\tfor (const entry of outline) {\n\t\tconst key = entry.field ?? \"\"\n\t\tif (!groups[key]) groups[key] = []\n\t\tgroups[key].push(entry)\n\t}\n\n\t// \u5408\u6210\u6587\u672C\n\tlet result = \"\"\n\tfor (const field of Object.keys(groups).sort()) {\n\t\tconst group = groups[field]\n\t\tconst title = field === \"\" ? \"[global]\" : `[${field}]`\n\t\tresult += title + \"\\n\"\n\t\tfor (const entry of group) {\n\t\t\tlet line = ` ${entry.type}`\n\t\t\tif (entry.description) line += `: ${entry.description.replace(/\\n/g, \" \")}`\n\t\t\tresult += line + \"\\n\"\n\t\t}\n\t\tresult += \"\\n\"\n\t}\n\treturn result.trimEnd()\n}\n", "import { SnippetType, ISnippetMeta, ParameterInfo, CodeLanguageType } from \"../types\"\nimport Parser from \"web-tree-sitter\"\nimport { generateSnippetHash, buildScopeChain } from \"./general\"\n\nexport async function extractSnippetsFromCapturesForPython(\n\tcaptures: Parser.QueryCapture[],\n\tsourceCode: string,\n\tfilePath: string,\n\tfileHash: string,\n\tsnippetTypes: SnippetType[],\n\toptions: { maxSnippetLines: number; minSnippetLines: number },\n): Promise<ISnippetMeta[]> {\n\tconst snippets: ISnippetMeta[] = []\n\tconst seenHashes = new Set<string>()\n\n\t// --- \u6536\u96C6\u6240\u6709 class captures \u7528\u4E8E\u786E\u5B9A field ---\n\tconst classCaptures = captures\n\t\t.filter((c) => c.name === \"definition.class\")\n\t\t.map((c) => ({\n\t\t\tnode: c.node,\n\t\t\tstart: c.node.startIndex,\n\t\t\tend: c.node.endIndex,\n\t\t\tnameCap: captures.find(\n\t\t\t\t(nc) =>\n\t\t\t\t\tnc.name === \"name.definition.class\" &&\n\t\t\t\t\tnc.node.startIndex >= c.node.startIndex &&\n\t\t\t\t\tnc.node.endIndex <= c.node.endIndex,\n\t\t\t),\n\t\t}))\n\n\t// --- Function/Method ---\n\tfor (const capture of captures) {\n\t\tif (capture.name !== \"definition.function\") continue\n\t\tconst node = capture.node\n\t\tconst startLine = node.startPosition.row + 1\n\t\tconst endLine = node.endPosition.row + 1\n\n\t\t// \u67E5\u627E\u51FD\u6570\u540D\n\t\tconst nameCap = captures.find(\n\t\t\t(c) =>\n\t\t\t\tc.name === \"name.definition.function\" &&\n\t\t\t\tc.node.startIndex >= node.startIndex &&\n\t\t\t\tc.node.endIndex <= node.endIndex,\n\t\t)\n\t\tif (!nameCap) continue\n\t\tconst name = sourceCode.substring(nameCap.node.startIndex, nameCap.node.endIndex)\n\n\t\t// \u67E5\u627E\u53C2\u6570\n\t\tconst paramCap = captures.find(\n\t\t\t(c) =>\n\t\t\t\tc.name === \"parameters.definition.function\" &&\n\t\t\t\tc.node.startIndex >= node.startIndex &&\n\t\t\t\tc.node.endIndex <= node.endIndex,\n\t\t)\n\n\t\tconst parameters: ParameterInfo[] = []\n\t\tif (paramCap) {\n\t\t\tconst paramText = sourceCode.substring(paramCap.node.startIndex, paramCap.node.endIndex)\n\t\t\tconst cleanParams = paramText.replace(/^\\(|\\)$/g, \"\").trim()\n\t\t\tif (cleanParams) {\n\t\t\t\t// Python\u53C2\u6570\u89E3\u6790 - \u5904\u7406\u9ED8\u8BA4\u53C2\u6570\u3001\u7C7B\u578B\u6CE8\u89E3\u7B49\n\t\t\t\tconst paramList = splitPythonParameters(cleanParams)\n\t\t\t\tparameters.push(...paramList.map((param) => ({ name: param })))\n\t\t\t}\n\t\t}\n\n\t\t// \u67E5\u627E\u51FD\u6570\u4F53\n\t\tconst bodyCap = captures.find(\n\t\t\t(c) =>\n\t\t\t\tc.name === \"body.definition.function\" &&\n\t\t\t\tc.node.startIndex >= node.startIndex &&\n\t\t\t\tc.node.endIndex <= node.endIndex,\n\t\t)\n\n\t\t// \u751F\u6210\u51FD\u6570\u7B7E\u540D\u4F5C\u4E3A\u5B9A\u4E49\u6587\u672C\n\t\tlet definitionText: string\n\t\tlet implementText: string | undefined = undefined\n\n\t\tif (bodyCap) {\n\t\t\t// \u4ECE\u51FD\u6570\u5F00\u59CB\u5230\u51FD\u6570\u4F53\u5F00\u59CB\uFF08\u4E0D\u5305\u62EC\u51FD\u6570\u4F53\uFF09\n\t\t\tconst functionHeader = sourceCode.substring(node.startIndex, bodyCap.node.startIndex).trimEnd()\n\t\t\t// \u786E\u4FDD\u4EE5\u5192\u53F7\u7ED3\u5C3E\n\t\t\tdefinitionText = functionHeader.endsWith(\":\") ? functionHeader : functionHeader + \":\"\n\t\t\timplementText = sourceCode.substring(node.startIndex, node.endIndex)\n\t\t} else {\n\t\t\t// \u5982\u679C\u6CA1\u6709\u51FD\u6570\u4F53\uFF0C\u4F7F\u7528\u6574\u4E2A\u8282\u70B9\u5185\u5BB9\n\t\t\tdefinitionText = sourceCode.substring(node.startIndex, node.endIndex)\n\t\t}\n\n\t\tconst rangeText = sourceCode.substring(node.startIndex, node.endIndex)\n\n\t\t// \u786E\u5B9A\u662F\u5426\u5C5E\u4E8E\u67D0\u4E2A\u7C7B\uFF08\u8BBE\u7F6Efield\uFF09\n\t\tlet field: string | undefined = undefined\n\t\tfor (const cls of classCaptures) {\n\t\t\tif (node.startIndex > cls.start && node.endIndex <= cls.end && cls.nameCap) {\n\t\t\t\tfield = sourceCode.substring(cls.nameCap.node.startIndex, cls.nameCap.node.endIndex)\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\n\t\tconst snippetHash = generateSnippetHash(filePath, startLine, endLine, rangeText)\n\t\tif (seenHashes.has(snippetHash)) continue\n\t\tseenHashes.add(snippetHash)\n\n\t\tconst paramStr = parameters.map((p) => p.name).join(\", \")\n\t\tconst signature = `${name}(${paramStr})`\n\t\tconst scope = buildScopeChain(node)\n\n\t\t// \u68C0\u6D4B\u51FD\u6570\u7C7B\u578B\n\t\tlet functionType = \"function\"\n\t\tconst nodeText = sourceCode.substring(node.startIndex, Math.min(node.startIndex + 100, node.endIndex))\n\t\tif (nodeText.includes(\"async def\")) functionType = \"async function\"\n\t\tif (field) functionType = \"method\"\n\n\t\tsnippets.push({\n\t\t\tname,\n\t\t\ttype: SnippetType.FunctionOrMethod,\n\t\t\tfilePath,\n\t\t\tstartLine,\n\t\t\tendLine,\n\t\t\trangeText,\n\t\t\tdefinitionText,\n\t\t\tscope,\n\t\t\tfileHash,\n\t\t\tfield,\n\t\t\tdefinition: {\n\t\t\t\tname,\n\t\t\t\ttype: functionType,\n\t\t\t\tparameters,\n\t\t\t\treturnType: \"\", // Python\u6CA1\u6709\u663E\u5F0F\u8FD4\u56DE\u7C7B\u578B\uFF08\u9664\u975E\u6709\u7C7B\u578B\u6CE8\u89E3\uFF09\n\t\t\t},\n\t\t\tparameters,\n\t\t\tsignature,\n\t\t\tlanguage: CodeLanguageType.Python,\n\t\t\t...(implementText ? { implementText } : {}),\n\t\t})\n\t}\n\n\t// --- Class ---\n\tfor (const capture of captures) {\n\t\tif (capture.name !== \"definition.class\") continue\n\t\tconst node = capture.node\n\t\tconst startLine = node.startPosition.row + 1\n\t\tconst endLine = node.endPosition.row + 1\n\n\t\tconst nameCap = captures.find(\n\t\t\t(c) =>\n\t\t\t\tc.name === \"name.definition.class\" &&\n\t\t\t\tc.node.startIndex >= node.startIndex &&\n\t\t\t\tc.node.endIndex <= node.endIndex,\n\t\t)\n\t\tif (!nameCap) continue\n\t\tconst name = sourceCode.substring(nameCap.node.startIndex, nameCap.node.endIndex)\n\n\t\tconst rangeText = sourceCode.substring(node.startIndex, node.endIndex)\n\t\tconst snippetHash = generateSnippetHash(filePath, startLine, endLine, rangeText)\n\t\tif (seenHashes.has(snippetHash)) continue\n\t\tseenHashes.add(snippetHash)\n\n\t\tconst scope = buildScopeChain(node)\n\n\t\tsnippets.push({\n\t\t\tname,\n\t\t\ttype: SnippetType.ClassOrInterfaceOrStructOrEnum,\n\t\t\tfilePath,\n\t\t\tstartLine,\n\t\t\tendLine,\n\t\t\trangeText,\n\t\t\tdefinitionText: rangeText,\n\t\t\tscope,\n\t\t\tfileHash,\n\t\t\tdefinition: {\n\t\t\t\tname,\n\t\t\t\ttype: \"class\",\n\t\t\t},\n\t\t\tlanguage: CodeLanguageType.Python,\n\t\t})\n\t}\n\n\t// --- \u5168\u5C40\u53D8\u91CF\u548C\u7C7B\u6210\u5458\u53D8\u91CF ---\n\tfor (const capture of captures) {\n\t\tif (capture.name !== \"definition.variable\") continue\n\t\tconst node = capture.node\n\t\tconst startLine = node.startPosition.row + 1\n\t\tconst endLine = node.endPosition.row + 1\n\n\t\t// \u67E5\u627E\u53D8\u91CF\u540D - \u652F\u6301\u666E\u901A\u53D8\u91CF\u548C\u6210\u5458\u53D8\u91CF\n\t\tconst memberVarCaps = captures.filter(\n\t\t\t(c) =>\n\t\t\t\tc.name === \"name.definition.member_variable\" &&\n\t\t\t\tc.node.startIndex >= node.startIndex &&\n\t\t\t\tc.node.endIndex <= node.endIndex,\n\t\t)\n\n\t\tconst regularVarCaps = captures.filter(\n\t\t\t(c) =>\n\t\t\t\tc.name === \"name.definition.variable\" &&\n\t\t\t\tc.node.startIndex >= node.startIndex &&\n\t\t\t\tc.node.endIndex <= node.endIndex,\n\t\t)\n\n\t\tconst allVarCaps = [...memberVarCaps, ...regularVarCaps]\n\t\tif (allVarCaps.length === 0) continue\n\n\t\tfor (const nameCap of allVarCaps) {\n\t\t\tconst name = sourceCode.substring(nameCap.node.startIndex, nameCap.node.endIndex)\n\t\t\tconst isMemberVar = nameCap.name === \"name.definition.member_variable\"\n\n\t\t\t// \u5982\u679C\u662F\u666E\u901A\u53D8\u91CF\u4E14\u5728\u51FD\u6570\u5185\u90E8\uFF0C\u5219\u8DF3\u8FC7\uFF08\u5C40\u90E8\u53D8\u91CF\uFF09\n\t\t\tif (!isMemberVar) {\n\t\t\t\tconst isInFunction = captures.some(\n\t\t\t\t\t(fc) =>\n\t\t\t\t\t\tfc.name === \"definition.function\" &&\n\t\t\t\t\t\tfc.node.startIndex < nameCap.node.startIndex &&\n\t\t\t\t\t\tnameCap.node.endIndex < fc.node.endIndex,\n\t\t\t\t)\n\t\t\t\tif (isInFunction) continue\n\t\t\t}\n\n\t\t\tconst rangeText = sourceCode.substring(node.startIndex, node.endIndex)\n\n\t\t\t// \u786E\u5B9A\u662F\u5426\u5C5E\u4E8E\u67D0\u4E2A\u7C7B\uFF08\u8BBE\u7F6Efield\uFF09\n\t\t\tlet field: string | undefined = undefined\n\t\t\tfor (const cls of classCaptures) {\n\t\t\t\tif (nameCap.node.startIndex > cls.start && nameCap.node.endIndex <= cls.end && cls.nameCap) {\n\t\t\t\t\tfield = sourceCode.substring(cls.nameCap.node.startIndex, cls.nameCap.node.endIndex)\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tconst snippetHash = generateSnippetHash(filePath, startLine, endLine, rangeText + name)\n\t\t\tif (seenHashes.has(snippetHash)) continue\n\t\t\tseenHashes.add(snippetHash)\n\n\t\t\tconst scope = buildScopeChain(nameCap.node)\n\n\t\t\tsnippets.push({\n\t\t\t\tname,\n\t\t\t\ttype: SnippetType.VariableOrConstant,\n\t\t\t\tfilePath,\n\t\t\t\tstartLine,\n\t\t\t\tendLine,\n\t\t\t\trangeText,\n\t\t\t\tdefinitionText: rangeText,\n\t\t\t\tscope,\n\t\t\t\tfileHash,\n\t\t\t\tfield,\n\t\t\t\tdefinition: {\n\t\t\t\t\tname,\n\t\t\t\t\ttype: field ? \"member_variable\" : \"global_variable\",\n\t\t\t\t},\n\t\t\t\tlanguage: CodeLanguageType.Python,\n\t\t\t})\n\t\t}\n\t}\n\n\t// --- Import ---\n\t// \u5148\u627E\u6240\u6709 definition.import\uFF0C\u8BB0\u4E0B\u5176\u533A\u95F4\n\tconst importDefs = captures.filter((c) => c.name === \"definition.import\")\n\t// \u518D\u627E\u6240\u6709 name.definition.import\uFF0C\u5F52\u5C5E\u5230\u6700\u8FD1\u7684 definition.import\n\tfor (const nameCap of captures.filter((c) => c.name === \"name.definition.import\")) {\n\t\t// \u627E\u5230\u5305\u542B\u5B83\u7684 definition.import capture\n\t\tconst defCap = importDefs.find(\n\t\t\t(def) => nameCap.node.startIndex >= def.node.startIndex && nameCap.node.endIndex <= def.node.endIndex,\n\t\t)\n\t\tif (!defCap) continue\n\t\tconst node = defCap.node\n\t\tconst startLine = node.startPosition.row + 1\n\t\tconst endLine = node.endPosition.row + 1\n\t\tconst rangeText = sourceCode.substring(node.startIndex, node.endIndex)\n\t\tconst name = sourceCode.substring(nameCap.node.startIndex, nameCap.node.endIndex)\n\t\tconst snippetHash = generateSnippetHash(filePath, startLine, endLine, name)\n\t\tif (seenHashes.has(snippetHash)) continue\n\t\tseenHashes.add(snippetHash)\n\t\tconst scope = buildScopeChain(node)\n\t\tsnippets.push({\n\t\t\tname,\n\t\t\ttype: SnippetType.ImportOrInclude,\n\t\t\tfilePath,\n\t\t\tstartLine,\n\t\t\tendLine,\n\t\t\trangeText,\n\t\t\tdefinitionText: rangeText,\n\t\t\tscope,\n\t\t\tfileHash,\n\t\t\tlanguage: CodeLanguageType.Python,\n\t\t})\n\t}\n\n\t// filter by snippetTypes\n\treturn snippets.filter((snippet) => snippetTypes.includes(snippet.type)).sort((a, b) => a.startLine - b.startLine)\n}\n\n/**\n * \u5206\u5272Python\u53C2\u6570\uFF0C\u5904\u7406\u9ED8\u8BA4\u53C2\u6570\u3001\u7C7B\u578B\u6CE8\u89E3\u3001*args\u3001**kwargs\u7B49\n */\nfunction splitPythonParameters(params: string): string[] {\n\tconst result: string[] = []\n\tlet current = \"\"\n\tlet parenDepth = 0\n\tlet bracketDepth = 0\n\tlet braceDepth = 0\n\tlet inString = false\n\tlet stringChar = \"\"\n\n\tfor (let i = 0; i < params.length; i++) {\n\t\tconst char = params[i]\n\t\tconst prevChar = i > 0 ? params[i - 1] : \"\"\n\n\t\t// \u5904\u7406\u5B57\u7B26\u4E32\u5B57\u9762\u91CF\n\t\tif (!inString && (char === '\"' || char === \"'\" || char === \"`\")) {\n\t\t\tinString = true\n\t\t\tstringChar = char\n\t\t} else if (inString && char === stringChar && prevChar !== \"\\\\\") {\n\t\t\tinString = false\n\t\t\tstringChar = \"\"\n\t\t}\n\n\t\tif (!inString) {\n\t\t\t// \u8DDF\u8E2A\u5D4C\u5957\u6DF1\u5EA6\n\t\t\tif (char === \"(\") parenDepth++\n\t\t\telse if (char === \")\") parenDepth--\n\t\t\telse if (char === \"[\") bracketDepth++\n\t\t\telse if (char === \"]\") bracketDepth--\n\t\t\telse if (char === \"{\") braceDepth++\n\t\t\telse if (char === \"}\") braceDepth--\n\t\t\telse if (char === \",\" && parenDepth === 0 && bracketDepth === 0 && braceDepth === 0) {\n\t\t\t\t// \u53EA\u5728\u9876\u5C42\u9017\u53F7\u5206\u5272\n\t\t\t\tif (current.trim()) {\n\t\t\t\t\tresult.push(current.trim())\n\t\t\t\t}\n\t\t\t\tcurrent = \"\"\n\t\t\t\tcontinue\n\t\t\t}\n\t\t}\n\n\t\tcurrent += char\n\t}\n\n\tif (current.trim()) {\n\t\tresult.push(current.trim())\n\t}\n\n\treturn result\n}\n\n// VSCode Outline Entry \u7C7B\u578B\nexport interface OutlineEntry {\n\ttype: string\n\tname: string\n\tfile: string // \u8868\u793A\u5F53\u524D\u6587\u4EF6\n\tfield?: string // \u7A7A\u5B57\u7B26\u4E32\u4EE3\u8868\u5F53\u524D\u6587\u4EF6\u7684global\n\tdescription?: string\n}\n\n/**\n * \u6839\u636E Python \u6587\u4EF6\u7684\u6240\u6709 snippet \u751F\u6210\u5927\u7EB2\uFF08Outline\uFF09\uFF0C\u652F\u6301 import\u3001global variables\u3001function\u3001method\uFF08\u5E26 field\uFF09\u3001class\n */\nexport function buildSummaryFromSnippets(snippets: ISnippetMeta[]): OutlineEntry[] {\n\tconst outline: OutlineEntry[] = []\n\n\tfor (const s of snippets) {\n\t\t// \u5224\u65AD\u662F\u5426\u662F\u9876\u5C42\u9879\u6216\u7C7B\u6210\u5458\n\t\tconst isTopLevelFunction =\n\t\t\ts.type === SnippetType.FunctionOrMethod && !s.field && (!s.scope || s.scope.length === 0)\n\t\tconst isClassOrGlobalVar =\n\t\t\t(s.type === SnippetType.ClassOrInterfaceOrStructOrEnum || s.type === SnippetType.VariableOrConstant) &&\n\t\t\t!s.scope?.some((scopeItem) => scopeItem.startsWith(\"function\"))\n\t\tconst isMethodOrMemberVar = !!s.field\n\t\tconst isImport = s.type === SnippetType.ImportOrInclude\n\n\t\tif (!(isTopLevelFunction || isClassOrGlobalVar || isMethodOrMemberVar || isImport)) {\n\t\t\tcontinue\n\t\t}\n\n\t\tif (s.type === SnippetType.ImportOrInclude) {\n\t\t\toutline.push({\n\t\t\t\ttype: \"import\",\n\t\t\t\tname: s.name,\n\t\t\t\tfile: s.filePath,\n\t\t\t\tfield: \"\",\n\t\t\t\tdescription: s.definitionText,\n\t\t\t})\n\t\t} else if (s.type === SnippetType.FunctionOrMethod) {\n\t\t\tif (s.field) {\n\t\t\t\toutline.push({\n\t\t\t\t\ttype: \"method\",\n\t\t\t\t\tname: s.name,\n\t\t\t\t\tfile: s.filePath,\n\t\t\t\t\tfield: s.field,\n\t\t\t\t\tdescription: s.definitionText,\n\t\t\t\t})\n\t\t\t} else {\n\t\t\t\toutline.push({\n\t\t\t\t\ttype: \"function\",\n\t\t\t\t\tname: s.name,\n\t\t\t\t\tfile: s.filePath,\n\t\t\t\t\tfield: \"\",\n\t\t\t\t\tdescription: s.definitionText,\n\t\t\t\t})\n\t\t\t}\n\t\t} else if (s.type === SnippetType.VariableOrConstant) {\n\t\t\tconst t = s.definition?.type === \"global_variable\" ? \"variable\" : \"member_variable\"\n\t\t\t// \u5BF9\u4E8E\u5B9E\u4F8B\u53D8\u91CF\uFF0C\u663E\u793A\u4E0D\u5E26self.\u524D\u7F00\u7684\u540D\u79F0\n\t\t\tconst displayName = s.name.startsWith(\"self.\") ? s.name.substring(5) : s.name\n\t\t\toutline.push({\n\t\t\t\ttype: t,\n\t\t\t\tname: displayName,\n\t\t\t\tfile: s.filePath,\n\t\t\t\tfield: s.field || \"\",\n\t\t\t\tdescription: s.definitionText,\n\t\t\t})\n\t\t} else if (s.type === SnippetType.ClassOrInterfaceOrStructOrEnum) {\n\t\t\toutline.push({\n\t\t\t\ttype: \"class\",\n\t\t\t\tname: s.name,\n\t\t\t\tfile: s.filePath,\n\t\t\t\tfield: \"\",\n\t\t\t\tdescription: s.name,\n\t\t\t})\n\t\t}\n\t}\n\n\treturn outline\n}\n\n/**\n * \u5C06 OutlineEntry[] \u683C\u5F0F\u5316\u4E3A\u6587\u672C\uFF0C\u540C\u4E00\u4E2A field \u7684\u653E\u5728\u4E00\u8D77\u3002\n * @param outline OutlineEntry[]\n * @returns string\n */\nexport function formatOutlineText(outline: OutlineEntry[]): string {\n\t// \u6309 field \u5206\u7EC4\n\tconst groups: Record<string, OutlineEntry[]> = {}\n\tfor (const entry of outline) {\n\t\tconst key = entry.field ?? \"\"\n\t\tif (!groups[key]) groups[key] = []\n\t\tgroups[key].push(entry)\n\t}\n\n\t// \u5408\u6210\u6587\u672C\n\tlet result = \"\"\n\tfor (const field of Object.keys(groups).sort()) {\n\t\tif (groups[field].length === 0) continue\n\t\tconst group = groups[field]\n\t\tconst title = field === \"\" ? \"[global]\" : `[${field}]`\n\t\tresult += title + \"\\n\"\n\t\tfor (const entry of group) {\n\t\t\tlet line = ` ${entry.type}`\n\t\t\t// \u5BF9\u4E8E\u53D8\u91CF\u7C7B\u578B\uFF0C\u663E\u793A\u540D\u79F0\u800C\u4E0D\u662F\u5B8C\u6574\u63CF\u8FF0\n\t\t\tif (entry.type === \"variable\" || entry.type === \"member_variable\") {\n\t\t\t\tline += `: ${entry.name}`\n\t\t\t} else if (entry.description) {\n\t\t\t\tline += `: ${entry.description.replace(/\\n/g, \" \")}`\n\t\t\t}\n\t\t\tresult += line + \"\\n\"\n\t\t}\n\t\tresult += \"\\n\"\n\t}\n\treturn result.trimEnd()\n}\n", "import { SnippetType, ISnippetMeta, ParameterInfo, CodeLanguageType } from \"../types\"\nimport Parser from \"web-tree-sitter\"\nimport { generateSnippetHash, buildScopeChain } from \"./general\"\nimport { Logger } from \"../Logger\"\n\nexport async function extractSnippetsFromCapturesForJava(\n\tcaptures: Parser.QueryCapture[],\n\tsourceCode: string,\n\tfilePath: string,\n\tfileHash: string,\n\tsnippetTypes: SnippetType[],\n\toptions: { maxSnippetLines: number; minSnippetLines: number },\n): Promise<ISnippetMeta[]> {\n\tconst logger = Logger.getDefaultLogger().with(\"[extractSnippetsFromCapturesForJava]\")\n\n\tconst snippets: ISnippetMeta[] = []\n\tconst seenHashes = new Set<string>()\n\n\tif (snippetTypes.length === 0) {\n\t\tlogger.warn(`No snippet types provided, skipping`)\n\t\treturn snippets\n\t}\n\n\t// \u5904\u7406 import \u548C package\n\tcaptures.forEach((capture) => {\n\t\tif (capture.name === \"name.definition.import\") {\n\t\t\tconst node = capture.node\n\t\t\tconst startLine = node.startPosition.row + 1\n\t\t\tconst endLine = node.endPosition.row + 1\n\t\t\tconst rangeText = sourceCode.substring(node.startIndex, node.endIndex)\n\t\t\tconst snippetHash = generateSnippetHash(filePath, startLine, endLine, rangeText)\n\t\t\tif (seenHashes.has(snippetHash)) return\n\t\t\tseenHashes.add(snippetHash)\n\t\t\tconst name = sourceCode.substring(node.startIndex, node.endIndex)\n\t\t\tconst scope = buildScopeChain(node)\n\t\t\tsnippets.push({\n\t\t\t\tname,\n\t\t\t\ttype: SnippetType.ImportOrInclude,\n\t\t\t\tfilePath,\n\t\t\t\tstartLine,\n\t\t\t\tendLine,\n\t\t\t\trangeText,\n\t\t\t\tdefinitionText: rangeText,\n\t\t\t\tscope,\n\t\t\t\tfileHash,\n\t\t\t})\n\t\t}\n\t})\n\n\t// \u5904\u7406 method \u548C constructor\n\tfor (const capture of captures) {\n\t\tif (capture.name !== \"definition.method\" && capture.name !== \"definition.constructor\") continue\n\t\tconst node = capture.node\n\t\tconst startLine = node.startPosition.row + 1\n\t\tconst endLine = node.endPosition.row + 1\n\n\t\tconst isConstructor = capture.name === \"definition.constructor\"\n\t\tconst nameCapName = isConstructor ? \"name.definition.constructor\" : \"name.definition.method\"\n\t\tconst paramCapName = isConstructor ? \"parameters.definition.constructor\" : \"parameters.definition.method\"\n\t\tconst bodyCapName = isConstructor ? \"body.definition.constructor\" : \"body.definition.method\"\n\n\t\tconst nameCap = captures.find(\n\t\t\t(c) => c.name === nameCapName && c.node.startIndex >= node.startIndex && c.node.endIndex <= node.endIndex,\n\t\t)\n\t\tif (!nameCap) continue\n\t\tconst name = sourceCode.substring(nameCap.node.startIndex, nameCap.node.endIndex)\n\n\t\t// \u89E3\u6790\u53C2\u6570\n\t\tconst paramCap = captures.find(\n\t\t\t(c) => c.name === paramCapName && c.node.startIndex >= node.startIndex && c.node.endIndex <= node.endIndex,\n\t\t)\n\t\tconst parameters: ParameterInfo[] = []\n\t\tif (paramCap) {\n\t\t\tconst paramText = sourceCode.substring(paramCap.node.startIndex, paramCap.node.endIndex)\n\t\t\t// \u89E3\u6790 Java \u53C2\u6570: (Type param1, Type param2, ...)\n\t\t\tconst cleanText = paramText.replace(/^\\(|\\)$/g, \"\").trim()\n\t\t\tif (cleanText) {\n\t\t\t\t// \u66F4\u597D\u7684Java\u53C2\u6570\u89E3\u6790\uFF0C\u4FDD\u6301\u5B8C\u6574\u7684\u7C7B\u578B\u4FE1\u606F\n\t\t\t\tconst paramList = parseJavaParameters(cleanText)\n\t\t\t\tparameters.push(...paramList.map((param: string) => ({ name: param })))\n\t\t\t}\n\t\t}\n\n\t\t// \u67E5\u627E\u65B9\u6CD5\u4F53\n\t\tconst bodyCap = captures.find(\n\t\t\t(c) => c.name === bodyCapName && c.node.startIndex >= node.startIndex && c.node.endIndex <= node.endIndex,\n\t\t)\n\n\t\tlet rangeText: string\n\t\tlet implementText: string | undefined = undefined\n\t\tif (bodyCap) {\n\t\t\trangeText = sourceCode.substring(node.startIndex, bodyCap.node.startIndex).trimEnd()\n\t\t\timplementText = sourceCode.substring(node.startIndex, node.endIndex)\n\t\t} else {\n\t\t\trangeText = sourceCode.substring(node.startIndex, node.endIndex)\n\t\t}\n\n\t\tconst snippetHash = generateSnippetHash(filePath, startLine, endLine, rangeText)\n\t\tif (seenHashes.has(snippetHash)) continue\n\t\tseenHashes.add(snippetHash)\n\n\t\tconst paramStr = parameters.map((p) => p.name).join(\", \")\n\t\tconst signature = `${name}(${paramStr})`\n\t\tconst scope = buildScopeChain(node)\n\n\t\t// \u67E5\u627E\u5F52\u5C5E\u7684\u7C7B/\u63A5\u53E3/\u679A\u4E3E/record\n\t\tlet field: string | undefined = undefined\n\t\tconst parentTypes = [\"class\", \"interface\", \"enum\", \"record\", \"annotation\"]\n\t\tfor (const parentType of parentTypes) {\n\t\t\tconst parentCap = captures.find(\n\t\t\t\t(c) =>\n\t\t\t\t\tc.name === `definition.${parentType}` &&\n\t\t\t\t\tc.node.startIndex < node.startIndex &&\n\t\t\t\t\tnode.endIndex < c.node.endIndex,\n\t\t\t)\n\t\t\tif (parentCap) {\n\t\t\t\tconst parentNameCap = captures.find(\n\t\t\t\t\t(c) =>\n\t\t\t\t\t\tc.name === `name.definition.${parentType}` &&\n\t\t\t\t\t\tc.node.startIndex >= parentCap.node.startIndex &&\n\t\t\t\t\t\tc.node.endIndex <= parentCap.node.endIndex,\n\t\t\t\t)\n\t\t\t\tif (parentNameCap) {\n\t\t\t\t\tfield = sourceCode.substring(parentNameCap.node.startIndex, parentNameCap.node.endIndex)\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tsnippets.push({\n\t\t\tname,\n\t\t\ttype: SnippetType.FunctionOrMethod,\n\t\t\tfilePath,\n\t\t\tstartLine,\n\t\t\tendLine,\n\t\t\trangeText,\n\t\t\tdefinitionText: rangeText,\n\t\t\tscope,\n\t\t\tfileHash,\n\t\t\tfield,\n\t\t\tdefinition: {\n\t\t\t\tname,\n\t\t\t\ttype: isConstructor ? \"constructor\" : \"method\",\n\t\t\t\tparameters,\n\t\t\t\treturnType: isConstructor ? \"\" : \"void\", // Java \u65B9\u6CD5\u9ED8\u8BA4\u8FD4\u56DE\u7C7B\u578B\n\t\t\t},\n\t\t\tparameters,\n\t\t\tsignature,\n\t\t\tlanguage: CodeLanguageType.Java,\n\t\t\t...(implementText ? { implementText } : {}),\n\t\t})\n\t}\n\n\t// \u5904\u7406 class/interface/enum/record/annotation\n\tconst typeDefs = [\n\t\t{ capture: \"name.definition.class\", outlineType: \"class\" },\n\t\t{ capture: \"name.definition.interface\", outlineType: \"interface\" },\n\t\t{ capture: \"name.definition.enum\", outlineType: \"enum\" },\n\t\t{ capture: \"name.definition.record\", outlineType: \"record\" },\n\t\t{ capture: \"name.definition.annotation\", outlineType: \"annotation\" },\n\t]\n\n\tfor (const { capture, outlineType } of typeDefs) {\n\t\tconst defCaptureName = `definition.${outlineType}`\n\t\tfor (const cap of captures.filter((c) => c.name === capture)) {\n\t\t\tconst node = cap.node\n\t\t\t// \u5224\u65AD\u662F\u5426\u5728\u65B9\u6CD5/\u6784\u9020\u51FD\u6570\u5185\uFF08\u5C40\u90E8\u7C7B\uFF09\n\t\t\tconst isInMethod = captures.some(\n\t\t\t\t(fc) =>\n\t\t\t\t\t(fc.name === \"definition.method\" || fc.name === \"definition.constructor\") &&\n\t\t\t\t\tfc.node.startIndex < node.startIndex &&\n\t\t\t\t\tnode.endIndex < fc.node.endIndex,\n\t\t\t)\n\t\t\tif (isInMethod) continue\n\n\t\t\t// \u4F18\u5148\u7528 @definition.xxx \u533A\u95F4\n\t\t\tconst defCap = captures.find(\n\t\t\t\t(c) =>\n\t\t\t\t\tc.name === defCaptureName &&\n\t\t\t\t\tc.node.startIndex <= node.startIndex &&\n\t\t\t\t\tnode.endIndex <= c.node.endIndex,\n\t\t\t)\n\t\t\tconst rangeText = defCap\n\t\t\t\t? sourceCode.substring(defCap.node.startIndex, defCap.node.endIndex)\n\t\t\t\t: sourceCode.substring(node.startIndex, node.endIndex)\n\t\t\tconst startLine = node.startPosition.row + 1\n\t\t\tconst endLine = node.endPosition.row + 1\n\t\t\tconst snippetHash = generateSnippetHash(filePath, startLine, endLine, rangeText)\n\t\t\tif (seenHashes.has(snippetHash)) continue\n\t\t\tseenHashes.add(snippetHash)\n\t\t\tconst name = sourceCode.substring(node.startIndex, node.endIndex)\n\t\t\tsnippets.push({\n\t\t\t\tname,\n\t\t\t\ttype: SnippetType.ClassOrInterfaceOrStructOrEnum,\n\t\t\t\tfilePath,\n\t\t\t\tstartLine,\n\t\t\t\tendLine,\n\t\t\t\trangeText,\n\t\t\t\tdefinitionText: rangeText,\n\t\t\t\timplementText: rangeText,\n\t\t\t\tscope: [],\n\t\t\t\tfileHash,\n\t\t\t\tfield: \"\",\n\t\t\t\tdefinition: { name, type: outlineType },\n\t\t\t\tlanguage: CodeLanguageType.Java,\n\t\t\t})\n\t\t}\n\t}\n\n\t// \u5904\u7406 field\uFF08\u5B57\u6BB5\uFF09- \u76F4\u63A5\u5904\u7406\u6BCF\u4E2A\u5B57\u6BB5\u540D\u79F0\n\tconst fieldNameCaptures = captures.filter((c) => c.name === \"name.definition.field\")\n\tfor (const nameCap of fieldNameCaptures) {\n\t\tconst name = sourceCode.substring(nameCap.node.startIndex, nameCap.node.endIndex)\n\n\t\t// \u627E\u5230\u5305\u542B\u8FD9\u4E2A\u540D\u79F0\u7684field_declaration\u8282\u70B9\n\t\tconst fieldCap = captures.find(\n\t\t\t(c) =>\n\t\t\t\tc.name === \"definition.field\" &&\n\t\t\t\tc.node.startIndex <= nameCap.node.startIndex &&\n\t\t\t\tnameCap.node.endIndex <= c.node.endIndex,\n\t\t)\n\n\t\tif (!fieldCap) continue\n\n\t\tconst node = fieldCap.node\n\t\tconst startLine = node.startPosition.row + 1\n\t\tconst endLine = node.endPosition.row + 1\n\n\t\t// \u5224\u65AD\u662F\u5426\u5728\u65B9\u6CD5\u5185\uFF08\u5C40\u90E8\u53D8\u91CF\uFF09\n\t\tconst isInMethod = captures.some(\n\t\t\t(fc) =>\n\t\t\t\t(fc.name === \"definition.method\" || fc.name === \"definition.constructor\") &&\n\t\t\t\tfc.node.startIndex < node.startIndex &&\n\t\t\t\tnode.endIndex < fc.node.endIndex,\n\t\t)\n\t\tif (isInMethod) continue\n\n\t\tconst rangeText = sourceCode.substring(node.startIndex, node.endIndex)\n\t\t// \u5BF9\u4E8E\u5B57\u6BB5\uFF0C\u4F7F\u7528\u53D8\u91CF\u540D\u7684\u4F4D\u7F6E\u6765\u751F\u6210hash\uFF0C\u907F\u514D\u540C\u4E00\u884C\u591A\u4E2A\u53D8\u91CF\u88AB\u53BB\u91CD\n\t\tconst nameStartLine = nameCap.node.startPosition.row + 1\n\t\tconst nameEndLine = nameCap.node.endPosition.row + 1\n\t\tconst nameRangeText = sourceCode.substring(nameCap.node.startIndex, nameCap.node.endIndex)\n\t\tconst snippetHash = generateSnippetHash(filePath, nameStartLine, nameEndLine, nameRangeText)\n\t\tif (seenHashes.has(snippetHash)) continue\n\t\tseenHashes.add(snippetHash)\n\n\t\t// \u67E5\u627E\u5F52\u5C5E\u7684\u7C7B/\u63A5\u53E3/\u679A\u4E3E/record\n\t\tlet field: string | undefined = undefined\n\t\tconst parentTypes = [\"class\", \"interface\", \"enum\", \"record\", \"annotation\"]\n\t\tfor (const parentType of parentTypes) {\n\t\t\tconst parentCap = captures.find(\n\t\t\t\t(c) =>\n\t\t\t\t\tc.name === `definition.${parentType}` &&\n\t\t\t\t\tc.node.startIndex < node.startIndex &&\n\t\t\t\t\tnode.endIndex < c.node.endIndex,\n\t\t\t)\n\t\t\tif (parentCap) {\n\t\t\t\tconst parentNameCap = captures.find(\n\t\t\t\t\t(c) =>\n\t\t\t\t\t\tc.name === `name.definition.${parentType}` &&\n\t\t\t\t\t\tc.node.startIndex >= parentCap.node.startIndex &&\n\t\t\t\t\t\tc.node.endIndex <= parentCap.node.endIndex,\n\t\t\t\t)\n\t\t\t\tif (parentNameCap) {\n\t\t\t\t\tfield = sourceCode.substring(parentNameCap.node.startIndex, parentNameCap.node.endIndex)\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tconst scope = buildScopeChain(node)\n\t\tsnippets.push({\n\t\t\tname,\n\t\t\ttype: SnippetType.VariableOrConstant,\n\t\t\tfilePath,\n\t\t\tstartLine,\n\t\t\tendLine,\n\t\t\trangeText,\n\t\t\tdefinitionText: rangeText,\n\t\t\timplementText: rangeText,\n\t\t\tscope,\n\t\t\tfileHash,\n\t\t\tfield: field || \"\",\n\t\t\tdefinition: { name, type: \"field\" },\n\t\t\tlanguage: CodeLanguageType.Java,\n\t\t})\n\t}\n\n\t// filter snippets by snippetTypes\n\treturn snippets.filter((snippet) => snippetTypes.includes(snippet.type)).sort((a, b) => a.startLine - b.startLine)\n}\n\n// VSCode Outline Entry \u7C7B\u578B\nexport interface OutlineEntry {\n\ttype: string\n\tname: string\n\tfile: string // \u8868\u793A\u5F53\u524D\u6587\u4EF6\n\tfield?: string // \u7A7A\u5B57\u7B26\u4E32\u4EE3\u8868\u5F53\u524D\u6587\u4EF6\u7684global\n\tdescription?: string\n}\n\n/**\n * \u6839\u636E Java \u6587\u4EF6\u7684\u6240\u6709 snippet \u751F\u6210\u5927\u7EB2\uFF08Outline\uFF09\uFF0C\u652F\u6301 import\u3001class\u3001interface\u3001enum\u3001record\u3001annotation\u3001method\u3001constructor\u3001field\n */\nexport function buildSummaryFromSnippets(snippets: ISnippetMeta[]): OutlineEntry[] {\n\tconst outline: OutlineEntry[] = []\n\n\t// \u5728Java\u4E2D\uFF0C\u6211\u4EEC\u5E94\u8BE5\u5305\u542B\u6240\u6709\u9876\u7EA7\u5B9A\u4E49\uFF08\u4E0D\u5728\u65B9\u6CD5\u5185\u90E8\u7684\uFF09\n\t// \u5305\u62EC\u7C7B\u3001\u63A5\u53E3\u3001\u65B9\u6CD5\u3001\u5B57\u6BB5\u7B49\n\tconst isTopLevel = (s: ISnippetMeta) => {\n\t\t// \u5982\u679Cscope\u4E3A\u7A7A\u6216\u8005\u53EA\u6709\u4E00\u5C42\uFF08\u6BD4\u5982\u53EA\u6709\u7C7B\u540D\uFF09\uFF0C\u5219\u8BA4\u4E3A\u662F\u9876\u7EA7\n\t\treturn !s.scope || s.scope.length <= 1\n\t}\n\n\tfor (const s of snippets) {\n\t\tif (!isTopLevel(s)) continue\n\t\tif (s.type === SnippetType.ImportOrInclude) {\n\t\t\toutline.push({\n\t\t\t\ttype: \"import\",\n\t\t\t\tname: s.name,\n\t\t\t\tfile: s.filePath,\n\t\t\t\tfield: \"\",\n\t\t\t\tdescription: s.definitionText,\n\t\t\t})\n\t\t} else if (s.type === SnippetType.FunctionOrMethod) {\n\t\t\tif (s.field) {\n\t\t\t\tconst methodType = s.definition?.type === \"constructor\" ? \"constructor\" : \"method\"\n\t\t\t\toutline.push({\n\t\t\t\t\ttype: methodType,\n\t\t\t\t\tname: s.name,\n\t\t\t\t\tfile: s.filePath,\n\t\t\t\t\tfield: s.field,\n\t\t\t\t\tdescription: s.definitionText,\n\t\t\t\t})\n\t\t\t} else {\n\t\t\t\toutline.push({\n\t\t\t\t\ttype: \"method\",\n\t\t\t\t\tname: s.name,\n\t\t\t\t\tfile: s.filePath,\n\t\t\t\t\tfield: \"\",\n\t\t\t\t\tdescription: s.definitionText,\n\t\t\t\t})\n\t\t\t}\n\t\t} else if (s.type === SnippetType.VariableOrConstant) {\n\t\t\tconst fieldType = s.definition?.type === \"field\" ? \"field\" : \"variable\"\n\t\t\t// \u5BF9\u4E8Eoutline\u663E\u793A\uFF0C\u4F7F\u7528\u7B80\u5355\u7684\u5B57\u6BB5\u540D\n\t\t\tconst simpleDescription = s.name\n\t\t\toutline.push({\n\t\t\t\ttype: fieldType,\n\t\t\t\tname: s.name,\n\t\t\t\tfile: s.filePath,\n\t\t\t\tfield: s.field || \"\",\n\t\t\t\tdescription: simpleDescription,\n\t\t\t})\n\t\t} else if (s.type === SnippetType.ClassOrInterfaceOrStructOrEnum) {\n\t\t\tconst t = s.definition?.type || \"class\"\n\t\t\t// \u5BF9\u4E8Eoutline\u663E\u793A\uFF0C\u4F7F\u7528\u7B80\u5355\u7684\u7C7B\u540D\n\t\t\toutline.push({\n\t\t\t\ttype: t,\n\t\t\t\tname: s.name,\n\t\t\t\tfile: s.filePath,\n\t\t\t\tfield: \"\",\n\t\t\t\tdescription: s.name,\n\t\t\t})\n\t\t}\n\t}\n\n\treturn outline\n}\n\n/**\n * \u5C06 OutlineEntry[] \u683C\u5F0F\u5316\u4E3A\u6587\u672C\uFF0C\u540C\u4E00\u4E2A field \u7684\u653E\u5728\u4E00\u8D77\u3002\n * @param outline OutlineEntry[]\n * @returns string\n */\nexport function formatOutlineText(outline: OutlineEntry[]): string {\n\t// \u6309 field \u5206\u7EC4\n\tconst groups: Record<string, OutlineEntry[]> = {}\n\tfor (const entry of outline) {\n\t\tconst key = entry.field ?? \"\"\n\t\tif (!groups[key]) groups[key] = []\n\t\tgroups[key].push(entry)\n\t}\n\n\t// \u5408\u6210\u6587\u672C\n\tlet result = \"\"\n\tfor (const field of Object.keys(groups).sort()) {\n\t\tconst group = groups[field]\n\t\tconst title = field === \"\" ? \"[global]\" : `[${field}]`\n\t\tresult += title + \"\\n\"\n\t\tfor (const entry of group) {\n\t\t\tlet line = ` ${entry.type}`\n\t\t\tif (entry.description) line += `: ${entry.description.replace(/\\n/g, \" \")}`\n\t\t\tresult += line + \"\\n\"\n\t\t}\n\t\tresult += \"\\n\"\n\t}\n\treturn result.trimEnd()\n}\n\n/**\n * \u89E3\u6790Java\u53C2\u6570\u5217\u8868\uFF0C\u4FDD\u6301\u5B8C\u6574\u7684\u7C7B\u578B\u4FE1\u606F\n * @param paramText \u53C2\u6570\u6587\u672C\uFF0C\u4F8B\u5982 \"String name, int age, List<String> items\"\n * @returns \u53C2\u6570\u6570\u7EC4\uFF0C\u6BCF\u4E2A\u5143\u7D20\u662F \"Type paramName\" \u5F62\u5F0F\n */\nfunction parseJavaParameters(paramText: string): string[] {\n\tif (!paramText.trim()) return []\n\n\tconst params: string[] = []\n\tlet current = \"\"\n\tlet bracketDepth = 0\n\tlet i = 0\n\n\twhile (i < paramText.length) {\n\t\tconst char = paramText[i]\n\n\t\tif (char === \"<\") {\n\t\t\tbracketDepth++\n\t\t\tcurrent += char\n\t\t} else if (char === \">\") {\n\t\t\tbracketDepth--\n\t\t\tcurrent += char\n\t\t} else if (char === \",\" && bracketDepth === 0) {\n\t\t\t// \u5230\u8FBE\u53C2\u6570\u5206\u9694\u7B26\n\t\t\tif (current.trim()) {\n\t\t\t\tparams.push(current.trim())\n\t\t\t}\n\t\t\tcurrent = \"\"\n\t\t} else {\n\t\t\tcurrent += char\n\t\t}\n\t\ti++\n\t}\n\n\t// \u6DFB\u52A0\u6700\u540E\u4E00\u4E2A\u53C2\u6570\n\tif (current.trim()) {\n\t\tparams.push(current.trim())\n\t}\n\n\treturn params\n}\n", "import { SnippetType, ISnippetMeta, ParameterInfo, CodeLanguageType } from \"../types\"\nimport Parser from \"web-tree-sitter\"\nimport { generateSnippetHash, buildScopeChain } from \"./general\"\n\n// Helper function to remove parentheses from parameter string\nfunction removeParentheses(text: string): string {\n\tlet result = text.trim()\n\tif (result.startsWith(\"(\") && result.endsWith(\")\")) {\n\t\tresult = result.slice(1, -1).trim()\n\t}\n\treturn result\n}\n\n// Helper function to remove brackets from array destructuring\nfunction removeBrackets(text: string): string {\n\tlet result = text.trim()\n\tif (result.startsWith(\"[\") && result.endsWith(\"]\")) {\n\t\tresult = result.slice(1, -1).trim()\n\t}\n\treturn result\n}\n\n// Helper function to check if a string is a valid JavaScript identifier\nfunction isValidJavaScriptIdentifier(name: string): boolean {\n\tif (!name) return false\n\n\t// First character must be letter, underscore, or dollar sign\n\tconst firstChar = name[0]\n\tif (\n\t\t!(firstChar >= \"a\" && firstChar <= \"z\") &&\n\t\t!(firstChar >= \"A\" && firstChar <= \"Z\") &&\n\t\tfirstChar !== \"_\" &&\n\t\tfirstChar !== \"$\"\n\t) {\n\t\treturn false\n\t}\n\n\t// Remaining characters can be letters, digits, underscore, or dollar sign\n\tfor (let i = 1; i < name.length; i++) {\n\t\tconst char = name[i]\n\t\tif (\n\t\t\t!(char >= \"a\" && char <= \"z\") &&\n\t\t\t!(char >= \"A\" && char <= \"Z\") &&\n\t\t\t!(char >= \"0\" && char <= \"9\") &&\n\t\t\tchar !== \"_\" &&\n\t\t\tchar !== \"$\"\n\t\t) {\n\t\t\treturn false\n\t\t}\n\t}\n\n\treturn true\n}\n\n// Helper function to replace newlines with spaces for formatting\nfunction replaceNewlinesWithSpaces(text: string): string {\n\treturn text.split(\"\\n\").join(\" \")\n}\n\n// Helper function to extract parameters from method text using string parsing\nfunction extractParametersFromMethodText(methodText: string): string | null {\n\tconst openParen = methodText.indexOf(\"(\")\n\tconst closeParen = methodText.lastIndexOf(\")\")\n\n\tif (openParen !== -1 && closeParen !== -1 && closeParen > openParen) {\n\t\treturn methodText.substring(openParen + 1, closeParen).trim()\n\t}\n\n\treturn null\n}\n\nexport async function extractSnippetsFromCapturesForJavaScript(\n\tcaptures: Parser.QueryCapture[],\n\tsourceCode: string,\n\tfilePath: string,\n\tfileHash: string,\n\tsnippetTypes: SnippetType[],\n\toptions: { maxSnippetLines: number; minSnippetLines: number },\n): Promise<ISnippetMeta[]> {\n\tconst snippets: ISnippetMeta[] = []\n\tconst seenHashes = new Set<string>()\n\n\t// --- Function/Method ---\n\t// Collect all class captures first for context\n\tconst classCaptures = captures\n\t\t.filter((c) => c.name === \"definition.class\")\n\t\t.map((c) => ({\n\t\t\tnode: c.node,\n\t\t\tstart: c.node.startIndex,\n\t\t\tend: c.node.endIndex,\n\t\t\tnameCap: captures.find(\n\t\t\t\t(nc) =>\n\t\t\t\t\tnc.name === \"name\" &&\n\t\t\t\t\tnc.node.startIndex >= c.node.startIndex &&\n\t\t\t\t\tnc.node.endIndex <= c.node.endIndex,\n\t\t\t),\n\t\t}))\n\n\t// Process function declarations\n\tfor (const capture of captures) {\n\t\tif (capture.name !== \"definition.function\") continue\n\t\tconst node = capture.node\n\t\tconst startLine = node.startPosition.row + 1\n\t\tconst endLine = node.endPosition.row + 1\n\n\t\t// Find function name\n\t\tconst nameCap = captures.find(\n\t\t\t(c) =>\n\t\t\t\t(c.name === \"name.definition.function\" || c.name === \"name\") &&\n\t\t\t\tc.node.startIndex >= node.startIndex &&\n\t\t\t\tc.node.endIndex <= node.endIndex,\n\t\t)\n\t\tif (!nameCap) continue\n\t\tconst name = sourceCode.substring(nameCap.node.startIndex, nameCap.node.endIndex)\n\n\t\t// Find parameters\n\t\tconst paramCap = captures.find(\n\t\t\t(c) =>\n\t\t\t\tc.name === \"parameters.definition.function\" &&\n\t\t\t\tc.node.startIndex >= node.startIndex &&\n\t\t\t\tc.node.endIndex <= node.endIndex,\n\t\t)\n\n\t\tconst parameters: ParameterInfo[] = []\n\t\tif (paramCap) {\n\t\t\tconst paramText = sourceCode.substring(paramCap.node.startIndex, paramCap.node.endIndex)\n\t\t\tconst cleanParams = removeParentheses(paramText)\n\t\t\tif (cleanParams) {\n\t\t\t\t// JavaScript parameter parsing - handle destructuring, defaults, etc.\n\t\t\t\tconst paramList = splitJavaScriptParameters(cleanParams)\n\t\t\t\tparameters.push(...paramList.map((param) => ({ name: param })))\n\t\t\t}\n\t\t}\n\n\t\t// Find function body\n\t\tconst bodyCap = captures.find(\n\t\t\t(c) =>\n\t\t\t\tc.name === \"body.definition.function\" &&\n\t\t\t\tc.node.startIndex >= node.startIndex &&\n\t\t\t\tc.node.endIndex <= node.endIndex,\n\t\t)\n\n\t\tlet rangeText: string\n\t\tlet implementText: string | undefined = undefined\n\t\tif (bodyCap) {\n\t\t\trangeText = sourceCode.substring(node.startIndex, bodyCap.node.startIndex).trimEnd()\n\t\t\timplementText = sourceCode.substring(node.startIndex, node.endIndex)\n\t\t} else {\n\t\t\trangeText = sourceCode.substring(node.startIndex, node.endIndex)\n\t\t}\n\n\t\t// Check if function belongs to a class\n\t\tlet field: string | undefined = undefined\n\t\tfor (const cls of classCaptures) {\n\t\t\tif (node.startIndex > cls.start && node.endIndex < cls.end && cls.nameCap) {\n\t\t\t\tfield = sourceCode.substring(cls.nameCap.node.startIndex, cls.nameCap.node.endIndex)\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\n\t\tconst snippetHash = generateSnippetHash(filePath, startLine, endLine, rangeText)\n\t\tif (seenHashes.has(snippetHash)) continue\n\t\tseenHashes.add(snippetHash)\n\n\t\tconst paramStr = parameters.map((p) => p.name).join(\", \")\n\t\tconst signature = `${name}(${paramStr})`\n\t\tconst scope = buildScopeChain(node)\n\n\t\t// Detect function type (async, generator, arrow, etc.)\n\t\tlet functionType = \"function\"\n\t\tconst nodeText = sourceCode.substring(node.startIndex, Math.min(node.startIndex + 100, node.endIndex))\n\t\tif (nodeText.includes(\"async\")) functionType = \"async function\"\n\t\tif (nodeText.includes(\"function*\")) functionType = \"generator function\"\n\t\tif (nodeText.includes(\"=>\")) functionType = \"arrow function\"\n\n\t\tsnippets.push({\n\t\t\tname,\n\t\t\ttype: SnippetType.FunctionOrMethod,\n\t\t\tfilePath,\n\t\t\tstartLine,\n\t\t\tendLine,\n\t\t\trangeText,\n\t\t\tdefinitionText: rangeText,\n\t\t\tscope,\n\t\t\tfileHash,\n\t\t\tfield,\n\t\t\tdefinition: {\n\t\t\t\tname,\n\t\t\t\ttype: functionType,\n\t\t\t\tparameters,\n\t\t\t\treturnType: \"\", // JavaScript doesn't have explicit return types\n\t\t\t},\n\t\t\tparameters,\n\t\t\tsignature,\n\t\t\tlanguage: CodeLanguageType.JavaScript,\n\t\t\t...(implementText ? { implementText } : {}),\n\t\t})\n\t}\n\n\t// --- Method definitions ---\n\tfor (const capture of captures) {\n\t\tif (capture.name !== \"definition.method\") continue\n\t\tconst node = capture.node\n\t\tconst startLine = node.startPosition.row + 1\n\t\tconst endLine = node.endPosition.row + 1\n\n\t\t// Find method name\n\t\tconst nameCap = captures.find(\n\t\t\t(c) => c.name === \"name\" && c.node.startIndex >= node.startIndex && c.node.endIndex <= node.endIndex,\n\t\t)\n\t\tif (!nameCap) continue\n\t\tconst name = sourceCode.substring(nameCap.node.startIndex, nameCap.node.endIndex)\n\n\t\t// Find method parameters - prioritize captured parameters\n\t\tconst paramCap = captures.find(\n\t\t\t(c) =>\n\t\t\t\tc.name === \"parameters.definition.method\" &&\n\t\t\t\tc.node.startIndex >= node.startIndex &&\n\t\t\t\tc.node.endIndex <= node.endIndex,\n\t\t)\n\n\t\tconst parameters: ParameterInfo[] = []\n\t\tif (paramCap) {\n\t\t\t// Use captured parameters\n\t\t\tconst paramText = sourceCode.substring(paramCap.node.startIndex, paramCap.node.endIndex)\n\t\t\tconst cleanParams = removeParentheses(paramText)\n\t\t\tif (cleanParams) {\n\t\t\t\tconst paramList = splitJavaScriptParameters(cleanParams)\n\t\t\t\tparameters.push(...paramList.map((param) => ({ name: param })))\n\t\t\t}\n\t\t} else {\n\t\t\t// Fallback to string parsing\n\t\t\tconst methodText = sourceCode.substring(node.startIndex, node.endIndex)\n\t\t\tconst paramString = extractParametersFromMethodText(methodText)\n\t\t\tif (paramString) {\n\t\t\t\tconst paramList = splitJavaScriptParameters(paramString)\n\t\t\t\tparameters.push(...paramList.map((param) => ({ name: param })))\n\t\t\t}\n\t\t}\n\n\t\t// Find containing class - we'll do this after all classes are processed\n\t\tlet field: string | undefined = undefined\n\n\t\tconst rangeText = sourceCode.substring(node.startIndex, node.endIndex)\n\t\tconst snippetHash = generateSnippetHash(filePath, startLine, endLine, rangeText)\n\t\tif (seenHashes.has(snippetHash)) continue\n\t\tseenHashes.add(snippetHash)\n\n\t\tconst paramStr = parameters.map((p) => p.name).join(\", \")\n\t\tconst signature = `${name}(${paramStr})`\n\t\tconst scope = buildScopeChain(node)\n\n\t\t// Detect method type\n\t\tlet methodType = \"method\"\n\t\tconst methodText = sourceCode.substring(node.startIndex, node.endIndex)\n\t\tif (methodText.includes(\"async\")) methodType = \"async method\"\n\t\tif (methodText.includes(\"static\")) methodType = \"static method\"\n\t\tif (methodText.includes(\"get \")) methodType = \"getter\"\n\t\tif (methodText.includes(\"set \")) methodType = \"setter\"\n\n\t\tsnippets.push({\n\t\t\tname,\n\t\t\ttype: SnippetType.FunctionOrMethod,\n\t\t\tfilePath,\n\t\t\tstartLine,\n\t\t\tendLine,\n\t\t\trangeText,\n\t\t\tdefinitionText: rangeText,\n\t\t\tscope,\n\t\t\tfileHash,\n\t\t\tfield,\n\t\t\tdefinition: {\n\t\t\t\tname,\n\t\t\t\ttype: methodType,\n\t\t\t\tparameters,\n\t\t\t\treturnType: \"\",\n\t\t\t},\n\t\t\tparameters,\n\t\t\tsignature,\n\t\t\tlanguage: CodeLanguageType.JavaScript,\n\t\t\timplementText: rangeText,\n\t\t})\n\t}\n\n\t// --- Class definitions ---\n\tfor (const capture of captures) {\n\t\tif (capture.name !== \"definition.class\") continue\n\t\tconst node = capture.node\n\t\tconst startLine = node.startPosition.row + 1\n\t\tconst endLine = node.endPosition.row + 1\n\n\t\tconst nameCap = captures.find(\n\t\t\t(c) =>\n\t\t\t\tc.name === \"name.definition.class\" &&\n\t\t\t\tc.node.startIndex >= node.startIndex &&\n\t\t\t\tc.node.endIndex <= node.endIndex,\n\t\t)\n\t\tif (!nameCap) continue\n\t\tconst name = sourceCode.substring(nameCap.node.startIndex, nameCap.node.endIndex)\n\n\t\tconst rangeText = sourceCode.substring(node.startIndex, node.endIndex)\n\t\tconst snippetHash = generateSnippetHash(filePath, startLine, endLine, rangeText)\n\t\tif (seenHashes.has(snippetHash)) continue\n\t\tseenHashes.add(snippetHash)\n\t\tconst scope = buildScopeChain(node)\n\n\t\tsnippets.push({\n\t\t\tname,\n\t\t\ttype: SnippetType.ClassOrInterfaceOrStructOrEnum,\n\t\t\tfilePath,\n\t\t\tstartLine,\n\t\t\tendLine,\n\t\t\trangeText,\n\t\t\tdefinitionText: rangeText,\n\t\t\tscope,\n\t\t\tfileHash,\n\t\t\tdefinition: {\n\t\t\t\tname,\n\t\t\t\ttype: \"class\",\n\t\t\t},\n\t\t\tlanguage: CodeLanguageType.JavaScript,\n\t\t})\n\t}\n\n\t// --- Fix method field associations ---\n\t// Get all classes to determine field associations\n\tconst allClasses = snippets.filter((s) => s.type === SnippetType.ClassOrInterfaceOrStructOrEnum)\n\n\t// Update method field associations\n\tfor (const method of snippets) {\n\t\tif (method.type === SnippetType.FunctionOrMethod && !method.field) {\n\t\t\tfor (const cls of allClasses) {\n\t\t\t\tif (method.startLine >= cls.startLine && method.endLine <= cls.endLine) {\n\t\t\t\t\tmethod.field = cls.name\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t// --- Variable definitions ---\n\n\tfor (const capture of captures) {\n\t\tif (capture.name !== \"definition.variable\") continue\n\n\t\tconst node = capture.node\n\t\tconst startLine = node.startPosition.row + 1\n\t\tconst endLine = node.endPosition.row + 1\n\n\t\t// Check if this is an array destructuring pattern\n\t\tconst arrayPatternCap = captures.find(\n\t\t\t(c) =>\n\t\t\t\tc.name === \"array_pattern\" && c.node.startIndex >= node.startIndex && c.node.endIndex <= node.endIndex,\n\t\t)\n\n\t\tif (arrayPatternCap) {\n\t\t\t// Handle array destructuring manually\n\t\t\tconst arrayPatternText = sourceCode.substring(\n\t\t\t\tarrayPatternCap.node.startIndex,\n\t\t\t\tarrayPatternCap.node.endIndex,\n\t\t\t)\n\t\t\t// Extract variable names from array pattern like [first, second]\n\t\t\tconst variableNames = removeBrackets(arrayPatternText)\n\t\t\t\t.split(\",\")\n\t\t\t\t.map((name) => name.trim())\n\t\t\t\t.filter((name) => name && isValidJavaScriptIdentifier(name)) // Valid identifiers only\n\n\t\t\t// Process each variable separately\n\t\t\tfor (const varName of variableNames) {\n\t\t\t\t// Skip local variables (inside functions)\n\t\t\t\tconst scope = buildScopeChain(node)\n\t\t\t\tconst isInsideFunction =\n\t\t\t\t\tscope.length > 0 &&\n\t\t\t\t\tscope.some((scopeItem) => {\n\t\t\t\t\t\treturn !allClasses.some((cls) => cls.name === scopeItem)\n\t\t\t\t\t})\n\n\t\t\t\tif (isInsideFunction) continue\n\n\t\t\t\tconst rangeText = sourceCode.substring(node.startIndex, node.endIndex)\n\t\t\t\tconst snippetHash = generateSnippetHash(filePath, startLine, endLine, `${rangeText}_${varName}`)\n\t\t\t\tif (seenHashes.has(snippetHash)) continue\n\t\t\t\tseenHashes.add(snippetHash)\n\n\t\t\t\t// Determine if this is a class member variable\n\t\t\t\tlet field: string | undefined = undefined\n\t\t\t\tlet variableType = \"global_variable\"\n\n\t\t\t\t// Check if variable is inside a class\n\t\t\t\tfor (const cls of allClasses) {\n\t\t\t\t\tif (startLine >= cls.startLine && endLine <= cls.endLine) {\n\t\t\t\t\t\tfield = cls.name\n\t\t\t\t\t\tvariableType = \"member_variable\"\n\t\t\t\t\t\tbreak\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Create definition text\n\t\t\t\tlet definitionText = varName\n\t\t\t\tif (variableType === \"global_variable\") {\n\t\t\t\t\tdefinitionText = replaceNewlinesWithSpaces(rangeText).trim()\n\t\t\t\t}\n\n\t\t\t\tsnippets.push({\n\t\t\t\t\tname: varName,\n\t\t\t\t\ttype: SnippetType.VariableOrConstant,\n\t\t\t\t\tfilePath,\n\t\t\t\t\tstartLine,\n\t\t\t\t\tendLine,\n\t\t\t\t\trangeText,\n\t\t\t\t\tdefinitionText,\n\t\t\t\t\tscope,\n\t\t\t\t\tfileHash,\n\t\t\t\t\tfield,\n\t\t\t\t\tdefinition: {\n\t\t\t\t\t\tname: varName,\n\t\t\t\t\t\ttype: variableType,\n\t\t\t\t\t},\n\t\t\t\t\tlanguage: CodeLanguageType.JavaScript,\n\t\t\t\t})\n\t\t\t}\n\t\t\tcontinue\n\t\t}\n\n\t\tconst nameCap =\n\t\t\tcaptures.find(\n\t\t\t\t(c) =>\n\t\t\t\t\tc.name === \"name.definition.variable\" &&\n\t\t\t\t\tc.node.startIndex >= node.startIndex &&\n\t\t\t\t\tc.node.endIndex <= node.endIndex,\n\t\t\t) ||\n\t\t\tcaptures.find(\n\t\t\t\t(c) =>\n\t\t\t\t\tc.name === \"name.definition.member_variable\" &&\n\t\t\t\t\tc.node.startIndex >= node.startIndex &&\n\t\t\t\t\tc.node.endIndex <= node.endIndex,\n\t\t\t)\n\t\tif (!nameCap) continue\n\t\tconst name = sourceCode.substring(nameCap.node.startIndex, nameCap.node.endIndex)\n\n\t\t// Skip local variables (inside functions)\n\t\tconst scope = buildScopeChain(node)\n\n\t\t// Check if this is a member variable assignment (this.property)\n\t\tconst isMemberVariable = captures.some(\n\t\t\t(c) =>\n\t\t\t\tc.name === \"name.definition.member_variable\" &&\n\t\t\t\tc.node.startIndex >= node.startIndex &&\n\t\t\t\tc.node.endIndex <= node.endIndex &&\n\t\t\t\tsourceCode.substring(c.node.startIndex, c.node.endIndex) === name,\n\t\t)\n\n\t\t// A variable is local if it's inside any function (scope has function names)\n\t\t// But we need to allow class member variables (inside classes but not functions)\n\t\t// and this.property assignments even if they're inside constructors\n\t\tconst isInsideFunction =\n\t\t\tscope.length > 0 &&\n\t\t\tscope.some((scopeItem) => {\n\t\t\t\t// Check if this scope item is a function by looking at the node type\n\t\t\t\t// For now, we'll use a heuristic: if it's not a class name, it's likely a function\n\t\t\t\treturn !allClasses.some((cls) => cls.name === scopeItem)\n\t\t\t})\n\n\t\t// Skip if it's a local variable but not a member variable\n\t\tif (isInsideFunction && !isMemberVariable) continue\n\n\t\tconst rangeText = sourceCode.substring(node.startIndex, node.endIndex)\n\t\tconst snippetHash = generateSnippetHash(filePath, startLine, endLine, rangeText)\n\t\tif (seenHashes.has(snippetHash)) continue\n\t\tseenHashes.add(snippetHash)\n\n\t\t// Determine if this is a class member variable\n\t\tlet field: string | undefined = undefined\n\t\tlet variableType = \"global_variable\"\n\n\t\t// Check if variable is inside a class\n\t\tfor (const cls of allClasses) {\n\t\t\tif (startLine >= cls.startLine && endLine <= cls.endLine) {\n\t\t\t\tfield = cls.name\n\t\t\t\tvariableType = \"member_variable\"\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\n\t\t// Create definition text (just the variable name for member variables)\n\t\tlet definitionText = name\n\t\tif (variableType === \"global_variable\") {\n\t\t\t// For global variables, show the full declaration\n\t\t\tdefinitionText = replaceNewlinesWithSpaces(rangeText).trim()\n\t\t}\n\n\t\tsnippets.push({\n\t\t\tname,\n\t\t\ttype: SnippetType.VariableOrConstant,\n\t\t\tfilePath,\n\t\t\tstartLine,\n\t\t\tendLine,\n\t\t\trangeText,\n\t\t\tdefinitionText,\n\t\t\tscope,\n\t\t\tfileHash,\n\t\t\tfield,\n\t\t\tdefinition: {\n\t\t\t\tname,\n\t\t\t\ttype: variableType,\n\t\t\t},\n\t\t\tlanguage: CodeLanguageType.JavaScript,\n\t\t})\n\t}\n\n\t// Filter by requested snippet types\n\treturn snippets.filter((snippet) => snippetTypes.includes(snippet.type)).sort((a, b) => a.startLine - b.startLine)\n}\n\n/**\n * Split JavaScript parameters handling destructuring, defaults, rest parameters, etc.\n */\nfunction splitJavaScriptParameters(params: string): string[] {\n\tconst result: string[] = []\n\tlet current = \"\"\n\tlet braceDepth = 0\n\tlet bracketDepth = 0\n\tlet parenDepth = 0\n\tlet inString = false\n\tlet stringChar = \"\"\n\n\tfor (let i = 0; i < params.length; i++) {\n\t\tconst char = params[i]\n\t\tconst prevChar = i > 0 ? params[i - 1] : \"\"\n\n\t\t// Handle string literals\n\t\tif (!inString && (char === '\"' || char === \"'\" || char === \"`\")) {\n\t\t\tinString = true\n\t\t\tstringChar = char\n\t\t} else if (inString && char === stringChar && prevChar !== \"\\\\\") {\n\t\t\tinString = false\n\t\t\tstringChar = \"\"\n\t\t}\n\n\t\tif (!inString) {\n\t\t\t// Track nesting depth\n\t\t\tif (char === \"{\") braceDepth++\n\t\t\telse if (char === \"}\") braceDepth--\n\t\t\telse if (char === \"[\") bracketDepth++\n\t\t\telse if (char === \"]\") bracketDepth--\n\t\t\telse if (char === \"(\") parenDepth++\n\t\t\telse if (char === \")\") parenDepth--\n\t\t\telse if (char === \",\" && braceDepth === 0 && bracketDepth === 0 && parenDepth === 0) {\n\t\t\t\t// Split only at top-level commas\n\t\t\t\tif (current.trim()) {\n\t\t\t\t\tresult.push(current.trim())\n\t\t\t\t}\n\t\t\t\tcurrent = \"\"\n\t\t\t\tcontinue\n\t\t\t}\n\t\t}\n\n\t\tcurrent += char\n\t}\n\n\tif (current.trim()) {\n\t\tresult.push(current.trim())\n\t}\n\n\treturn result\n}\n// VSCode Outline Entry \u7C7B\u578B\nexport interface OutlineEntry {\n\ttype: string\n\tname: string\n\tfile: string // \u8868\u793A\u5F53\u524D\u6587\u4EF6\n\tfield?: string // \u7A7A\u5B57\u7B26\u4E32\u4EE3\u8868\u5F53\u524D\u6587\u4EF6\u7684global\n\tdescription?: string\n}\n\n/**\n * \u6839\u636E JavaScript \u6587\u4EF6\u7684\u6240\u6709 snippet \u751F\u6210\u5927\u7EB2\uFF08Outline\uFF09\uFF0C\u652F\u6301 import\u3001global variables\u3001function\u3001method\uFF08\u5E26 field\uFF09\u3001class\n */\nexport function buildSummaryFromSnippets(snippets: ISnippetMeta[]): OutlineEntry[] {\n\tconst outline: OutlineEntry[] = []\n\n\tfor (const s of snippets) {\n\t\t// \u5224\u65AD\u662F\u5426\u662F\u9876\u5C42\u9879\u6216\u7C7B\u6210\u5458\n\t\tconst isTopLevelFunction =\n\t\t\ts.type === SnippetType.FunctionOrMethod && !s.field && (!s.scope || s.scope.length === 0)\n\t\tconst isClassOrGlobalVar =\n\t\t\t(s.type === SnippetType.ClassOrInterfaceOrStructOrEnum || s.type === SnippetType.VariableOrConstant) &&\n\t\t\t!s.scope?.some((scopeItem) => scopeItem.startsWith(\"function\"))\n\t\tconst isMethodOrMemberVar = !!s.field\n\t\tconst isImport = s.type === SnippetType.ImportOrInclude\n\n\t\tif (!(isTopLevelFunction || isClassOrGlobalVar || isMethodOrMemberVar || isImport)) {\n\t\t\tcontinue\n\t\t}\n\n\t\tif (s.type === SnippetType.ImportOrInclude) {\n\t\t\toutline.push({\n\t\t\t\ttype: \"import\",\n\t\t\t\tname: s.name,\n\t\t\t\tfile: s.filePath,\n\t\t\t\tfield: \"\",\n\t\t\t\tdescription: s.definitionText,\n\t\t\t})\n\t\t} else if (s.type === SnippetType.FunctionOrMethod) {\n\t\t\tif (s.field) {\n\t\t\t\toutline.push({\n\t\t\t\t\ttype: \"method\",\n\t\t\t\t\tname: s.name,\n\t\t\t\t\tfile: s.filePath,\n\t\t\t\t\tfield: s.field,\n\t\t\t\t\tdescription: s.definitionText,\n\t\t\t\t})\n\t\t\t} else {\n\t\t\t\toutline.push({\n\t\t\t\t\ttype: \"function\",\n\t\t\t\t\tname: s.name,\n\t\t\t\t\tfile: s.filePath,\n\t\t\t\t\tfield: \"\",\n\t\t\t\t\tdescription: s.definitionText,\n\t\t\t\t})\n\t\t\t}\n\t\t} else if (s.type === SnippetType.VariableOrConstant) {\n\t\t\tconst t = s.definition?.type === \"global_variable\" ? \"variable\" : \"member_variable\"\n\t\t\t// \u5BF9\u4E8E\u6210\u5458\u53D8\u91CF\uFF0C\u663E\u793A\u4E0D\u5E26this.\u524D\u7F00\u7684\u540D\u79F0\n\t\t\tconst displayName = s.name.startsWith(\"this.\") ? s.name.substring(5) : s.name\n\t\t\toutline.push({\n\t\t\t\ttype: t,\n\t\t\t\tname: displayName,\n\t\t\t\tfile: s.filePath,\n\t\t\t\tfield: s.field || \"\",\n\t\t\t\tdescription: s.definitionText,\n\t\t\t})\n\t\t} else if (s.type === SnippetType.ClassOrInterfaceOrStructOrEnum) {\n\t\t\toutline.push({\n\t\t\t\ttype: \"class\",\n\t\t\t\tname: s.name,\n\t\t\t\tfile: s.filePath,\n\t\t\t\tfield: \"\",\n\t\t\t\tdescription: s.name,\n\t\t\t})\n\t\t}\n\t}\n\n\treturn outline\n}\n\n/**\n * \u5C06 OutlineEntry[] \u683C\u5F0F\u5316\u4E3A\u6587\u672C\uFF0C\u540C\u4E00\u4E2A field \u7684\u653E\u5728\u4E00\u8D77\u3002\n * @param outline OutlineEntry[]\n * @returns string\n */\nexport function formatOutlineText(outline: OutlineEntry[]): string {\n\t// \u6309 field \u5206\u7EC4\n\tconst groups: Record<string, OutlineEntry[]> = {}\n\tfor (const entry of outline) {\n\t\tconst key = entry.field ?? \"\"\n\t\tif (!groups[key]) groups[key] = []\n\t\tgroups[key].push(entry)\n\t}\n\n\t// \u5408\u6210\u6587\u672C\n\tlet result = \"\"\n\tfor (const field of Object.keys(groups).sort()) {\n\t\tif (groups[field].length === 0) continue\n\t\tconst group = groups[field]\n\t\tconst title = field === \"\" ? \"[global]\" : `[${field}]`\n\t\tresult += title + \"\\n\"\n\t\tfor (const entry of group) {\n\t\t\tlet line = ` ${entry.type}`\n\t\t\t// \u5BF9\u4E8E\u53D8\u91CF\u7C7B\u578B\uFF0C\u663E\u793A\u540D\u79F0\u800C\u4E0D\u662F\u5B8C\u6574\u63CF\u8FF0\n\t\t\tif (entry.type === \"variable\" || entry.type === \"member_variable\") {\n\t\t\t\tline += `: ${entry.name}`\n\t\t\t} else if (entry.description) {\n\t\t\t\tline += `: ${replaceNewlinesWithSpaces(entry.description)}`\n\t\t\t}\n\t\t\tresult += line + \"\\n\"\n\t\t}\n\t\tresult += \"\\n\"\n\t}\n\treturn result.trimEnd()\n}\n", "import { SnippetType, ISnippetMeta, ParameterInfo, CodeLanguageType } from \"../types\"\nimport Parser from \"web-tree-sitter\"\nimport { generateSnippetHash, buildScopeChain } from \"./general\"\nimport { extractSnippetsFromCapturesForJavaScript } from \"./javascript\"\n\nexport async function extractSnippetsFromCapturesForJSX(\n\tcaptures: Parser.QueryCapture[],\n\tsourceCode: string,\n\tfilePath: string,\n\tfileHash: string,\n\tsnippetTypes: SnippetType[],\n\toptions: { maxSnippetLines: number; minSnippetLines: number },\n): Promise<ISnippetMeta[]> {\n\t// \u9996\u5148\u8BA9JavaScript\u5904\u7406\u5668\u5904\u7406\u57FA\u7840\u7684\u51FD\u6570\u548C\u53D8\u91CF\n\tconst jsSnippets = await extractSnippetsFromCapturesForJavaScript(\n\t\tcaptures,\n\t\tsourceCode,\n\t\tfilePath,\n\t\tfileHash,\n\t\tsnippetTypes,\n\t\toptions,\n\t)\n\n\t// \u66F4\u65B0language\u5B57\u6BB5\u4E3AJSX\uFF0C\u5E76\u4FEE\u6539definition\u7C7B\u578B\u4EE5\u7B26\u5408React\u60EF\u4F8B\n\tfor (const snippet of jsSnippets) {\n\t\tsnippet.language = CodeLanguageType.JSX\n\n\t\t// \u4FEE\u6539\u51FD\u6570\u7684definition\u7C7B\u578B\u4E3Areact_component\n\t\tif (snippet.type === SnippetType.FunctionOrMethod && snippet.definition?.type === \"function\") {\n\t\t\tsnippet.definition.type = \"react_component\"\n\n\t\t\t// \u6539\u8FDB\u53C2\u6570\u89E3\u6790 - \u89E3\u6784\u53C2\u6570\n\t\t\tif (snippet.parameters && snippet.parameters.length > 0) {\n\t\t\t\tconst improvedParams: ParameterInfo[] = []\n\t\t\t\tfor (const param of snippet.parameters) {\n\t\t\t\t\t// \u5904\u7406\u89E3\u6784\u53C2\u6570 {name, age, email}\n\t\t\t\t\tif (param.name.includes(\"{\") && param.name.includes(\"}\")) {\n\t\t\t\t\t\tconst openBrace = param.name.indexOf(\"{\")\n\t\t\t\t\t\tconst closeBrace = param.name.indexOf(\"}\")\n\t\t\t\t\t\tif (openBrace !== -1 && closeBrace !== -1 && closeBrace > openBrace) {\n\t\t\t\t\t\t\tconst destructuredContent = param.name.substring(openBrace + 1, closeBrace)\n\t\t\t\t\t\t\tconst destructuredParams = destructuredContent.split(\",\").map((p) => {\n\t\t\t\t\t\t\t\t// \u79FB\u9664\u9ED8\u8BA4\u503C - \u4F7F\u7528indexOf\u800C\u4E0D\u662F\u6B63\u5219\u8868\u8FBE\u5F0F\n\t\t\t\t\t\t\t\tconst equalIndex = p.indexOf(\"=\")\n\t\t\t\t\t\t\t\tconst cleanParam = equalIndex !== -1 ? p.substring(0, equalIndex).trim() : p.trim()\n\t\t\t\t\t\t\t\treturn cleanParam\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\timprovedParams.push(...destructuredParams.map((p) => ({ name: p })))\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\timprovedParams.push(param)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tsnippet.parameters = improvedParams\n\n\t\t\t\t// \u66F4\u65B0\u7B7E\u540D\n\t\t\t\tconst paramStr = improvedParams.map((p) => p.name).join(\", \")\n\t\t\t\tsnippet.signature = `${snippet.name}(${paramStr})`\n\t\t\t}\n\t\t} else if (snippet.type === SnippetType.FunctionOrMethod && snippet.definition?.type === \"arrow function\") {\n\t\t\tsnippet.definition.type = \"react_component\"\n\n\t\t\t// \u6539\u8FDB\u53C2\u6570\u89E3\u6790 - \u89E3\u6784\u53C2\u6570\n\t\t\tif (snippet.parameters && snippet.parameters.length > 0) {\n\t\t\t\tconst improvedParams: ParameterInfo[] = []\n\t\t\t\tfor (const param of snippet.parameters) {\n\t\t\t\t\t// \u5904\u7406\u89E3\u6784\u53C2\u6570 {name, age, email}\n\t\t\t\t\tif (param.name.includes(\"{\") && param.name.includes(\"}\")) {\n\t\t\t\t\t\t// \u4F7F\u7528indexOf\u548Csubstring\u66FF\u4EE3\u6B63\u5219\u8868\u8FBE\u5F0F\n\t\t\t\t\t\tconst openBrace = param.name.indexOf(\"{\")\n\t\t\t\t\t\tconst closeBrace = param.name.indexOf(\"}\")\n\t\t\t\t\t\tif (openBrace !== -1 && closeBrace !== -1 && closeBrace > openBrace) {\n\t\t\t\t\t\t\tconst destructuredContent = param.name.substring(openBrace + 1, closeBrace)\n\t\t\t\t\t\t\tconst destructuredParams = destructuredContent.split(\",\").map((p) => {\n\t\t\t\t\t\t\t\t// \u79FB\u9664\u9ED8\u8BA4\u503C - \u4F7F\u7528indexOf\u800C\u4E0D\u662F\u6B63\u5219\u8868\u8FBE\u5F0F\n\t\t\t\t\t\t\t\tconst equalIndex = p.indexOf(\"=\")\n\t\t\t\t\t\t\t\tconst cleanParam = equalIndex !== -1 ? p.substring(0, equalIndex).trim() : p.trim()\n\t\t\t\t\t\t\t\treturn cleanParam\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\timprovedParams.push(...destructuredParams.map((p) => ({ name: p })))\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\timprovedParams.push(param)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tsnippet.parameters = improvedParams\n\n\t\t\t\t// \u66F4\u65B0\u7B7E\u540D\n\t\t\t\tconst paramStr = improvedParams.map((p) => p.name).join(\", \")\n\t\t\t\tsnippet.signature = `${snippet.name}(${paramStr})`\n\t\t\t}\n\t\t} else if (\n\t\t\tsnippet.type === SnippetType.ClassOrInterfaceOrStructOrEnum &&\n\t\t\tsnippet.definition?.type === \"class\"\n\t\t) {\n\t\t\tsnippet.definition.type = \"react_class_component\"\n\t\t} else if (snippet.type === SnippetType.ImportOrInclude && snippet.definition?.type === \"import\") {\n\t\t\tsnippet.definition.type = \"react_import\"\n\t\t}\n\n\t\t// \u4FEE\u6539\u81EA\u5B9A\u4E49hook\uFF08\u4EE5use\u5F00\u5934\u7684\u51FD\u6570\uFF09\u7684definition\u7C7B\u578B\n\t\tif (\n\t\t\tsnippet.type === SnippetType.FunctionOrMethod &&\n\t\t\tsnippet.name.startsWith(\"use\") &&\n\t\t\tsnippet.definition?.type === \"react_component\"\n\t\t) {\n\t\t\tsnippet.definition.type = \"react_custom_hook\"\n\n\t\t\t// \u6539\u8FDB\u81EA\u5B9A\u4E49hook\u7684\u53C2\u6570\u89E3\u6790 - \u4F7F\u7528tree-sitter\u800C\u975E\u6B63\u5219\u8868\u8FBE\u5F0F\n\t\t\tif (snippet.parameters && snippet.parameters.length > 0) {\n\t\t\t\tconst improvedParams: ParameterInfo[] = []\n\t\t\t\tfor (const param of snippet.parameters) {\n\t\t\t\t\t// \u79FB\u9664\u9ED8\u8BA4\u503C\n\t\t\t\t\tconst equalIndex = param.name.indexOf(\"=\")\n\t\t\t\t\tconst cleanName = equalIndex !== -1 ? param.name.substring(0, equalIndex).trim() : param.name\n\t\t\t\t\timprovedParams.push({ name: cleanName })\n\t\t\t\t}\n\t\t\t\tsnippet.parameters = improvedParams\n\n\t\t\t\t// \u66F4\u65B0\u7B7E\u540D\n\t\t\t\tconst paramStr = improvedParams.map((p) => p.name).join(\", \")\n\t\t\t\tsnippet.signature = `${snippet.name}(${paramStr})`\n\t\t\t}\n\t\t}\n\t}\n\n\tconst snippets: ISnippetMeta[] = [...jsSnippets]\n\tconst seenHashes = new Set<string>()\n\n\t// \u586B\u5145\u5DF2\u89C1\u8FC7\u7684\u54C8\u5E0C\u503C\n\tfor (const snippet of snippets) {\n\t\tconst hash = generateSnippetHash(snippet.filePath, snippet.startLine, snippet.endLine, snippet.rangeText)\n\t\tseenHashes.add(hash)\n\t}\n\n\t// === JSX Elements ===\n\tfor (const capture of captures) {\n\t\tif (capture.name !== \"definition.jsx_element\") continue\n\n\t\tconst node = capture.node\n\t\tconst startLine = node.startPosition.row + 1\n\t\tconst endLine = node.endPosition.row + 1\n\n\t\t// Find JSX component name\n\t\tconst nameCap = captures.find(\n\t\t\t(c) =>\n\t\t\t\tc.name === \"name.jsx_element\" &&\n\t\t\t\tc.node.startIndex >= node.startIndex &&\n\t\t\t\tc.node.endIndex <= node.endIndex,\n\t\t)\n\t\tif (!nameCap) continue\n\t\tconst name = sourceCode.substring(nameCap.node.startIndex, nameCap.node.endIndex)\n\n\t\t// Only capture custom components (starting with uppercase) - using character comparison instead of regex\n\t\tconst firstChar = name.charAt(0)\n\t\tif (firstChar < \"A\" || firstChar > \"Z\") continue\n\n\t\tconst rangeText = sourceCode.substring(node.startIndex, node.endIndex)\n\t\tconst snippetHash = generateSnippetHash(filePath, startLine, endLine, rangeText)\n\t\tif (seenHashes.has(snippetHash)) continue\n\t\tseenHashes.add(snippetHash)\n\n\t\tconst scope = buildScopeChain(node)\n\n\t\tsnippets.push({\n\t\t\tname,\n\t\t\tsignature: `<${name}>`,\n\t\t\tparameters: [],\n\t\t\ttype: SnippetType.VariableOrConstant,\n\t\t\tfilePath,\n\t\t\tstartLine,\n\t\t\tendLine,\n\t\t\trangeText,\n\t\t\timplementText: rangeText,\n\t\t\tscope,\n\t\t\tfileHash,\n\t\t\tlanguage: CodeLanguageType.JSX,\n\t\t\tdefinition: {\n\t\t\t\tname,\n\t\t\t\ttype: \"jsx_element\",\n\t\t\t\tparameters: [],\n\t\t\t},\n\t\t})\n\t}\n\n\t// === Process array patterns for useState hooks ===\n\tfor (const capture of captures) {\n\t\tif (capture.name !== \"array_pattern\") continue\n\n\t\tconst node = capture.node\n\t\tconst startLine = node.startPosition.row + 1\n\t\tconst endLine = node.endPosition.row + 1\n\n\t\t// \u68C0\u67E5\u662F\u5426\u662FuseState\u7684\u89E3\u6784\n\t\tconst parentNode = node.parent\n\t\tif (!parentNode || parentNode.type !== \"variable_declarator\") continue\n\n\t\tconst valueNode = parentNode.namedChild(1) // value\u8282\u70B9\n\t\tif (!valueNode || valueNode.type !== \"call_expression\") continue\n\n\t\tconst functionNode = valueNode.namedChild(0) // function\u8282\u70B9\n\t\tif (!functionNode || functionNode.type !== \"identifier\") continue\n\n\t\tconst functionName = sourceCode.substring(functionNode.startIndex, functionNode.endIndex)\n\t\tif (functionName !== \"useState\") continue\n\n\t\t// \u83B7\u53D6\u89E3\u6784\u7684\u53D8\u91CF\u540D\n\t\tconst firstIdentifier = node.namedChild(0)\n\t\tconst secondIdentifier = node.namedChild(1)\n\n\t\tif (\n\t\t\t!firstIdentifier ||\n\t\t\t!secondIdentifier ||\n\t\t\tfirstIdentifier.type !== \"identifier\" ||\n\t\t\tsecondIdentifier.type !== \"identifier\"\n\t\t) {\n\t\t\tcontinue\n\t\t}\n\n\t\tconst stateName = sourceCode.substring(firstIdentifier.startIndex, firstIdentifier.endIndex)\n\t\tconst setterName = sourceCode.substring(secondIdentifier.startIndex, secondIdentifier.endIndex)\n\t\tconst rangeText = sourceCode.substring(parentNode.startIndex, parentNode.endIndex)\n\t\tconst snippetHash = generateSnippetHash(filePath, startLine, endLine, rangeText)\n\t\tif (seenHashes.has(snippetHash)) continue\n\t\tseenHashes.add(snippetHash)\n\n\t\tconst scope = buildScopeChain(node)\n\n\t\tsnippets.push({\n\t\t\tname: stateName,\n\t\t\tsignature: `useState()`,\n\t\t\tparameters: [],\n\t\t\ttype: SnippetType.VariableOrConstant,\n\t\t\tfilePath,\n\t\t\tstartLine,\n\t\t\tendLine,\n\t\t\trangeText,\n\t\t\timplementText: rangeText,\n\t\t\tscope,\n\t\t\tfileHash,\n\t\t\tlanguage: CodeLanguageType.JSX,\n\t\t\tdefinition: {\n\t\t\t\tname: stateName,\n\t\t\t\ttype: \"react_hook\",\n\t\t\t\tparameters: [],\n\t\t\t},\n\t\t})\n\t}\n\n\t// === Process useEffect and other hooks ===\n\tfor (const capture of captures) {\n\t\tif (capture.name !== \"name.definition.function\") continue\n\n\t\tconst node = capture.node\n\t\tconst functionName = sourceCode.substring(node.startIndex, node.endIndex)\n\n\t\t// \u53EA\u5904\u7406React hooks\n\t\tif (!functionName.startsWith(\"use\")) continue\n\n\t\tconst startLine = node.startPosition.row + 1\n\t\tconst endLine = node.endPosition.row + 1\n\n\t\t// \u627E\u5230\u8C03\u7528\u8868\u8FBE\u5F0F\u7684\u7236\u8282\u70B9\n\t\tlet callExpressionNode = node.parent\n\t\twhile (callExpressionNode && callExpressionNode.type !== \"call_expression\") {\n\t\t\tcallExpressionNode = callExpressionNode.parent\n\t\t}\n\n\t\tif (!callExpressionNode) continue\n\n\t\t// \u8DF3\u8FC7\u5DF2\u7ECF\u5904\u7406\u8FC7\u7684useState hooks\uFF08\u907F\u514D\u91CD\u590D\uFF09\n\t\tif (functionName === \"useState\") {\n\t\t\t// \u68C0\u67E5\u662F\u5426\u662F\u89E3\u6784\u8D4B\u503C\n\t\t\tlet parentNode = callExpressionNode.parent\n\t\t\twhile (parentNode && parentNode.type !== \"variable_declarator\") {\n\t\t\t\tparentNode = parentNode.parent\n\t\t\t}\n\t\t\tif (parentNode) {\n\t\t\t\tconst nameNode = parentNode.namedChild(0)\n\t\t\t\tif (nameNode && nameNode.type === \"array_pattern\") {\n\t\t\t\t\tcontinue // \u8DF3\u8FC7\uFF0C\u56E0\u4E3A\u5DF2\u7ECF\u5728useState\u5904\u7406\u4E2D\u5904\u7406\u4E86\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tconst rangeText = sourceCode.substring(callExpressionNode.startIndex, callExpressionNode.endIndex)\n\t\tconst snippetHash = generateSnippetHash(filePath, startLine, endLine, rangeText)\n\t\tif (seenHashes.has(snippetHash)) continue\n\t\tseenHashes.add(snippetHash)\n\n\t\tconst scope = buildScopeChain(node)\n\n\t\tsnippets.push({\n\t\t\tname: functionName,\n\t\t\tsignature: `${functionName}()`,\n\t\t\tparameters: [],\n\t\t\ttype: SnippetType.VariableOrConstant,\n\t\t\tfilePath,\n\t\t\tstartLine,\n\t\t\tendLine,\n\t\t\trangeText,\n\t\t\timplementText: rangeText,\n\t\t\tscope,\n\t\t\tfileHash,\n\t\t\tlanguage: CodeLanguageType.JSX,\n\t\t\tdefinition: {\n\t\t\t\tname: functionName,\n\t\t\t\ttype: \"react_hook\",\n\t\t\t\tparameters: [],\n\t\t\t},\n\t\t})\n\t}\n\n\t// === Process HOCs ===\n\tfor (const capture of captures) {\n\t\tif (capture.name !== \"name.definition.variable\") continue\n\n\t\tconst node = capture.node\n\t\tconst variableName = sourceCode.substring(node.startIndex, node.endIndex)\n\n\t\t// \u627E\u5230\u53D8\u91CF\u58F0\u660E\u7684\u7236\u8282\u70B9\n\t\tlet declaratorNode = node.parent\n\t\twhile (declaratorNode && declaratorNode.type !== \"variable_declarator\") {\n\t\t\tdeclaratorNode = declaratorNode.parent\n\t\t}\n\n\t\tif (!declaratorNode) continue\n\n\t\t// \u68C0\u67E5\u662F\u5426\u662F\u51FD\u6570\u8C03\u7528\u8D4B\u503C\n\t\tconst valueNode = declaratorNode.namedChild(1)\n\t\tif (!valueNode || valueNode.type !== \"call_expression\") continue\n\n\t\tconst functionNode = valueNode.namedChild(0)\n\t\tif (!functionNode || functionNode.type !== \"identifier\") continue\n\n\t\tconst functionName = sourceCode.substring(functionNode.startIndex, functionNode.endIndex)\n\n\t\t// Simple HOC detection: function name starts with uppercase or with \"with\" - using character comparison instead of regex\n\t\tconst firstChar = functionName.charAt(0)\n\t\tconst isUppercase = firstChar >= \"A\" && firstChar <= \"Z\"\n\t\tconst startsWithWith = functionName.startsWith(\"with\")\n\n\t\tif (!isUppercase && !startsWithWith) continue\n\n\t\tconst startLine = node.startPosition.row + 1\n\t\tconst endLine = node.endPosition.row + 1\n\n\t\tconst rangeText = sourceCode.substring(declaratorNode.startIndex, declaratorNode.endIndex)\n\t\tconst snippetHash = generateSnippetHash(filePath, startLine, endLine, rangeText)\n\t\tif (seenHashes.has(snippetHash)) continue\n\t\tseenHashes.add(snippetHash)\n\n\t\tconst scope = buildScopeChain(node)\n\n\t\tsnippets.push({\n\t\t\tname: variableName,\n\t\t\tsignature: `${functionName}(${variableName})`,\n\t\t\tparameters: [],\n\t\t\ttype: SnippetType.FunctionOrMethod,\n\t\t\tfilePath,\n\t\t\tstartLine,\n\t\t\tendLine,\n\t\t\trangeText,\n\t\t\timplementText: rangeText,\n\t\t\tscope,\n\t\t\tfileHash,\n\t\t\tlanguage: CodeLanguageType.JSX,\n\t\t\tdefinition: {\n\t\t\t\tname: variableName,\n\t\t\t\ttype: \"react_hoc\",\n\t\t\t\tparameters: [],\n\t\t\t},\n\t\t})\n\t}\n\n\treturn snippets\n}\n\nexport interface OutlineEntry {\n\ttype: string\n\tname: string\n\tfile: string // \u8868\u793A\u5F53\u524D\u6587\u4EF6\n\tfield?: string // \u7A7A\u5B57\u7B26\u4E32\u4EE3\u8868\u5F53\u524D\u6587\u4EF6\u7684global\n\tdescription?: string\n}\n\n/**\n * \u6839\u636E JSX \u6587\u4EF6\u7684\u6240\u6709 snippet \u751F\u6210\u5927\u7EB2\uFF08Outline\uFF09\uFF0C\u652F\u6301 import\u3001component\u3001class\u3001hook\u3001jsx_element\u3001variable\n */\nexport function buildSummaryFromSnippets(snippets: ISnippetMeta[]): OutlineEntry[] {\n\tconst outline: OutlineEntry[] = []\n\n\t// \u5728JSX\u4E2D\uFF0C\u6211\u4EEC\u5E94\u8BE5\u5305\u542B\u6240\u6709\u9876\u7EA7\u5B9A\u4E49\uFF08\u4E0D\u5728\u65B9\u6CD5\u5185\u90E8\u7684\uFF09\n\t// \u5305\u62EC\u7EC4\u4EF6\u3001\u7C7B\u3001hooks\u3001JSX\u5143\u7D20\u3001\u53D8\u91CF\u7B49\n\tconst isTopLevel = (s: ISnippetMeta) => {\n\t\t// \u5982\u679Cscope\u4E3A\u7A7A\u6216\u8005\u53EA\u6709\u4E00\u5C42\uFF08\u6BD4\u5982\u53EA\u6709\u7EC4\u4EF6\u540D\uFF09\uFF0C\u5219\u8BA4\u4E3A\u662F\u9876\u7EA7\n\t\treturn !s.scope || s.scope.length <= 1\n\t}\n\n\tfor (const s of snippets) {\n\t\tif (!isTopLevel(s)) continue\n\t\t// Skip imports - focus on file-level definitions only\n\t\tif (s.type === SnippetType.ImportOrInclude) {\n\t\t\tcontinue\n\t\t} else if (s.type === SnippetType.FunctionOrMethod) {\n\t\t\tconst definitionType = s.definition?.type\n\t\t\tif (definitionType === \"react_component\") {\n\t\t\t\toutline.push({\n\t\t\t\t\ttype: \"component\",\n\t\t\t\t\tname: s.name,\n\t\t\t\t\tfile: s.filePath,\n\t\t\t\t\tfield: \"\",\n\t\t\t\t\tdescription: s.signature,\n\t\t\t\t})\n\t\t\t} else if (definitionType === \"react_custom_hook\") {\n\t\t\t\toutline.push({\n\t\t\t\t\ttype: \"custom_hook\",\n\t\t\t\t\tname: s.name,\n\t\t\t\t\tfile: s.filePath,\n\t\t\t\t\tfield: \"\",\n\t\t\t\t\tdescription: s.signature,\n\t\t\t\t})\n\t\t\t} else {\n\t\t\t\toutline.push({\n\t\t\t\t\ttype: \"function\",\n\t\t\t\t\tname: s.name,\n\t\t\t\t\tfile: s.filePath,\n\t\t\t\t\tfield: s.field || \"\",\n\t\t\t\t\tdescription: s.signature,\n\t\t\t\t})\n\t\t\t}\n\t\t} else if (s.type === SnippetType.ClassOrInterfaceOrStructOrEnum) {\n\t\t\toutline.push({\n\t\t\t\ttype: \"class\",\n\t\t\t\tname: s.name,\n\t\t\t\tfile: s.filePath,\n\t\t\t\tfield: \"\",\n\t\t\t\tdescription: s.signature || s.name,\n\t\t\t})\n\t\t} else if (s.type === SnippetType.VariableOrConstant) {\n\t\t\tconst definitionType = s.definition?.type\n\t\t\tif (definitionType === \"react_hook\") {\n\t\t\t\toutline.push({\n\t\t\t\t\ttype: \"hook\",\n\t\t\t\t\tname: s.name,\n\t\t\t\t\tfile: s.filePath,\n\t\t\t\t\tfield: \"\",\n\t\t\t\t\tdescription: s.signature,\n\t\t\t\t})\n\t\t\t} else if (definitionType === \"jsx_element\") {\n\t\t\t\toutline.push({\n\t\t\t\t\ttype: \"jsx_element\",\n\t\t\t\t\tname: s.name,\n\t\t\t\t\tfile: s.filePath,\n\t\t\t\t\tfield: \"\",\n\t\t\t\t\tdescription: s.signature,\n\t\t\t\t})\n\t\t\t} else {\n\t\t\t\toutline.push({\n\t\t\t\t\ttype: \"variable\",\n\t\t\t\t\tname: s.name,\n\t\t\t\t\tfile: s.filePath,\n\t\t\t\t\tfield: s.field || \"\",\n\t\t\t\t\tdescription: s.signature || s.name,\n\t\t\t\t})\n\t\t\t}\n\t\t}\n\t}\n\n\treturn outline\n}\n\nexport function formatOutlineText(outline: OutlineEntry[]): string {\n\t// \u6309\u7C7B\u578B\u5206\u7EC4\n\tconst groups: Record<string, OutlineEntry[]> = {}\n\tfor (const entry of outline) {\n\t\tconst key = entry.type\n\t\tif (!groups[key]) groups[key] = []\n\t\tgroups[key].push(entry)\n\t}\n\n\t// \u5408\u6210\u6587\u672C\n\tlet result = \"\"\n\tconst typeOrder = [\"component\", \"class\", \"custom_hook\", \"hook\", \"jsx_element\", \"function\", \"variable\"]\n\tconst typeLabels: Record<string, string> = {\n\t\tcomponent: \"## React Components\",\n\t\tclass: \"## Classes\",\n\t\tcustom_hook: \"## Custom Hooks\",\n\t\thook: \"## React Hooks\",\n\t\tjsx_element: \"## JSX Elements\",\n\t\tfunction: \"## Functions\",\n\t\tvariable: \"## Variables\",\n\t}\n\n\tfor (const type of typeOrder) {\n\t\tconst group = groups[type]\n\t\tif (!group || group.length === 0) continue\n\n\t\tresult += typeLabels[type] + \"\\n\"\n\t\tfor (const entry of group) {\n\t\t\tresult += `- ${entry.description || entry.name}\\n`\n\t\t}\n\t\tresult += \"\\n\"\n\t}\n\n\treturn result\n}\n", "import { SnippetType, ISnippetMeta, ParameterInfo, CodeLanguageType } from \"../types\"\nimport Parser from \"web-tree-sitter\"\nimport { generateSnippetHash, buildScopeChain } from \"./general\"\nimport { Logger } from \"../Logger\"\n\nexport async function extractSnippetsFromCapturesForTypeScript(\n\tcaptures: Parser.QueryCapture[],\n\tsourceCode: string,\n\tfilePath: string,\n\tfileHash: string,\n\tsnippetTypes: SnippetType[],\n\toptions: { maxSnippetLines: number; minSnippetLines: number },\n): Promise<ISnippetMeta[]> {\n\tconst logger = Logger.getDefaultLogger().with(\"[TS extract]\")\n\tconst snippets: ISnippetMeta[] = []\n\tconst seen = new Set<string>()\n\tif (snippetTypes.length === 0) return snippets\n\n\t// --- imports ---\n\tfor (const c of captures.filter((c) => c.name === \"name.import\")) {\n\t\tconst node = c.node\n\t\tconst startLine = node.startPosition.row + 1\n\t\tconst endLine = node.endPosition.row + 1\n\t\tconst text = sourceCode.slice(node.startIndex, node.endIndex)\n\t\tconst hash = generateSnippetHash(filePath, startLine, endLine, text)\n\t\tif (seen.has(hash)) continue\n\t\tseen.add(hash)\n\t\tsnippets.push({\n\t\t\tname: text,\n\t\t\ttype: SnippetType.ImportOrInclude,\n\t\t\tfilePath,\n\t\t\tstartLine,\n\t\t\tendLine,\n\t\t\trangeText: text,\n\t\t\tdefinitionText: text,\n\t\t\tscope: buildScopeChain(node),\n\t\t\tfileHash,\n\t\t})\n\t}\n\n\t// --- functions & methods ---\n\tfor (const def of captures.filter((c) => c.name === \"definition.function\" || c.name === \"definition.method\")) {\n\t\tconst node = def.node\n\t\tconst startLine = node.startPosition.row + 1\n\t\tconst endLine = node.endPosition.row + 1\n\n\t\t// \u540D\u79F0\n\t\tconst nameCap = captures.find(\n\t\t\t(c) =>\n\t\t\t\tc.name === (def.name === \"definition.method\" ? \"name.method\" : \"name.function\") &&\n\t\t\t\tc.node.startIndex >= node.startIndex &&\n\t\t\t\tc.node.endIndex <= node.endIndex,\n\t\t)\n\t\tif (!nameCap) continue\n\t\tconst name = sourceCode.slice(nameCap.node.startIndex, nameCap.node.endIndex)\n\n\t\t// \u53C2\u6570\u5217\u8868\n\t\tconst paramsCap = captures.find(\n\t\t\t(c) =>\n\t\t\t\tc.name === \"parameters.function\" &&\n\t\t\t\tc.node.startIndex >= node.startIndex &&\n\t\t\t\tc.node.endIndex <= node.endIndex,\n\t\t)\n\t\tconst parameters: ParameterInfo[] = []\n\t\tif (paramsCap) {\n\t\t\tconst raw = sourceCode.slice(paramsCap.node.startIndex, paramsCap.node.endIndex)\n\t\t\traw.replace(/^\\(|\\)$/g, \"\")\n\t\t\t\t.split(\",\")\n\t\t\t\t.map((p) => p.trim())\n\t\t\t\t.filter((p) => p)\n\t\t\t\t.forEach((p) => parameters.push({ name: p }))\n\t\t}\n\n\t\t// \u662F\u5426\u662F\u7C7B\u65B9\u6CD5\n\t\tconst isMethod = def.name === \"definition.method\"\n\t\t// \u63D0\u53D6\u65B9\u6CD5\u6240\u5C5E class\n\t\tlet field: string | undefined\n\t\tif (isMethod) {\n\t\t\t// \u5728TypeScript\u4E2D\uFF0Cmethod\u5728class\u5185\u90E8\uFF0C\u6240\u4EE5\u67E5\u627E\u5305\u542B\u8FD9\u4E2Amethod\u7684class\n\t\t\t// \u9700\u8981\u627E\u5230\u5305\u542B\u5F53\u524Dmethod\u8282\u70B9\u7684class declaration\n\t\t\tconst classDefCap = captures.find(\n\t\t\t\t(c) =>\n\t\t\t\t\tc.name === \"definition.class\" &&\n\t\t\t\t\tc.node.startIndex < node.startIndex &&\n\t\t\t\t\tc.node.endIndex > node.endIndex,\n\t\t\t)\n\t\t\tif (classDefCap) {\n\t\t\t\tconst classCap = captures.find(\n\t\t\t\t\t(c) =>\n\t\t\t\t\t\tc.name === \"name.class\" &&\n\t\t\t\t\t\tc.node.startIndex >= classDefCap.node.startIndex &&\n\t\t\t\t\t\tc.node.endIndex <= classDefCap.node.endIndex,\n\t\t\t\t)\n\t\t\t\tif (classCap) {\n\t\t\t\t\tfield = sourceCode.slice(classCap.node.startIndex, classCap.node.endIndex)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// \u7B7E\u540D\u3001hash\n\t\tconst sig = `${name}(${parameters.map((p) => p.name).join(\", \")})`\n\t\tconst hash = generateSnippetHash(filePath, startLine, endLine, sig)\n\t\tif (seen.has(hash)) continue\n\t\tseen.add(hash)\n\n\t\tsnippets.push({\n\t\t\tname,\n\t\t\ttype: SnippetType.FunctionOrMethod,\n\t\t\tfilePath,\n\t\t\tstartLine,\n\t\t\tendLine,\n\t\t\trangeText: sourceCode.slice(node.startIndex, node.endIndex),\n\t\t\tdefinitionText: sig,\n\t\t\tscope: buildScopeChain(node),\n\t\t\tfileHash,\n\t\t\tfield,\n\t\t\tparameters,\n\t\t\tsignature: sig,\n\t\t\tdefinition: {\n\t\t\t\tname,\n\t\t\t\ttype: def.name === \"definition.method\" ? \"method\" : \"function\",\n\t\t\t\tparameters,\n\t\t\t\treturnType: \"\",\n\t\t\t},\n\t\t\tlanguage: CodeLanguageType.TypeScript,\n\t\t\timplementText: sourceCode.slice(node.startIndex, node.endIndex),\n\t\t})\n\t}\n\n\t// --- classes / interfaces / enums / types ---\n\tconst typeDefs = [\n\t\t{\n\t\t\tname: \"name.class\",\n\t\t\tdef: \"definition.class\",\n\t\t\tkind: \"class\",\n\t\t\ttype: SnippetType.ClassOrInterfaceOrStructOrEnum,\n\t\t},\n\t\t{\n\t\t\tname: \"name.interface\",\n\t\t\tdef: \"definition.interface\",\n\t\t\tkind: \"interface\",\n\t\t\ttype: SnippetType.ClassOrInterfaceOrStructOrEnum,\n\t\t},\n\t\t{ name: \"name.enum\", def: \"definition.enum\", kind: \"enum\", type: SnippetType.ClassOrInterfaceOrStructOrEnum },\n\t\t{\n\t\t\tname: \"name.type_alias\",\n\t\t\tdef: \"definition.type_alias\",\n\t\t\tkind: \"type\",\n\t\t\ttype: SnippetType.ClassOrInterfaceOrStructOrEnum,\n\t\t},\n\t]\n\tfor (const { name: capName, def: defName, kind, type } of typeDefs) {\n\t\tfor (const c of captures.filter((c) => c.name === capName)) {\n\t\t\tconst node = c.node\n\t\t\tconst startLine = node.startPosition.row + 1\n\t\t\tconst endLine = node.endPosition.row + 1\n\t\t\tconst text = sourceCode.slice(node.startIndex, node.endIndex)\n\n\t\t\t// \u5224\u65AD\u662F\u5426\u5728\u51FD\u6570/\u65B9\u6CD5\u5185\n\t\t\tconst inFunc = captures.some(\n\t\t\t\t(fc) =>\n\t\t\t\t\t(fc.name === \"definition.function\" || fc.name === \"definition.method\") &&\n\t\t\t\t\tfc.node.startIndex < node.startIndex &&\n\t\t\t\t\tnode.endIndex < fc.node.endIndex,\n\t\t\t)\n\t\t\tif (inFunc) continue\n\n\t\t\t// \u4F18\u5148\u4F7F\u7528definition\u533A\u95F4\n\t\t\tconst defCap = captures.find(\n\t\t\t\t(dc) =>\n\t\t\t\t\tdc.name === defName && dc.node.startIndex <= node.startIndex && node.endIndex <= dc.node.endIndex,\n\t\t\t)\n\t\t\tconst defNode = defCap ? defCap.node : node.parent || node\n\n\t\t\tconst hash = generateSnippetHash(filePath, startLine, endLine, text)\n\t\t\tif (seen.has(hash)) continue\n\t\t\tseen.add(hash)\n\n\t\t\tsnippets.push({\n\t\t\t\tname: text,\n\t\t\t\ttype,\n\t\t\t\tfilePath,\n\t\t\t\tstartLine,\n\t\t\t\tendLine,\n\t\t\t\trangeText: sourceCode.slice(defNode.startIndex, defNode.endIndex),\n\t\t\t\tdefinitionText: text,\n\t\t\t\timplementText: sourceCode.slice(defNode.startIndex, defNode.endIndex),\n\t\t\t\tscope: buildScopeChain(node),\n\t\t\t\tfileHash,\n\t\t\t\tdefinition: { name: text, type: kind },\n\t\t\t\tlanguage: CodeLanguageType.TypeScript,\n\t\t\t\tfield: \"\",\n\t\t\t})\n\t\t}\n\t}\n\n\t// --- \u53D8\u91CF / \u5E38\u91CF ---\n\tfor (const c of captures.filter((c) => c.name === \"name.variable\")) {\n\t\tconst node = c.node\n\t\tconst startLine = node.startPosition.row + 1\n\t\tconst endLine = node.endPosition.row + 1\n\t\tconst name = sourceCode.slice(node.startIndex, node.endIndex)\n\n\t\t// \u8DF3\u8FC7\u51FD\u6570\u5185\u90E8\u5C40\u90E8\u53D8\u91CF\n\t\tconst inFunc = captures.some(\n\t\t\t(fc) =>\n\t\t\t\t(fc.name === \"definition.function\" || fc.name === \"definition.method\") &&\n\t\t\t\tfc.node.startIndex < node.startIndex &&\n\t\t\t\tnode.endIndex < fc.node.endIndex,\n\t\t)\n\t\tif (inFunc) continue\n\n\t\tconst hash = generateSnippetHash(filePath, startLine, endLine, name)\n\t\tif (seen.has(hash)) continue\n\t\tseen.add(hash)\n\n\t\tsnippets.push({\n\t\t\tname,\n\t\t\ttype: SnippetType.VariableOrConstant,\n\t\t\tfilePath,\n\t\t\tstartLine,\n\t\t\tendLine,\n\t\t\trangeText: sourceCode.slice(node.startIndex, node.endIndex),\n\t\t\tdefinitionText: name,\n\t\t\timplementText: name,\n\t\t\tscope: buildScopeChain(node),\n\t\t\tfileHash,\n\t\t\tdefinition: { name, type: \"variable\" },\n\t\t\tlanguage: CodeLanguageType.TypeScript,\n\t\t\tfield: \"\",\n\t\t})\n\t}\n\n\t// --- properties ---\n\tfor (const c of captures.filter((c) => c.name === \"name.property\")) {\n\t\tconst node = c.node\n\t\tconst startLine = node.startPosition.row + 1\n\t\tconst endLine = node.endPosition.row + 1\n\t\tconst name = sourceCode.slice(node.startIndex, node.endIndex)\n\n\t\t// \u67E5\u627E\u6240\u5C5E\u7684interface\u6216class\n\t\tlet field: string | undefined\n\t\tconst parentInterface = captures.find(\n\t\t\t(ic) =>\n\t\t\t\tic.name === \"definition.interface\" &&\n\t\t\t\tic.node.startIndex < node.startIndex &&\n\t\t\t\tic.node.endIndex > node.endIndex,\n\t\t)\n\t\tconst parentClass = captures.find(\n\t\t\t(cc) =>\n\t\t\t\tcc.name === \"definition.class\" &&\n\t\t\t\tcc.node.startIndex < node.startIndex &&\n\t\t\t\tcc.node.endIndex > node.endIndex,\n\t\t)\n\n\t\tif (parentInterface) {\n\t\t\tconst interfaceCap = captures.find(\n\t\t\t\t(ic) =>\n\t\t\t\t\tic.name === \"name.interface\" &&\n\t\t\t\t\tic.node.startIndex >= parentInterface.node.startIndex &&\n\t\t\t\t\tic.node.endIndex <= parentInterface.node.endIndex,\n\t\t\t)\n\t\t\tif (interfaceCap) {\n\t\t\t\tfield = sourceCode.slice(interfaceCap.node.startIndex, interfaceCap.node.endIndex)\n\t\t\t}\n\t\t} else if (parentClass) {\n\t\t\tconst classCap = captures.find(\n\t\t\t\t(cc) =>\n\t\t\t\t\tcc.name === \"name.class\" &&\n\t\t\t\t\tcc.node.startIndex >= parentClass.node.startIndex &&\n\t\t\t\t\tcc.node.endIndex <= parentClass.node.endIndex,\n\t\t\t)\n\t\t\tif (classCap) {\n\t\t\t\tfield = sourceCode.slice(classCap.node.startIndex, classCap.node.endIndex)\n\t\t\t}\n\t\t}\n\n\t\tconst hash = generateSnippetHash(filePath, startLine, endLine, name)\n\t\tif (seen.has(hash)) continue\n\t\tseen.add(hash)\n\n\t\tsnippets.push({\n\t\t\tname,\n\t\t\ttype: SnippetType.VariableOrConstant,\n\t\t\tfilePath,\n\t\t\tstartLine,\n\t\t\tendLine,\n\t\t\trangeText: sourceCode.slice(node.startIndex, node.endIndex),\n\t\t\tdefinitionText: name,\n\t\t\timplementText: name,\n\t\t\tscope: buildScopeChain(node),\n\t\t\tfileHash,\n\t\t\tfield,\n\t\t\tdefinition: { name, type: \"property\" },\n\t\t\tlanguage: CodeLanguageType.TypeScript,\n\t\t})\n\t}\n\n\treturn snippets\n}\n\nexport interface OutlineEntry {\n\ttype: string\n\tname: string\n\tfile: string\n\tfield?: string\n\tdescription?: string\n}\n\nexport function buildSummaryFromSnippets(snips: ISnippetMeta[]): OutlineEntry[] {\n\tconst outline: OutlineEntry[] = []\n\tfor (const s of snips) {\n\t\tif (s.type === SnippetType.ImportOrInclude) {\n\t\t\toutline.push({ type: \"import\", name: s.name, file: s.filePath, field: \"\", description: s.definitionText })\n\t\t} else if (s.type === SnippetType.FunctionOrMethod) {\n\t\t\toutline.push({\n\t\t\t\ttype: s.field ? \"method\" : \"function\",\n\t\t\t\tname: s.name,\n\t\t\t\tfile: s.filePath,\n\t\t\t\tfield: s.field || \"\",\n\t\t\t\tdescription: s.definitionText,\n\t\t\t})\n\t\t} else if (s.type === SnippetType.ClassOrInterfaceOrStructOrEnum) {\n\t\t\toutline.push({\n\t\t\t\ttype: s.definition?.type || \"type\",\n\t\t\t\tname: s.name,\n\t\t\t\tfile: s.filePath,\n\t\t\t\tfield: \"\",\n\t\t\t\tdescription: s.name,\n\t\t\t})\n\t\t} else if (s.type === SnippetType.VariableOrConstant) {\n\t\t\toutline.push({ type: \"variable\", name: s.name, file: s.filePath, field: \"\", description: s.definitionText })\n\t\t}\n\t}\n\treturn outline\n}\n\nexport function formatOutlineText(outline: OutlineEntry[]): string {\n\tconst groups: Record<string, OutlineEntry[]> = {}\n\tfor (const e of outline) {\n\t\tconst key = e.field || \"\"\n\t\t;(groups[key] ||= []).push(e)\n\t}\n\tlet out = \"\"\n\tfor (const field of Object.keys(groups).sort()) {\n\t\tout += (field ? `[${field}]` : \"[global]\") + \"\\n\"\n\t\tfor (const e of groups[field]) {\n\t\t\tout += ` ${e.type}: ${e.description}\\n`\n\t\t}\n\t\tout += \"\\n\"\n\t}\n\treturn out.trimEnd()\n}\n", "import { SnippetType, ISnippetMeta, ParameterInfo, CodeLanguageType } from \"../types\"\nimport Parser from \"web-tree-sitter\"\nimport { generateSnippetHash, buildScopeChain } from \"./general\"\nimport { extractSnippetsFromCapturesForTypeScript } from \"./typescript\"\nimport { Logger } from \"../Logger\"\n\n// Helper function to check if a name starts with uppercase letter\nfunction startsWithUppercase(name: string): boolean {\n\treturn name.length > 0 && name[0] >= \"A\" && name[0] <= \"Z\"\n}\n\n// Helper function to check if a function is a generic component\nfunction isGenericComponent(rangeText: string): boolean {\n\treturn rangeText.includes(\"function\") && rangeText.includes(\"<\") && rangeText.includes(\">(\")\n}\n\n// Helper function to clean parameter name by removing type annotations, defaults, and optional markers\nfunction cleanParameterName(paramText: string): string {\n\tlet cleaned = paramText.trim()\n\n\t// Remove type annotation (: type)\n\tconst colonIndex = cleaned.indexOf(\":\")\n\tif (colonIndex !== -1) {\n\t\tcleaned = cleaned.substring(0, colonIndex).trim()\n\t}\n\n\t// Remove default value (= value)\n\tconst equalsIndex = cleaned.indexOf(\"=\")\n\tif (equalsIndex !== -1) {\n\t\tcleaned = cleaned.substring(0, equalsIndex).trim()\n\t}\n\n\t// Remove optional marker (?)\n\tif (cleaned.endsWith(\"?\")) {\n\t\tcleaned = cleaned.slice(0, -1).trim()\n\t}\n\n\treturn cleaned\n}\n\n// Helper function to extract parameters from destructured props using string parsing\nfunction extractDestructuredParamsFromText(paramText: string): string[] {\n\tconst params: string[] = []\n\n\t// Find destructuring pattern { ... }\n\tconst openBrace = paramText.indexOf(\"{\")\n\tconst closeBrace = paramText.lastIndexOf(\"}\")\n\n\tif (openBrace !== -1 && closeBrace !== -1 && closeBrace > openBrace) {\n\t\tconst destructuredContent = paramText.substring(openBrace + 1, closeBrace)\n\t\tconst paramNames = destructuredContent.split(\",\")\n\n\t\tfor (const param of paramNames) {\n\t\t\tconst cleanName = cleanParameterName(param)\n\t\t\tif (cleanName && cleanName !== \"...\" && !cleanName.includes(\"...\")) {\n\t\t\t\tparams.push(cleanName)\n\t\t\t}\n\t\t}\n\t}\n\n\treturn params\n}\n\nexport async function extractSnippetsFromCapturesForTSX(\n\tcaptures: Parser.QueryCapture[],\n\tsourceCode: string,\n\tfilePath: string,\n\tfileHash: string,\n\tsnippetTypes: SnippetType[],\n\toptions: { maxSnippetLines: number; minSnippetLines: number },\n): Promise<ISnippetMeta[]> {\n\tconst logger = Logger.getDefaultLogger().with(\"[TSX extract]\")\n\n\t// \u9996\u5148\u8BA9TypeScript\u5904\u7406\u5668\u5904\u7406\u57FA\u7840\u7684\u51FD\u6570\u3001\u7C7B\u3001\u63A5\u53E3\u3001\u53D8\u91CF\u7B49\n\tconst tsSnippets = await extractSnippetsFromCapturesForTypeScript(\n\t\tcaptures,\n\t\tsourceCode,\n\t\tfilePath,\n\t\tfileHash,\n\t\tsnippetTypes,\n\t\toptions,\n\t)\n\n\t// \u66F4\u65B0language\u5B57\u6BB5\u4E3ATSX\uFF0C\u5E76\u4FEE\u6539definition\u7C7B\u578B\u4EE5\u7B26\u5408React\u60EF\u4F8B\n\tfor (const snippet of tsSnippets) {\n\t\tsnippet.language = CodeLanguageType.TSX\n\n\t\t// \u4FEE\u6539\u51FD\u6570\u7684definition\u7C7B\u578B\u4E3Areact_component\n\t\tif (snippet.type === SnippetType.FunctionOrMethod && snippet.definition?.type === \"function\") {\n\t\t\t// \u4FEE\u6539\u81EA\u5B9A\u4E49hook\uFF08\u4EE5use\u5F00\u5934\u7684\u51FD\u6570\uFF09\u7684definition\u7C7B\u578B\n\t\t\tif (snippet.name.startsWith(\"use\")) {\n\t\t\t\tsnippet.definition.type = \"react_custom_hook\"\n\t\t\t} else {\n\t\t\t\t// \u68C0\u67E5\u662F\u5426\u662FReact\u7EC4\u4EF6\uFF08\u51FD\u6570\u540D\u4EE5\u5927\u5199\u5B57\u6BCD\u5F00\u5934\u6216\u8FD4\u56DEJSX\uFF09\n\t\t\t\tconst isReactComponent =\n\t\t\t\t\tstartsWithUppercase(snippet.name) ||\n\t\t\t\t\t(snippet.rangeText.includes(\"return\") &&\n\t\t\t\t\t\tsnippet.rangeText.includes(\"<\") &&\n\t\t\t\t\t\tsnippet.rangeText.includes(\">\"))\n\n\t\t\t\tif (isReactComponent) {\n\t\t\t\t\t// \u68C0\u67E5\u662F\u5426\u662F\u6CDB\u578B\u7EC4\u4EF6\n\t\t\t\t\tif (\n\t\t\t\t\t\tsnippet.rangeText.includes(\"<\") &&\n\t\t\t\t\t\tsnippet.rangeText.includes(\">(\") &&\n\t\t\t\t\t\tisGenericComponent(snippet.rangeText)\n\t\t\t\t\t) {\n\t\t\t\t\t\tsnippet.definition.type = \"react_generic_component\"\n\t\t\t\t\t} else {\n\t\t\t\t\t\tsnippet.definition.type = \"react_component\"\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// \u6539\u8FDB\u53C2\u6570\u89E3\u6790 - \u5904\u7406props\u89E3\u6784\u53C2\u6570\n\t\t\tif (snippet.parameters && snippet.parameters.length > 0) {\n\t\t\t\t// \u9996\u5148\u91CD\u65B0\u7EC4\u5408\u6240\u6709\u53C2\u6570\uFF0C\u4EE5\u68C0\u6D4B\u88AB\u5206\u5272\u7684\u89E3\u6784\u53C2\u6570\n\t\t\t\tconst paramTexts = snippet.parameters.map((p) => p.name.trim())\n\t\t\t\tconst fullParamText = paramTexts.join(\", \")\n\n\t\t\t\tconst improvedParams: ParameterInfo[] = []\n\n\t\t\t\t// \u68C0\u67E5\u91CD\u65B0\u7EC4\u5408\u7684\u6587\u672C\u662F\u5426\u5305\u542B\u89E3\u6784\u53C2\u6570\n\t\t\t\tif (fullParamText.includes(\"{\") && fullParamText.includes(\"}\")) {\n\t\t\t\t\t// \u91CD\u65B0\u89E3\u6790\u6574\u4E2A\u53C2\u6570\u5B57\u7B26\u4E32\u4F7F\u7528\u5B57\u7B26\u4E32\u65B9\u6CD5\n\t\t\t\t\tconst destructuredParams = extractDestructuredParamsFromText(fullParamText)\n\t\t\t\t\timprovedParams.push(...destructuredParams.map((p) => ({ name: p })))\n\t\t\t\t} else {\n\t\t\t\t\t// \u5904\u7406\u666E\u901A\u53C2\u6570\n\t\t\t\t\tfor (const param of snippet.parameters) {\n\t\t\t\t\t\tconst paramText = param.name.trim()\n\t\t\t\t\t\tconst cleanName = cleanParameterName(paramText)\n\t\t\t\t\t\tif (cleanName && !cleanName.includes(\"{\") && !cleanName.includes(\"}\")) {\n\t\t\t\t\t\t\timprovedParams.push({ name: cleanName })\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tsnippet.parameters = improvedParams\n\n\t\t\t\t// \u66F4\u65B0\u7B7E\u540D\n\t\t\t\tconst paramStr = improvedParams.map((p) => p.name).join(\", \")\n\t\t\t\tsnippet.signature = `${snippet.name}(${paramStr})`\n\t\t\t} else if (!snippet.parameters || snippet.parameters.length === 0) {\n\t\t\t\t// \u5982\u679C snippet.parameters \u662F\u7A7A\u7684\u6216\u4E0D\u5B58\u5728\uFF0C\u4F46 definition.parameters \u6709\u5185\u5BB9\uFF0C\u4F7F\u7528 definition.parameters\n\t\t\t\tif (snippet.definition?.parameters && snippet.definition.parameters.length > 0) {\n\t\t\t\t\t// \u9700\u8981\u91CD\u65B0\u7EC4\u5408\u88AB\u9519\u8BEF\u5206\u5272\u7684\u89E3\u6784\u53C2\u6570\n\t\t\t\t\tconst paramTexts = snippet.definition.parameters.map((p) => p.name || \"\")\n\t\t\t\t\tconst fullParamText = paramTexts.join(\", \")\n\n\t\t\t\t\tconst improvedParams: ParameterInfo[] = []\n\n\t\t\t\t\t// \u68C0\u67E5\u662F\u5426\u5305\u542B\u89E3\u6784\u53C2\u6570\n\t\t\t\t\tif (fullParamText.includes(\"{\") && fullParamText.includes(\"}\")) {\n\t\t\t\t\t\t// \u91CD\u65B0\u89E3\u6790\u6574\u4E2A\u53C2\u6570\u5B57\u7B26\u4E32\u4F7F\u7528\u5B57\u7B26\u4E32\u65B9\u6CD5\n\t\t\t\t\t\tconst destructuredParams = extractDestructuredParamsFromText(fullParamText)\n\t\t\t\t\t\timprovedParams.push(...destructuredParams.map((p) => ({ name: p })))\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// \u5904\u7406\u666E\u901A\u53C2\u6570\n\t\t\t\t\t\tfor (const param of snippet.definition.parameters) {\n\t\t\t\t\t\t\tconst paramText = param.name?.trim() || \"\"\n\t\t\t\t\t\t\tconst cleanName = cleanParameterName(paramText)\n\t\t\t\t\t\t\tif (cleanName && !cleanName.includes(\"{\") && !cleanName.includes(\"}\")) {\n\t\t\t\t\t\t\t\timprovedParams.push({ name: cleanName })\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tsnippet.parameters = improvedParams\n\n\t\t\t\t\t// \u66F4\u65B0\u7B7E\u540D\n\t\t\t\t\tconst paramStr = improvedParams.map((p) => p.name).join(\", \")\n\t\t\t\t\tsnippet.signature = `${snippet.name}(${paramStr})`\n\t\t\t\t}\n\t\t\t}\n\t\t} else if (snippet.type === SnippetType.FunctionOrMethod && snippet.definition?.type === \"method\") {\n\t\t\t// \u7C7B\u65B9\u6CD5\u4FDD\u6301\u539F\u6837\uFF0C\u4F46\u66F4\u65B0\u8BED\u8A00\u7C7B\u578B\n\t\t} else if (\n\t\t\tsnippet.type === SnippetType.ClassOrInterfaceOrStructOrEnum &&\n\t\t\tsnippet.definition?.type === \"class\"\n\t\t) {\n\t\t\t// \u68C0\u67E5\u662F\u5426\u662FReact\u7C7B\u7EC4\u4EF6\uFF08\u7EE7\u627F\u81EAComponent\u6216PureComponent\uFF09\n\t\t\tif (\n\t\t\t\tsnippet.rangeText.includes(\"extends\") &&\n\t\t\t\t(snippet.rangeText.includes(\"Component\") || snippet.rangeText.includes(\"PureComponent\"))\n\t\t\t) {\n\t\t\t\tsnippet.definition.type = \"react_class_component\"\n\t\t\t}\n\t\t} else if (snippet.type === SnippetType.ImportOrInclude && snippet.definition?.type === \"import\") {\n\t\t\tsnippet.definition.type = \"react_import\"\n\t\t} else if (snippet.type === SnippetType.VariableOrConstant && snippet.definition?.type === \"variable\") {\n\t\t\t// \u68C0\u67E5\u53D8\u91CF\u662F\u5426\u662FReact\u7EC4\u4EF6\uFF08\u4EE5\u5927\u5199\u5B57\u6BCD\u5F00\u5934\u4E14\u53EF\u80FD\u5305\u542BJSX\uFF09\n\t\t\tif (startsWithUppercase(snippet.name)) {\n\t\t\t\t// \u7531\u4E8E rangeText \u53EF\u80FD\u53EA\u5305\u542B\u53D8\u91CF\u540D\uFF0C\u6211\u4EEC\u9700\u8981\u68C0\u67E5\u4EE3\u7801\u4E0A\u4E0B\u6587\n\t\t\t\t// \u68C0\u67E5\u662F\u5426\u5728\u540C\u4E00\u6587\u4EF6\u4E2D\u6709\u5BF9\u5E94\u7684\u51FD\u6570\u7EC4\u4EF6\u5B9A\u4E49\n\t\t\t\tconst isLikelyComponent =\n\t\t\t\t\ttsSnippets.some(\n\t\t\t\t\t\t(s) =>\n\t\t\t\t\t\t\ts.name === snippet.name &&\n\t\t\t\t\t\t\ts.type === SnippetType.FunctionOrMethod &&\n\t\t\t\t\t\t\ts.definition?.type === \"react_component\",\n\t\t\t\t\t) ||\n\t\t\t\t\t// \u6216\u8005\u68C0\u67E5\u5E38\u89C1\u7684 React \u7EC4\u4EF6\u6A21\u5F0F\n\t\t\t\t\tsnippet.rangeText.includes(\"withError\") ||\n\t\t\t\t\tsnippet.rangeText.includes(\"memo(\") ||\n\t\t\t\t\tsnippet.rangeText.includes(\"forwardRef(\") ||\n\t\t\t\t\tsnippet.rangeText.includes(\"lazy(\") ||\n\t\t\t\t\tsnippet.rangeText.includes(\"React.\") ||\n\t\t\t\t\tsnippet.rangeText.includes(\"FC\") ||\n\t\t\t\t\tsnippet.rangeText.includes(\"FunctionComponent\") ||\n\t\t\t\t\t(snippet.rangeText.includes(\"=>\") &&\n\t\t\t\t\t\tsnippet.rangeText.includes(\"<\") &&\n\t\t\t\t\t\tsnippet.rangeText.includes(\">\"))\n\n\t\t\t\tif (isLikelyComponent) {\n\t\t\t\t\tsnippet.definition.type = \"react_component\"\n\t\t\t\t\tsnippet.type = SnippetType.FunctionOrMethod // \u6539\u53D8\u7C7B\u578B\u4E3A\u51FD\u6570\u7EC4\u4EF6\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tconst snippets: ISnippetMeta[] = [...tsSnippets]\n\tconst seenHashes = new Set<string>()\n\n\t// \u586B\u5145\u5DF2\u89C1\u8FC7\u7684\u54C8\u5E0C\u503C\n\tfor (const snippet of snippets) {\n\t\tconst hash = generateSnippetHash(snippet.filePath, snippet.startLine, snippet.endLine, snippet.rangeText)\n\t\tseenHashes.add(hash)\n\t}\n\n\t// === JSX Components ===\n\tfor (const capture of captures) {\n\t\tif (\n\t\t\tcapture.name !== \"definition.component\" &&\n\t\t\tcapture.name !== \"definition.jsx_element\" &&\n\t\t\tcapture.name !== \"definition.jsx_self_closing_element\"\n\t\t)\n\t\t\tcontinue\n\n\t\tconst node = capture.node\n\t\tconst startLine = node.startPosition.row + 1\n\t\tconst endLine = node.endPosition.row + 1\n\n\t\t// Find JSX component name\n\t\tlet nameCap: Parser.QueryCapture | undefined\n\t\tif (capture.name === \"definition.component\") {\n\t\t\tnameCap = captures.find(\n\t\t\t\t(c) => c.name === \"name\" && c.node.startIndex >= node.startIndex && c.node.endIndex <= node.endIndex,\n\t\t\t)\n\t\t} else {\n\t\t\tnameCap = captures.find(\n\t\t\t\t(c) =>\n\t\t\t\t\tc.name === \"component\" && c.node.startIndex >= node.startIndex && c.node.endIndex <= node.endIndex,\n\t\t\t)\n\t\t}\n\n\t\tif (!nameCap) continue\n\t\tconst name = sourceCode.substring(nameCap.node.startIndex, nameCap.node.endIndex)\n\n\t\t// Only capture custom components (starting with uppercase) or known React components\n\t\tif (!startsWithUppercase(name) && !isKnownReactComponent(name)) continue\n\n\t\tconst rangeText = sourceCode.substring(node.startIndex, node.endIndex)\n\t\tconst snippetHash = generateSnippetHash(filePath, startLine, endLine, rangeText)\n\t\tif (seenHashes.has(snippetHash)) continue\n\t\tseenHashes.add(snippetHash)\n\n\t\tconst scope = buildScopeChain(node)\n\n\t\tsnippets.push({\n\t\t\tname,\n\t\t\tsignature: `<${name}>`,\n\t\t\ttype: SnippetType.FunctionOrMethod,\n\t\t\tfilePath,\n\t\t\tstartLine,\n\t\t\tendLine,\n\t\t\trangeText,\n\t\t\tdefinitionText: `<${name}>`,\n\t\t\timplementText: rangeText,\n\t\t\tscope,\n\t\t\tfileHash,\n\t\t\tlanguage: CodeLanguageType.TSX,\n\t\t\tdefinition: {\n\t\t\t\tname,\n\t\t\t\ttype: \"jsx_component\",\n\t\t\t\tparameters: [],\n\t\t\t\treturnType: \"JSX.Element\",\n\t\t\t},\n\t\t})\n\t}\n\n\t// === JSX Member Components (e.g., Button.Primary) ===\n\tfor (const capture of captures) {\n\t\tif (capture.name !== \"definition.member_component\") continue\n\n\t\tconst node = capture.node\n\t\tconst startLine = node.startPosition.row + 1\n\t\tconst endLine = node.endPosition.row + 1\n\n\t\t// Find object and property\n\t\tconst objectCap = captures.find(\n\t\t\t(c) => c.name === \"object\" && c.node.startIndex >= node.startIndex && c.node.endIndex <= node.endIndex,\n\t\t)\n\t\tconst propertyCap = captures.find(\n\t\t\t(c) => c.name === \"property\" && c.node.startIndex >= node.startIndex && c.node.endIndex <= node.endIndex,\n\t\t)\n\n\t\tif (!objectCap || !propertyCap) continue\n\n\t\tconst objectName = sourceCode.substring(objectCap.node.startIndex, objectCap.node.endIndex)\n\t\tconst propertyName = sourceCode.substring(propertyCap.node.startIndex, propertyCap.node.endIndex)\n\t\tconst fullName = `${objectName}.${propertyName}`\n\n\t\t// Only capture if object starts with uppercase (component namespace)\n\t\tif (!startsWithUppercase(objectName)) continue\n\n\t\tconst rangeText = sourceCode.substring(node.startIndex, node.endIndex)\n\t\tconst snippetHash = generateSnippetHash(filePath, startLine, endLine, rangeText)\n\t\tif (seenHashes.has(snippetHash)) continue\n\t\tseenHashes.add(snippetHash)\n\n\t\tconst scope = buildScopeChain(node)\n\n\t\tsnippets.push({\n\t\t\tname: fullName,\n\t\t\tsignature: `<${fullName}>`,\n\t\t\ttype: SnippetType.FunctionOrMethod,\n\t\t\tfilePath,\n\t\t\tstartLine,\n\t\t\tendLine,\n\t\t\trangeText,\n\t\t\tdefinitionText: `<${fullName}>`,\n\t\t\timplementText: rangeText,\n\t\t\tscope,\n\t\t\tfileHash,\n\t\t\tfield: objectName,\n\t\t\tlanguage: CodeLanguageType.TSX,\n\t\t\tdefinition: {\n\t\t\t\tname: fullName,\n\t\t\t\ttype: \"jsx_member_component\",\n\t\t\t\tparameters: [],\n\t\t\t\treturnType: \"JSX.Element\",\n\t\t\t},\n\t\t})\n\t}\n\n\t// === JSX Conditional Components ===\n\tfor (const capture of captures) {\n\t\tif (capture.name !== \"definition.conditional_component\") continue\n\n\t\tconst node = capture.node\n\t\tconst startLine = node.startPosition.row + 1\n\t\tconst endLine = node.endPosition.row + 1\n\n\t\t// Find component name in conditional expression\n\t\tconst componentCap = captures.find(\n\t\t\t(c) => c.name === \"component\" && c.node.startIndex >= node.startIndex && c.node.endIndex <= node.endIndex,\n\t\t)\n\n\t\tif (!componentCap) continue\n\t\tconst name = sourceCode.substring(componentCap.node.startIndex, componentCap.node.endIndex)\n\n\t\t// Only capture custom components (starting with uppercase)\n\t\tif (!startsWithUppercase(name)) continue\n\n\t\tconst rangeText = sourceCode.substring(node.startIndex, node.endIndex)\n\t\tconst snippetHash = generateSnippetHash(filePath, startLine, endLine, rangeText)\n\t\tif (seenHashes.has(snippetHash)) continue\n\t\tseenHashes.add(snippetHash)\n\n\t\tconst scope = buildScopeChain(node)\n\n\t\tsnippets.push({\n\t\t\tname,\n\t\t\tsignature: `{condition ? <${name}> : null}`,\n\t\t\ttype: SnippetType.FunctionOrMethod,\n\t\t\tfilePath,\n\t\t\tstartLine,\n\t\t\tendLine,\n\t\t\trangeText,\n\t\t\tdefinitionText: `{condition ? <${name}> : null}`,\n\t\t\timplementText: rangeText,\n\t\t\tscope,\n\t\t\tfileHash,\n\t\t\tlanguage: CodeLanguageType.TSX,\n\t\t\tdefinition: {\n\t\t\t\tname,\n\t\t\t\ttype: \"jsx_conditional_component\",\n\t\t\t\tparameters: [],\n\t\t\t\treturnType: \"JSX.Element | null\",\n\t\t\t},\n\t\t})\n\t}\n\n\t// === Generic Components ===\n\tfor (const capture of captures) {\n\t\tif (capture.name !== \"definition.generic_component\") continue\n\n\t\tconst node = capture.node\n\t\tconst startLine = node.startPosition.row + 1\n\t\tconst endLine = node.endPosition.row + 1\n\n\t\t// Find component name\n\t\tconst nameCap = captures.find(\n\t\t\t(c) => c.name === \"name\" && c.node.startIndex >= node.startIndex && c.node.endIndex <= node.endIndex,\n\t\t)\n\n\t\tif (!nameCap) continue\n\t\tconst name = sourceCode.substring(nameCap.node.startIndex, nameCap.node.endIndex)\n\n\t\t// Check if it's a React component (starts with uppercase or returns JSX)\n\t\tconst isReactComponent =\n\t\t\tstartsWithUppercase(name) || sourceCode.substring(node.startIndex, node.endIndex).includes(\"JSX\")\n\n\t\tif (!isReactComponent) continue\n\n\t\tconst rangeText = sourceCode.substring(node.startIndex, node.endIndex)\n\t\tconst snippetHash = generateSnippetHash(filePath, startLine, endLine, rangeText)\n\t\tif (seenHashes.has(snippetHash)) continue\n\t\tseenHashes.add(snippetHash)\n\n\t\tconst scope = buildScopeChain(node)\n\n\t\tsnippets.push({\n\t\t\tname,\n\t\t\tsignature: `${name}<T>`,\n\t\t\ttype: SnippetType.FunctionOrMethod,\n\t\t\tfilePath,\n\t\t\tstartLine,\n\t\t\tendLine,\n\t\t\trangeText,\n\t\t\tdefinitionText: `${name}<T>`,\n\t\t\timplementText: rangeText,\n\t\t\tscope,\n\t\t\tfileHash,\n\t\t\tlanguage: CodeLanguageType.TSX,\n\t\t\tdefinition: {\n\t\t\t\tname,\n\t\t\t\ttype: \"react_generic_component\",\n\t\t\t\tparameters: [],\n\t\t\t\treturnType: \"JSX.Element\",\n\t\t\t},\n\t\t})\n\t}\n\n\treturn snippets\n}\n\n// Helper function to check if a component name is a known React component\nfunction isKnownReactComponent(name: string): boolean {\n\tconst knownComponents = [\n\t\t\"Fragment\",\n\t\t\"Suspense\",\n\t\t\"StrictMode\",\n\t\t\"Profiler\",\n\t\t\"ErrorBoundary\",\n\t\t\"Provider\",\n\t\t\"Consumer\",\n\t\t\"Portal\",\n\t]\n\treturn knownComponents.includes(name)\n}\n\nexport interface OutlineEntry {\n\ttype: string\n\tname: string\n\tfile: string\n\tfield?: string\n\tdescription?: string\n}\n\nexport function buildSummaryFromSnippets(snips: ISnippetMeta[]): OutlineEntry[] {\n\tconst outline: OutlineEntry[] = []\n\tfor (const s of snips) {\n\t\tif (s.type === SnippetType.ImportOrInclude) {\n\t\t\toutline.push({\n\t\t\t\ttype: \"import\",\n\t\t\t\tname: s.name,\n\t\t\t\tfile: s.filePath,\n\t\t\t\tfield: \"\",\n\t\t\t\tdescription: s.definitionText,\n\t\t\t})\n\t\t} else if (s.type === SnippetType.FunctionOrMethod) {\n\t\t\tlet type = \"function\"\n\t\t\tif (s.definition?.type === \"react_component\") type = \"component\"\n\t\t\telse if (s.definition?.type === \"react_custom_hook\") type = \"hook\"\n\t\t\telse if (s.definition?.type === \"jsx_component\") type = \"jsx\"\n\t\t\telse if (s.definition?.type === \"jsx_member_component\") type = \"jsx.member\"\n\t\t\telse if (s.definition?.type === \"jsx_conditional_component\") type = \"jsx.conditional\"\n\t\t\telse if (s.definition?.type === \"react_generic_component\") type = \"component.generic\"\n\t\t\telse if (s.field) type = \"method\"\n\n\t\t\toutline.push({\n\t\t\t\ttype,\n\t\t\t\tname: s.name,\n\t\t\t\tfile: s.filePath,\n\t\t\t\tfield: s.field || \"\",\n\t\t\t\tdescription: s.definitionText,\n\t\t\t})\n\t\t} else if (s.type === SnippetType.ClassOrInterfaceOrStructOrEnum) {\n\t\t\tlet type = s.definition?.type || \"type\"\n\t\t\tif (s.definition?.type === \"react_class_component\") type = \"class.component\"\n\n\t\t\toutline.push({\n\t\t\t\ttype,\n\t\t\t\tname: s.name,\n\t\t\t\tfile: s.filePath,\n\t\t\t\tfield: \"\",\n\t\t\t\tdescription: s.name,\n\t\t\t})\n\t\t} else if (s.type === SnippetType.VariableOrConstant) {\n\t\t\toutline.push({\n\t\t\t\ttype: \"variable\",\n\t\t\t\tname: s.name,\n\t\t\t\tfile: s.filePath,\n\t\t\t\tfield: s.field || \"\",\n\t\t\t\tdescription: s.definitionText,\n\t\t\t})\n\t\t}\n\t}\n\treturn outline\n}\n\nexport function formatOutlineText(outline: OutlineEntry[]): string {\n\tconst groups: Record<string, OutlineEntry[]> = {}\n\tfor (const e of outline) {\n\t\tconst key = e.field || \"\"\n\t\t;(groups[key] ||= []).push(e)\n\t}\n\tlet out = \"\"\n\tfor (const field of Object.keys(groups).sort()) {\n\t\tout += (field ? `[${field}]` : \"[global]\") + \"\\n\"\n\t\tfor (const e of groups[field]) {\n\t\t\tout += ` ${e.type}: ${e.description}\\n`\n\t\t}\n\t\tout += \"\\n\"\n\t}\n\treturn out.trimEnd()\n}\n", "import { SnippetType, ISnippetMeta, ParameterInfo, CodeLanguageType } from \"../types\"\nimport Parser from \"web-tree-sitter\"\nimport { generateSnippetHash, buildScopeChain } from \"./general\"\nimport { Logger } from \"../Logger\"\n\nexport async function extractSnippetsFromCapturesForSwift(\n\tcaptures: Parser.QueryCapture[],\n\tsourceCode: string,\n\tfilePath: string,\n\tfileHash: string,\n\tsnippetTypes: SnippetType[],\n\toptions: { maxSnippetLines: number; minSnippetLines: number },\n): Promise<ISnippetMeta[]> {\n\tconst logger = Logger.getDefaultLogger().with(\"[extractSnippetsFromCapturesForSwift]\")\n\n\tconst snippets: ISnippetMeta[] = []\n\tconst seenHashes = new Set<string>()\n\n\tif (snippetTypes.length === 0) {\n\t\tlogger.warn(`No snippet types provided, skipping`)\n\t\treturn snippets\n\t}\n\n\t// \u6536\u96C6\u6240\u6709\u7C7B/\u7ED3\u6784\u4F53/\u534F\u8BAE/\u6269\u5C55captures\u7528\u4E8E\u786E\u5B9Afield\n\tconst containerCaptures = captures\n\t\t.filter(\n\t\t\t(c) =>\n\t\t\t\tc.name === \"definition.class\" ||\n\t\t\t\tc.name === \"definition.struct\" ||\n\t\t\t\tc.name === \"definition.protocol\" ||\n\t\t\t\tc.name === \"definition.enum\",\n\t\t)\n\t\t.map((c) => {\n\t\t\tconst node = c.node\n\t\t\tconst type = c.name.split(\".\")[1] // class, struct, protocol, enum\n\n\t\t\t// \u67E5\u627E\u540D\u79F0capture\n\t\t\tlet nameCap = captures.find(\n\t\t\t\t(nc) =>\n\t\t\t\t\tnc.name === `name.${c.name}` &&\n\t\t\t\t\tnc.node.startIndex >= node.startIndex &&\n\t\t\t\t\tnc.node.endIndex <= node.endIndex,\n\t\t\t)\n\n\t\t\t// \u7279\u6B8A\u5904\u7406extension\uFF1A\u83B7\u53D6\u88AB\u6269\u5C55\u7684\u7C7B\u578B\u540D\n\t\t\tlet actualName = nameCap ? sourceCode.substring(nameCap.node.startIndex, nameCap.node.endIndex) : \"\"\n\t\t\tif (type === \"class\") {\n\t\t\t\tconst actualType = determineClassDeclarationType(node, sourceCode)\n\t\t\t\tif (actualType === \"extension\") {\n\t\t\t\t\t// \u5BF9\u4E8Eextension\uFF0C\u83B7\u53D6\u88AB\u6269\u5C55\u7684\u7C7B\u578B\u540D\uFF08\u7B2C\u4E8C\u4E2A\u5B50\u8282\u70B9\u7684type_identifier\uFF09\n\t\t\t\t\tif (node.childCount >= 2) {\n\t\t\t\t\t\tconst userTypeNode = node.child(1) // user_type\u8282\u70B9\n\t\t\t\t\t\tif (userTypeNode && userTypeNode.type === \"user_type\" && userTypeNode.childCount > 0) {\n\t\t\t\t\t\t\tconst typeIdNode = userTypeNode.child(0)\n\t\t\t\t\t\t\tif (typeIdNode && typeIdNode.type === \"type_identifier\") {\n\t\t\t\t\t\t\t\tactualName = sourceCode.substring(typeIdNode.startIndex, typeIdNode.endIndex)\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\tnode,\n\t\t\t\tstart: node.startIndex,\n\t\t\t\tend: node.endIndex,\n\t\t\t\ttype,\n\t\t\t\tnameCap,\n\t\t\t\tactualName, // \u5B9E\u9645\u7684\u7C7B\u578B\u540D\uFF08\u5BF9\u4E8Eextension\u662F\u88AB\u6269\u5C55\u7684\u7C7B\u578B\uFF09\n\t\t\t}\n\t\t})\n\n\t// \u5904\u7406import\u8BED\u53E5\n\tcaptures.forEach((capture) => {\n\t\tif (capture.name === \"name.definition.import\") {\n\t\t\tconst node = capture.node\n\t\t\tconst startLine = node.startPosition.row + 1\n\t\t\tconst endLine = node.endPosition.row + 1\n\t\t\tconst rangeText = sourceCode.substring(node.startIndex, node.endIndex)\n\t\t\tconst snippetHash = generateSnippetHash(filePath, startLine, endLine, rangeText)\n\t\t\tif (seenHashes.has(snippetHash)) return\n\t\t\tseenHashes.add(snippetHash)\n\n\t\t\tconst name = sourceCode.substring(node.startIndex, node.endIndex)\n\t\t\tconst scope = buildScopeChain(node)\n\n\t\t\tsnippets.push({\n\t\t\t\tname,\n\t\t\t\ttype: SnippetType.ImportOrInclude,\n\t\t\t\tfilePath,\n\t\t\t\tstartLine,\n\t\t\t\tendLine,\n\t\t\t\trangeText,\n\t\t\t\tdefinitionText: rangeText,\n\t\t\t\tscope,\n\t\t\t\tfileHash,\n\t\t\t})\n\t\t}\n\t})\n\n\t// \u5904\u7406\u51FD\u6570/\u65B9\u6CD5\u5B9A\u4E49\n\tfor (const capture of captures) {\n\t\tif (\n\t\t\tcapture.name !== \"definition.method\" &&\n\t\t\tcapture.name !== \"definition.initializer\" &&\n\t\t\tcapture.name !== \"definition.deinitializer\" &&\n\t\t\tcapture.name !== \"definition.protocol_method\"\n\t\t)\n\t\t\tcontinue\n\n\t\tconst node = capture.node\n\t\tconst startLine = node.startPosition.row + 1\n\t\tconst endLine = node.endPosition.row + 1\n\n\t\t// \u67E5\u627E\u51FD\u6570/\u65B9\u6CD5\u540D\n\t\tlet nameCap: Parser.QueryCapture | undefined\n\t\tif (capture.name === \"definition.method\") {\n\t\t\tnameCap = captures.find(\n\t\t\t\t(c) =>\n\t\t\t\t\tc.name === \"name.definition.method\" &&\n\t\t\t\t\tc.node.startIndex >= node.startIndex &&\n\t\t\t\t\tc.node.endIndex <= node.endIndex,\n\t\t\t)\n\t\t} else if (capture.name === \"definition.protocol_method\") {\n\t\t\tnameCap = captures.find(\n\t\t\t\t(c) =>\n\t\t\t\t\tc.name === \"name.definition.protocol_method\" &&\n\t\t\t\t\tc.node.startIndex >= node.startIndex &&\n\t\t\t\t\tc.node.endIndex <= node.endIndex,\n\t\t\t)\n\t\t} else if (capture.name === \"definition.initializer\") {\n\t\t\tnameCap = captures.find(\n\t\t\t\t(c) =>\n\t\t\t\t\tc.name === \"name.definition.initializer\" &&\n\t\t\t\t\tc.node.startIndex >= node.startIndex &&\n\t\t\t\t\tc.node.endIndex <= node.endIndex,\n\t\t\t)\n\t\t} else if (capture.name === \"definition.deinitializer\") {\n\t\t\tnameCap = captures.find(\n\t\t\t\t(c) =>\n\t\t\t\t\tc.name === \"name.definition.deinitializer\" &&\n\t\t\t\t\tc.node.startIndex >= node.startIndex &&\n\t\t\t\t\tc.node.endIndex <= node.endIndex,\n\t\t\t)\n\t\t}\n\n\t\tif (!nameCap) continue\n\t\tconst name = sourceCode.substring(nameCap.node.startIndex, nameCap.node.endIndex)\n\n\t\t// \u67E5\u627E\u53C2\u6570 - \u4E3ASwift\u5B9E\u73B0\u57FA\u672C\u7684\u53C2\u6570\u89E3\u6790\n\t\tconst parameters: ParameterInfo[] = []\n\n\t\t// \u67E5\u627E\u51FD\u6570\u58F0\u660E\u4E2D\u7684\u53C2\u6570\u5217\u8868\n\t\t// Swift\u51FD\u6570\u53C2\u6570\u5728 parameter_list \u8282\u70B9\u4E2D\n\t\tlet parameterNodes: Parser.SyntaxNode[] = []\n\t\tfunction findParameterNodes(node: Parser.SyntaxNode) {\n\t\t\tif (node.type === \"parameter\") {\n\t\t\t\tparameterNodes.push(node)\n\t\t\t}\n\t\t\tfor (let i = 0; i < node.childCount; i++) {\n\t\t\t\tconst child = node.child(i)\n\t\t\t\tif (child) {\n\t\t\t\t\tfindParameterNodes(child)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tfindParameterNodes(node)\n\n\t\t// \u89E3\u6790\u6BCF\u4E2A\u53C2\u6570\n\t\tfor (const paramNode of parameterNodes) {\n\t\t\t// \u67E5\u627E\u53C2\u6570\u540D - Swift\u53C2\u6570\u53EF\u80FD\u6709external name\u548Cinternal name\n\t\t\tlet paramName = \"\"\n\t\t\tfor (let i = 0; i < paramNode.childCount; i++) {\n\t\t\t\tconst child = paramNode.child(i)\n\t\t\t\tif (child && child.type === \"simple_identifier\") {\n\t\t\t\t\tparamName = sourceCode.substring(child.startIndex, child.endIndex)\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (paramName) {\n\t\t\t\tparameters.push({\n\t\t\t\t\tname: paramName,\n\t\t\t\t\ttype: \"Any\", // \u6682\u65F6\u4F7F\u7528\u5360\u4F4D\u7B26\u7C7B\u578B\n\t\t\t\t})\n\t\t\t}\n\t\t}\n\n\t\t// \u67E5\u627E\u65B9\u6CD5\u4F53\n\t\tconst bodyCap = captures.find(\n\t\t\t(c) =>\n\t\t\t\tc.name === \"body.definition.method\" &&\n\t\t\t\tc.node.startIndex >= node.startIndex &&\n\t\t\t\tc.node.endIndex <= node.endIndex,\n\t\t)\n\n\t\tlet rangeText: string\n\t\tlet implementText: string | undefined = undefined\n\n\t\tif (bodyCap) {\n\t\t\t// \u83B7\u53D6\u65B9\u6CD5\u7B7E\u540D\uFF08\u4E0D\u5305\u62EC\u65B9\u6CD5\u4F53\uFF09\n\t\t\trangeText = sourceCode.substring(node.startIndex, bodyCap.node.startIndex).trimEnd()\n\t\t\timplementText = sourceCode.substring(node.startIndex, node.endIndex)\n\t\t} else {\n\t\t\trangeText = sourceCode.substring(node.startIndex, node.endIndex)\n\t\t}\n\n\t\tconst snippetHash = generateSnippetHash(filePath, startLine, endLine, rangeText)\n\t\tif (seenHashes.has(snippetHash)) continue\n\t\tseenHashes.add(snippetHash)\n\n\t\t// \u67E5\u627E\u8FD4\u56DE\u7C7B\u578B - \u6682\u65F6\u8DF3\u8FC7\n\t\tlet returnType = \"\"\n\n\t\tconst paramStr = parameters.map((p) => p.name).join(\", \")\n\t\tconst signature = `${name}(${paramStr})`\n\t\tconst scope = buildScopeChain(node)\n\n\t\t// \u786E\u5B9A\u662F\u5426\u5C5E\u4E8E\u67D0\u4E2A\u7C7B/\u7ED3\u6784\u4F53/\u534F\u8BAE\uFF08\u8BBE\u7F6Efield\uFF09\n\t\tlet field: string | undefined = undefined\n\t\tlet closestContainer: (typeof containerCaptures)[0] | undefined = undefined\n\n\t\t// \u627E\u5230\u6700\u5C0F\u7684\u5305\u542B\u5F53\u524D\u8282\u70B9\u7684\u5BB9\u5668\n\t\tfor (const container of containerCaptures) {\n\t\t\tif (node.startIndex > container.start && node.endIndex <= container.end) {\n\t\t\t\tif (\n\t\t\t\t\t!closestContainer ||\n\t\t\t\t\tcontainer.end - container.start < closestContainer.end - closestContainer.start\n\t\t\t\t) {\n\t\t\t\t\tclosestContainer = container\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (closestContainer) {\n\t\t\t// \u5BF9\u4E8Eextension\uFF0C\u4F7F\u7528\u88AB\u6269\u5C55\u7684\u7C7B\u578B\u540D\uFF1B\u5426\u5219\u4F7F\u7528\u5BB9\u5668\u7684\u540D\u79F0\n\t\t\tfield =\n\t\t\t\tclosestContainer.actualName ||\n\t\t\t\t(closestContainer.nameCap\n\t\t\t\t\t? sourceCode.substring(\n\t\t\t\t\t\t\tclosestContainer.nameCap.node.startIndex,\n\t\t\t\t\t\t\tclosestContainer.nameCap.node.endIndex,\n\t\t\t\t\t\t)\n\t\t\t\t\t: undefined)\n\t\t}\n\n\t\tsnippets.push({\n\t\t\tname,\n\t\t\ttype: SnippetType.FunctionOrMethod,\n\t\t\tfilePath,\n\t\t\tstartLine,\n\t\t\tendLine,\n\t\t\trangeText,\n\t\t\tdefinitionText: rangeText,\n\t\t\tscope,\n\t\t\tfileHash,\n\t\t\tfield,\n\t\t\tdefinition: {\n\t\t\t\tname,\n\t\t\t\ttype: node.type,\n\t\t\t\tparameters,\n\t\t\t\treturnType,\n\t\t\t},\n\t\t\tparameters,\n\t\t\tsignature,\n\t\t\tlanguage: CodeLanguageType.Swift,\n\t\t\t...(implementText ? { implementText } : {}),\n\t\t})\n\t}\n\n\t// \u5904\u7406\u5C5E\u6027\u5B9A\u4E49\uFF08\u5305\u542B\u8BA1\u7B97\u5C5E\u6027\uFF09\n\tfor (const capture of captures) {\n\t\tif (capture.name !== \"definition.property\" && capture.name !== \"definition.computed_property\") continue\n\n\t\tconst node = capture.node\n\t\tconst startLine = node.startPosition.row + 1\n\t\tconst endLine = node.endPosition.row + 1\n\n\t\t// \u68C0\u67E5\u662F\u5426\u5DF2\u7ECF\u5904\u7406\u8FC7\u8FD9\u4E2A\u8282\u70B9\uFF08\u9632\u6B62\u91CD\u590D\u5904\u7406\u540C\u4E00\u4E2A\u5C5E\u6027\uFF09\n\t\tconst nodeHash = `${node.startIndex}-${node.endIndex}`\n\t\tconst isAlreadyProcessed = snippets.some(\n\t\t\t(s) => s.rangeText === sourceCode.substring(node.startIndex, node.endIndex) && s.startLine === startLine,\n\t\t)\n\t\tif (isAlreadyProcessed) continue\n\n\t\t// \u67E5\u627E\u5C5E\u6027\u540D\uFF0C\u4F18\u5148\u4F7F\u7528computed_property\u7684\u540D\u79F0\n\t\tlet nameCap: Parser.QueryCapture | undefined\n\t\tlet isComputedProperty = false\n\n\t\t// \u9996\u5148\u68C0\u67E5\u662F\u5426\u6709computed_property\u540D\u79F0capture\n\t\tnameCap = captures.find(\n\t\t\t(c) =>\n\t\t\t\tc.name === \"name.definition.computed_property\" &&\n\t\t\t\tc.node.startIndex >= node.startIndex &&\n\t\t\t\tc.node.endIndex <= node.endIndex,\n\t\t)\n\n\t\tif (nameCap) {\n\t\t\tisComputedProperty = true\n\t\t} else {\n\t\t\t// \u5982\u679C\u6CA1\u6709\uFF0C\u4F7F\u7528\u666E\u901Aproperty\u540D\u79F0capture\n\t\t\tnameCap = captures.find(\n\t\t\t\t(c) =>\n\t\t\t\t\tc.name === \"name.definition.property\" &&\n\t\t\t\t\tc.node.startIndex >= node.startIndex &&\n\t\t\t\t\tc.node.endIndex <= node.endIndex,\n\t\t\t)\n\t\t}\n\n\t\tif (!nameCap) continue\n\t\tconst name = sourceCode.substring(nameCap.node.startIndex, nameCap.node.endIndex)\n\n\t\t// \u5224\u65AD\u662F\u5426\u5728\u5BB9\u5668\u5185\u90E8\n\t\tconst isInContainer = containerCaptures.some(\n\t\t\t(container) => node.startIndex > container.start && node.endIndex <= container.end,\n\t\t)\n\n\t\tif (!isInContainer) continue // \u53EA\u5904\u7406\u7C7B/\u7ED3\u6784\u4F53\u5185\u7684\u5C5E\u6027\n\n\t\tconst rangeText = sourceCode.substring(node.startIndex, node.endIndex)\n\t\tconst snippetHash = generateSnippetHash(filePath, startLine, endLine, rangeText)\n\t\tif (seenHashes.has(snippetHash)) continue\n\t\tseenHashes.add(snippetHash)\n\n\t\tconst scope = buildScopeChain(node)\n\n\t\t// \u786E\u5B9A\u5C5E\u4E8E\u54EA\u4E2A\u5BB9\u5668\n\t\tlet field: string | undefined = undefined\n\t\tlet closestContainer: (typeof containerCaptures)[0] | undefined = undefined\n\n\t\t// \u627E\u5230\u6700\u5C0F\u7684\u5305\u542B\u5F53\u524D\u8282\u70B9\u7684\u5BB9\u5668\n\t\tfor (const container of containerCaptures) {\n\t\t\tif (node.startIndex > container.start && node.endIndex <= container.end) {\n\t\t\t\tif (\n\t\t\t\t\t!closestContainer ||\n\t\t\t\t\tcontainer.end - container.start < closestContainer.end - closestContainer.start\n\t\t\t\t) {\n\t\t\t\t\tclosestContainer = container\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (closestContainer) {\n\t\t\t// \u5BF9\u4E8Eextension\uFF0C\u4F7F\u7528\u88AB\u6269\u5C55\u7684\u7C7B\u578B\u540D\uFF1B\u5426\u5219\u4F7F\u7528\u5BB9\u5668\u7684\u540D\u79F0\n\t\t\tfield =\n\t\t\t\tclosestContainer.actualName ||\n\t\t\t\t(closestContainer.nameCap\n\t\t\t\t\t? sourceCode.substring(\n\t\t\t\t\t\t\tclosestContainer.nameCap.node.startIndex,\n\t\t\t\t\t\t\tclosestContainer.nameCap.node.endIndex,\n\t\t\t\t\t\t)\n\t\t\t\t\t: undefined)\n\t\t}\n\n\t\tsnippets.push({\n\t\t\tname,\n\t\t\ttype: SnippetType.VariableOrConstant,\n\t\t\tfilePath,\n\t\t\tstartLine,\n\t\t\tendLine,\n\t\t\trangeText,\n\t\t\tdefinitionText: rangeText,\n\t\t\timplementText: rangeText,\n\t\t\tscope,\n\t\t\tfileHash,\n\t\t\tfield,\n\t\t\tdefinition: {\n\t\t\t\tname,\n\t\t\t\ttype: isComputedProperty ? \"computed_property\" : \"property\",\n\t\t\t},\n\t\t\tlanguage: CodeLanguageType.Swift,\n\t\t})\n\t}\n\n\t// \u5904\u7406\u5168\u5C40\u53D8\u91CF\u548C\u5E38\u91CF\n\tfor (const capture of captures) {\n\t\tif (capture.name !== \"definition.global_var\") continue\n\n\t\tconst node = capture.node\n\t\tconst startLine = node.startPosition.row + 1\n\t\tconst endLine = node.endPosition.row + 1\n\n\t\t// \u67E5\u627E\u53D8\u91CF\u540D\n\t\tconst nameCap = captures.find(\n\t\t\t(c) =>\n\t\t\t\tc.name === \"name.definition.global_var\" &&\n\t\t\t\tc.node.startIndex >= node.startIndex &&\n\t\t\t\tc.node.endIndex <= node.endIndex,\n\t\t)\n\n\t\tif (!nameCap) continue\n\t\tconst name = sourceCode.substring(nameCap.node.startIndex, nameCap.node.endIndex)\n\n\t\tconst rangeText = sourceCode.substring(node.startIndex, node.endIndex)\n\t\tconst snippetHash = generateSnippetHash(filePath, startLine, endLine, rangeText)\n\t\tif (seenHashes.has(snippetHash)) continue\n\t\tseenHashes.add(snippetHash)\n\n\t\tconst scope = buildScopeChain(node)\n\n\t\t// \u5224\u65AD\u662Flet\u8FD8\u662Fvar\n\t\tlet varType = \"var\"\n\t\tif (rangeText.trim().startsWith(\"let\")) {\n\t\t\tvarType = \"let\"\n\t\t}\n\n\t\tsnippets.push({\n\t\t\tname,\n\t\t\ttype: SnippetType.VariableOrConstant,\n\t\t\tfilePath,\n\t\t\tstartLine,\n\t\t\tendLine,\n\t\t\trangeText,\n\t\t\tdefinitionText: rangeText,\n\t\t\timplementText: rangeText,\n\t\t\tscope,\n\t\t\tfileHash,\n\t\t\tfield: \"\",\n\t\t\tdefinition: { name, type: varType },\n\t\t\tlanguage: CodeLanguageType.Swift,\n\t\t})\n\t}\n\n\t// \u5904\u7406\u7C7B/\u7ED3\u6784\u4F53/\u534F\u8BAE/\u679A\u4E3E\u5B9A\u4E49\n\tconst typeDefs = [\n\t\t{ capture: \"name.definition.class\", outlineType: \"class\" },\n\t\t{ capture: \"name.definition.protocol\", outlineType: \"protocol\" },\n\t\t{ capture: \"name.definition.type_alias\", outlineType: \"typealias\" },\n\t]\n\n\tfor (const { capture, outlineType } of typeDefs) {\n\t\tconst defCaptureName = `definition.${outlineType === \"typealias\" ? \"type_alias\" : outlineType}`\n\n\t\tfor (const cap of captures.filter((c) => c.name === capture)) {\n\t\t\tconst node = cap.node\n\n\t\t\t// \u5224\u65AD\u662F\u5426\u5728\u51FD\u6570/\u65B9\u6CD5\u5185\n\t\t\tconst isInFunc = captures.some(\n\t\t\t\t(fc) =>\n\t\t\t\t\t(fc.name === \"definition.method\" ||\n\t\t\t\t\t\tfc.name === \"definition.initializer\" ||\n\t\t\t\t\t\tfc.name === \"definition.deinitializer\") &&\n\t\t\t\t\tfc.node.startIndex < node.startIndex &&\n\t\t\t\t\tnode.endIndex < fc.node.endIndex,\n\t\t\t)\n\t\t\tif (isInFunc) continue\n\n\t\t\t// \u4F18\u5148\u4F7F\u7528@definition.xxx\u533A\u95F4 - \u627E\u5230\u6700\u5177\u4F53\uFF08\u6700\u5C0F\uFF09\u7684\u5305\u542B\u6B64\u540D\u79F0\u7684\u5B9A\u4E49\n\t\t\tlet defCap = captures\n\t\t\t\t.filter(\n\t\t\t\t\t(c) =>\n\t\t\t\t\t\tc.name === defCaptureName &&\n\t\t\t\t\t\tc.node.startIndex <= node.startIndex &&\n\t\t\t\t\t\tnode.endIndex <= c.node.endIndex,\n\t\t\t\t)\n\t\t\t\t.sort((a, b) => a.node.endIndex - a.node.startIndex - (b.node.endIndex - b.node.startIndex))[0]\n\n\t\t\tconst rangeText = defCap\n\t\t\t\t? sourceCode.substring(defCap.node.startIndex, defCap.node.endIndex)\n\t\t\t\t: sourceCode.substring(node.startIndex, node.endIndex)\n\n\t\t\t// \u5BF9\u4E8Eclass_declaration\uFF0C\u4F7F\u7528AST\u68C0\u67E5\u786E\u5B9A\u771F\u5B9E\u7C7B\u578B\n\t\t\tlet actualType = outlineType\n\t\t\tif (outlineType === \"class\" && defCap) {\n\t\t\t\tactualType = determineClassDeclarationType(defCap.node, sourceCode)\n\t\t\t}\n\n\t\t\tconst startLine = node.startPosition.row + 1\n\t\t\tconst endLine = node.endPosition.row + 1\n\t\t\tconst snippetHash = generateSnippetHash(filePath, startLine, endLine, rangeText)\n\t\t\tif (seenHashes.has(snippetHash)) continue\n\t\t\tseenHashes.add(snippetHash)\n\n\t\t\tconst name = sourceCode.substring(node.startIndex, node.endIndex)\n\n\t\t\tsnippets.push({\n\t\t\t\tname,\n\t\t\t\ttype: SnippetType.ClassOrInterfaceOrStructOrEnum,\n\t\t\t\tfilePath,\n\t\t\t\tstartLine,\n\t\t\t\tendLine,\n\t\t\t\trangeText,\n\t\t\t\tdefinitionText: rangeText,\n\t\t\t\timplementText: rangeText,\n\t\t\t\tscope: [],\n\t\t\t\tfileHash,\n\t\t\t\tfield: \"\",\n\t\t\t\tdefinition: { name, type: actualType },\n\t\t\t\tlanguage: CodeLanguageType.Swift,\n\t\t\t})\n\t\t}\n\t}\n\n\t// \u6839\u636EsnippetTypes\u8FC7\u6EE4\u5E76\u6392\u5E8F\n\treturn snippets.filter((snippet) => snippetTypes.includes(snippet.type)).sort((a, b) => a.startLine - b.startLine)\n}\n\n/**\n * \u5C06\u6587\u672C\u4E2D\u7684\u6362\u884C\u7B26\u66FF\u6362\u4E3A\u7A7A\u683C\uFF0C\u63D0\u9AD8\u53EF\u8BFB\u6027\n */\nfunction normalizeTextForSummary(text: string): string {\n\treturn text.split(\"\\n\").join(\" \")\n}\n\n/**\n * \u786E\u5B9Aclass_declaration\u7684\u5B9E\u9645\u7C7B\u578B\uFF08class\u3001struct\u3001enum\u3001extension\uFF09\n */\nfunction determineClassDeclarationType(node: Parser.SyntaxNode, sourceCode: string): string {\n\t// \u68C0\u67E5\u7B2C\u4E00\u4E2A\u5B50\u8282\u70B9\u6765\u786E\u5B9A\u7C7B\u578B\n\tif (node.childCount > 0) {\n\t\tconst firstChild = node.child(0)\n\t\tif (firstChild) {\n\t\t\tconst firstChildType = firstChild.type\n\t\t\tif (firstChildType === \"struct\") return \"struct\"\n\t\t\tif (firstChildType === \"enum\") return \"enum\"\n\t\t\tif (firstChildType === \"class\") return \"class\"\n\t\t\tif (firstChildType === \"extension\") return \"extension\"\n\t\t}\n\t}\n\t// \u9ED8\u8BA4\u8FD4\u56DEclass\n\treturn \"class\"\n}\nfunction parseSwiftParameters(paramText: string): string[] {\n\tif (!paramText.trim()) return []\n\n\tconst params: string[] = []\n\tlet current = \"\"\n\tlet parenDepth = 0\n\tlet bracketDepth = 0\n\tlet inString = false\n\tlet stringChar = \"\"\n\n\tfor (let i = 0; i < paramText.length; i++) {\n\t\tconst char = paramText[i]\n\n\t\tif (!inString) {\n\t\t\tif (char === '\"' || char === \"'\") {\n\t\t\t\tinString = true\n\t\t\t\tstringChar = char\n\t\t\t} else if (char === \"(\") {\n\t\t\t\tparenDepth++\n\t\t\t} else if (char === \")\") {\n\t\t\t\tparenDepth--\n\t\t\t} else if (char === \"[\") {\n\t\t\t\tbracketDepth++\n\t\t\t} else if (char === \"]\") {\n\t\t\t\tbracketDepth--\n\t\t\t} else if (char === \",\" && parenDepth === 0 && bracketDepth === 0) {\n\t\t\t\tif (current.trim()) {\n\t\t\t\t\tparams.push(current.trim())\n\t\t\t\t}\n\t\t\t\tcurrent = \"\"\n\t\t\t\tcontinue\n\t\t\t}\n\t\t} else {\n\t\t\tif (char === stringChar && paramText[i - 1] !== \"\\\\\") {\n\t\t\t\tinString = false\n\t\t\t\tstringChar = \"\"\n\t\t\t}\n\t\t}\n\n\t\tcurrent += char\n\t}\n\n\tif (current.trim()) {\n\t\tparams.push(current.trim())\n\t}\n\n\treturn params\n}\n\n// VSCode Outline Entry \u7C7B\u578B\nexport interface OutlineEntry {\n\ttype: string\n\tname: string\n\tfile: string // \u8868\u793A\u5F53\u524D\u6587\u4EF6\n\tfield?: string // \u7A7A\u5B57\u7B26\u4E32\u4EE3\u8868\u5F53\u524D\u6587\u4EF6\u7684global\n\tdescription?: string\n}\n\n/**\n * \u6839\u636ESwift\u6587\u4EF6\u7684\u6240\u6709snippet\u751F\u6210\u5927\u7EB2\uFF08Outline\uFF09\n */\nexport function buildSummaryFromSnippets(snippets: ISnippetMeta[]): OutlineEntry[] {\n\tconst outline: OutlineEntry[] = []\n\n\t// \u53EA\u4FDD\u7559\u5168\u5C40\u5B9A\u4E49\uFF08scope\u4E3A\u7A7A\u6216\u5168\u4E3A\"\"\uFF09\n\tconst isGlobal = (s: ISnippetMeta) => !s.scope || s.scope.length === 0 || s.scope.every((x) => !x)\n\n\tfor (const s of snippets) {\n\t\tif (!isGlobal(s)) continue\n\n\t\tif (s.type === SnippetType.ImportOrInclude) {\n\t\t\toutline.push({\n\t\t\t\ttype: \"import\",\n\t\t\t\tname: s.name,\n\t\t\t\tfile: s.filePath,\n\t\t\t\tfield: \"\",\n\t\t\t\tdescription: s.definitionText,\n\t\t\t})\n\t\t} else if (s.type === SnippetType.FunctionOrMethod) {\n\t\t\tif (s.field) {\n\t\t\t\toutline.push({\n\t\t\t\t\ttype: \"method\",\n\t\t\t\t\tname: s.name,\n\t\t\t\t\tfile: s.filePath,\n\t\t\t\t\tfield: s.field,\n\t\t\t\t\tdescription: s.definitionText,\n\t\t\t\t})\n\t\t\t} else {\n\t\t\t\toutline.push({\n\t\t\t\t\ttype: \"function\",\n\t\t\t\t\tname: s.name,\n\t\t\t\t\tfile: s.filePath,\n\t\t\t\t\tfield: \"\",\n\t\t\t\t\tdescription: s.definitionText,\n\t\t\t\t})\n\t\t\t}\n\t\t} else if (s.type === SnippetType.VariableOrConstant) {\n\t\t\tconst t = s.definition?.type || \"var\"\n\t\t\toutline.push({\n\t\t\t\ttype: t,\n\t\t\t\tname: s.name,\n\t\t\t\tfile: s.filePath,\n\t\t\t\tfield: s.field || \"\",\n\t\t\t\tdescription: s.definitionText,\n\t\t\t})\n\t\t} else if (s.type === SnippetType.ClassOrInterfaceOrStructOrEnum) {\n\t\t\tconst t = s.definition?.type || \"type\"\n\t\t\toutline.push({\n\t\t\t\ttype: t,\n\t\t\t\tname: s.name,\n\t\t\t\tfile: s.filePath,\n\t\t\t\tfield: \"\",\n\t\t\t\tdescription: s.name,\n\t\t\t})\n\t\t}\n\t}\n\n\treturn outline\n}\n\n/**\n * \u5C06OutlineEntry[]\u683C\u5F0F\u5316\u4E3A\u6587\u672C\uFF0C\u540C\u4E00\u4E2Afield\u7684\u653E\u5728\u4E00\u8D77\u3002\n */\nexport function formatOutlineText(outline: OutlineEntry[]): string {\n\t// \u6309field\u5206\u7EC4\n\tconst groups: Record<string, OutlineEntry[]> = {}\n\tfor (const entry of outline) {\n\t\tconst key = entry.field ?? \"\"\n\t\tif (!groups[key]) groups[key] = []\n\t\tgroups[key].push(entry)\n\t}\n\n\t// \u5408\u6210\u6587\u672C\n\tlet result = \"\"\n\tfor (const field of Object.keys(groups).sort()) {\n\t\tconst group = groups[field]\n\t\tconst title = field === \"\" ? \"[global]\" : `[${field}]`\n\t\tresult += title + \"\\n\"\n\t\tfor (const entry of group) {\n\t\t\tlet line = ` ${entry.type}`\n\t\t\tif (entry.description) line += `: ${normalizeTextForSummary(entry.description)}`\n\t\t\tresult += line + \"\\n\"\n\t\t}\n\t\tresult += \"\\n\"\n\t}\n\treturn result.trimEnd()\n}\n", "import { SnippetType, ISnippetMeta, ParameterInfo, CodeLanguageType } from \"../types\"\nimport Parser from \"web-tree-sitter\"\nimport { generateSnippetHash, buildScopeChain } from \"./general\"\nimport { Logger } from \"../Logger\"\n\n/**\n * CSS\u7279\u5B9A\u7684\u8F85\u52A9\u51FD\u6570\n */\n\n/**\n * \u89E3\u6790CSS\u9009\u62E9\u5668\u8282\u70B9\uFF0C\u57FA\u4E8Etree-sitter AST\u63D0\u53D6\u9009\u62E9\u5668\u540D\u79F0\n */\nfunction extractSelectorName(selectorsNode: Parser.SyntaxNode, sourceCode: string): string {\n\t// \u9012\u5F52\u67E5\u627E\u7B2C\u4E00\u4E2A\u6709\u610F\u4E49\u7684\u9009\u62E9\u5668\u540D\u79F0\n\tfunction findSelectorName(node: Parser.SyntaxNode): string | null {\n\t\t// \u5904\u7406\u7C7B\u9009\u62E9\u5668\n\t\tif (node.type === \"class_selector\") {\n\t\t\tconst classNameNode = findChildByType(node, \"class_name\")\n\t\t\tif (classNameNode) {\n\t\t\t\treturn getNodeText(classNameNode, sourceCode)\n\t\t\t}\n\t\t}\n\n\t\t// \u5904\u7406ID\u9009\u62E9\u5668\n\t\tif (node.type === \"id_selector\") {\n\t\t\tconst idNameNode = findChildByType(node, \"id_name\")\n\t\t\tif (idNameNode) {\n\t\t\t\treturn getNodeText(idNameNode, sourceCode)\n\t\t\t}\n\t\t}\n\n\t\t// \u5904\u7406\u6807\u7B7E\u9009\u62E9\u5668\n\t\tif (node.type === \"tag_name\") {\n\t\t\treturn getNodeText(node, sourceCode)\n\t\t}\n\n\t\t// \u5904\u7406\u4F2A\u7C7B/\u4F2A\u5143\u7D20\u9009\u62E9\u5668\n\t\tif (node.type === \"pseudo_class_selector\" || node.type === \"pseudo_element_selector\") {\n\t\t\tconst nameNode = findChildByType(node, \"class_name\") || findChildByType(node, \"tag_name\")\n\t\t\tif (nameNode) {\n\t\t\t\treturn getNodeText(nameNode, sourceCode)\n\t\t\t}\n\t\t}\n\n\t\t// \u9012\u5F52\u67E5\u627E\u5B50\u8282\u70B9\n\t\tfor (let i = 0; i < node.childCount; i++) {\n\t\t\tconst child = node.child(i)\n\t\t\tif (child) {\n\t\t\t\tconst name = findSelectorName(child)\n\t\t\t\tif (name) return name\n\t\t\t}\n\t\t}\n\n\t\treturn null\n\t}\n\n\tconst name = findSelectorName(selectorsNode)\n\tif (name) return name\n\n\t// \u5982\u679C\u65E0\u6CD5\u4ECEAST\u4E2D\u63D0\u53D6\u540D\u79F0\uFF0C\u56DE\u9000\u5230\u7B80\u5355\u7684\u6587\u672C\u5904\u7406\n\tconst selectorText = getNodeText(selectorsNode, sourceCode).trim()\n\n\tlet firstSelector = selectorText\n\tconst separators = [\" \", \",\", \">\", \"+\", \"~\"]\n\tfor (const sep of separators) {\n\t\tconst index = firstSelector.indexOf(sep)\n\t\tif (index >= 0) {\n\t\t\tfirstSelector = firstSelector.substring(0, index)\n\t\t}\n\t}\n\n\t// \u79FB\u9664\u7279\u6B8A\u5B57\u7B26\n\tif (firstSelector.startsWith(\".\")) return firstSelector.substring(1)\n\tif (firstSelector.startsWith(\"#\")) return firstSelector.substring(1)\n\n\treturn firstSelector || \"selector\"\n}\n\n/**\n * \u5224\u65AD\u662F\u5426\u4E3ACSS\u53D8\u91CF\uFF08\u81EA\u5B9A\u4E49\u5C5E\u6027\uFF09\n */\nfunction isCSSVariable(propertyName: string): boolean {\n\treturn propertyName.startsWith(\"--\")\n}\n\n/**\n * \u4ECE\u8282\u70B9\u4E2D\u63D0\u53D6\u6587\u672C\u5185\u5BB9\n */\nfunction getNodeText(node: Parser.SyntaxNode, sourceCode: string): string {\n\treturn sourceCode.substring(node.startIndex, node.endIndex)\n}\n\n/**\n * \u67E5\u627E\u5B50\u8282\u70B9\u6309\u7C7B\u578B\n */\nfunction findChildByType(node: Parser.SyntaxNode, type: string): Parser.SyntaxNode | null {\n\tfor (let i = 0; i < node.childCount; i++) {\n\t\tconst child = node.child(i)\n\t\tif (child && child.type === type) {\n\t\t\treturn child\n\t\t}\n\t}\n\treturn null\n}\n\n/**\n * \u4E3B\u8981\u7684CSS\u6355\u83B7\u5904\u7406\u51FD\u6570\n * \u4ECEtree-sitter\u7684captures\u4E2D\u63D0\u53D6CSS\u4EE3\u7801\u7247\u6BB5\u4FE1\u606F\n */\nexport async function extractSnippetsFromCapturesForCSS(\n\tcaptures: Parser.QueryCapture[],\n\tsourceCode: string,\n\tfilePath: string,\n\tfileHash: string,\n\tsnippetTypes: SnippetType[],\n\toptions: { maxSnippetLines: number; minSnippetLines: number },\n): Promise<ISnippetMeta[]> {\n\tconst logger = Logger.getDefaultLogger().with(\"[extractSnippetsFromCapturesForCSS]\")\n\tconst snippets: ISnippetMeta[] = []\n\tconst seenHashes = new Set<string>()\n\n\tif (snippetTypes.length === 0) {\n\t\tlogger.warn(`No snippet types provided, skipping`)\n\t\treturn snippets\n\t}\n\n\t// \u5904\u7406\u6355\u83B7\u7684\u6BCF\u4E2A\u8282\u70B9\n\tfor (const capture of captures) {\n\t\tconst node = capture.node\n\t\tconst startLine = node.startPosition.row + 1\n\t\tconst endLine = node.endPosition.row + 1\n\t\tconst rangeText = getNodeText(node, sourceCode)\n\n\t\tconst snippetHash = generateSnippetHash(filePath, startLine, endLine, rangeText)\n\t\tif (seenHashes.has(snippetHash)) continue\n\t\tseenHashes.add(snippetHash)\n\n\t\t// \u5904\u7406CSS\u89C4\u5219\u96C6\uFF08\u9009\u62E9\u5668\uFF09\n\t\tif (capture.name === \"definition.rule\" && snippetTypes.includes(SnippetType.ClassOrInterfaceOrStructOrEnum)) {\n\t\t\t// \u67E5\u627E\u9009\u62E9\u5668capture\n\t\t\tconst selectorsCapture = captures.find(\n\t\t\t\t(c) =>\n\t\t\t\t\tc.name === \"selectors.definition.rule\" &&\n\t\t\t\t\tc.node.startIndex >= node.startIndex &&\n\t\t\t\t\tc.node.endIndex <= node.endIndex,\n\t\t\t)\n\n\t\t\tif (selectorsCapture) {\n\t\t\t\tconst selectorText = getNodeText(selectorsCapture.node, sourceCode)\n\t\t\t\tconst selectorName = extractSelectorName(selectorsCapture.node, sourceCode)\n\n\t\t\t\t// \u57FA\u4E8EAST\u8282\u70B9\u786E\u5B9A\u9009\u62E9\u5668\u7C7B\u578B\n\t\t\t\tlet definitionType = \"selector\"\n\n\t\t\t\t// \u9012\u5F52\u67E5\u627E\u9009\u62E9\u5668\u7C7B\u578B\n\t\t\t\tfunction findSelectorType(node: Parser.SyntaxNode): string {\n\t\t\t\t\tif (node.type === \"class_selector\") return \"class_selector\"\n\t\t\t\t\tif (node.type === \"id_selector\") return \"id_selector\"\n\t\t\t\t\tif (node.type === \"tag_name\") return \"tag_selector\"\n\t\t\t\t\tif (node.type === \"pseudo_class_selector\" || node.type === \"pseudo_element_selector\")\n\t\t\t\t\t\treturn \"pseudo_selector\"\n\n\t\t\t\t\tfor (let i = 0; i < node.childCount; i++) {\n\t\t\t\t\t\tconst child = node.child(i)\n\t\t\t\t\t\tif (child) {\n\t\t\t\t\t\t\tconst type = findSelectorType(child)\n\t\t\t\t\t\t\tif (type !== \"selector\") return type\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\treturn \"selector\"\n\t\t\t\t}\n\n\t\t\t\tdefinitionType = findSelectorType(selectorsCapture.node)\n\n\t\t\t\tsnippets.push({\n\t\t\t\t\tname: selectorName,\n\t\t\t\t\ttype: SnippetType.ClassOrInterfaceOrStructOrEnum,\n\t\t\t\t\tfilePath,\n\t\t\t\t\tstartLine,\n\t\t\t\t\tendLine,\n\t\t\t\t\trangeText,\n\t\t\t\t\tfileHash,\n\t\t\t\t\tlanguage: CodeLanguageType.CSS,\n\t\t\t\t\tdefinition: {\n\t\t\t\t\t\tname: selectorName,\n\t\t\t\t\t\ttype: definitionType,\n\t\t\t\t\t},\n\t\t\t\t\tdefinitionText: rangeText,\n\t\t\t\t\tsignature: selectorName,\n\t\t\t\t\tscope: buildScopeChain(node),\n\t\t\t\t})\n\t\t\t}\n\t\t}\n\n\t\t// \u5904\u7406@import\u8BED\u53E5\n\t\telse if (capture.name === \"definition.import\" && snippetTypes.includes(SnippetType.ImportOrInclude)) {\n\t\t\t// \u67E5\u627E\u5BFC\u5165\u540D\u79F0capture\n\t\t\tconst nameCapture = captures.find(\n\t\t\t\t(c) =>\n\t\t\t\t\tc.name === \"name.definition.import\" &&\n\t\t\t\t\tc.node.startIndex >= node.startIndex &&\n\t\t\t\t\tc.node.endIndex <= node.endIndex,\n\t\t\t)\n\n\t\t\tlet importName = \"import\"\n\t\t\tif (nameCapture) {\n\t\t\t\t// \u4F7F\u7528\u5B57\u7B26\u4E32\u65B9\u6CD5\u79FB\u9664\u5F15\u53F7\uFF0C\u4EE3\u66FF\u6B63\u5219\u8868\u8FBE\u5F0F\n\t\t\t\tlet rawName = getNodeText(nameCapture.node, sourceCode)\n\t\t\t\tif (rawName.startsWith('\"') && rawName.endsWith('\"')) {\n\t\t\t\t\trawName = rawName.slice(1, -1)\n\t\t\t\t} else if (rawName.startsWith(\"'\") && rawName.endsWith(\"'\")) {\n\t\t\t\t\trawName = rawName.slice(1, -1)\n\t\t\t\t}\n\t\t\t\timportName = rawName\n\t\t\t}\n\n\t\t\tsnippets.push({\n\t\t\t\tname: importName,\n\t\t\t\ttype: SnippetType.ImportOrInclude,\n\t\t\t\tfilePath,\n\t\t\t\tstartLine,\n\t\t\t\tendLine,\n\t\t\t\trangeText,\n\t\t\t\tfileHash,\n\t\t\t\tlanguage: CodeLanguageType.CSS,\n\t\t\t\tdefinitionText: rangeText,\n\t\t\t\tsignature: `@import \"${importName}\"`,\n\t\t\t\tscope: buildScopeChain(node),\n\t\t\t})\n\t\t}\n\n\t\t// \u5904\u7406@keyframes\u52A8\u753B\n\t\telse if (\n\t\t\tcapture.name === \"definition.keyframes\" &&\n\t\t\tsnippetTypes.includes(SnippetType.ClassOrInterfaceOrStructOrEnum)\n\t\t) {\n\t\t\t// \u67E5\u627Ekeyframes\u540D\u79F0capture\n\t\t\tconst nameCapture = captures.find(\n\t\t\t\t(c) =>\n\t\t\t\t\tc.name === \"name.definition.keyframes\" &&\n\t\t\t\t\tc.node.startIndex >= node.startIndex &&\n\t\t\t\t\tc.node.endIndex <= node.endIndex,\n\t\t\t)\n\n\t\t\tlet keyframesName = \"animation\"\n\t\t\tif (nameCapture) {\n\t\t\t\tkeyframesName = getNodeText(nameCapture.node, sourceCode)\n\t\t\t}\n\n\t\t\tsnippets.push({\n\t\t\t\tname: keyframesName,\n\t\t\t\ttype: SnippetType.ClassOrInterfaceOrStructOrEnum,\n\t\t\t\tfilePath,\n\t\t\t\tstartLine,\n\t\t\t\tendLine,\n\t\t\t\trangeText,\n\t\t\t\tfileHash,\n\t\t\t\tlanguage: CodeLanguageType.CSS,\n\t\t\t\tdefinition: {\n\t\t\t\t\tname: keyframesName,\n\t\t\t\t\ttype: \"keyframes\",\n\t\t\t\t},\n\t\t\t\tdefinitionText: rangeText,\n\t\t\t\tsignature: keyframesName,\n\t\t\t\tscope: buildScopeChain(node),\n\t\t\t})\n\t\t}\n\n\t\t// \u5904\u7406@media\u67E5\u8BE2\n\t\telse if (\n\t\t\tcapture.name === \"definition.media\" &&\n\t\t\tsnippetTypes.includes(SnippetType.ClassOrInterfaceOrStructOrEnum)\n\t\t) {\n\t\t\t// \u67E5\u627E\u5A92\u4F53\u67E5\u8BE2capture\n\t\t\tconst queryCapture = captures.find(\n\t\t\t\t(c) =>\n\t\t\t\t\tc.name === \"query.definition.media\" &&\n\t\t\t\t\tc.node.startIndex >= node.startIndex &&\n\t\t\t\t\tc.node.endIndex <= node.endIndex,\n\t\t\t)\n\n\t\t\tlet mediaName = \"media\"\n\t\t\tif (queryCapture) {\n\t\t\t\tmediaName = getNodeText(queryCapture.node, sourceCode).trim()\n\t\t\t}\n\n\t\t\tsnippets.push({\n\t\t\t\tname: mediaName,\n\t\t\t\ttype: SnippetType.ClassOrInterfaceOrStructOrEnum,\n\t\t\t\tfilePath,\n\t\t\t\tstartLine,\n\t\t\t\tendLine,\n\t\t\t\trangeText,\n\t\t\t\tfileHash,\n\t\t\t\tlanguage: CodeLanguageType.CSS,\n\t\t\t\tdefinition: {\n\t\t\t\t\tname: mediaName,\n\t\t\t\t\ttype: \"media\",\n\t\t\t\t},\n\t\t\t\tdefinitionText: rangeText,\n\t\t\t\tsignature: `@media ${mediaName}`,\n\t\t\t\tscope: buildScopeChain(node),\n\t\t\t})\n\t\t}\n\n\t\t// \u5904\u7406CSS\u51FD\u6570\n\t\telse if (capture.name === \"definition.function\" && snippetTypes.includes(SnippetType.FunctionOrMethod)) {\n\t\t\t// \u67E5\u627E\u51FD\u6570\u540Dcapture\n\t\t\tconst nameCapture = captures.find(\n\t\t\t\t(c) =>\n\t\t\t\t\tc.name === \"name.definition.function\" &&\n\t\t\t\t\tc.node.startIndex >= node.startIndex &&\n\t\t\t\t\tc.node.endIndex <= node.endIndex,\n\t\t\t)\n\n\t\t\tif (nameCapture) {\n\t\t\t\tconst functionName = getNodeText(nameCapture.node, sourceCode)\n\n\t\t\t\t// \u67E5\u627E\u53C2\u6570capture\n\t\t\t\tconst argsCapture = captures.find(\n\t\t\t\t\t(c) =>\n\t\t\t\t\t\tc.name === \"args.definition.function\" &&\n\t\t\t\t\t\tc.node.startIndex >= node.startIndex &&\n\t\t\t\t\t\tc.node.endIndex <= node.endIndex,\n\t\t\t\t)\n\n\t\t\t\tconst parameters: ParameterInfo[] = []\n\t\t\t\tif (argsCapture) {\n\t\t\t\t\tconst argsText = getNodeText(argsCapture.node, sourceCode)\n\t\t\t\t\t// \u7B80\u5355\u7684\u53C2\u6570\u5206\u5272\uFF0C\u5904\u7406\u9017\u53F7\u5206\u9694\u7684\u53C2\u6570\n\t\t\t\t\tconst args = argsText\n\t\t\t\t\t\t.split(\",\")\n\t\t\t\t\t\t.map((arg) => arg.trim())\n\t\t\t\t\t\t.filter((arg) => arg.length > 0)\n\t\t\t\t\tparameters.push(...args.map((arg) => ({ name: arg })))\n\t\t\t\t}\n\n\t\t\t\tconst signature =\n\t\t\t\t\tparameters.length > 0\n\t\t\t\t\t\t? `${functionName}(${parameters.map((p) => p.name).join(\", \")})`\n\t\t\t\t\t\t: `${functionName}()`\n\n\t\t\t\tsnippets.push({\n\t\t\t\t\tname: functionName,\n\t\t\t\t\ttype: SnippetType.FunctionOrMethod,\n\t\t\t\t\tfilePath,\n\t\t\t\t\tstartLine,\n\t\t\t\t\tendLine,\n\t\t\t\t\trangeText,\n\t\t\t\t\tfileHash,\n\t\t\t\t\tlanguage: CodeLanguageType.CSS,\n\t\t\t\t\tparameters,\n\t\t\t\t\tdefinition: {\n\t\t\t\t\t\tname: functionName,\n\t\t\t\t\t\ttype: \"function\",\n\t\t\t\t\t\tparameters,\n\t\t\t\t\t},\n\t\t\t\t\tdefinitionText: rangeText,\n\t\t\t\t\tsignature,\n\t\t\t\t\tscope: buildScopeChain(node),\n\t\t\t\t})\n\t\t\t}\n\t\t}\n\n\t\t// \u5904\u7406CSS\u58F0\u660E\uFF08\u53D8\u91CF\u548C\u5C5E\u6027\uFF09\n\t\telse if (capture.name === \"definition.declaration\" && snippetTypes.includes(SnippetType.VariableOrConstant)) {\n\t\t\t// \u67E5\u627E\u5C5E\u6027\u540Dcapture\n\t\t\tconst propertyCapture = captures.find(\n\t\t\t\t(c) =>\n\t\t\t\t\tc.name === \"property.definition.declaration\" &&\n\t\t\t\t\tc.node.startIndex >= node.startIndex &&\n\t\t\t\t\tc.node.endIndex <= node.endIndex,\n\t\t\t)\n\n\t\t\tif (propertyCapture) {\n\t\t\t\tconst propertyName = getNodeText(propertyCapture.node, sourceCode)\n\n\t\t\t\t// \u53EA\u5904\u7406CSS\u53D8\u91CF\n\t\t\t\tif (isCSSVariable(propertyName)) {\n\t\t\t\t\t// \u67E5\u627E\u503Ccapture\n\t\t\t\t\tconst valueCapture = captures.find(\n\t\t\t\t\t\t(c) =>\n\t\t\t\t\t\t\tc.name === \"value.definition.declaration\" &&\n\t\t\t\t\t\t\tc.node.startIndex >= node.startIndex &&\n\t\t\t\t\t\t\tc.node.endIndex <= node.endIndex,\n\t\t\t\t\t)\n\n\t\t\t\t\tlet propertyValue = \"\"\n\t\t\t\t\tif (valueCapture) {\n\t\t\t\t\t\tpropertyValue = getNodeText(valueCapture.node, sourceCode)\n\t\t\t\t\t}\n\n\t\t\t\t\tsnippets.push({\n\t\t\t\t\t\tname: propertyName,\n\t\t\t\t\t\ttype: SnippetType.VariableOrConstant,\n\t\t\t\t\t\tfilePath,\n\t\t\t\t\t\tstartLine,\n\t\t\t\t\t\tendLine,\n\t\t\t\t\t\trangeText,\n\t\t\t\t\t\tfileHash,\n\t\t\t\t\t\tlanguage: CodeLanguageType.CSS,\n\t\t\t\t\t\tdefinition: {\n\t\t\t\t\t\t\tname: propertyName,\n\t\t\t\t\t\t\ttype: \"css_variable\",\n\t\t\t\t\t\t},\n\t\t\t\t\t\tdefinitionText: `${propertyName}: ${propertyValue};`,\n\t\t\t\t\t\tsignature: `${propertyName}: ${propertyValue}`,\n\t\t\t\t\t\tscope: buildScopeChain(node),\n\t\t\t\t\t})\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tlogger.info(`Extracted ${snippets.length} CSS snippets`)\n\treturn snippets\n}\n\n/**\n * \u6784\u5EFACSS\u6587\u4EF6\u7684\u6458\u8981\u4FE1\u606F\n */\nexport function buildSummaryFromSnippets(snippets: ISnippetMeta[]): {\n\tselectors: ISnippetMeta[]\n\tvariables: ISnippetMeta[]\n\tfunctions: ISnippetMeta[]\n\tatRules: ISnippetMeta[]\n\timports: ISnippetMeta[]\n} {\n\tconst selectors: ISnippetMeta[] = []\n\tconst variables: ISnippetMeta[] = []\n\tconst functions: ISnippetMeta[] = []\n\tconst atRules: ISnippetMeta[] = []\n\tconst imports: ISnippetMeta[] = []\n\n\tfor (const snippet of snippets) {\n\t\tswitch (snippet.type) {\n\t\t\tcase SnippetType.ImportOrInclude:\n\t\t\t\timports.push(snippet)\n\t\t\t\tbreak\n\t\t\tcase SnippetType.FunctionOrMethod:\n\t\t\t\tfunctions.push(snippet)\n\t\t\t\tbreak\n\t\t\tcase SnippetType.VariableOrConstant:\n\t\t\t\tvariables.push(snippet)\n\t\t\t\tbreak\n\t\t\tcase SnippetType.ClassOrInterfaceOrStructOrEnum:\n\t\t\t\tif (snippet.definition?.type?.includes(\"selector\")) {\n\t\t\t\t\tselectors.push(snippet)\n\t\t\t\t} else {\n\t\t\t\t\tatRules.push(snippet)\n\t\t\t\t}\n\t\t\t\tbreak\n\t\t}\n\t}\n\n\treturn { selectors, variables, functions, atRules, imports }\n}\n\n/**\n * \u683C\u5F0F\u5316CSS\u6587\u4EF6\u7684\u5927\u7EB2\u6587\u672C\n */\nexport function formatOutlineText(summary: {\n\tselectors: ISnippetMeta[]\n\tvariables: ISnippetMeta[]\n\tfunctions: ISnippetMeta[]\n\tatRules: ISnippetMeta[]\n\timports: ISnippetMeta[]\n}): string {\n\tlet outline = \"CSS File Overview:\\n\\n\"\n\n\tif (summary.imports.length > 0) {\n\t\toutline += \"Imports:\\n\"\n\t\tfor (const imp of summary.imports) {\n\t\t\toutline += ` - ${imp.signature}\\n`\n\t\t}\n\t\toutline += \"\\n\"\n\t}\n\n\tif (summary.variables.length > 0) {\n\t\toutline += \"CSS Variables & Properties:\\n\"\n\t\tfor (const variable of summary.variables) {\n\t\t\toutline += ` - ${variable.signature}\\n`\n\t\t}\n\t\toutline += \"\\n\"\n\t}\n\n\tif (summary.selectors.length > 0) {\n\t\toutline += \"Selectors:\\n\"\n\t\tfor (const selector of summary.selectors) {\n\t\t\tconst type = selector.definition?.type || \"selector\"\n\t\t\toutline += ` - ${selector.name} (${type})\\n`\n\t\t}\n\t\toutline += \"\\n\"\n\t}\n\n\tif (summary.functions.length > 0) {\n\t\toutline += \"CSS Functions:\\n\"\n\t\tfor (const func of summary.functions) {\n\t\t\toutline += ` - ${func.signature}\\n`\n\t\t}\n\t\toutline += \"\\n\"\n\t}\n\n\tif (summary.atRules.length > 0) {\n\t\toutline += \"At-Rules:\\n\"\n\t\tfor (const rule of summary.atRules) {\n\t\t\toutline += ` - @${rule.definition?.type}: ${rule.name}\\n`\n\t\t}\n\t\toutline += \"\\n\"\n\t}\n\n\treturn outline.trim()\n}\n", "import { SnippetType, ISnippetMeta, ParameterInfo, CodeLanguageType } from \"../types\"\nimport Parser from \"web-tree-sitter\"\nimport { generateSnippetHash, buildScopeChain } from \"./general\"\nimport { Logger } from \"../Logger\"\n\n/**\n * HTML\u7279\u5B9A\u7684\u8F85\u52A9\u51FD\u6570\n */\n\n/**\n * \u66FF\u6362\u5B57\u7B26\u4E32\u4E2D\u7684\u6362\u884C\u7B26\u4E3A\u53EF\u89C6\u5316\u5B57\u7B26\uFF08\u7528\u4E8E\u65E5\u5FD7\u8F93\u51FA\uFF09\n */\nfunction escapeNewlinesForLogging(text: string): string {\n\treturn text.split(\"\\n\").join(\"\\\\n\")\n}\n\n/**\n * \u683C\u5F0F\u5316\u7C7B\u578B\u540D\u79F0\uFF1A\u5C06\u4E0B\u5212\u7EBF\u5206\u9694\u7684\u7C7B\u578B\u540D\u8F6C\u6362\u4E3A\u6807\u9898\u683C\u5F0F\n * \u4F8B\u5982: \"semantic_element\" -> \"Semantic Element\"\n */\nfunction formatTypeLabel(type: string): string {\n\treturn type\n\t\t.split(\"_\")\n\t\t.map((word) => word.charAt(0).toUpperCase() + word.slice(1).toLowerCase())\n\t\t.join(\" \")\n}\n\n/**\n * \u4ECE\u8282\u70B9\u4E2D\u63D0\u53D6\u6587\u672C\u5185\u5BB9\n */\nfunction getNodeText(node: Parser.SyntaxNode, sourceCode: string): string {\n\treturn sourceCode.substring(node.startIndex, node.endIndex)\n}\n\n/**\n * \u67E5\u627E\u5B50\u8282\u70B9\u6309\u7C7B\u578B\n */\nfunction findChildByType(node: Parser.SyntaxNode, type: string): Parser.SyntaxNode | null {\n\tfor (let i = 0; i < node.childCount; i++) {\n\t\tconst child = node.child(i)\n\t\tif (child && child.type === type) {\n\t\t\treturn child\n\t\t}\n\t}\n\treturn null\n}\n\n/**\n * \u9012\u5F52\u67E5\u627E\u6307\u5B9A\u7C7B\u578B\u7684\u5B50\u8282\u70B9\n */\nfunction findChildByTypeRecursive(node: Parser.SyntaxNode, type: string): Parser.SyntaxNode | null {\n\tif (node.type === type) {\n\t\treturn node\n\t}\n\n\tfor (let i = 0; i < node.childCount; i++) {\n\t\tconst child = node.child(i)\n\t\tif (child) {\n\t\t\tconst found = findChildByTypeRecursive(child, type)\n\t\t\tif (found) return found\n\t\t}\n\t}\n\treturn null\n}\n\n/**\n * \u63D0\u53D6HTML\u5143\u7D20\u7684\u6807\u7B7E\u540D\n */\nfunction extractTagName(node: Parser.SyntaxNode, sourceCode: string): string {\n\t// \u67E5\u627Etag_name\u8282\u70B9\n\tconst tagNameNode = findChildByTypeRecursive(node, \"tag_name\")\n\tif (tagNameNode) {\n\t\treturn getNodeText(tagNameNode, sourceCode)\n\t}\n\n\t// \u56DE\u9000\u5230\u9ED8\u8BA4\u540D\u79F0\n\treturn \"element\"\n}\n\n/**\n * \u63D0\u53D6HTML\u5C5E\u6027\u4FE1\u606F\n */\nfunction extractAttributeInfo(node: Parser.SyntaxNode, sourceCode: string): { name: string; value?: string } {\n\tconst attributeNameNode = findChildByType(node, \"attribute_name\")\n\tconst attributeValueNode =\n\t\tfindChildByType(node, \"attribute_value\") || findChildByType(node, \"quoted_attribute_value\")\n\n\tconst name = attributeNameNode ? getNodeText(attributeNameNode, sourceCode) : \"attribute\"\n\tlet value: string | undefined\n\n\tif (attributeValueNode) {\n\t\tlet rawValue = getNodeText(attributeValueNode, sourceCode)\n\t\t// \u79FB\u9664\u5F15\u53F7\n\t\tif (\n\t\t\t(rawValue.startsWith('\"') && rawValue.endsWith('\"')) ||\n\t\t\t(rawValue.startsWith(\"'\") && rawValue.endsWith(\"'\"))\n\t\t) {\n\t\t\trawValue = rawValue.slice(1, -1)\n\t\t}\n\t\tvalue = rawValue\n\t}\n\n\treturn { name, value }\n}\n\n/**\n * \u5224\u65AD\u662F\u5426\u4E3A\u8BED\u4E49\u5316HTML\u5143\u7D20\n */\nfunction isSemanticElement(tagName: string): boolean {\n\tconst semanticTags = new Set([\n\t\t\"header\",\n\t\t\"nav\",\n\t\t\"main\",\n\t\t\"section\",\n\t\t\"article\",\n\t\t\"aside\",\n\t\t\"footer\",\n\t\t\"figure\",\n\t\t\"figcaption\",\n\t\t\"details\",\n\t\t\"summary\",\n\t\t\"mark\",\n\t\t\"time\",\n\t])\n\treturn semanticTags.has(tagName.toLowerCase())\n}\n\n/**\n * \u5224\u65AD\u662F\u5426\u4E3A\u4EA4\u4E92\u5F0FHTML\u5143\u7D20\n */\nfunction isInteractiveElement(tagName: string): boolean {\n\tconst interactiveTags = new Set([\"button\", \"input\", \"select\", \"textarea\", \"a\", \"form\"])\n\treturn interactiveTags.has(tagName.toLowerCase())\n}\n\n/**\n * \u4E3B\u8981\u7684HTML\u6355\u83B7\u5904\u7406\u51FD\u6570\n * \u4ECEtree-sitter\u7684captures\u4E2D\u63D0\u53D6HTML\u4EE3\u7801\u7247\u6BB5\u4FE1\u606F\n */\nexport async function extractSnippetsFromCapturesForHTML(\n\tcaptures: Parser.QueryCapture[],\n\tsourceCode: string,\n\tfilePath: string,\n\tfileHash: string,\n\tsnippetTypes: SnippetType[],\n\toptions: { maxSnippetLines: number; minSnippetLines: number },\n): Promise<ISnippetMeta[]> {\n\tconst logger = Logger.getDefaultLogger().with(\"[extractSnippetsFromCapturesForHTML]\")\n\tconst snippets: ISnippetMeta[] = []\n\tconst seenHashes = new Set<string>()\n\n\tif (snippetTypes.length === 0) {\n\t\tlogger.warn(`No snippet types provided, skipping`)\n\t\treturn snippets\n\t}\n\n\t// \u5904\u7406\u6355\u83B7\u7684\u6BCF\u4E2A\u8282\u70B9\n\tfor (const capture of captures) {\n\t\tconst node = capture.node\n\t\tconst startLine = node.startPosition.row + 1\n\t\tconst endLine = node.endPosition.row + 1\n\t\tconst rangeText = getNodeText(node, sourceCode)\n\n\t\tconst snippetHash = generateSnippetHash(filePath, startLine, endLine, rangeText) + \"_\" + capture.name\n\t\tif (seenHashes.has(snippetHash)) continue\n\t\tseenHashes.add(snippetHash)\n\n\t\t// DEBUG: Log each capture being processed\n\t\tlogger.info(`Processing capture: ${capture.name} -> \"${escapeNewlinesForLogging(rangeText)}\"`)\n\n\t\t// \u5904\u7406DOCTYPE\u58F0\u660E\n\t\tif (capture.name === \"definition.doctype\" && snippetTypes.includes(SnippetType.ImportOrInclude)) {\n\t\t\tsnippets.push({\n\t\t\t\tname: \"DOCTYPE\",\n\t\t\t\ttype: SnippetType.ImportOrInclude,\n\t\t\t\tfilePath,\n\t\t\t\tstartLine,\n\t\t\t\tendLine,\n\t\t\t\trangeText,\n\t\t\t\tfileHash,\n\t\t\t\tlanguage: CodeLanguageType.HTML,\n\t\t\t\tdefinition: {\n\t\t\t\t\tname: \"DOCTYPE\",\n\t\t\t\t\ttype: \"doctype\",\n\t\t\t\t},\n\t\t\t\tdefinitionText: rangeText,\n\t\t\t\tsignature: \"DOCTYPE html\",\n\t\t\t\tscope: buildScopeChain(node),\n\t\t\t})\n\t\t}\n\n\t\t// \u5904\u7406\u6587\u6863\u6839\u5143\u7D20\n\t\telse if (\n\t\t\tcapture.name === \"definition.document\" &&\n\t\t\tsnippetTypes.includes(SnippetType.ClassOrInterfaceOrStructOrEnum)\n\t\t) {\n\t\t\tsnippets.push({\n\t\t\t\tname: \"document\",\n\t\t\t\ttype: SnippetType.ClassOrInterfaceOrStructOrEnum,\n\t\t\t\tfilePath,\n\t\t\t\tstartLine,\n\t\t\t\tendLine,\n\t\t\t\trangeText,\n\t\t\t\tfileHash,\n\t\t\t\tlanguage: CodeLanguageType.HTML,\n\t\t\t\tdefinition: {\n\t\t\t\t\tname: \"document\",\n\t\t\t\t\ttype: \"document\",\n\t\t\t\t},\n\t\t\t\tdefinitionText: rangeText,\n\t\t\t\tsignature: \"HTML Document\",\n\t\t\t\tscope: buildScopeChain(node),\n\t\t\t})\n\t\t}\n\n\t\t// \u5904\u7406\u5E38\u89C4HTML\u5143\u7D20\n\t\telse if (\n\t\t\tcapture.name === \"definition.element\" &&\n\t\t\tsnippetTypes.includes(SnippetType.ClassOrInterfaceOrStructOrEnum)\n\t\t) {\n\t\t\t// \u67E5\u627E\u5BF9\u5E94\u7684name capture - \u5B83\u5E94\u8BE5\u5728\u76F8\u540C\u8303\u56F4\u5185\n\t\t\tconst nameCapture = captures.find(\n\t\t\t\t(c) =>\n\t\t\t\t\tc.name === \"name.definition\" &&\n\t\t\t\t\tc.node.startIndex >= node.startIndex &&\n\t\t\t\t\tc.node.endIndex <= node.endIndex,\n\t\t\t)\n\n\t\t\tconst elementName = nameCapture\n\t\t\t\t? getNodeText(nameCapture.node, sourceCode)\n\t\t\t\t: extractTagName(node, sourceCode)\n\n\t\t\t// \u786E\u5B9A\u5143\u7D20\u7C7B\u578B\n\t\t\tlet elementType = \"element\"\n\t\t\tif (isSemanticElement(elementName)) {\n\t\t\t\telementType = \"semantic_element\"\n\t\t\t} else if (isInteractiveElement(elementName)) {\n\t\t\t\telementType = \"interactive_element\"\n\t\t\t}\n\n\t\t\tsnippets.push({\n\t\t\t\tname: elementName,\n\t\t\t\ttype: SnippetType.ClassOrInterfaceOrStructOrEnum,\n\t\t\t\tfilePath,\n\t\t\t\tstartLine,\n\t\t\t\tendLine,\n\t\t\t\trangeText,\n\t\t\t\tfileHash,\n\t\t\t\tlanguage: CodeLanguageType.HTML,\n\t\t\t\tdefinition: {\n\t\t\t\t\tname: elementName,\n\t\t\t\t\ttype: elementType,\n\t\t\t\t},\n\t\t\t\tdefinitionText: rangeText,\n\t\t\t\tsignature: `<${elementName}>`,\n\t\t\t\tscope: buildScopeChain(node),\n\t\t\t})\n\t\t}\n\n\t\t// \u5904\u7406\u811A\u672C\u5143\u7D20\n\t\telse if (capture.name === \"definition.script\" && snippetTypes.includes(SnippetType.FunctionOrMethod)) {\n\t\t\t// \u67E5\u627E\u5BF9\u5E94\u7684name capture - \u5E94\u8BE5\u5728\u76F8\u540C\u8303\u56F4\u5185\n\t\t\tconst nameCapture = captures.find(\n\t\t\t\t(c) =>\n\t\t\t\t\tc.name === \"name.definition\" &&\n\t\t\t\t\tc.node.startIndex >= node.startIndex &&\n\t\t\t\t\tc.node.endIndex <= node.endIndex,\n\t\t\t)\n\n\t\t\tconst scriptName = nameCapture ? getNodeText(nameCapture.node, sourceCode) : \"script\"\n\n\t\t\tsnippets.push({\n\t\t\t\tname: scriptName,\n\t\t\t\ttype: SnippetType.FunctionOrMethod,\n\t\t\t\tfilePath,\n\t\t\t\tstartLine,\n\t\t\t\tendLine,\n\t\t\t\trangeText,\n\t\t\t\tfileHash,\n\t\t\t\tlanguage: CodeLanguageType.HTML,\n\t\t\t\tdefinition: {\n\t\t\t\t\tname: scriptName,\n\t\t\t\t\ttype: \"script\",\n\t\t\t\t},\n\t\t\t\tdefinitionText: rangeText,\n\t\t\t\tsignature: `<${scriptName}>`,\n\t\t\t\tscope: buildScopeChain(node),\n\t\t\t})\n\t\t}\n\n\t\t// \u5904\u7406\u6837\u5F0F\u5143\u7D20\n\t\telse if (capture.name === \"definition.style\" && snippetTypes.includes(SnippetType.FunctionOrMethod)) {\n\t\t\tconst nameCapture = captures.find(\n\t\t\t\t(c) =>\n\t\t\t\t\tc.name === \"name.definition\" &&\n\t\t\t\t\tc.node.startIndex >= node.startIndex &&\n\t\t\t\t\tc.node.endIndex <= node.endIndex,\n\t\t\t)\n\n\t\t\tconst styleName = nameCapture ? getNodeText(nameCapture.node, sourceCode) : \"style\"\n\n\t\t\tsnippets.push({\n\t\t\t\tname: styleName,\n\t\t\t\ttype: SnippetType.FunctionOrMethod,\n\t\t\t\tfilePath,\n\t\t\t\tstartLine,\n\t\t\t\tendLine,\n\t\t\t\trangeText,\n\t\t\t\tfileHash,\n\t\t\t\tlanguage: CodeLanguageType.HTML,\n\t\t\t\tdefinition: {\n\t\t\t\t\tname: styleName,\n\t\t\t\t\ttype: \"style\",\n\t\t\t\t},\n\t\t\t\tdefinitionText: rangeText,\n\t\t\t\tsignature: `<${styleName}>`,\n\t\t\t\tscope: buildScopeChain(node),\n\t\t\t})\n\t\t}\n\n\t\t// \u5904\u7406void\u5143\u7D20\uFF08\u81EA\u95ED\u5408\u5143\u7D20\uFF09\n\t\telse if (\n\t\t\tcapture.name === \"definition.void_element\" &&\n\t\t\tsnippetTypes.includes(SnippetType.ClassOrInterfaceOrStructOrEnum)\n\t\t) {\n\t\t\t// \u67E5\u627E\u5BF9\u5E94\u7684void\u5143\u7D20\u7684name capture\n\t\t\tconst nameCapture = captures.find(\n\t\t\t\t(c) =>\n\t\t\t\t\tc.name === \"name.definition.void\" &&\n\t\t\t\t\tc.node.startIndex >= node.startIndex &&\n\t\t\t\t\tc.node.endIndex <= node.endIndex,\n\t\t\t)\n\n\t\t\tconst elementName = nameCapture\n\t\t\t\t? getNodeText(nameCapture.node, sourceCode)\n\t\t\t\t: extractTagName(node, sourceCode)\n\n\t\t\t// \u786E\u5B9A\u5143\u7D20\u7C7B\u578B - \u4F18\u5148\u68C0\u67E5\u662F\u5426\u4E3A\u4EA4\u4E92\u5143\u7D20\n\t\t\tlet elementType = \"void_element\"\n\t\t\tif (isInteractiveElement(elementName)) {\n\t\t\t\telementType = \"interactive_element\"\n\t\t\t} else if (isSemanticElement(elementName)) {\n\t\t\t\telementType = \"semantic_element\"\n\t\t\t}\n\n\t\t\tsnippets.push({\n\t\t\t\tname: elementName,\n\t\t\t\ttype: SnippetType.ClassOrInterfaceOrStructOrEnum,\n\t\t\t\tfilePath,\n\t\t\t\tstartLine,\n\t\t\t\tendLine,\n\t\t\t\trangeText,\n\t\t\t\tfileHash,\n\t\t\t\tlanguage: CodeLanguageType.HTML,\n\t\t\t\tdefinition: {\n\t\t\t\t\tname: elementName,\n\t\t\t\t\ttype: elementType,\n\t\t\t\t},\n\t\t\t\tdefinitionText: rangeText,\n\t\t\t\tsignature: elementType === \"void_element\" ? `<${elementName} />` : `<${elementName}>`,\n\t\t\t\tscope: buildScopeChain(node),\n\t\t\t})\n\t\t}\n\n\t\t// \u5904\u7406\u81EA\u95ED\u5408\u6807\u7B7E\n\t\telse if (\n\t\t\tcapture.name === \"definition.self_closing_tag\" &&\n\t\t\tsnippetTypes.includes(SnippetType.ClassOrInterfaceOrStructOrEnum)\n\t\t) {\n\t\t\tconst nameCapture = captures.find(\n\t\t\t\t(c) =>\n\t\t\t\t\tc.name === \"name.definition\" &&\n\t\t\t\t\tc.node.startIndex >= node.startIndex &&\n\t\t\t\t\tc.node.endIndex <= node.endIndex,\n\t\t\t)\n\n\t\t\tconst tagName = nameCapture ? getNodeText(nameCapture.node, sourceCode) : \"self_closing_tag\"\n\n\t\t\tsnippets.push({\n\t\t\t\tname: tagName,\n\t\t\t\ttype: SnippetType.ClassOrInterfaceOrStructOrEnum,\n\t\t\t\tfilePath,\n\t\t\t\tstartLine,\n\t\t\t\tendLine,\n\t\t\t\trangeText,\n\t\t\t\tfileHash,\n\t\t\t\tlanguage: CodeLanguageType.HTML,\n\t\t\t\tdefinition: {\n\t\t\t\t\tname: tagName,\n\t\t\t\t\ttype: \"self_closing_tag\",\n\t\t\t\t},\n\t\t\t\tdefinitionText: rangeText,\n\t\t\t\tsignature: `<${tagName} />`,\n\t\t\t\tscope: buildScopeChain(node),\n\t\t\t})\n\t\t}\n\n\t\t// \u5904\u7406HTML\u5C5E\u6027\n\t\telse if (capture.name === \"definition.attribute\" && snippetTypes.includes(SnippetType.VariableOrConstant)) {\n\t\t\t// \u67E5\u627E\u5BF9\u5E94\u7684name capture - \u5E94\u8BE5\u5728\u76F8\u540C\u8303\u56F4\u5185\n\t\t\tconst nameCapture = captures.find(\n\t\t\t\t(c) =>\n\t\t\t\t\tc.name === \"name.definition\" &&\n\t\t\t\t\tc.node.startIndex >= node.startIndex &&\n\t\t\t\t\tc.node.endIndex <= node.endIndex,\n\t\t\t)\n\n\t\t\tif (nameCapture) {\n\t\t\t\tconst attributeInfo = extractAttributeInfo(node, sourceCode)\n\t\t\t\tconst attributeName = attributeInfo.name\n\n\t\t\t\t// \u786E\u5B9A\u5C5E\u6027\u7C7B\u578B\n\t\t\t\tlet attributeType = \"attribute\"\n\t\t\t\tif (attributeName.startsWith(\"data-\")) {\n\t\t\t\t\tattributeType = \"data_attribute\"\n\t\t\t\t} else if (attributeName.startsWith(\"aria-\")) {\n\t\t\t\t\tattributeType = \"aria_attribute\"\n\t\t\t\t} else if ([\"id\", \"class\"].includes(attributeName)) {\n\t\t\t\t\tattributeType = \"core_attribute\"\n\t\t\t\t}\n\n\t\t\t\tconst signature = attributeInfo.value ? `${attributeName}=\"${attributeInfo.value}\"` : attributeName\n\n\t\t\t\tsnippets.push({\n\t\t\t\t\tname: attributeName,\n\t\t\t\t\ttype: SnippetType.VariableOrConstant,\n\t\t\t\t\tfilePath,\n\t\t\t\t\tstartLine,\n\t\t\t\t\tendLine,\n\t\t\t\t\trangeText,\n\t\t\t\t\tfileHash,\n\t\t\t\t\tlanguage: CodeLanguageType.HTML,\n\t\t\t\t\tdefinition: {\n\t\t\t\t\t\tname: attributeName,\n\t\t\t\t\t\ttype: attributeType,\n\t\t\t\t\t},\n\t\t\t\t\tdefinitionText: rangeText,\n\t\t\t\t\tsignature,\n\t\t\t\t\tscope: buildScopeChain(node),\n\t\t\t\t})\n\t\t\t}\n\t\t}\n\n\t\t// \u5904\u7406HTML\u6CE8\u91CA\n\t\telse if (capture.name === \"definition.comment\" && snippetTypes.includes(SnippetType.ImportOrInclude)) {\n\t\t\t// \u63D0\u53D6\u6CE8\u91CA\u5185\u5BB9\uFF0C\u79FB\u9664\u6CE8\u91CA\u6807\u8BB0\n\t\t\tlet commentText = rangeText.trim()\n\t\t\tif (commentText.startsWith(\"<!--\") && commentText.endsWith(\"-->\")) {\n\t\t\t\tcommentText = commentText.slice(4, -3).trim()\n\t\t\t}\n\n\t\t\t// \u53D6\u6CE8\u91CA\u7684\u7B2C\u4E00\u884C\u4F5C\u4E3A\u540D\u79F0\n\t\t\tconst firstLine = commentText.split(\"\\n\")[0].trim()\n\t\t\tconst commentName = firstLine.length > 0 ? firstLine : \"comment\"\n\n\t\t\tsnippets.push({\n\t\t\t\tname: commentName,\n\t\t\t\ttype: SnippetType.ImportOrInclude,\n\t\t\t\tfilePath,\n\t\t\t\tstartLine,\n\t\t\t\tendLine,\n\t\t\t\trangeText,\n\t\t\t\tfileHash,\n\t\t\t\tlanguage: CodeLanguageType.HTML,\n\t\t\t\tdefinition: {\n\t\t\t\t\tname: commentName,\n\t\t\t\t\ttype: \"comment\",\n\t\t\t\t},\n\t\t\t\tdefinitionText: rangeText,\n\t\t\t\tsignature: `<!-- ${commentName} -->`,\n\t\t\t\tscope: buildScopeChain(node),\n\t\t\t})\n\t\t}\n\n\t\t// \u5904\u7406\u6587\u672C\u5185\u5BB9\uFF08\u6EE1\u8DB3\u6700\u5C0F\u884C\u6570\u8981\u6C42\uFF09\n\t\telse if (capture.name === \"definition.text\" && snippetTypes.includes(SnippetType.VariableOrConstant)) {\n\t\t\tconst lineCount = endLine - startLine + 1\n\t\t\tif (lineCount >= options.minSnippetLines) {\n\t\t\t\t// \u63D0\u53D6\u6587\u672C\u5185\u5BB9\u7684\u7B2C\u4E00\u884C\u4F5C\u4E3A\u540D\u79F0\n\t\t\t\tconst textContent = rangeText.trim()\n\t\t\t\tconst firstLine = textContent.split(\"\\n\")[0].trim()\n\t\t\t\tconst textName = firstLine.length > 0 ? firstLine : \"text\"\n\n\t\t\t\tsnippets.push({\n\t\t\t\t\tname: textName,\n\t\t\t\t\ttype: SnippetType.VariableOrConstant,\n\t\t\t\t\tfilePath,\n\t\t\t\t\tstartLine,\n\t\t\t\t\tendLine,\n\t\t\t\t\trangeText,\n\t\t\t\t\tfileHash,\n\t\t\t\t\tlanguage: CodeLanguageType.HTML,\n\t\t\t\t\tdefinition: {\n\t\t\t\t\t\tname: textName,\n\t\t\t\t\t\ttype: \"text\",\n\t\t\t\t\t},\n\t\t\t\t\tdefinitionText: rangeText,\n\t\t\t\t\tsignature: textName,\n\t\t\t\t\tscope: buildScopeChain(node),\n\t\t\t\t})\n\t\t\t}\n\t\t}\n\n\t\t// \u5904\u7406\u539F\u59CB\u6587\u672C\u5185\u5BB9\n\t\telse if (capture.name === \"definition.raw_text\" && snippetTypes.includes(SnippetType.VariableOrConstant)) {\n\t\t\tconst lineCount = endLine - startLine + 1\n\t\t\tif (lineCount >= options.minSnippetLines) {\n\t\t\t\tconst textContent = rangeText.trim()\n\t\t\t\tconst firstLine = textContent.split(\"\\n\")[0].trim()\n\t\t\t\tconst rawTextName = firstLine.length > 0 ? firstLine : \"raw_text\"\n\n\t\t\t\tsnippets.push({\n\t\t\t\t\tname: rawTextName,\n\t\t\t\t\ttype: SnippetType.VariableOrConstant,\n\t\t\t\t\tfilePath,\n\t\t\t\t\tstartLine,\n\t\t\t\t\tendLine,\n\t\t\t\t\trangeText,\n\t\t\t\t\tfileHash,\n\t\t\t\t\tlanguage: CodeLanguageType.HTML,\n\t\t\t\t\tdefinition: {\n\t\t\t\t\t\tname: rawTextName,\n\t\t\t\t\t\ttype: \"raw_text\",\n\t\t\t\t\t},\n\t\t\t\t\tdefinitionText: rangeText,\n\t\t\t\t\tsignature: rawTextName,\n\t\t\t\t\tscope: buildScopeChain(node),\n\t\t\t\t})\n\t\t\t}\n\t\t}\n\n\t\t// \u5904\u7406\u5D4C\u5957\u5143\u7D20\u7ED3\u6784\n\t\telse if (\n\t\t\tcapture.name === \"definition.nested_elements\" &&\n\t\t\tsnippetTypes.includes(SnippetType.ClassOrInterfaceOrStructOrEnum)\n\t\t) {\n\t\t\tconst tagName = extractTagName(node, sourceCode)\n\n\t\t\tsnippets.push({\n\t\t\t\tname: `${tagName}_container`,\n\t\t\t\ttype: SnippetType.ClassOrInterfaceOrStructOrEnum,\n\t\t\t\tfilePath,\n\t\t\t\tstartLine,\n\t\t\t\tendLine,\n\t\t\t\trangeText,\n\t\t\t\tfileHash,\n\t\t\t\tlanguage: CodeLanguageType.HTML,\n\t\t\t\tdefinition: {\n\t\t\t\t\tname: `${tagName}_container`,\n\t\t\t\t\ttype: \"nested_elements\",\n\t\t\t\t},\n\t\t\t\tdefinitionText: rangeText,\n\t\t\t\tsignature: `<${tagName}> (with children)`,\n\t\t\t\tscope: buildScopeChain(node),\n\t\t\t})\n\t\t}\n\t}\n\n\tlogger.info(`[CodeContext] Extracted ${snippets.length} HTML snippets`)\n\treturn snippets\n}\n\n/**\n * \u6784\u5EFAHTML\u4EE3\u7801\u7684\u6982\u89C8\u6587\u672C\n */\nexport function buildSummaryFromSnippets(snippets: ISnippetMeta[]): {\n\tdoctypes: ISnippetMeta[]\n\telements: ISnippetMeta[]\n\tattributes: ISnippetMeta[]\n\tscripts: ISnippetMeta[]\n\tstyles: ISnippetMeta[]\n\tcomments: ISnippetMeta[]\n\ttextContent: ISnippetMeta[]\n} {\n\tconst summary = {\n\t\tdoctypes: [] as ISnippetMeta[],\n\t\telements: [] as ISnippetMeta[],\n\t\tattributes: [] as ISnippetMeta[],\n\t\tscripts: [] as ISnippetMeta[],\n\t\tstyles: [] as ISnippetMeta[],\n\t\tcomments: [] as ISnippetMeta[],\n\t\ttextContent: [] as ISnippetMeta[],\n\t}\n\n\tfor (const snippet of snippets) {\n\t\tconst defType = snippet.definition?.type || \"\"\n\n\t\tswitch (defType) {\n\t\t\tcase \"doctype\":\n\t\t\t\tsummary.doctypes.push(snippet)\n\t\t\t\tbreak\n\t\t\tcase \"element\":\n\t\t\tcase \"semantic_element\":\n\t\t\tcase \"interactive_element\":\n\t\t\tcase \"void_element\":\n\t\t\tcase \"self_closing_tag\":\n\t\t\tcase \"nested_elements\":\n\t\t\t\tsummary.elements.push(snippet)\n\t\t\t\tbreak\n\t\t\tcase \"attribute\":\n\t\t\tcase \"data_attribute\":\n\t\t\tcase \"aria_attribute\":\n\t\t\tcase \"core_attribute\":\n\t\t\t\tsummary.attributes.push(snippet)\n\t\t\t\tbreak\n\t\t\tcase \"script\":\n\t\t\t\tsummary.scripts.push(snippet)\n\t\t\t\tbreak\n\t\t\tcase \"style\":\n\t\t\t\tsummary.styles.push(snippet)\n\t\t\t\tbreak\n\t\t\tcase \"comment\":\n\t\t\t\tsummary.comments.push(snippet)\n\t\t\t\tbreak\n\t\t\tcase \"text\":\n\t\t\tcase \"raw_text\":\n\t\t\t\tsummary.textContent.push(snippet)\n\t\t\t\tbreak\n\t\t}\n\t}\n\n\treturn summary\n}\n\n/**\n * \u683C\u5F0F\u5316HTML\u6982\u89C8\u6587\u672C\u8F93\u51FA\n */\nexport function formatOutlineText(summary: ReturnType<typeof buildSummaryFromSnippets>): string {\n\tconst lines: string[] = []\n\n\t// DOCTYPE\u58F0\u660E\n\tif (summary.doctypes.length > 0) {\n\t\tlines.push(\"## Document Type\")\n\t\tsummary.doctypes.forEach((snippet) => {\n\t\t\tlines.push(`- ${snippet.signature || snippet.name}`)\n\t\t})\n\t\tlines.push(\"\")\n\t}\n\n\t// HTML\u5143\u7D20\n\tif (summary.elements.length > 0) {\n\t\tlines.push(\"## HTML Elements\")\n\t\tsummary.elements.forEach((snippet) => {\n\t\t\tconst typeSuffix =\n\t\t\t\tsnippet.definition?.type === \"semantic_element\"\n\t\t\t\t\t? \" (semantic)\"\n\t\t\t\t\t: snippet.definition?.type === \"interactive_element\"\n\t\t\t\t\t\t? \" (interactive)\"\n\t\t\t\t\t\t: \"\"\n\t\t\tlines.push(`- ${snippet.signature || snippet.name}${typeSuffix}`)\n\t\t})\n\t\tlines.push(\"\")\n\t}\n\n\t// \u811A\u672C\u548C\u6837\u5F0F\n\tif (summary.scripts.length > 0 || summary.styles.length > 0) {\n\t\tlines.push(\"## Scripts & Styles\")\n\t\tsummary.scripts.forEach((snippet) => {\n\t\t\tlines.push(`- ${snippet.signature || snippet.name} (script)`)\n\t\t})\n\t\tsummary.styles.forEach((snippet) => {\n\t\t\tlines.push(`- ${snippet.signature || snippet.name} (style)`)\n\t\t})\n\t\tlines.push(\"\")\n\t}\n\n\t// \u5C5E\u6027\n\tif (summary.attributes.length > 0) {\n\t\tlines.push(\"## Attributes\")\n\t\tconst attributesByType: Record<string, ISnippetMeta[]> = {}\n\t\tsummary.attributes.forEach((snippet) => {\n\t\t\tconst type = snippet.definition?.type || \"attribute\"\n\t\t\tif (!attributesByType[type]) attributesByType[type] = []\n\t\t\tattributesByType[type].push(snippet)\n\t\t})\n\n\t\tObject.keys(attributesByType)\n\t\t\t.sort()\n\t\t\t.forEach((type) => {\n\t\t\t\tconst typeLabel = formatTypeLabel(type)\n\t\t\t\tlines.push(`### ${typeLabel}`)\n\t\t\t\tattributesByType[type].forEach((snippet) => {\n\t\t\t\t\tlines.push(`- ${snippet.signature || snippet.name}`)\n\t\t\t\t})\n\t\t\t})\n\t\tlines.push(\"\")\n\t}\n\n\t// \u6CE8\u91CA\n\tif (summary.comments.length > 0) {\n\t\tlines.push(\"## Comments\")\n\t\tsummary.comments.forEach((snippet) => {\n\t\t\tlines.push(`- ${snippet.name}`)\n\t\t})\n\t\tlines.push(\"\")\n\t}\n\n\t// \u6587\u672C\u5185\u5BB9\n\tif (summary.textContent.length > 0) {\n\t\tlines.push(\"## Text Content\")\n\t\tsummary.textContent.forEach((snippet) => {\n\t\t\tconst preview = snippet.name.length > 50 ? snippet.name.substring(0, 47) + \"...\" : snippet.name\n\t\t\tlines.push(`- ${preview}`)\n\t\t})\n\t\tlines.push(\"\")\n\t}\n\n\treturn lines.join(\"\\n\").trim()\n}\n", "import { Logger } from \"../Logger\"\nimport { CodeLanguageType, ISnippetMeta, SnippetType, ParameterInfo } from \"../types\"\nimport Parser from \"web-tree-sitter\"\nimport * as crypto from \"crypto\"\n\n/**\n * \u63D0\u53D6\u4FEE\u9970\u7B26\uFF08private, protected, internal, public\u7B49\uFF09\n */\nfunction extractModifiers(node: Parser.SyntaxNode, sourceCode: string): string[] {\n\tconst modifiers: string[] = []\n\n\t// \u67E5\u627E\u4FEE\u9970\u7B26\u8282\u70B9\n\tconst modifierNode = node.children.find((child) => child.type === \"modifiers\")\n\tif (modifierNode) {\n\t\tmodifierNode.children.forEach((child) => {\n\t\t\tif (child.type === \"visibility_modifier\" || child.type === \"modifier\") {\n\t\t\t\tconst modifier = sourceCode.substring(child.startIndex, child.endIndex)\n\t\t\t\tmodifiers.push(modifier)\n\t\t\t}\n\t\t})\n\t}\n\n\treturn modifiers\n}\n\n/**\n * \u4ECEimport\u8BED\u53E5\u4E2D\u63D0\u53D6\u5BFC\u5165\u8DEF\u5F84\uFF08\u907F\u514D\u4F7F\u7528\u6B63\u5219\u8868\u8FBE\u5F0F\uFF09\n */\nfunction extractImportPath(importNode: Parser.SyntaxNode, sourceCode: string): string {\n\t// \u5148\u5C1D\u8BD5\u67E5\u627E\u5B8C\u6574\u7684import\u8DEF\u5F84\uFF0C\u5305\u62EC\u901A\u914D\u7B26\n\tconst fullImportText = sourceCode.substring(importNode.startIndex, importNode.endIndex)\n\n\t// \u67E5\u627Eimport\u5173\u952E\u5B57\u7684\u4F4D\u7F6E\n\tconst importKeywordIndex = fullImportText.indexOf(\"import\")\n\tif (importKeywordIndex === -1) return fullImportText.trim()\n\n\t// \u63D0\u53D6import\u540E\u9762\u7684\u5185\u5BB9\n\tconst importKeywordEnd = importKeywordIndex + 6 // \"import\".length\n\tlet pathPart = fullImportText.substring(importKeywordEnd).trim()\n\n\t// \u79FB\u9664\u53EF\u80FD\u7684\u6362\u884C\u7B26\u548C\u5206\u53F7\n\tpathPart = pathPart.split(\"\\n\")[0].split(\"\\r\")[0].split(\";\")[0].trim()\n\n\treturn pathPart\n}\n\n/**\n * \u6839\u636EAST\u8282\u70B9\u786E\u5B9A\u5B9A\u4E49\u7C7B\u578B\uFF08\u907F\u514D\u4F7F\u7528\u5B57\u7B26\u4E32\u5339\u914D\uFF09\n */\nfunction getDefinitionType(node: Parser.SyntaxNode, sourceCode: string): string {\n\t// \u68C0\u67E5\u8282\u70B9\u7C7B\u578B\n\tif (node.type === \"object_declaration\") return \"object\"\n\tif (node.type === \"type_alias\") return \"typealias\"\n\n\tif (node.type === \"class_declaration\") {\n\t\t// \u67E5\u627E\u4FEE\u9970\u7B26\u8282\u70B9\u6765\u786E\u5B9A\u7C7B\u578B\n\t\tconst modifierNode = node.children.find((child) => child.type === \"modifiers\")\n\t\tif (modifierNode) {\n\t\t\tconst modifierTexts = modifierNode.children.map((child) =>\n\t\t\t\tsourceCode.substring(child.startIndex, child.endIndex),\n\t\t\t)\n\n\t\t\t// \u68C0\u67E5\u4FEE\u9970\u7B26\u7EC4\u5408\n\t\t\tif (modifierTexts.includes(\"sealed\")) return \"sealed class\"\n\t\t\tif (modifierTexts.includes(\"data\")) return \"data class\"\n\t\t\tif (modifierTexts.includes(\"enum\")) return \"enum\"\n\t\t\tif (modifierTexts.includes(\"annotation\")) return \"annotation class\"\n\t\t}\n\n\t\t// \u68C0\u67E5\u662F\u5426\u6709enum_class_body\n\t\tconst hasEnumBody = node.children.some((child) => child.type === \"enum_class_body\")\n\t\tif (hasEnumBody) return \"enum\"\n\n\t\t// \u68C0\u67E5\u662F\u5426\u4E3A\u63A5\u53E3\uFF08\u901A\u8FC7\u67E5\u627Einterface\u5173\u952E\u5B57\u8282\u70B9\uFF09\n\t\tconst hasInterfaceKeyword = node.children.some((child) => {\n\t\t\tif (child.type === \"interface\") return true\n\t\t\tconst childText = sourceCode.substring(child.startIndex, child.endIndex)\n\t\t\treturn childText === \"interface\"\n\t\t})\n\t\tif (hasInterfaceKeyword) return \"interface\"\n\n\t\treturn \"class\"\n\t}\n\n\treturn \"class\"\n}\n\n/**\n * \u67E5\u627E\u7236\u7C7B\u6216\u63A5\u53E3\u540D\u79F0\n */\nfunction findParentClassName(\n\tcaptures: Parser.QueryCapture[],\n\tnode: Parser.SyntaxNode,\n\tsourceCode: string,\n): string | undefined {\n\t// \u67E5\u627E\u5305\u542B\u5F53\u524D\u8282\u70B9\u7684\u7C7B\u58F0\u660E\n\tconst classCapture = captures.find(\n\t\t(c) =>\n\t\t\tc.name === \"definition.class\" && c.node.startIndex <= node.startIndex && c.node.endIndex >= node.endIndex,\n\t)\n\n\tif (classCapture) {\n\t\tconst nameNode = classCapture.node.children.find((child) => child.type === \"type_identifier\")\n\t\treturn nameNode ? sourceCode.substring(nameNode.startIndex, nameNode.endIndex) : undefined\n\t}\n\n\treturn undefined\n}\n\n/**\n * \u89E3\u6790\u5355\u4E2A\u53C2\u6570\u7684\u4FE1\u606F\uFF08\u907F\u514D\u4F7F\u7528\u6B63\u5219\u8868\u8FBE\u5F0F\uFF09\n */\nfunction parseParameterInfo(paramNode: Parser.SyntaxNode, sourceCode: string): ParameterInfo {\n\t// \u67E5\u627E\u53C2\u6570\u540D\u79F0\n\tconst nameNode = paramNode.children.find((child) => child.type === \"simple_identifier\")\n\tconst name = nameNode ? sourceCode.substring(nameNode.startIndex, nameNode.endIndex) : \"\"\n\n\t// \u67E5\u627E\u7C7B\u578B\u6CE8\u89E3\n\tconst typeNode = paramNode.children.find((child) => child.type === \"user_type\" || child.type === \"type_identifier\")\n\tconst type = typeNode ? sourceCode.substring(typeNode.startIndex, typeNode.endIndex) : undefined\n\n\t// \u67E5\u627E\u9ED8\u8BA4\u503C\n\tconst defaultValueNode = paramNode.children.find((child) => child.type === \"default_value\")\n\tconst defaultValue = defaultValueNode\n\t\t? sourceCode.substring(defaultValueNode.startIndex, defaultValueNode.endIndex)\n\t\t: undefined\n\n\treturn {\n\t\tname: name.trim(),\n\t\ttype: type?.trim(),\n\t\tdefaultValue: defaultValue?.trim(),\n\t\tisOptional: !!defaultValue,\n\t}\n}\n\n/**\n * \u63D0\u53D6\u51FD\u6570\u53C2\u6570\n */\nfunction extractParameters(node: Parser.SyntaxNode, sourceCode: string): ParameterInfo[] {\n\tconst parameters: ParameterInfo[] = []\n\n\t// \u67E5\u627E\u53C2\u6570\u5217\u8868\n\tconst parameterList = node.children.find((child) => child.type === \"function_value_parameters\")\n\tif (parameterList) {\n\t\t// \u67E5\u627E\u6240\u6709\u53C2\u6570\n\t\tconst paramNodes = parameterList.children.filter((child) => child.type === \"parameter\")\n\t\tparamNodes.forEach((paramNode) => {\n\t\t\tconst paramInfo = parseParameterInfo(paramNode, sourceCode)\n\t\t\tif (paramInfo.name) {\n\t\t\t\tparameters.push(paramInfo)\n\t\t\t}\n\t\t})\n\t}\n\n\treturn parameters\n}\n\n/**\n * \u63D0\u53D6\u51FD\u6570\u8FD4\u56DE\u7C7B\u578B\n */\nfunction extractReturnType(node: Parser.SyntaxNode, sourceCode: string): string {\n\t// \u67E5\u627E\u8FD4\u56DE\u7C7B\u578B\n\tconst returnTypeNode = node.children.find((child) => child.type === \"user_type\" || child.type === \"type_identifier\")\n\tif (returnTypeNode) {\n\t\treturn sourceCode.substring(returnTypeNode.startIndex, returnTypeNode.endIndex)\n\t}\n\n\treturn \"Unit\"\n}\n\n/**\n * \u4ECEKotlin\u4EE3\u7801\u7684AST\u6355\u83B7\u4E2D\u63D0\u53D6\u4EE3\u7801\u7247\u6BB5\n */\nexport async function extractSnippetsFromCapturesForKotlin(\n\tcaptures: Parser.QueryCapture[],\n\tsourceCode: string,\n\tfilePath: string,\n\tfileHash: string,\n\tsnippetTypes: SnippetType[],\n\toptions: { maxSnippetLines: number; minSnippetLines: number },\n): Promise<ISnippetMeta[]> {\n\tconst logger = Logger.getDefaultLogger().with(\"[extractSnippetsFromCapturesForKotlin]\")\n\tconst snippets: ISnippetMeta[] = []\n\tconst seenHashes = new Set<string>()\n\n\tif (snippetTypes.length === 0) {\n\t\tlogger.warn(`No snippet types provided, skipping`)\n\t\treturn snippets\n\t}\n\n\t// \u5904\u7406 import \u548C package\n\tif (snippetTypes.includes(SnippetType.ImportOrInclude)) {\n\t\tcaptures.forEach((capture) => {\n\t\t\tif (capture.name === \"definition.import\") {\n\t\t\t\tconst node = capture.node\n\t\t\t\tconst startLine = node.startPosition.row + 1\n\t\t\t\tconst endLine = node.endPosition.row + 1\n\n\t\t\t\t// \u63D0\u53D6import\u8DEF\u5F84\n\t\t\t\tconst importPath = extractImportPath(node, sourceCode)\n\t\t\t\tconst name = importPath\n\t\t\t\tconst scope = [\"global\"]\n\t\t\t\tconst rangeText = sourceCode.substring(node.startIndex, node.endIndex).trim()\n\n\t\t\t\t// \u751F\u6210\u552F\u4E00\u7684\u54C8\u5E0C\u503C\n\t\t\t\tconst hash = crypto.createHash(\"md5\").update(`${name}-${filePath}-${startLine}`).digest(\"hex\")\n\t\t\t\tif (seenHashes.has(hash)) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t\tseenHashes.add(hash)\n\n\t\t\t\tsnippets.push({\n\t\t\t\t\tname,\n\t\t\t\t\ttype: SnippetType.ImportOrInclude,\n\t\t\t\t\tfilePath,\n\t\t\t\t\tstartLine,\n\t\t\t\t\tendLine,\n\t\t\t\t\trangeText,\n\t\t\t\t\tdefinitionText: rangeText,\n\t\t\t\t\tscope,\n\t\t\t\t\tfileHash,\n\t\t\t\t\tlanguage: CodeLanguageType.Kotlin,\n\t\t\t\t\tdefinition: {\n\t\t\t\t\t\tname,\n\t\t\t\t\t\ttype: \"import\",\n\t\t\t\t\t},\n\t\t\t\t})\n\t\t\t}\n\t\t})\n\t}\n\n\t// \u5904\u7406\u7C7B\u3001\u63A5\u53E3\u3001\u5BF9\u8C61\u7B49\u58F0\u660E\n\tif (snippetTypes.includes(SnippetType.ClassOrInterfaceOrStructOrEnum)) {\n\t\tcaptures.forEach((capture) => {\n\t\t\tif (capture.name === \"definition.class\" || capture.name === \"definition.object\") {\n\t\t\t\tconst node = capture.node\n\t\t\t\tconst startLine = node.startPosition.row + 1\n\t\t\t\tconst endLine = node.endPosition.row + 1\n\n\t\t\t\t// \u63D0\u53D6\u540D\u79F0\n\t\t\t\tconst nameNode = node.children.find((child) => child.type === \"type_identifier\")\n\t\t\t\tconst name = nameNode ? sourceCode.substring(nameNode.startIndex, nameNode.endIndex) : \"\"\n\n\t\t\t\tif (!name) return\n\n\t\t\t\tconst scope = [\"global\"]\n\t\t\t\tconst rangeText = sourceCode.substring(node.startIndex, node.endIndex)\n\n\t\t\t\t// \u751F\u6210\u552F\u4E00\u7684\u54C8\u5E0C\u503C\n\t\t\t\tconst hash = crypto.createHash(\"md5\").update(`${name}-${filePath}-${startLine}`).digest(\"hex\")\n\t\t\t\tif (seenHashes.has(hash)) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t\tseenHashes.add(hash)\n\n\t\t\t\t// \u63D0\u53D6\u4FEE\u9970\u7B26\u548C\u7C7B\u578B\n\t\t\t\tconst modifiers = extractModifiers(node, sourceCode)\n\t\t\t\tconst definitionType = getDefinitionType(node, sourceCode)\n\n\t\t\t\tsnippets.push({\n\t\t\t\t\tname,\n\t\t\t\t\ttype: SnippetType.ClassOrInterfaceOrStructOrEnum,\n\t\t\t\t\tfilePath,\n\t\t\t\t\tstartLine,\n\t\t\t\t\tendLine,\n\t\t\t\t\trangeText,\n\t\t\t\t\tdefinitionText: rangeText,\n\t\t\t\t\tscope,\n\t\t\t\t\tfileHash,\n\t\t\t\t\tlanguage: CodeLanguageType.Kotlin,\n\t\t\t\t\tdefinition: {\n\t\t\t\t\t\tname,\n\t\t\t\t\t\ttype: definitionType,\n\t\t\t\t\t\tvisibility: modifiers.includes(\"private\")\n\t\t\t\t\t\t\t? \"private\"\n\t\t\t\t\t\t\t: modifiers.includes(\"protected\")\n\t\t\t\t\t\t\t\t? \"protected\"\n\t\t\t\t\t\t\t\t: modifiers.includes(\"internal\")\n\t\t\t\t\t\t\t\t\t? \"internal\"\n\t\t\t\t\t\t\t\t\t: \"public\",\n\t\t\t\t\t},\n\t\t\t\t})\n\t\t\t}\n\t\t})\n\t}\n\n\t// \u5904\u7406\u51FD\u6570\u548C\u65B9\u6CD5\u76F8\u5173\u58F0\u660E\n\tif (snippetTypes.includes(SnippetType.FunctionOrMethod)) {\n\t\tcaptures.forEach((capture) => {\n\t\t\tif (capture.name === \"definition.function\") {\n\t\t\t\tconst node = capture.node\n\t\t\t\tconst startLine = node.startPosition.row + 1\n\t\t\t\tconst endLine = node.endPosition.row + 1\n\n\t\t\t\t// \u63D0\u53D6\u51FD\u6570\u540D\u79F0\n\t\t\t\tconst nameNode = node.children.find((child) => child.type === \"simple_identifier\")\n\t\t\t\tconst name = nameNode ? sourceCode.substring(nameNode.startIndex, nameNode.endIndex) : \"\"\n\n\t\t\t\tif (!name) return\n\n\t\t\t\tconst scope = [\"global\"]\n\t\t\t\tconst rangeText = sourceCode.substring(node.startIndex, node.endIndex)\n\n\t\t\t\t// \u751F\u6210\u552F\u4E00\u7684\u54C8\u5E0C\u503C\n\t\t\t\tconst hash = crypto.createHash(\"md5\").update(`${name}-${filePath}-${startLine}`).digest(\"hex\")\n\t\t\t\tif (seenHashes.has(hash)) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t\tseenHashes.add(hash)\n\n\t\t\t\t// \u63D0\u53D6\u51FD\u6570\u53C2\u6570\u548C\u8FD4\u56DE\u7C7B\u578B\n\t\t\t\tconst parameters = extractParameters(node, sourceCode)\n\t\t\t\tconst returnType = extractReturnType(node, sourceCode)\n\t\t\t\tconst modifiers = extractModifiers(node, sourceCode)\n\n\t\t\t\t// \u67E5\u627E\u6240\u5C5E\u7C7B\n\t\t\t\tconst className = findParentClassName(captures, node, sourceCode)\n\n\t\t\t\tsnippets.push({\n\t\t\t\t\tname,\n\t\t\t\t\ttype: SnippetType.FunctionOrMethod,\n\t\t\t\t\tfilePath,\n\t\t\t\t\tstartLine,\n\t\t\t\t\tendLine,\n\t\t\t\t\trangeText,\n\t\t\t\t\tdefinitionText: rangeText,\n\t\t\t\t\tscope,\n\t\t\t\t\tfileHash,\n\t\t\t\t\tlanguage: CodeLanguageType.Kotlin,\n\t\t\t\t\tparameters,\n\t\t\t\t\t...(className && { field: className }),\n\t\t\t\t\tdefinition: {\n\t\t\t\t\t\tname,\n\t\t\t\t\t\ttype: \"function\",\n\t\t\t\t\t\tparameters,\n\t\t\t\t\t\treturnType,\n\t\t\t\t\t\tvisibility: modifiers.includes(\"private\")\n\t\t\t\t\t\t\t? \"private\"\n\t\t\t\t\t\t\t: modifiers.includes(\"protected\")\n\t\t\t\t\t\t\t\t? \"protected\"\n\t\t\t\t\t\t\t\t: modifiers.includes(\"internal\")\n\t\t\t\t\t\t\t\t\t? \"internal\"\n\t\t\t\t\t\t\t\t\t: \"public\",\n\t\t\t\t\t\t...(className && { className }),\n\t\t\t\t\t},\n\t\t\t\t})\n\t\t\t}\n\t\t})\n\t}\n\n\t// \u5904\u7406\u53D8\u91CF\u548C\u5E38\u91CF\u76F8\u5173\u58F0\u660E\n\tif (snippetTypes.includes(SnippetType.VariableOrConstant)) {\n\t\tcaptures.forEach((capture) => {\n\t\t\tif (capture.name === \"definition.property\") {\n\t\t\t\tconst node = capture.node\n\t\t\t\tconst startLine = node.startPosition.row + 1\n\t\t\t\tconst endLine = node.endPosition.row + 1\n\n\t\t\t\t// \u63D0\u53D6\u5C5E\u6027\u540D\u79F0 - \u5C1D\u8BD5\u591A\u79CD\u65B9\u5F0F\u67E5\u627E\u540D\u79F0\n\t\t\t\tlet nameNode = node.children.find((child) => child.type === \"simple_identifier\")\n\t\t\t\tif (!nameNode) {\n\t\t\t\t\t// \u5982\u679C\u6CA1\u6709\u627E\u5230\uFF0C\u5C1D\u8BD5\u5728variable_declaration\u4E2D\u67E5\u627E\n\t\t\t\t\tconst variableDecl = node.children.find((child) => child.type === \"variable_declaration\")\n\t\t\t\t\tif (variableDecl) {\n\t\t\t\t\t\tnameNode = variableDecl.children.find((child) => child.type === \"simple_identifier\")\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tconst name = nameNode ? sourceCode.substring(nameNode.startIndex, nameNode.endIndex) : \"\"\n\n\t\t\t\tif (!name) return\n\n\t\t\t\tconst scope = [\"global\"]\n\t\t\t\tconst rangeText = sourceCode.substring(node.startIndex, node.endIndex)\n\n\t\t\t\t// \u751F\u6210\u552F\u4E00\u7684\u54C8\u5E0C\u503C\n\t\t\t\tconst hash = crypto.createHash(\"md5\").update(`${name}-${filePath}-${startLine}`).digest(\"hex\")\n\t\t\t\tif (seenHashes.has(hash)) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t\tseenHashes.add(hash)\n\n\t\t\t\t// \u63D0\u53D6\u4FEE\u9970\u7B26\n\t\t\t\tconst modifiers = extractModifiers(node, sourceCode)\n\n\t\t\t\t// \u67E5\u627E\u6240\u5C5E\u7C7B\n\t\t\t\tconst className = findParentClassName(captures, node, sourceCode)\n\n\t\t\t\tsnippets.push({\n\t\t\t\t\tname,\n\t\t\t\t\ttype: SnippetType.VariableOrConstant,\n\t\t\t\t\tfilePath,\n\t\t\t\t\tstartLine,\n\t\t\t\t\tendLine,\n\t\t\t\t\trangeText,\n\t\t\t\t\tdefinitionText: rangeText,\n\t\t\t\t\tscope,\n\t\t\t\t\tfileHash,\n\t\t\t\t\tlanguage: CodeLanguageType.Kotlin,\n\t\t\t\t\t...(className && { field: className }),\n\t\t\t\t\tdefinition: {\n\t\t\t\t\t\tname,\n\t\t\t\t\t\ttype: \"property\",\n\t\t\t\t\t\tvisibility: modifiers.includes(\"private\")\n\t\t\t\t\t\t\t? \"private\"\n\t\t\t\t\t\t\t: modifiers.includes(\"protected\")\n\t\t\t\t\t\t\t\t? \"protected\"\n\t\t\t\t\t\t\t\t: modifiers.includes(\"internal\")\n\t\t\t\t\t\t\t\t\t? \"internal\"\n\t\t\t\t\t\t\t\t\t: \"public\",\n\t\t\t\t\t\t...(className && { className }),\n\t\t\t\t\t},\n\t\t\t\t})\n\t\t\t}\n\t\t})\n\t}\n\n\t// \u5904\u7406 typealias \u58F0\u660E\n\tif (snippetTypes.includes(SnippetType.ClassOrInterfaceOrStructOrEnum)) {\n\t\tcaptures.forEach((capture) => {\n\t\t\tif (capture.name === \"definition.type_alias\") {\n\t\t\t\tconst node = capture.node\n\t\t\t\tconst startLine = node.startPosition.row + 1\n\t\t\t\tconst endLine = node.endPosition.row + 1\n\n\t\t\t\t// \u63D0\u53D6 typealias \u540D\u79F0\n\t\t\t\tconst nameNode = node.children.find((child) => child.type === \"type_identifier\")\n\t\t\t\tconst name = nameNode ? sourceCode.substring(nameNode.startIndex, nameNode.endIndex) : \"\"\n\n\t\t\t\tif (!name) return\n\n\t\t\t\tconst scope = [\"global\"]\n\t\t\t\tconst rangeText = sourceCode.substring(node.startIndex, node.endIndex)\n\n\t\t\t\t// \u751F\u6210\u552F\u4E00\u7684\u54C8\u5E0C\u503C\n\t\t\t\tconst hash = crypto.createHash(\"md5\").update(`${name}-${filePath}-${startLine}`).digest(\"hex\")\n\t\t\t\tif (seenHashes.has(hash)) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t\tseenHashes.add(hash)\n\n\t\t\t\tsnippets.push({\n\t\t\t\t\tname,\n\t\t\t\t\ttype: SnippetType.ClassOrInterfaceOrStructOrEnum,\n\t\t\t\t\tfilePath,\n\t\t\t\t\tstartLine,\n\t\t\t\t\tendLine,\n\t\t\t\t\trangeText,\n\t\t\t\t\tdefinitionText: rangeText,\n\t\t\t\t\tscope,\n\t\t\t\t\tfileHash,\n\t\t\t\t\tlanguage: CodeLanguageType.Kotlin,\n\t\t\t\t\tdefinition: {\n\t\t\t\t\t\tname,\n\t\t\t\t\t\ttype: \"type_alias\",\n\t\t\t\t\t},\n\t\t\t\t})\n\t\t\t}\n\t\t})\n\t}\n\n\treturn snippets\n}\n\n/**\n * \u6784\u5EFAKotlin\u4EE3\u7801\u7247\u6BB5\u7684\u6458\u8981\n */\nexport function buildSummaryFromSnippets(snippets: ISnippetMeta[]): any {\n\tconst summary = {\n\t\timports: snippets.filter((s) => s.type === SnippetType.ImportOrInclude),\n\t\tclasses: snippets.filter((s) => s.type === SnippetType.ClassOrInterfaceOrStructOrEnum),\n\t\tfunctions: snippets.filter((s) => s.type === SnippetType.FunctionOrMethod),\n\t\tvariables: snippets.filter((s) => s.type === SnippetType.VariableOrConstant),\n\t}\n\n\treturn summary\n}\n\n/**\n * \u683C\u5F0F\u5316\u5927\u7EB2\u6587\u672C\n */\nexport function formatOutlineText(summary: any): string {\n\tconst lines: string[] = []\n\n\t// \u5904\u7406imports\n\tif (summary.imports?.length > 0) {\n\t\tlines.push(\"# Imports\")\n\t\tsummary.imports.forEach((item: ISnippetMeta) => {\n\t\t\tlines.push(` import: ${item.name}`)\n\t\t})\n\t\tlines.push(\"\")\n\t}\n\n\t// \u5904\u7406classes\n\tif (summary.classes?.length > 0) {\n\t\tlines.push(\"# Classes/Interfaces/Objects\")\n\t\tsummary.classes.forEach((item: ISnippetMeta) => {\n\t\t\tconst type = item.definition?.type || \"class\"\n\t\t\tlines.push(` ${type}: ${item.name}`)\n\t\t})\n\t\tlines.push(\"\")\n\t}\n\n\t// \u5904\u7406functions\n\tif (summary.functions?.length > 0) {\n\t\tlines.push(\"# Functions/Methods\")\n\t\tsummary.functions.forEach((item: ISnippetMeta) => {\n\t\t\tconst params = item.definition?.parameters?.map((p) => `${p.name}: ${p.type || \"Any\"}`).join(\", \") || \"\"\n\t\t\tconst returnType = item.definition?.returnType || \"Unit\"\n\t\t\tconst className = item.field\n\t\t\tconst prefix = className ? `[${className}] ` : \"\"\n\t\t\tlines.push(` ${prefix}${item.name}(${params}): ${returnType}`)\n\t\t})\n\t\tlines.push(\"\")\n\t}\n\n\t// \u5904\u7406variables\n\tif (summary.variables?.length > 0) {\n\t\tlines.push(\"# Variables/Properties\")\n\t\tsummary.variables.forEach((item: ISnippetMeta) => {\n\t\t\tconst className = item.field\n\t\t\tconst prefix = className ? `[${className}] ` : \"\"\n\t\t\tlines.push(` ${prefix}property: ${item.name}`)\n\t\t})\n\t\tlines.push(\"\")\n\t}\n\n\treturn lines.join(\"\\n\")\n}\n", "import { SnippetType, ISnippetMeta, ParameterInfo, CodeLanguageType } from \"../types\"\nimport Parser from \"web-tree-sitter\"\nimport { generateSnippetHash, buildScopeChain } from \"./general\"\nimport { Logger } from \"../Logger\"\n\nexport async function extractSnippetsFromCapturesForPHP(\n\tcaptures: Parser.QueryCapture[],\n\tsourceCode: string,\n\tfilePath: string,\n\tfileHash: string,\n\tsnippetTypes: SnippetType[],\n\toptions: { maxSnippetLines: number; minSnippetLines: number },\n): Promise<ISnippetMeta[]> {\n\tconst logger = Logger.getDefaultLogger().with(\"[extractSnippetsFromCapturesForPHP]\")\n\n\tconst snippets: ISnippetMeta[] = []\n\tconst seenHashes = new Set<string>()\n\n\tif (snippetTypes.length === 0) {\n\t\tlogger.warn(`No snippet types provided, skipping`)\n\t\treturn snippets\n\t}\n\n\t// \u6536\u96C6\u6240\u6709\u7C7B\u76F8\u5173\u7684captures\u7528\u4E8E\u786E\u5B9Afield\u5F52\u5C5E\n\tconst classCaptures = captures\n\t\t.filter(\n\t\t\t(c) =>\n\t\t\t\tc.name === \"definition.class\" ||\n\t\t\t\tc.name === \"definition.abstract_class\" ||\n\t\t\t\tc.name === \"definition.final_class\" ||\n\t\t\t\tc.name === \"definition.readonly_class\",\n\t\t)\n\t\t.map((c) => ({\n\t\t\tnode: c.node,\n\t\t\tstart: c.node.startIndex,\n\t\t\tend: c.node.endIndex,\n\t\t\tnameCap: captures.find(\n\t\t\t\t(nc) =>\n\t\t\t\t\t(nc.name === \"name.definition.class\" ||\n\t\t\t\t\t\tnc.name === \"name.definition.abstract_class\" ||\n\t\t\t\t\t\tnc.name === \"name.definition.final_class\" ||\n\t\t\t\t\t\tnc.name === \"name.definition.readonly_class\") &&\n\t\t\t\t\tnc.node.startIndex >= c.node.startIndex &&\n\t\t\t\t\tnc.node.endIndex <= c.node.endIndex,\n\t\t\t),\n\t\t}))\n\n\t// \u6536\u96C6\u63A5\u53E3\u3001trait\u3001\u679A\u4E3E\u7684captures\n\tconst interfaceCaptures = captures\n\t\t.filter((c) => c.name === \"definition.interface\")\n\t\t.map((c) => ({\n\t\t\tnode: c.node,\n\t\t\tstart: c.node.startIndex,\n\t\t\tend: c.node.endIndex,\n\t\t\tnameCap: captures.find(\n\t\t\t\t(nc) =>\n\t\t\t\t\tnc.name === \"name.definition.interface\" &&\n\t\t\t\t\tnc.node.startIndex >= c.node.startIndex &&\n\t\t\t\t\tnc.node.endIndex <= c.node.endIndex,\n\t\t\t),\n\t\t}))\n\n\tconst traitCaptures = captures\n\t\t.filter((c) => c.name === \"definition.trait\")\n\t\t.map((c) => ({\n\t\t\tnode: c.node,\n\t\t\tstart: c.node.startIndex,\n\t\t\tend: c.node.endIndex,\n\t\t\tnameCap: captures.find(\n\t\t\t\t(nc) =>\n\t\t\t\t\tnc.name === \"name.definition.trait\" &&\n\t\t\t\t\tnc.node.startIndex >= c.node.startIndex &&\n\t\t\t\t\tnc.node.endIndex <= c.node.endIndex,\n\t\t\t),\n\t\t}))\n\n\tconst enumCaptures = captures\n\t\t.filter((c) => c.name === \"definition.enum\")\n\t\t.map((c) => ({\n\t\t\tnode: c.node,\n\t\t\tstart: c.node.startIndex,\n\t\t\tend: c.node.endIndex,\n\t\t\tnameCap: captures.find(\n\t\t\t\t(nc) =>\n\t\t\t\t\tnc.name === \"name.definition.enum\" &&\n\t\t\t\t\tnc.node.startIndex >= c.node.startIndex &&\n\t\t\t\t\tnc.node.endIndex <= c.node.endIndex,\n\t\t\t),\n\t\t}))\n\n\t// \u6536\u96C6namespace captures\u7528\u4E8E\u786E\u5B9Anamespace\u5F52\u5C5E\n\tconst namespaceCaptures = captures\n\t\t.filter((c) => c.name === \"definition.namespace\")\n\t\t.map((c) => ({\n\t\t\tnode: c.node,\n\t\t\tstart: c.node.startIndex,\n\t\t\tend: c.node.endIndex,\n\t\t\tnameCap: captures.find(\n\t\t\t\t(nc) =>\n\t\t\t\t\tnc.name === \"name.definition.namespace\" &&\n\t\t\t\t\tnc.node.startIndex >= c.node.startIndex &&\n\t\t\t\t\tnc.node.endIndex <= c.node.endIndex,\n\t\t\t),\n\t\t}))\n\n\t// \u8F85\u52A9\u51FD\u6570\uFF1A\u786E\u5B9A\u8282\u70B9\u6240\u5C5E\u7684namespace\n\tfunction findNamespaceForNode(node: Parser.SyntaxNode): string | undefined {\n\t\t// \u5728PHP\u4E2D\uFF0Cnamespace\u901A\u5E38\u662F\u6587\u4EF6\u7EA7\u522B\u7684\uFF0C\u627E\u5230\u6700\u8FD1\u7684\u524D\u9762\u7684namespace\u58F0\u660E\n\t\tlet closestNamespace: string | undefined = undefined\n\t\tlet closestDistance = Infinity\n\n\t\tfor (const ns of namespaceCaptures) {\n\t\t\t// namespace\u5E94\u8BE5\u5728\u5F53\u524D\u8282\u70B9\u4E4B\u524D\u5B9A\u4E49\n\t\t\tif (ns.start < node.startIndex && ns.nameCap) {\n\t\t\t\tconst distance = node.startIndex - ns.start\n\t\t\t\tif (distance < closestDistance) {\n\t\t\t\t\tclosestDistance = distance\n\t\t\t\t\tclosestNamespace = sourceCode.substring(ns.nameCap.node.startIndex, ns.nameCap.node.endIndex)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn closestNamespace\n\t}\n\n\t// \u5904\u7406 use \u8BED\u53E5 (imports)\n\tcaptures.forEach((capture) => {\n\t\tif (capture.name === \"name.definition.use\") {\n\t\t\tconst node = capture.node\n\t\t\tconst startLine = node.startPosition.row + 1\n\t\t\tconst endLine = node.endPosition.row + 1\n\t\t\tconst rangeText = sourceCode.substring(node.startIndex, node.endIndex)\n\t\t\tconst snippetHash = generateSnippetHash(filePath, startLine, endLine, rangeText)\n\t\t\tif (seenHashes.has(snippetHash)) return\n\t\t\tseenHashes.add(snippetHash)\n\t\t\tconst name = sourceCode.substring(node.startIndex, node.endIndex)\n\t\t\tconst scope = buildScopeChain(node)\n\t\t\tconst namespace = findNamespaceForNode(node)\n\t\t\tsnippets.push({\n\t\t\t\tname,\n\t\t\t\ttype: SnippetType.ImportOrInclude,\n\t\t\t\tfilePath,\n\t\t\t\tstartLine,\n\t\t\t\tendLine,\n\t\t\t\trangeText,\n\t\t\t\tdefinitionText: rangeText,\n\t\t\t\tscope,\n\t\t\t\tfileHash,\n\t\t\t\tnamespace,\n\t\t\t})\n\t\t}\n\t})\n\n\t// \u5904\u7406\u51FD\u6570\u548C\u65B9\u6CD5\n\tfor (const capture of captures) {\n\t\tif (\n\t\t\tcapture.name !== \"definition.function\" &&\n\t\t\tcapture.name !== \"definition.method\" &&\n\t\t\tcapture.name !== \"definition.static_method\" &&\n\t\t\tcapture.name !== \"definition.abstract_method\" &&\n\t\t\tcapture.name !== \"definition.final_method\"\n\t\t)\n\t\t\tcontinue\n\n\t\tconst node = capture.node\n\t\tconst startLine = node.startPosition.row + 1\n\t\tconst endLine = node.endPosition.row + 1\n\n\t\t// \u786E\u5B9A\u540D\u79F0capture\u7684\u7C7B\u578B\n\t\tlet nameCapName: string\n\t\tlet paramCapName: string\n\t\tlet bodyCapName: string\n\n\t\tif (capture.name === \"definition.function\") {\n\t\t\tnameCapName = \"name.definition.function\"\n\t\t\tparamCapName = \"parameters.definition.function\"\n\t\t\tbodyCapName = \"body.definition.function\"\n\t\t} else if (capture.name === \"definition.method\") {\n\t\t\tnameCapName = \"name.definition.method\"\n\t\t\tparamCapName = \"parameters.definition.method\"\n\t\t\tbodyCapName = \"body.definition.method\"\n\t\t} else if (capture.name === \"definition.static_method\") {\n\t\t\tnameCapName = \"name.definition.static_method\"\n\t\t\tparamCapName = \"parameters.definition.static_method\"\n\t\t\tbodyCapName = \"body.definition.static_method\"\n\t\t} else if (capture.name === \"definition.abstract_method\") {\n\t\t\tnameCapName = \"name.definition.abstract_method\"\n\t\t\tparamCapName = \"parameters.definition.abstract_method\"\n\t\t\tbodyCapName = \"body.definition.abstract_method\"\n\t\t} else if (capture.name === \"definition.final_method\") {\n\t\t\tnameCapName = \"name.definition.final_method\"\n\t\t\tparamCapName = \"parameters.definition.final_method\"\n\t\t\tbodyCapName = \"body.definition.final_method\"\n\t\t} else {\n\t\t\tcontinue\n\t\t}\n\n\t\t// \u67E5\u627E\u51FD\u6570/\u65B9\u6CD5\u540D\n\t\tconst nameCap = captures.find(\n\t\t\t(c) => c.name === nameCapName && c.node.startIndex >= node.startIndex && c.node.endIndex <= node.endIndex,\n\t\t)\n\t\tif (!nameCap) continue\n\t\tconst name = sourceCode.substring(nameCap.node.startIndex, nameCap.node.endIndex)\n\n\t\t// \u89E3\u6790\u53C2\u6570\n\t\tconst paramCap = captures.find(\n\t\t\t(c) => c.name === paramCapName && c.node.startIndex >= node.startIndex && c.node.endIndex <= node.endIndex,\n\t\t)\n\t\tconst parameters: ParameterInfo[] = []\n\t\tif (paramCap) {\n\t\t\tconst paramText = sourceCode.substring(paramCap.node.startIndex, paramCap.node.endIndex)\n\t\t\tconst cleanText = removeParentheses(paramText).trim()\n\t\t\tif (cleanText) {\n\t\t\t\tconst paramList = parsePHPParameters(cleanText)\n\t\t\t\tparameters.push(...paramList.map((param: string) => ({ name: param })))\n\t\t\t}\n\t\t}\n\n\t\t// \u67E5\u627E\u51FD\u6570/\u65B9\u6CD5\u4F53\n\t\tconst bodyCap = captures.find(\n\t\t\t(c) => c.name === bodyCapName && c.node.startIndex >= node.startIndex && c.node.endIndex <= node.endIndex,\n\t\t)\n\n\t\tlet rangeText: string\n\t\tlet implementText: string | undefined = undefined\n\t\tif (bodyCap) {\n\t\t\trangeText = sourceCode.substring(node.startIndex, bodyCap.node.startIndex).trimEnd()\n\t\t\timplementText = sourceCode.substring(node.startIndex, node.endIndex)\n\t\t} else {\n\t\t\trangeText = sourceCode.substring(node.startIndex, node.endIndex)\n\t\t}\n\n\t\tconst snippetHash = generateSnippetHash(filePath, startLine, endLine, rangeText)\n\t\tif (seenHashes.has(snippetHash)) continue\n\t\tseenHashes.add(snippetHash)\n\n\t\tconst paramStr = parameters.map((p) => p.name).join(\", \")\n\t\tconst signature = `${name}(${paramStr})`\n\t\tconst scope = buildScopeChain(node)\n\n\t\t// \u786E\u5B9A\u5F52\u5C5E\u7684\u7C7B/\u63A5\u53E3/trait/\u679A\u4E3E\n\t\tlet field: string | undefined = undefined\n\t\tconst allParentCaptures = [...classCaptures, ...interfaceCaptures, ...traitCaptures, ...enumCaptures]\n\t\tfor (const parent of allParentCaptures) {\n\t\t\tif (node.startIndex > parent.start && node.endIndex <= parent.end && parent.nameCap) {\n\t\t\t\tfield = sourceCode.substring(parent.nameCap.node.startIndex, parent.nameCap.node.endIndex)\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\n\t\tconst namespace = findNamespaceForNode(node)\n\n\t\tsnippets.push({\n\t\t\tname,\n\t\t\ttype: SnippetType.FunctionOrMethod,\n\t\t\tfilePath,\n\t\t\tstartLine,\n\t\t\tendLine,\n\t\t\trangeText,\n\t\t\tdefinitionText: rangeText,\n\t\t\tscope,\n\t\t\tfileHash,\n\t\t\tfield,\n\t\t\tnamespace,\n\t\t\tdefinition: {\n\t\t\t\tname,\n\t\t\t\ttype: capture.name === \"definition.function\" ? \"function\" : \"method\",\n\t\t\t\tparameters,\n\t\t\t\treturnType: \"mixed\", // PHP\u9ED8\u8BA4\u8FD4\u56DE\u7C7B\u578B\n\t\t\t},\n\t\t\tparameters,\n\t\t\tsignature,\n\t\t\tlanguage: CodeLanguageType.PHP,\n\t\t\t...(implementText ? { implementText } : {}),\n\t\t})\n\t}\n\n\t// \u5904\u7406\u5C5E\u6027\uFF08\u5305\u62EC\u9759\u6001\u5C5E\u6027\u3001\u53EA\u8BFB\u5C5E\u6027\u3001\u6784\u9020\u51FD\u6570\u63D0\u5347\u5C5E\u6027\uFF09\n\tfor (const capture of captures) {\n\t\tif (\n\t\t\tcapture.name !== \"definition.property\" &&\n\t\t\tcapture.name !== \"definition.static_property\" &&\n\t\t\tcapture.name !== \"definition.readonly_property\" &&\n\t\t\tcapture.name !== \"definition.promoted_property\"\n\t\t)\n\t\t\tcontinue\n\n\t\tconst node = capture.node\n\t\tconst startLine = node.startPosition.row + 1\n\t\tconst endLine = node.endPosition.row + 1\n\n\t\t// \u786E\u5B9A\u540D\u79F0capture\u7684\u7C7B\u578B\n\t\tlet nameCapName: string\n\t\tif (capture.name === \"definition.property\") {\n\t\t\tnameCapName = \"name.definition.property\"\n\t\t} else if (capture.name === \"definition.static_property\") {\n\t\t\tnameCapName = \"name.definition.static_property\"\n\t\t} else if (capture.name === \"definition.readonly_property\") {\n\t\t\tnameCapName = \"name.definition.readonly_property\"\n\t\t} else if (capture.name === \"definition.promoted_property\") {\n\t\t\tnameCapName = \"name.definition.promoted_property\"\n\t\t} else {\n\t\t\tcontinue\n\t\t}\n\n\t\t// \u67E5\u627E\u5C5E\u6027\u540D\n\t\tconst nameCap = captures.find(\n\t\t\t(c) => c.name === nameCapName && c.node.startIndex >= node.startIndex && c.node.endIndex <= node.endIndex,\n\t\t)\n\t\tif (!nameCap) continue\n\t\tconst name = sourceCode.substring(nameCap.node.startIndex, nameCap.node.endIndex)\n\n\t\tconst rangeText = sourceCode.substring(node.startIndex, node.endIndex)\n\t\tconst snippetHash = generateSnippetHash(filePath, startLine, endLine, rangeText)\n\t\tif (seenHashes.has(snippetHash)) continue\n\t\tseenHashes.add(snippetHash)\n\n\t\tconst scope = buildScopeChain(node)\n\n\t\t// \u786E\u5B9A\u5F52\u5C5E\u7684\u7C7B/\u63A5\u53E3/trait/\u679A\u4E3E\n\t\tlet field: string | undefined = undefined\n\t\tconst allParentCaptures = [...classCaptures, ...interfaceCaptures, ...traitCaptures, ...enumCaptures]\n\t\tfor (const parent of allParentCaptures) {\n\t\t\tif (node.startIndex > parent.start && node.endIndex <= parent.end && parent.nameCap) {\n\t\t\t\tfield = sourceCode.substring(parent.nameCap.node.startIndex, parent.nameCap.node.endIndex)\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\n\t\tconst namespace = findNamespaceForNode(node)\n\n\t\tsnippets.push({\n\t\t\tname,\n\t\t\ttype: SnippetType.VariableOrConstant,\n\t\t\tfilePath,\n\t\t\tstartLine,\n\t\t\tendLine,\n\t\t\trangeText,\n\t\t\tdefinitionText: rangeText,\n\t\t\tscope,\n\t\t\tfileHash,\n\t\t\tfield,\n\t\t\tnamespace,\n\t\t\tlanguage: CodeLanguageType.PHP,\n\t\t})\n\t}\n\n\t// \u5904\u7406\u5E38\u91CF\n\tfor (const capture of captures) {\n\t\tif (capture.name !== \"definition.constant\") continue\n\n\t\tconst node = capture.node\n\t\tconst startLine = node.startPosition.row + 1\n\t\tconst endLine = node.endPosition.row + 1\n\n\t\tconst nameCap = captures.find(\n\t\t\t(c) =>\n\t\t\t\tc.name === \"name.definition.constant\" &&\n\t\t\t\tc.node.startIndex >= node.startIndex &&\n\t\t\t\tc.node.endIndex <= node.endIndex,\n\t\t)\n\t\tif (!nameCap) continue\n\t\tconst name = sourceCode.substring(nameCap.node.startIndex, nameCap.node.endIndex)\n\n\t\tconst rangeText = sourceCode.substring(node.startIndex, node.endIndex)\n\t\tconst snippetHash = generateSnippetHash(filePath, startLine, endLine, rangeText)\n\t\tif (seenHashes.has(snippetHash)) continue\n\t\tseenHashes.add(snippetHash)\n\n\t\tconst scope = buildScopeChain(node)\n\n\t\t// \u786E\u5B9A\u5F52\u5C5E\u7684\u7C7B/\u63A5\u53E3/trait/\u679A\u4E3E\n\t\tlet field: string | undefined = undefined\n\t\tconst allParentCaptures = [...classCaptures, ...interfaceCaptures, ...traitCaptures, ...enumCaptures]\n\t\tfor (const parent of allParentCaptures) {\n\t\t\tif (node.startIndex > parent.start && node.endIndex <= parent.end && parent.nameCap) {\n\t\t\t\tfield = sourceCode.substring(parent.nameCap.node.startIndex, parent.nameCap.node.endIndex)\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\n\t\tconst namespace = findNamespaceForNode(node)\n\n\t\tsnippets.push({\n\t\t\tname,\n\t\t\ttype: SnippetType.VariableOrConstant,\n\t\t\tfilePath,\n\t\t\tstartLine,\n\t\t\tendLine,\n\t\t\trangeText,\n\t\t\tdefinitionText: rangeText,\n\t\t\tscope,\n\t\t\tfileHash,\n\t\t\tfield,\n\t\t\tnamespace,\n\t\t\tlanguage: CodeLanguageType.PHP,\n\t\t})\n\t}\n\n\t// \u5904\u7406\u7C7B\u3001\u63A5\u53E3\u3001trait\u3001\u679A\u4E3E\u5B9A\u4E49\n\tconst typeDefs = [\n\t\t{ capture: \"name.definition.class\", outlineType: \"class\" },\n\t\t{ capture: \"name.definition.abstract_class\", outlineType: \"abstract_class\" },\n\t\t{ capture: \"name.definition.final_class\", outlineType: \"final_class\" },\n\t\t{ capture: \"name.definition.readonly_class\", outlineType: \"readonly_class\" },\n\t\t{ capture: \"name.definition.interface\", outlineType: \"interface\" },\n\t\t{ capture: \"name.definition.trait\", outlineType: \"trait\" },\n\t\t{ capture: \"name.definition.enum\", outlineType: \"enum\" },\n\t]\n\n\tfor (const { capture, outlineType } of typeDefs) {\n\t\tconst defCaptureName = `definition.${outlineType}`\n\t\tfor (const cap of captures.filter((c) => c.name === capture)) {\n\t\t\tconst node = cap.node\n\t\t\t// \u5224\u65AD\u662F\u5426\u5728\u51FD\u6570/\u65B9\u6CD5\u5185\uFF08\u5C40\u90E8\u7C7B\uFF09\n\t\t\tconst isInMethod = captures.some(\n\t\t\t\t(fc) =>\n\t\t\t\t\t(fc.name === \"definition.function\" ||\n\t\t\t\t\t\tfc.name === \"definition.method\" ||\n\t\t\t\t\t\tfc.name === \"definition.static_method\" ||\n\t\t\t\t\t\tfc.name === \"definition.abstract_method\" ||\n\t\t\t\t\t\tfc.name === \"definition.final_method\") &&\n\t\t\t\t\tfc.node.startIndex < node.startIndex &&\n\t\t\t\t\tnode.endIndex < fc.node.endIndex,\n\t\t\t)\n\t\t\tif (isInMethod) continue\n\n\t\t\t// \u4F18\u5148\u4F7F\u7528 @definition.xxx \u533A\u95F4\n\t\t\tconst defCap = captures.find(\n\t\t\t\t(c) =>\n\t\t\t\t\tc.name === defCaptureName &&\n\t\t\t\t\tc.node.startIndex <= node.startIndex &&\n\t\t\t\t\tnode.endIndex <= c.node.endIndex,\n\t\t\t)\n\t\t\tconst rangeText = defCap\n\t\t\t\t? sourceCode.substring(defCap.node.startIndex, defCap.node.endIndex)\n\t\t\t\t: sourceCode.substring(node.startIndex, node.endIndex)\n\t\t\tconst startLine = node.startPosition.row + 1\n\t\t\tconst endLine = node.endPosition.row + 1\n\t\t\tconst snippetHash = generateSnippetHash(filePath, startLine, endLine, rangeText)\n\t\t\tif (seenHashes.has(snippetHash)) continue\n\t\t\tseenHashes.add(snippetHash)\n\t\t\tconst name = sourceCode.substring(node.startIndex, node.endIndex)\n\t\t\tconst scope = buildScopeChain(node)\n\t\t\tconst namespace = findNamespaceForNode(node)\n\n\t\t\tsnippets.push({\n\t\t\t\tname,\n\t\t\t\ttype: SnippetType.ClassOrInterfaceOrStructOrEnum,\n\t\t\t\tfilePath,\n\t\t\t\tstartLine,\n\t\t\t\tendLine,\n\t\t\t\trangeText,\n\t\t\t\tdefinitionText: rangeText,\n\t\t\t\timplementText: rangeText,\n\t\t\t\tscope,\n\t\t\t\tfileHash,\n\t\t\t\tnamespace,\n\t\t\t\tlanguage: CodeLanguageType.PHP,\n\t\t\t})\n\t\t}\n\t}\n\n\treturn snippets\n}\n\n// \u89E3\u6790PHP\u53C2\u6570\u7684\u8F85\u52A9\u51FD\u6570\nfunction parsePHPParameters(paramText: string): string[] {\n\tconst params: string[] = []\n\tlet current = \"\"\n\tlet depth = 0\n\tlet inString = false\n\tlet stringChar = \"\"\n\n\tfor (let i = 0; i < paramText.length; i++) {\n\t\tconst char = paramText[i]\n\t\tconst prev = i > 0 ? paramText[i - 1] : \"\"\n\n\t\tif (!inString) {\n\t\t\tif (char === '\"' || char === \"'\") {\n\t\t\t\tinString = true\n\t\t\t\tstringChar = char\n\t\t\t} else if (char === \"(\" || char === \"[\" || char === \"{\") {\n\t\t\t\tdepth++\n\t\t\t} else if (char === \")\" || char === \"]\" || char === \"}\") {\n\t\t\t\tdepth--\n\t\t\t} else if (char === \",\" && depth === 0) {\n\t\t\t\tif (current.trim()) {\n\t\t\t\t\tparams.push(extractPHPParamName(current.trim()))\n\t\t\t\t}\n\t\t\t\tcurrent = \"\"\n\t\t\t\tcontinue\n\t\t\t}\n\t\t} else {\n\t\t\tif (char === stringChar && prev !== \"\\\\\") {\n\t\t\t\tinString = false\n\t\t\t\tstringChar = \"\"\n\t\t\t}\n\t\t}\n\n\t\tcurrent += char\n\t}\n\n\tif (current.trim()) {\n\t\tparams.push(extractPHPParamName(current.trim()))\n\t}\n\n\treturn params\n}\n\n// \u4ECEPHP\u53C2\u6570\u5B57\u7B26\u4E32\u4E2D\u63D0\u53D6\u53C2\u6570\u540D\nfunction extractPHPParamName(param: string): string {\n\t// \u79FB\u9664\u7C7B\u578B\u63D0\u793A\u3001\u9ED8\u8BA4\u503C\u7B49\uFF0C\u53EA\u4FDD\u7559\u53C2\u6570\u540D\n\t// \u4F8B\u5982: \"string $name = 'default'\" -> \"$name\"\n\t// \u4F8B\u5982: \"array &$items\" -> \"$items\"\n\t// \u4F8B\u5982: \"...$args\" -> \"$args\"\n\n\t// \u9996\u5148\u5904\u7406\u5F15\u7528\u7B26\u53F7\u548C\u5C55\u5F00\u8FD0\u7B97\u7B26\n\tlet cleaned = removeReferenceAndSplatOperators(param)\n\n\t// \u67E5\u627E\u53D8\u91CF\u540D\uFF08\u4EE5$\u5F00\u5934\uFF09\n\tconst variableName = findPHPVariableName(cleaned)\n\tif (variableName) {\n\t\treturn variableName\n\t}\n\n\t// \u5982\u679C\u6CA1\u6709\u627E\u5230\u53D8\u91CF\u540D\uFF0C\u8FD4\u56DE\u539F\u59CB\u53C2\u6570\n\treturn param\n}\n\n// \u79FB\u9664\u62EC\u53F7\u7684\u8F85\u52A9\u51FD\u6570\nfunction removeParentheses(text: string): string {\n\tif (text.startsWith(\"(\") && text.endsWith(\")\")) {\n\t\treturn text.slice(1, -1)\n\t}\n\treturn text\n}\n\n// \u79FB\u9664\u5F15\u7528\u7B26\u53F7\u548C\u5C55\u5F00\u8FD0\u7B97\u7B26\u7684\u8F85\u52A9\u51FD\u6570\nfunction removeReferenceAndSplatOperators(param: string): string {\n\tlet result = param.trim()\n\n\t// \u79FB\u9664\u5F00\u5934\u7684\u7A7A\u767D\n\twhile (result.startsWith(\" \") || result.startsWith(\"\\t\")) {\n\t\tresult = result.slice(1)\n\t}\n\n\t// \u79FB\u9664\u5F15\u7528\u7B26\u53F7 &\n\tif (result.startsWith(\"&\")) {\n\t\tresult = result.slice(1).trim()\n\t}\n\n\t// \u79FB\u9664\u5C55\u5F00\u8FD0\u7B97\u7B26 ...\n\tif (result.startsWith(\"...\")) {\n\t\tresult = result.slice(3).trim()\n\t}\n\n\treturn result\n}\n\n// \u67E5\u627EPHP\u53D8\u91CF\u540D\u7684\u8F85\u52A9\u51FD\u6570\nfunction findPHPVariableName(text: string): string | null {\n\t// \u67E5\u627E\u4EE5$\u5F00\u5934\u7684\u53D8\u91CF\u540D\n\tfor (let i = 0; i < text.length; i++) {\n\t\tif (text[i] === \"$\") {\n\t\t\tlet variableName = \"$\"\n\t\t\tlet j = i + 1\n\n\t\t\t// \u63D0\u53D6\u53D8\u91CF\u540D\u90E8\u5206\uFF08\u5B57\u6BCD\u3001\u6570\u5B57\u3001\u4E0B\u5212\u7EBF\uFF09\n\t\t\twhile (j < text.length) {\n\t\t\t\tconst char = text[j]\n\t\t\t\tif (isValidPHPVariableChar(char)) {\n\t\t\t\t\tvariableName += char\n\t\t\t\t\tj++\n\t\t\t\t} else {\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (variableName.length > 1) {\n\t\t\t\t// \u786E\u4FDD\u4E0D\u53EA\u662F$\u7B26\u53F7\n\t\t\t\treturn variableName\n\t\t\t}\n\t\t}\n\t}\n\n\treturn null\n}\n\n// \u68C0\u67E5\u5B57\u7B26\u662F\u5426\u662F\u6709\u6548\u7684PHP\u53D8\u91CF\u5B57\u7B26\nfunction isValidPHPVariableChar(char: string): boolean {\n\treturn (char >= \"a\" && char <= \"z\") || (char >= \"A\" && char <= \"Z\") || (char >= \"0\" && char <= \"9\") || char === \"_\"\n}\n\n// \u6784\u5EFA\u6982\u8981\u4FE1\u606F\nexport function buildSummaryFromSnippets(snippets: ISnippetMeta[]): OutlineData {\n\tconst outline: OutlineData = {\n\t\timports: [],\n\t\tclasses: [],\n\t\tinterfaces: [],\n\t\ttraits: [],\n\t\tenums: [],\n\t\tfunctions: [],\n\t\tconstants: [],\n\t\tnamespaces: [],\n\t}\n\n\tfor (const snippet of snippets) {\n\t\t// \u6536\u96C6namespace\u4FE1\u606F\n\t\tif (snippet.namespace && !outline.namespaces.includes(snippet.namespace)) {\n\t\t\toutline.namespaces.push(snippet.namespace)\n\t\t}\n\n\t\tswitch (snippet.type) {\n\t\t\tcase SnippetType.ImportOrInclude:\n\t\t\t\toutline.imports.push(snippet.name)\n\t\t\t\tbreak\n\t\t\tcase SnippetType.ClassOrInterfaceOrStructOrEnum:\n\t\t\t\tif (snippet.name.includes(\"interface\")) {\n\t\t\t\t\toutline.interfaces.push(snippet.name)\n\t\t\t\t} else if (snippet.name.includes(\"trait\")) {\n\t\t\t\t\toutline.traits.push(snippet.name)\n\t\t\t\t} else if (snippet.name.includes(\"enum\")) {\n\t\t\t\t\toutline.enums.push(snippet.name)\n\t\t\t\t} else {\n\t\t\t\t\toutline.classes.push(snippet.name)\n\t\t\t\t}\n\t\t\t\tbreak\n\t\t\tcase SnippetType.FunctionOrMethod:\n\t\t\t\toutline.functions.push(snippet.name)\n\t\t\t\tbreak\n\t\t\tcase SnippetType.VariableOrConstant:\n\t\t\t\tif (snippet.name.includes(\"const\")) {\n\t\t\t\t\toutline.constants.push(snippet.name)\n\t\t\t\t}\n\t\t\t\tbreak\n\t\t}\n\t}\n\n\treturn outline\n}\n\n// \u683C\u5F0F\u5316\u6982\u8981\u6587\u672C\nexport function formatOutlineText(outline: OutlineData): string {\n\tconst sections: string[] = []\n\n\tif (outline.namespaces.length > 0) {\n\t\tsections.push(`Namespaces: ${outline.namespaces.join(\", \")}`)\n\t}\n\n\tif (outline.imports.length > 0) {\n\t\tsections.push(`Imports: ${outline.imports.join(\", \")}`)\n\t}\n\n\tif (outline.classes.length > 0) {\n\t\tsections.push(`Classes: ${outline.classes.join(\", \")}`)\n\t}\n\n\tif (outline.interfaces.length > 0) {\n\t\tsections.push(`Interfaces: ${outline.interfaces.join(\", \")}`)\n\t}\n\n\tif (outline.traits.length > 0) {\n\t\tsections.push(`Traits: ${outline.traits.join(\", \")}`)\n\t}\n\n\tif (outline.enums.length > 0) {\n\t\tsections.push(`Enums: ${outline.enums.join(\", \")}`)\n\t}\n\n\tif (outline.functions.length > 0) {\n\t\tsections.push(`Functions: ${outline.functions.join(\", \")}`)\n\t}\n\n\tif (outline.constants.length > 0) {\n\t\tsections.push(`Constants: ${outline.constants.join(\", \")}`)\n\t}\n\n\treturn sections.join(\"\\n\")\n}\n\n// \u5B9A\u4E49\u6982\u8981\u6570\u636E\u7ED3\u6784\ninterface OutlineData {\n\timports: string[]\n\tclasses: string[]\n\tinterfaces: string[]\n\ttraits: string[]\n\tenums: string[]\n\tfunctions: string[]\n\tconstants: string[]\n\tnamespaces: string[]\n}\n", "import { SnippetType, ISnippetMeta, ParameterInfo, CodeLanguageType } from \"../types\"\nimport Parser from \"web-tree-sitter\"\nimport { generateSnippetHash, buildScopeChain } from \"./general\"\nimport { Logger } from \"../Logger\"\n\nexport async function extractSnippetsFromCapturesForRust(\n\tcaptures: Parser.QueryCapture[],\n\tsourceCode: string,\n\tfilePath: string,\n\tfileHash: string,\n\tsnippetTypes: SnippetType[],\n\toptions: { maxSnippetLines: number; minSnippetLines: number },\n): Promise<ISnippetMeta[]> {\n\tconst logger = Logger.getDefaultLogger().with(\"[extractSnippetsFromCapturesForRust]\")\n\n\tconst snippets: ISnippetMeta[] = []\n\tconst seenHashes = new Set<string>()\n\n\tif (snippetTypes.length === 0) {\n\t\tlogger.warn(`No snippet types provided, skipping`)\n\t\treturn snippets\n\t}\n\n\t// \u6536\u96C6\u6240\u6709 struct/enum/trait/impl captures \u7528\u4E8E\u786E\u5B9A field\n\tconst containerCaptures = captures\n\t\t.filter(\n\t\t\t(c) =>\n\t\t\t\tc.name === \"definition.struct\" ||\n\t\t\t\tc.name === \"definition.enum\" ||\n\t\t\t\tc.name === \"definition.trait\" ||\n\t\t\t\tc.name === \"definition.impl\" ||\n\t\t\t\tc.name === \"definition.impl_trait\",\n\t\t)\n\t\t.map((c) => ({\n\t\t\tnode: c.node,\n\t\t\tstart: c.node.startIndex,\n\t\t\tend: c.node.endIndex,\n\t\t\tname: c.name,\n\t\t\tnameCap: findNameCaptureForContainer(c, captures, sourceCode),\n\t\t}))\n\t\t.filter((c) => c.nameCap) // \u53EA\u4FDD\u7559\u6709\u540D\u79F0\u7684containers\n\n\t// \u5904\u7406 use declarations (imports)\n\tif (snippetTypes.includes(SnippetType.ImportOrInclude)) {\n\t\tcaptures.forEach((capture) => {\n\t\t\tif (capture.name === \"definition.use_declaration\") {\n\t\t\t\tconst node = capture.node\n\t\t\t\tconst startLine = node.startPosition.row + 1\n\t\t\t\tconst endLine = node.endPosition.row + 1\n\t\t\t\tconst rangeText = sourceCode.substring(node.startIndex, node.endIndex)\n\t\t\t\tconst snippetHash = generateSnippetHash(filePath, startLine, endLine, rangeText)\n\n\t\t\t\tif (seenHashes.has(snippetHash)) return\n\t\t\t\tseenHashes.add(snippetHash)\n\n\t\t\t\t// \u4ECE use \u8BED\u53E5\u4E2D\u63D0\u53D6\u5BFC\u5165\u7684\u540D\u79F0\n\t\t\t\tconst name = extractUseStatementName(rangeText)\n\t\t\t\tconst scope = buildScopeChain(node)\n\n\t\t\t\tsnippets.push({\n\t\t\t\t\tname,\n\t\t\t\t\ttype: SnippetType.ImportOrInclude,\n\t\t\t\t\tfilePath,\n\t\t\t\t\tstartLine,\n\t\t\t\t\tendLine,\n\t\t\t\t\trangeText,\n\t\t\t\t\tdefinitionText: rangeText,\n\t\t\t\t\tscope,\n\t\t\t\t\tfileHash,\n\t\t\t\t})\n\t\t\t}\n\t\t})\n\t}\n\n\t// \u5904\u7406 functions \u548C methods\n\tif (snippetTypes.includes(SnippetType.FunctionOrMethod)) {\n\t\tfor (const capture of captures) {\n\t\t\tif (capture.name !== \"definition.function\") continue\n\t\t\tconst node = capture.node\n\t\t\tconst startLine = node.startPosition.row + 1\n\t\t\tconst endLine = node.endPosition.row + 1\n\n\t\t\t// \u67E5\u627E\u51FD\u6570\u540D\n\t\t\tconst nameCap = captures.find(\n\t\t\t\t(c) =>\n\t\t\t\t\tc.name === \"name.definition.function\" &&\n\t\t\t\t\tc.node.startIndex >= node.startIndex &&\n\t\t\t\t\tc.node.endIndex <= node.endIndex,\n\t\t\t)\n\t\t\tif (!nameCap) continue\n\t\t\tconst name = sourceCode.substring(nameCap.node.startIndex, nameCap.node.endIndex)\n\n\t\t\t// \u67E5\u627E\u53C2\u6570\n\t\t\tconst paramCap = captures.find(\n\t\t\t\t(c) =>\n\t\t\t\t\tc.name === \"parameters.definition.function\" &&\n\t\t\t\t\tc.node.startIndex >= node.startIndex &&\n\t\t\t\t\tc.node.endIndex <= node.endIndex,\n\t\t\t)\n\n\t\t\tconst parameters: ParameterInfo[] = []\n\t\t\tif (paramCap) {\n\t\t\t\tconst paramText = sourceCode.substring(paramCap.node.startIndex, paramCap.node.endIndex)\n\t\t\t\tconst cleanParams = removeParentheses(paramText).trim()\n\t\t\t\tif (cleanParams) {\n\t\t\t\t\tconst paramList = parseRustParameters(cleanParams)\n\t\t\t\t\tparameters.push(...paramList.map((param) => ({ name: param })))\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// \u67E5\u627E\u51FD\u6570\u4F53\n\t\t\tconst bodyCap = captures.find(\n\t\t\t\t(c) =>\n\t\t\t\t\tc.name === \"body.definition.function\" &&\n\t\t\t\t\tc.node.startIndex >= node.startIndex &&\n\t\t\t\t\tc.node.endIndex <= node.endIndex,\n\t\t\t)\n\n\t\t\t// \u751F\u6210\u51FD\u6570\u7B7E\u540D\n\t\t\tlet definitionText: string\n\t\t\tlet implementText: string | undefined = undefined\n\n\t\t\tif (bodyCap) {\n\t\t\t\t// \u4ECE\u51FD\u6570\u5F00\u59CB\u5230\u51FD\u6570\u4F53\u5F00\u59CB\uFF08\u4E0D\u5305\u62EC\u51FD\u6570\u4F53\uFF09\n\t\t\t\tconst functionHeader = sourceCode.substring(node.startIndex, bodyCap.node.startIndex).trimEnd()\n\t\t\t\tdefinitionText = functionHeader.endsWith(\"{\") ? functionHeader.slice(0, -1).trim() : functionHeader\n\t\t\t\timplementText = sourceCode.substring(node.startIndex, node.endIndex)\n\t\t\t} else {\n\t\t\t\t// \u5982\u679C\u6CA1\u6709\u51FD\u6570\u4F53\uFF0C\u4F7F\u7528\u6574\u4E2A\u8282\u70B9\u5185\u5BB9\n\t\t\t\tdefinitionText = sourceCode.substring(node.startIndex, node.endIndex)\n\t\t\t}\n\n\t\t\tconst rangeText = sourceCode.substring(node.startIndex, node.endIndex)\n\n\t\t\t// \u786E\u5B9A\u662F\u5426\u5C5E\u4E8E\u67D0\u4E2A\u5BB9\u5668\uFF08\u8BBE\u7F6Efield\uFF09\n\t\t\tlet field: string | undefined = undefined\n\t\t\t// \u4F18\u5148\u5339\u914D impl_trait\uFF0C\u7136\u540E\u624D\u662F\u5176\u4ED6\u5BB9\u5668\n\t\t\tconst sortedContainers = containerCaptures.sort((a, b) => {\n\t\t\t\tif (a.name === \"definition.impl_trait\" && b.name !== \"definition.impl_trait\") return -1\n\t\t\t\tif (a.name !== \"definition.impl_trait\" && b.name === \"definition.impl_trait\") return 1\n\t\t\t\treturn 0\n\t\t\t})\n\t\t\tfor (const container of sortedContainers) {\n\t\t\t\tif (node.startIndex > container.start && node.endIndex <= container.end && container.nameCap) {\n\t\t\t\t\tfield = container.nameCap\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tconst snippetHash = generateSnippetHash(filePath, startLine, endLine, rangeText)\n\t\t\tif (seenHashes.has(snippetHash)) continue\n\t\t\tseenHashes.add(snippetHash)\n\n\t\t\tconst scope = buildScopeChain(node)\n\t\t\tsnippets.push({\n\t\t\t\tname,\n\t\t\t\ttype: SnippetType.FunctionOrMethod,\n\t\t\t\tfilePath,\n\t\t\t\tstartLine,\n\t\t\t\tendLine,\n\t\t\t\trangeText,\n\t\t\t\tdefinitionText,\n\t\t\t\timplementText,\n\t\t\t\tparameters,\n\t\t\t\tfield,\n\t\t\t\tscope,\n\t\t\t\tfileHash,\n\t\t\t})\n\t\t}\n\n\t\t// \u5904\u7406 methods (\u5728 impl \u5757\u4E2D\u7684\u51FD\u6570)\n\t\tfor (const capture of captures) {\n\t\t\tif (capture.name !== \"name.definition.method\") continue\n\t\t\tconst methodNode = capture.node\n\t\t\tconst name = sourceCode.substring(methodNode.startIndex, methodNode.endIndex)\n\n\t\t\t// \u627E\u5230\u5305\u542B\u8FD9\u4E2A method \u7684 impl \u5757\n\t\t\tconst implCapture = captures.find(\n\t\t\t\t(c) =>\n\t\t\t\t\t(c.name === \"definition.impl\" || c.name === \"definition.impl_trait\") &&\n\t\t\t\t\tc.node.startIndex <= methodNode.startIndex &&\n\t\t\t\t\tc.node.endIndex >= methodNode.endIndex,\n\t\t\t)\n\n\t\t\tif (!implCapture) continue\n\n\t\t\t// \u627E\u5230\u5BF9\u5E94\u7684\u51FD\u6570\u8282\u70B9\n\t\t\tconst functionNode = findParentFunctionNode(methodNode, sourceCode)\n\t\t\tif (!functionNode) continue\n\n\t\t\tconst startLine = functionNode.startPosition.row + 1\n\t\t\tconst endLine = functionNode.endPosition.row + 1\n\n\t\t\t// \u67E5\u627E\u53C2\u6570\n\t\t\tconst paramCap = captures.find(\n\t\t\t\t(c) =>\n\t\t\t\t\tc.name === \"parameters.definition.method\" &&\n\t\t\t\t\tc.node.startIndex >= functionNode.startIndex &&\n\t\t\t\t\tc.node.endIndex <= functionNode.endIndex,\n\t\t\t)\n\n\t\t\tconst parameters: ParameterInfo[] = []\n\t\t\tif (paramCap) {\n\t\t\t\tconst paramText = sourceCode.substring(paramCap.node.startIndex, paramCap.node.endIndex)\n\t\t\t\tconst cleanParams = removeParentheses(paramText).trim()\n\t\t\t\tif (cleanParams) {\n\t\t\t\t\tconst paramList = parseRustParameters(cleanParams)\n\t\t\t\t\tparameters.push(...paramList.map((param) => ({ name: param })))\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// \u67E5\u627E\u65B9\u6CD5\u4F53\n\t\t\tconst bodyCap = captures.find(\n\t\t\t\t(c) =>\n\t\t\t\t\tc.name === \"body.definition.method\" &&\n\t\t\t\t\tc.node.startIndex >= functionNode.startIndex &&\n\t\t\t\t\tc.node.endIndex <= functionNode.endIndex,\n\t\t\t)\n\n\t\t\t// \u751F\u6210\u65B9\u6CD5\u7B7E\u540D\n\t\t\tlet definitionText: string\n\t\t\tlet implementText: string | undefined = undefined\n\n\t\t\tif (bodyCap) {\n\t\t\t\tconst methodHeader = sourceCode.substring(functionNode.startIndex, bodyCap.node.startIndex).trimEnd()\n\t\t\t\tdefinitionText = methodHeader.endsWith(\"{\") ? methodHeader.slice(0, -1).trim() : methodHeader\n\t\t\t\timplementText = sourceCode.substring(functionNode.startIndex, functionNode.endIndex)\n\t\t\t} else {\n\t\t\t\tdefinitionText = sourceCode.substring(functionNode.startIndex, functionNode.endIndex)\n\t\t\t}\n\n\t\t\tconst rangeText = sourceCode.substring(functionNode.startIndex, functionNode.endIndex)\n\n\t\t\t// \u786E\u5B9A\u6240\u5C5E\u7684\u7ED3\u6784\u4F53/\u7279\u5F81\n\t\t\tlet field: string | undefined = undefined\n\t\t\t// \u4F18\u5148\u5339\u914D impl_trait\uFF0C\u7136\u540E\u624D\u662F\u5176\u4ED6\u5BB9\u5668\n\t\t\tconst sortedContainers = containerCaptures.sort((a, b) => {\n\t\t\t\tif (a.name === \"definition.impl_trait\" && b.name !== \"definition.impl_trait\") return -1\n\t\t\t\tif (a.name !== \"definition.impl_trait\" && b.name === \"definition.impl_trait\") return 1\n\t\t\t\treturn 0\n\t\t\t})\n\t\t\tfor (const container of sortedContainers) {\n\t\t\t\tif (\n\t\t\t\t\tfunctionNode.startIndex > container.start &&\n\t\t\t\t\tfunctionNode.endIndex <= container.end &&\n\t\t\t\t\tcontainer.nameCap\n\t\t\t\t) {\n\t\t\t\t\tfield = container.nameCap\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tconst snippetHash = generateSnippetHash(filePath, startLine, endLine, rangeText)\n\t\t\tif (seenHashes.has(snippetHash)) continue\n\t\t\tseenHashes.add(snippetHash)\n\n\t\t\tconst scope = buildScopeChain(functionNode)\n\t\t\tsnippets.push({\n\t\t\t\tname,\n\t\t\t\ttype: SnippetType.FunctionOrMethod,\n\t\t\t\tfilePath,\n\t\t\t\tstartLine,\n\t\t\t\tendLine,\n\t\t\t\trangeText,\n\t\t\t\tdefinitionText,\n\t\t\t\timplementText,\n\t\t\t\tparameters,\n\t\t\t\tfield,\n\t\t\t\tscope,\n\t\t\t\tfileHash,\n\t\t\t})\n\t\t}\n\t}\n\n\t// \u5904\u7406 structs, enums, traits, impls\n\tif (snippetTypes.includes(SnippetType.ClassOrInterfaceOrStructOrEnum)) {\n\t\tconst structureTypes = [\n\t\t\t\"definition.struct\",\n\t\t\t\"definition.enum\",\n\t\t\t\"definition.trait\",\n\t\t\t\"definition.impl\",\n\t\t\t\"definition.impl_trait\",\n\t\t]\n\n\t\t// \u5904\u7406 structs, enums, traits, impls - \u907F\u514D\u91CD\u590D\u5904\u7406\n\t\tconst processedNodes = new Set<string>()\n\n\t\tfor (const capture of captures) {\n\t\t\tif (!structureTypes.includes(capture.name)) continue\n\t\t\tconst node = capture.node\n\t\t\tconst startLine = node.startPosition.row + 1\n\t\t\tconst endLine = node.endPosition.row + 1\n\n\t\t\t// \u907F\u514D\u91CD\u590D\u5904\u7406\u540C\u4E00\u4E2A\u8282\u70B9\n\t\t\tconst nodeKey = `${node.startIndex}:${node.endIndex}`\n\t\t\tif (processedNodes.has(nodeKey)) continue\n\n\t\t\t// \u5BF9\u4E8Eimpl\u5757\uFF0C\u4F18\u5148\u5904\u7406impl_trait\u800C\u4E0D\u662Fimpl\n\t\t\tif (capture.name === \"definition.impl\") {\n\t\t\t\tconst hasImplTrait = captures.some(\n\t\t\t\t\t(c) =>\n\t\t\t\t\t\tc.name === \"definition.impl_trait\" &&\n\t\t\t\t\t\tc.node.startIndex === node.startIndex &&\n\t\t\t\t\t\tc.node.endIndex === node.endIndex,\n\t\t\t\t)\n\t\t\t\tif (hasImplTrait) continue // \u8DF3\u8FC7\uFF0C\u8BA9impl_trait\u5904\u7406\n\t\t\t}\n\n\t\t\tprocessedNodes.add(nodeKey)\n\n\t\t\tlet nameCap: Parser.QueryCapture | undefined\n\t\t\tlet name: string = \"\"\n\n\t\t\t// \u6839\u636E\u4E0D\u540C\u7C7B\u578B\u67E5\u627E\u540D\u79F0\n\t\t\tswitch (capture.name) {\n\t\t\t\tcase \"definition.struct\":\n\t\t\t\t\tnameCap = captures.find(\n\t\t\t\t\t\t(c) =>\n\t\t\t\t\t\t\tc.name === \"name.definition.struct\" &&\n\t\t\t\t\t\t\tc.node.startIndex >= node.startIndex &&\n\t\t\t\t\t\t\tc.node.endIndex <= node.endIndex,\n\t\t\t\t\t)\n\t\t\t\t\tif (nameCap) {\n\t\t\t\t\t\tname = sourceCode.substring(nameCap.node.startIndex, nameCap.node.endIndex)\n\t\t\t\t\t}\n\t\t\t\t\tbreak\n\t\t\t\tcase \"definition.enum\":\n\t\t\t\t\tnameCap = captures.find(\n\t\t\t\t\t\t(c) =>\n\t\t\t\t\t\t\tc.name === \"name.definition.enum\" &&\n\t\t\t\t\t\t\tc.node.startIndex >= node.startIndex &&\n\t\t\t\t\t\t\tc.node.endIndex <= node.endIndex,\n\t\t\t\t\t)\n\t\t\t\t\tif (nameCap) {\n\t\t\t\t\t\tname = sourceCode.substring(nameCap.node.startIndex, nameCap.node.endIndex)\n\t\t\t\t\t}\n\t\t\t\t\tbreak\n\t\t\t\tcase \"definition.trait\":\n\t\t\t\t\tnameCap = captures.find(\n\t\t\t\t\t\t(c) =>\n\t\t\t\t\t\t\tc.name === \"name.definition.trait\" &&\n\t\t\t\t\t\t\tc.node.startIndex >= node.startIndex &&\n\t\t\t\t\t\t\tc.node.endIndex <= node.endIndex,\n\t\t\t\t\t)\n\t\t\t\t\tif (nameCap) {\n\t\t\t\t\t\tname = sourceCode.substring(nameCap.node.startIndex, nameCap.node.endIndex)\n\t\t\t\t\t}\n\t\t\t\t\tbreak\n\t\t\t\tcase \"definition.impl\":\n\t\t\t\t\tnameCap = captures.find(\n\t\t\t\t\t\t(c) =>\n\t\t\t\t\t\t\tc.name === \"name.definition.impl\" &&\n\t\t\t\t\t\t\tc.node.startIndex >= node.startIndex &&\n\t\t\t\t\t\t\tc.node.endIndex <= node.endIndex,\n\t\t\t\t\t)\n\t\t\t\t\tif (nameCap) {\n\t\t\t\t\t\tname = sourceCode.substring(nameCap.node.startIndex, nameCap.node.endIndex)\n\t\t\t\t\t}\n\t\t\t\t\tbreak\n\t\t\t\tcase \"definition.impl_trait\":\n\t\t\t\t\tconst traitCap = captures.find(\n\t\t\t\t\t\t(c) =>\n\t\t\t\t\t\t\tc.name === \"name.definition.impl_trait\" &&\n\t\t\t\t\t\t\tc.node.startIndex >= node.startIndex &&\n\t\t\t\t\t\t\tc.node.endIndex <= node.endIndex,\n\t\t\t\t\t)\n\t\t\t\t\tconst forCap = captures.find(\n\t\t\t\t\t\t(c) =>\n\t\t\t\t\t\t\tc.name === \"name.definition.impl_for\" &&\n\t\t\t\t\t\t\tc.node.startIndex >= node.startIndex &&\n\t\t\t\t\t\t\tc.node.endIndex <= node.endIndex,\n\t\t\t\t\t)\n\t\t\t\t\tif (traitCap && forCap) {\n\t\t\t\t\t\tconst traitName = sourceCode.substring(traitCap.node.startIndex, traitCap.node.endIndex)\n\t\t\t\t\t\tconst forName = sourceCode.substring(forCap.node.startIndex, forCap.node.endIndex)\n\t\t\t\t\t\tname = `${traitName} for ${forName}`\n\t\t\t\t\t}\n\t\t\t\t\tbreak\n\t\t\t}\n\n\t\t\tif (!name) continue\n\n\t\t\tconst rangeText = sourceCode.substring(node.startIndex, node.endIndex)\n\t\t\tconst snippetHash = generateSnippetHash(filePath, startLine, endLine, rangeText)\n\n\t\t\tif (seenHashes.has(snippetHash)) continue\n\t\t\tseenHashes.add(snippetHash)\n\n\t\t\tconst scope = buildScopeChain(node)\n\t\t\tsnippets.push({\n\t\t\t\tname,\n\t\t\t\ttype: SnippetType.ClassOrInterfaceOrStructOrEnum,\n\t\t\t\tfilePath,\n\t\t\t\tstartLine,\n\t\t\t\tendLine,\n\t\t\t\trangeText,\n\t\t\t\tdefinitionText: rangeText,\n\t\t\t\tscope,\n\t\t\t\tfileHash,\n\t\t\t})\n\t\t}\n\t}\n\n\t// \u5904\u7406 variables, constants, statics\n\tif (snippetTypes.includes(SnippetType.VariableOrConstant)) {\n\t\tconst variableTypes = [\n\t\t\t{ captureName: \"definition.variable\", nameCapture: \"name.definition.variable\" },\n\t\t\t{ captureName: \"definition.constant\", nameCapture: \"name.definition.constant\" },\n\t\t\t{ captureName: \"definition.static\", nameCapture: \"name.definition.static\" },\n\t\t]\n\n\t\tfor (const { captureName, nameCapture } of variableTypes) {\n\t\t\tfor (const capture of captures) {\n\t\t\t\tif (capture.name !== captureName) continue\n\t\t\t\tconst node = capture.node\n\t\t\t\tconst startLine = node.startPosition.row + 1\n\t\t\t\tconst endLine = node.endPosition.row + 1\n\n\t\t\t\tconst nameCap = captures.find(\n\t\t\t\t\t(c) =>\n\t\t\t\t\t\tc.name === nameCapture &&\n\t\t\t\t\t\tc.node.startIndex >= node.startIndex &&\n\t\t\t\t\t\tc.node.endIndex <= node.endIndex,\n\t\t\t\t)\n\t\t\t\tif (!nameCap) continue\n\t\t\t\tconst name = sourceCode.substring(nameCap.node.startIndex, nameCap.node.endIndex)\n\n\t\t\t\tconst rangeText = sourceCode.substring(node.startIndex, node.endIndex)\n\t\t\t\tconst snippetHash = generateSnippetHash(filePath, startLine, endLine, rangeText)\n\n\t\t\t\tif (seenHashes.has(snippetHash)) continue\n\t\t\t\tseenHashes.add(snippetHash)\n\n\t\t\t\t// \u786E\u5B9A\u662F\u5426\u5C5E\u4E8E\u67D0\u4E2A\u5BB9\u5668\n\t\t\t\tlet field: string | undefined = undefined\n\t\t\t\tfor (const container of containerCaptures) {\n\t\t\t\t\tif (node.startIndex > container.start && node.endIndex <= container.end && container.nameCap) {\n\t\t\t\t\t\tfield = container.nameCap\n\t\t\t\t\t\tbreak\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tconst scope = buildScopeChain(node)\n\t\t\t\tsnippets.push({\n\t\t\t\t\tname,\n\t\t\t\t\ttype: SnippetType.VariableOrConstant,\n\t\t\t\t\tfilePath,\n\t\t\t\t\tstartLine,\n\t\t\t\t\tendLine,\n\t\t\t\t\trangeText,\n\t\t\t\t\tdefinitionText: rangeText,\n\t\t\t\t\tfield,\n\t\t\t\t\tscope,\n\t\t\t\t\tfileHash,\n\t\t\t\t})\n\t\t\t}\n\t\t}\n\t}\n\n\treturn snippets\n}\n\n// \u8F85\u52A9\u51FD\u6570\uFF1A\u89E3\u6790 Rust \u53C2\u6570\nfunction parseRustParameters(paramText: string): string[] {\n\tconst params: string[] = []\n\tlet current = \"\"\n\tlet depth = 0\n\tlet inString = false\n\tlet escapeNext = false\n\n\tfor (let i = 0; i < paramText.length; i++) {\n\t\tconst char = paramText[i]\n\n\t\tif (escapeNext) {\n\t\t\tcurrent += char\n\t\t\tescapeNext = false\n\t\t\tcontinue\n\t\t}\n\n\t\tif (char === \"\\\\\") {\n\t\t\tescapeNext = true\n\t\t\tcurrent += char\n\t\t\tcontinue\n\t\t}\n\n\t\tif (char === '\"' || char === \"'\") {\n\t\t\tinString = !inString\n\t\t\tcurrent += char\n\t\t\tcontinue\n\t\t}\n\n\t\tif (inString) {\n\t\t\tcurrent += char\n\t\t\tcontinue\n\t\t}\n\n\t\tif (char === \"<\" || char === \"(\" || char === \"[\" || char === \"{\") {\n\t\t\tdepth++\n\t\t} else if (char === \">\" || char === \")\" || char === \"]\" || char === \"}\") {\n\t\t\tdepth--\n\t\t}\n\n\t\tif (char === \",\" && depth === 0) {\n\t\t\tconst param = current.trim()\n\t\t\tif (param) {\n\t\t\t\t// \u63D0\u53D6\u53C2\u6570\u540D\uFF08\u5728 : \u4E4B\u524D\u7684\u90E8\u5206\uFF09\n\t\t\t\tconst colonIndex = param.indexOf(\":\")\n\t\t\t\tconst paramName = colonIndex > -1 ? param.substring(0, colonIndex).trim() : param\n\t\t\t\t// \u5904\u7406 self, &self, &mut self\n\t\t\t\tif (paramName === \"self\" || paramName === \"&self\" || paramName === \"&mut self\") {\n\t\t\t\t\tparams.push(paramName)\n\t\t\t\t} else {\n\t\t\t\t\tparams.push(paramName)\n\t\t\t\t}\n\t\t\t}\n\t\t\tcurrent = \"\"\n\t\t} else {\n\t\t\tcurrent += char\n\t\t}\n\t}\n\n\t// \u5904\u7406\u6700\u540E\u4E00\u4E2A\u53C2\u6570\n\tconst param = current.trim()\n\tif (param) {\n\t\tconst colonIndex = param.indexOf(\":\")\n\t\tconst paramName = colonIndex > -1 ? param.substring(0, colonIndex).trim() : param\n\t\tif (paramName === \"self\" || paramName === \"&self\" || paramName === \"&mut self\") {\n\t\t\tparams.push(paramName)\n\t\t} else {\n\t\t\tparams.push(paramName)\n\t\t}\n\t}\n\n\treturn params\n}\n\n// \u8F85\u52A9\u51FD\u6570\uFF1A\u4ECE use \u8BED\u53E5\u4E2D\u63D0\u53D6\u540D\u79F0\nfunction extractUseStatementName(useStatement: string): string {\n\t// \u79FB\u9664 use \u5173\u952E\u5B57\u548C\u5206\u53F7\n\tlet cleaned = removeUseKeywordAndSemicolon(useStatement).trim()\n\n\t// \u5904\u7406 as \u91CD\u547D\u540D\n\tconst asIndex = cleaned.lastIndexOf(\" as \")\n\tif (asIndex > -1) {\n\t\treturn cleaned.substring(asIndex + 4).trim()\n\t}\n\n\t// \u5904\u7406\u82B1\u62EC\u53F7\u5BFC\u5165 {a, b, c}\n\tif (cleaned.includes(\"{\") && cleaned.includes(\"}\")) {\n\t\tconst braceContent = extractBraceContent(cleaned)\n\t\tif (braceContent) {\n\t\t\tconst items = braceContent.split(\",\").map((s: string) => s.trim())\n\t\t\treturn items.join(\", \")\n\t\t}\n\t}\n\n\t// \u5904\u7406\u8DEF\u5F84\u5BFC\u5165\uFF0C\u53D6\u6700\u540E\u4E00\u4E2A\u90E8\u5206\n\tconst parts = cleaned.split(\"::\")\n\treturn parts[parts.length - 1].trim()\n}\n\n// \u8F85\u52A9\u51FD\u6570\uFF1A\u4E3A\u5BB9\u5668\u67E5\u627E\u540D\u79F0capture\nfunction findNameCaptureForContainer(\n\tcontainer: Parser.QueryCapture,\n\tcaptures: Parser.QueryCapture[],\n\tsourceCode: string,\n): string | undefined {\n\tlet nameCaptureName: string\n\n\tswitch (container.name) {\n\t\tcase \"definition.struct\":\n\t\t\tnameCaptureName = \"name.definition.struct\"\n\t\t\tbreak\n\t\tcase \"definition.enum\":\n\t\t\tnameCaptureName = \"name.definition.enum\"\n\t\t\tbreak\n\t\tcase \"definition.trait\":\n\t\t\tnameCaptureName = \"name.definition.trait\"\n\t\t\tbreak\n\t\tcase \"definition.impl\":\n\t\t\tnameCaptureName = \"name.definition.impl\"\n\t\t\tbreak\n\t\tcase \"definition.impl_trait\":\n\t\t\tconst traitCap = captures.find(\n\t\t\t\t(c) =>\n\t\t\t\t\tc.name === \"name.definition.impl_trait\" &&\n\t\t\t\t\tc.node.startIndex >= container.node.startIndex &&\n\t\t\t\t\tc.node.endIndex <= container.node.endIndex,\n\t\t\t)\n\t\t\tconst forCap = captures.find(\n\t\t\t\t(c) =>\n\t\t\t\t\tc.name === \"name.definition.impl_for\" &&\n\t\t\t\t\tc.node.startIndex >= container.node.startIndex &&\n\t\t\t\t\tc.node.endIndex <= container.node.endIndex,\n\t\t\t)\n\t\t\tif (traitCap && forCap) {\n\t\t\t\tconst traitName = sourceCode.substring(traitCap.node.startIndex, traitCap.node.endIndex)\n\t\t\t\tconst forName = sourceCode.substring(forCap.node.startIndex, forCap.node.endIndex)\n\t\t\t\treturn `${traitName} for ${forName}`\n\t\t\t}\n\t\t\treturn undefined\n\t\tdefault:\n\t\t\treturn undefined\n\t}\n\n\tconst nameCap = captures.find(\n\t\t(c) =>\n\t\t\tc.name === nameCaptureName &&\n\t\t\tc.node.startIndex >= container.node.startIndex &&\n\t\t\tc.node.endIndex <= container.node.endIndex,\n\t)\n\n\treturn nameCap ? sourceCode.substring(nameCap.node.startIndex, nameCap.node.endIndex) : undefined\n}\n\n// \u8F85\u52A9\u51FD\u6570\uFF1A\u67E5\u627E\u7236\u51FD\u6570\u8282\u70B9\nfunction findParentFunctionNode(methodNameNode: Parser.SyntaxNode, sourceCode: string): Parser.SyntaxNode | undefined {\n\tlet current = methodNameNode.parent\n\twhile (current) {\n\t\tif (current.type === \"function_item\") {\n\t\t\treturn current\n\t\t}\n\t\tcurrent = current.parent\n\t}\n\treturn undefined\n}\n\n// \u8F85\u52A9\u51FD\u6570\uFF1A\u79FB\u9664\u5706\u62EC\u53F7\nfunction removeParentheses(text: string): string {\n\tif (text.startsWith(\"(\") && text.endsWith(\")\")) {\n\t\treturn text.slice(1, -1)\n\t}\n\treturn text\n}\n\n// \u8F85\u52A9\u51FD\u6570\uFF1A\u79FB\u9664use\u5173\u952E\u5B57\u548C\u5206\u53F7\nfunction removeUseKeywordAndSemicolon(useStatement: string): string {\n\tlet result = useStatement.trim()\n\n\t// \u79FB\u9664\u5F00\u5934\u7684 \"use\" \u5173\u952E\u5B57\n\tif (result.startsWith(\"use \")) {\n\t\tresult = result.substring(4)\n\t}\n\n\t// \u79FB\u9664\u7ED3\u5C3E\u7684\u5206\u53F7\n\tif (result.endsWith(\";\")) {\n\t\tresult = result.slice(0, -1)\n\t}\n\n\treturn result\n}\n\n// \u8F85\u52A9\u51FD\u6570\uFF1A\u63D0\u53D6\u82B1\u62EC\u53F7\u5185\u5BB9\nfunction extractBraceContent(text: string): string | null {\n\tconst startIndex = text.indexOf(\"{\")\n\tconst endIndex = text.lastIndexOf(\"}\")\n\n\tif (startIndex > -1 && endIndex > startIndex) {\n\t\treturn text.substring(startIndex + 1, endIndex)\n\t}\n\n\treturn null\n}\n\n// \u6784\u5EFA\u6458\u8981\u4FE1\u606F\nexport interface RustSummary {\n\tfunctions: Array<{ name: string; parameters: string[]; field?: string }>\n\tstructs: Array<{ name: string }>\n\tenums: Array<{ name: string }>\n\ttraits: Array<{ name: string }>\n\timpls: Array<{ name: string }>\n\tconstants: Array<{ name: string; field?: string }>\n\tvariables: Array<{ name: string; field?: string }>\n\timports: Array<{ name: string }>\n}\n\nexport function buildSummaryFromSnippets(snippets: ISnippetMeta[]): RustSummary {\n\tconst summary: RustSummary = {\n\t\tfunctions: [],\n\t\tstructs: [],\n\t\tenums: [],\n\t\ttraits: [],\n\t\timpls: [],\n\t\tconstants: [],\n\t\tvariables: [],\n\t\timports: [],\n\t}\n\n\tfor (const snippet of snippets) {\n\t\tswitch (snippet.type) {\n\t\t\tcase SnippetType.FunctionOrMethod:\n\t\t\t\tsummary.functions.push({\n\t\t\t\t\tname: snippet.name,\n\t\t\t\t\tparameters: snippet.parameters?.map((p) => p.name) || [],\n\t\t\t\t\tfield: snippet.field,\n\t\t\t\t})\n\t\t\t\tbreak\n\t\t\tcase SnippetType.ClassOrInterfaceOrStructOrEnum:\n\t\t\t\t// \u6839\u636E\u5B9A\u4E49\u6587\u672C\u5224\u65AD\u662F\u4EC0\u4E48\u7C7B\u578B\u7684\u7ED3\u6784\n\t\t\t\tconst defText = snippet.definitionText || \"\"\n\t\t\t\tif (defText.startsWith(\"struct \")) {\n\t\t\t\t\tsummary.structs.push({ name: snippet.name })\n\t\t\t\t} else if (defText.startsWith(\"enum \")) {\n\t\t\t\t\tsummary.enums.push({ name: snippet.name })\n\t\t\t\t} else if (defText.startsWith(\"trait \")) {\n\t\t\t\t\tsummary.traits.push({ name: snippet.name })\n\t\t\t\t} else if (defText.startsWith(\"impl \")) {\n\t\t\t\t\tsummary.impls.push({ name: snippet.name })\n\t\t\t\t}\n\t\t\t\tbreak\n\t\t\tcase SnippetType.VariableOrConstant:\n\t\t\t\tconst varDefText = snippet.definitionText || \"\"\n\t\t\t\tif (varDefText.startsWith(\"const \") || varDefText.startsWith(\"static \")) {\n\t\t\t\t\tsummary.constants.push({\n\t\t\t\t\t\tname: snippet.name,\n\t\t\t\t\t\tfield: snippet.field,\n\t\t\t\t\t})\n\t\t\t\t} else {\n\t\t\t\t\tsummary.variables.push({\n\t\t\t\t\t\tname: snippet.name,\n\t\t\t\t\t\tfield: snippet.field,\n\t\t\t\t\t})\n\t\t\t\t}\n\t\t\t\tbreak\n\t\t\tcase SnippetType.ImportOrInclude:\n\t\t\t\tsummary.imports.push({ name: snippet.name })\n\t\t\t\tbreak\n\t\t}\n\t}\n\n\treturn summary\n}\n\nexport function formatOutlineText(summary: RustSummary): string {\n\tlet outlineText = \"\"\n\n\tif (summary.imports.length > 0) {\n\t\toutlineText += \"Imports:\\n\"\n\t\tfor (const imp of summary.imports) {\n\t\t\toutlineText += ` - ${imp.name}\\n`\n\t\t}\n\t\toutlineText += \"\\n\"\n\t}\n\n\tif (summary.structs.length > 0) {\n\t\toutlineText += \"Structs:\\n\"\n\t\tfor (const struct of summary.structs) {\n\t\t\toutlineText += ` - ${struct.name}\\n`\n\t\t}\n\t\toutlineText += \"\\n\"\n\t}\n\n\tif (summary.enums.length > 0) {\n\t\toutlineText += \"Enums:\\n\"\n\t\tfor (const enumItem of summary.enums) {\n\t\t\toutlineText += ` - ${enumItem.name}\\n`\n\t\t}\n\t\toutlineText += \"\\n\"\n\t}\n\n\tif (summary.traits.length > 0) {\n\t\toutlineText += \"Traits:\\n\"\n\t\tfor (const trait of summary.traits) {\n\t\t\toutlineText += ` - ${trait.name}\\n`\n\t\t}\n\t\toutlineText += \"\\n\"\n\t}\n\n\tif (summary.impls.length > 0) {\n\t\toutlineText += \"Implementations:\\n\"\n\t\tfor (const impl of summary.impls) {\n\t\t\toutlineText += ` - ${impl.name}\\n`\n\t\t}\n\t\toutlineText += \"\\n\"\n\t}\n\n\tif (summary.functions.length > 0) {\n\t\toutlineText += \"Functions/Methods:\\n\"\n\t\tfor (const func of summary.functions) {\n\t\t\tconst paramStr = func.parameters.length > 0 ? `(${func.parameters.join(\", \")})` : \"()\"\n\t\t\tconst fieldStr = func.field ? ` [in ${func.field}]` : \"\"\n\t\t\toutlineText += ` - ${func.name}${paramStr}${fieldStr}\\n`\n\t\t}\n\t\toutlineText += \"\\n\"\n\t}\n\n\tif (summary.constants.length > 0) {\n\t\toutlineText += \"Constants/Statics:\\n\"\n\t\tfor (const constant of summary.constants) {\n\t\t\tconst fieldStr = constant.field ? ` [in ${constant.field}]` : \"\"\n\t\t\toutlineText += ` - ${constant.name}${fieldStr}\\n`\n\t\t}\n\t\toutlineText += \"\\n\"\n\t}\n\n\tif (summary.variables.length > 0) {\n\t\toutlineText += \"Variables:\\n\"\n\t\tfor (const variable of summary.variables) {\n\t\t\tconst fieldStr = variable.field ? ` [in ${variable.field}]` : \"\"\n\t\t\toutlineText += ` - ${variable.name}${fieldStr}\\n`\n\t\t}\n\t\toutlineText += \"\\n\"\n\t}\n\n\treturn outlineText.trim()\n}\n", "import { SnippetType, ISnippetMeta, ParameterInfo, CodeLanguageType } from \"../types\"\nimport Parser from \"web-tree-sitter\"\nimport { generateSnippetHash, buildScopeChain } from \"./general\"\nimport { Logger } from \"../Logger\"\n\nexport async function extractSnippetsFromCapturesForC(\n\tcaptures: Parser.QueryCapture[],\n\tsourceCode: string,\n\tfilePath: string,\n\tfileHash: string,\n\tsnippetTypes: SnippetType[],\n\toptions: { maxSnippetLines: number; minSnippetLines: number },\n): Promise<ISnippetMeta[]> {\n\tconst logger = Logger.getDefaultLogger().with(\"[extractSnippetsFromCapturesForC]\")\n\n\tconst snippets: ISnippetMeta[] = []\n\tconst seenHashes = new Set<string>()\n\n\tif (snippetTypes.length === 0) {\n\t\tlogger.warn(`No snippet types provided, skipping`)\n\t\treturn snippets\n\t}\n\n\t// \u6536\u96C6\u6240\u6709 struct/union/enum captures \u7528\u4E8E\u786E\u5B9A field\n\tconst containerCaptures = captures\n\t\t.filter((c) => c.name === \"definition.struct\" || c.name === \"definition.union\" || c.name === \"definition.enum\")\n\t\t.map((c) => ({\n\t\t\tnode: c.node,\n\t\t\tstart: c.node.startIndex,\n\t\t\tend: c.node.endIndex,\n\t\t\tname: c.name,\n\t\t\tnameCap: findNameCaptureForContainer(c, captures, sourceCode),\n\t\t}))\n\t\t.filter((c) => c.nameCap) // \u53EA\u4FDD\u7559\u6709\u540D\u79F0\u7684containers\n\n\t// \u5904\u7406 include declarations (imports)\n\tif (snippetTypes.includes(SnippetType.ImportOrInclude)) {\n\t\tcaptures.forEach((capture) => {\n\t\t\tif (capture.name === \"definition.include\") {\n\t\t\t\tconst node = capture.node\n\t\t\t\tconst startLine = node.startPosition.row + 1\n\t\t\t\tconst endLine = node.endPosition.row + 1\n\t\t\t\tconst rangeText = sourceCode.substring(node.startIndex, node.endIndex)\n\t\t\t\tconst snippetHash = generateSnippetHash(filePath, startLine, endLine, rangeText)\n\n\t\t\t\tif (!seenHashes.has(snippetHash)) {\n\t\t\t\t\tseenHashes.add(snippetHash)\n\t\t\t\t\tconst scope = buildScopeChain(node)\n\n\t\t\t\t\tconst includeNameCapture = captures.find(\n\t\t\t\t\t\t(c) =>\n\t\t\t\t\t\t\tc.name === \"name.definition.include\" &&\n\t\t\t\t\t\t\tc.node.startIndex >= node.startIndex &&\n\t\t\t\t\t\t\tc.node.endIndex <= node.endIndex,\n\t\t\t\t\t)\n\t\t\t\t\tconst includeName = includeNameCapture\n\t\t\t\t\t\t? sourceCode.substring(includeNameCapture.node.startIndex, includeNameCapture.node.endIndex)\n\t\t\t\t\t\t: \"\"\n\n\t\t\t\t\tsnippets.push({\n\t\t\t\t\t\ttype: SnippetType.ImportOrInclude,\n\t\t\t\t\t\tname: includeName,\n\t\t\t\t\t\trangeText,\n\t\t\t\t\t\tstartLine,\n\t\t\t\t\t\tendLine,\n\t\t\t\t\t\tfilePath,\n\t\t\t\t\t\tfileHash,\n\t\t\t\t\t\tscope,\n\t\t\t\t\t\tlanguage: CodeLanguageType.C,\n\t\t\t\t\t})\n\t\t\t\t}\n\t\t\t}\n\t\t})\n\t}\n\n\t// \u5904\u7406 function definitions and declarations\n\tif (snippetTypes.includes(SnippetType.FunctionOrMethod)) {\n\t\tconst functionCaptures = captures.filter((c) => c.name === \"definition.function\")\n\n\t\tfunctionCaptures.forEach((capture) => {\n\t\t\tconst node = capture.node\n\t\t\tconst startLine = node.startPosition.row + 1\n\t\t\tconst endLine = node.endPosition.row + 1\n\t\t\tconst rangeText = sourceCode.substring(node.startIndex, node.endIndex)\n\t\t\tconst snippetHash = generateSnippetHash(filePath, startLine, endLine, rangeText)\n\n\t\t\tif (!seenHashes.has(snippetHash)) {\n\t\t\t\tseenHashes.add(snippetHash)\n\t\t\t\tconst scope = buildScopeChain(node)\n\n\t\t\t\tconst functionNameCapture = captures.find(\n\t\t\t\t\t(c) =>\n\t\t\t\t\t\tc.name === \"name.definition.function\" &&\n\t\t\t\t\t\tc.node.startIndex >= node.startIndex &&\n\t\t\t\t\t\tc.node.endIndex <= node.endIndex,\n\t\t\t\t)\n\t\t\t\tconst functionName = functionNameCapture\n\t\t\t\t\t? sourceCode.substring(functionNameCapture.node.startIndex, functionNameCapture.node.endIndex)\n\t\t\t\t\t: \"\"\n\n\t\t\t\tconst parametersCapture = captures.find(\n\t\t\t\t\t(c) =>\n\t\t\t\t\t\tc.name === \"parameters.definition.function\" &&\n\t\t\t\t\t\tc.node.startIndex >= node.startIndex &&\n\t\t\t\t\t\tc.node.endIndex <= node.endIndex,\n\t\t\t\t)\n\t\t\t\tconst parameters = parametersCapture\n\t\t\t\t\t? extractParametersFromNode(parametersCapture.node, sourceCode)\n\t\t\t\t\t: []\n\n\t\t\t\tconst bodyCapture = captures.find(\n\t\t\t\t\t(c) =>\n\t\t\t\t\t\tc.name === \"body.definition.function\" &&\n\t\t\t\t\t\tc.node.startIndex >= node.startIndex &&\n\t\t\t\t\t\tc.node.endIndex <= node.endIndex,\n\t\t\t\t)\n\t\t\t\tconst hasBody = !!bodyCapture\n\n\t\t\t\tsnippets.push({\n\t\t\t\t\ttype: SnippetType.FunctionOrMethod,\n\t\t\t\t\tname: functionName,\n\t\t\t\t\trangeText,\n\t\t\t\t\tstartLine,\n\t\t\t\t\tendLine,\n\t\t\t\t\tfilePath,\n\t\t\t\t\tfileHash,\n\t\t\t\t\tscope,\n\t\t\t\t\tlanguage: CodeLanguageType.C,\n\t\t\t\t\tparameters,\n\t\t\t\t\tdefinition: {\n\t\t\t\t\t\tname: functionName,\n\t\t\t\t\t\ttype: \"function\",\n\t\t\t\t\t\tparameters,\n\t\t\t\t\t},\n\t\t\t\t})\n\t\t\t}\n\t\t})\n\t}\n\n\t// \u5904\u7406 struct definitions\n\tif (snippetTypes.includes(SnippetType.ClassOrInterfaceOrStructOrEnum)) {\n\t\tconst structCaptures = captures.filter((c) => c.name === \"definition.struct\")\n\n\t\tstructCaptures.forEach((capture) => {\n\t\t\tconst node = capture.node\n\t\t\tconst startLine = node.startPosition.row + 1\n\t\t\tconst endLine = node.endPosition.row + 1\n\t\t\tconst rangeText = sourceCode.substring(node.startIndex, node.endIndex)\n\t\t\tconst snippetHash = generateSnippetHash(filePath, startLine, endLine, rangeText)\n\n\t\t\tif (!seenHashes.has(snippetHash)) {\n\t\t\t\tseenHashes.add(snippetHash)\n\t\t\t\tconst scope = buildScopeChain(node)\n\n\t\t\t\tconst structNameCapture = captures.find(\n\t\t\t\t\t(c) =>\n\t\t\t\t\t\tc.name === \"name.definition.struct\" &&\n\t\t\t\t\t\tc.node.startIndex >= node.startIndex &&\n\t\t\t\t\t\tc.node.endIndex <= node.endIndex,\n\t\t\t\t)\n\t\t\t\tconst structName = structNameCapture\n\t\t\t\t\t? sourceCode.substring(structNameCapture.node.startIndex, structNameCapture.node.endIndex)\n\t\t\t\t\t: \"\"\n\n\t\t\t\tconst fields = extractFieldsFromStructNode(node, sourceCode, captures)\n\n\t\t\t\tsnippets.push({\n\t\t\t\t\ttype: SnippetType.ClassOrInterfaceOrStructOrEnum,\n\t\t\t\t\tname: structName,\n\t\t\t\t\trangeText,\n\t\t\t\t\tstartLine,\n\t\t\t\t\tendLine,\n\t\t\t\t\tfilePath,\n\t\t\t\t\tfileHash,\n\t\t\t\t\tscope,\n\t\t\t\t\tlanguage: CodeLanguageType.C,\n\t\t\t\t\tdefinition: {\n\t\t\t\t\t\tname: structName,\n\t\t\t\t\t\ttype: \"struct\",\n\t\t\t\t\t},\n\t\t\t\t})\n\t\t\t}\n\t\t})\n\t}\n\n\t// \u5904\u7406 union definitions\n\tif (snippetTypes.includes(SnippetType.ClassOrInterfaceOrStructOrEnum)) {\n\t\tconst unionCaptures = captures.filter((c) => c.name === \"definition.union\")\n\n\t\tunionCaptures.forEach((capture) => {\n\t\t\tconst node = capture.node\n\t\t\tconst startLine = node.startPosition.row + 1\n\t\t\tconst endLine = node.endPosition.row + 1\n\t\t\tconst rangeText = sourceCode.substring(node.startIndex, node.endIndex)\n\t\t\tconst snippetHash = generateSnippetHash(filePath, startLine, endLine, rangeText)\n\n\t\t\tif (!seenHashes.has(snippetHash)) {\n\t\t\t\tseenHashes.add(snippetHash)\n\t\t\t\tconst scope = buildScopeChain(node)\n\n\t\t\t\tconst unionNameCapture = captures.find(\n\t\t\t\t\t(c) =>\n\t\t\t\t\t\tc.name === \"name.definition.union\" &&\n\t\t\t\t\t\tc.node.startIndex >= node.startIndex &&\n\t\t\t\t\t\tc.node.endIndex <= node.endIndex,\n\t\t\t\t)\n\t\t\t\tconst unionName = unionNameCapture\n\t\t\t\t\t? sourceCode.substring(unionNameCapture.node.startIndex, unionNameCapture.node.endIndex)\n\t\t\t\t\t: \"\"\n\n\t\t\t\tconst fields = extractFieldsFromStructNode(node, sourceCode, captures)\n\n\t\t\t\tsnippets.push({\n\t\t\t\t\ttype: SnippetType.ClassOrInterfaceOrStructOrEnum,\n\t\t\t\t\tname: unionName,\n\t\t\t\t\trangeText,\n\t\t\t\t\tstartLine,\n\t\t\t\t\tendLine,\n\t\t\t\t\tfilePath,\n\t\t\t\t\tfileHash,\n\t\t\t\t\tscope,\n\t\t\t\t\tlanguage: CodeLanguageType.C,\n\t\t\t\t\tdefinition: {\n\t\t\t\t\t\tname: unionName,\n\t\t\t\t\t\ttype: \"union\",\n\t\t\t\t\t},\n\t\t\t\t})\n\t\t\t}\n\t\t})\n\t}\n\n\t// \u5904\u7406 enum definitions\n\tif (snippetTypes.includes(SnippetType.ClassOrInterfaceOrStructOrEnum)) {\n\t\tconst enumCaptures = captures.filter((c) => c.name === \"definition.enum\")\n\n\t\tenumCaptures.forEach((capture) => {\n\t\t\tconst node = capture.node\n\t\t\tconst startLine = node.startPosition.row + 1\n\t\t\tconst endLine = node.endPosition.row + 1\n\t\t\tconst rangeText = sourceCode.substring(node.startIndex, node.endIndex)\n\t\t\tconst snippetHash = generateSnippetHash(filePath, startLine, endLine, rangeText)\n\n\t\t\tif (!seenHashes.has(snippetHash)) {\n\t\t\t\tseenHashes.add(snippetHash)\n\t\t\t\tconst scope = buildScopeChain(node)\n\n\t\t\t\tconst enumNameCapture = captures.find(\n\t\t\t\t\t(c) =>\n\t\t\t\t\t\tc.name === \"name.definition.enum\" &&\n\t\t\t\t\t\tc.node.startIndex >= node.startIndex &&\n\t\t\t\t\t\tc.node.endIndex <= node.endIndex,\n\t\t\t\t)\n\t\t\t\tconst enumName = enumNameCapture\n\t\t\t\t\t? sourceCode.substring(enumNameCapture.node.startIndex, enumNameCapture.node.endIndex)\n\t\t\t\t\t: \"\"\n\n\t\t\t\tconst enumerators = extractEnumeratorsFromEnumNode(node, sourceCode, captures)\n\n\t\t\t\tsnippets.push({\n\t\t\t\t\ttype: SnippetType.ClassOrInterfaceOrStructOrEnum,\n\t\t\t\t\tname: enumName,\n\t\t\t\t\trangeText,\n\t\t\t\t\tstartLine,\n\t\t\t\t\tendLine,\n\t\t\t\t\tfilePath,\n\t\t\t\t\tfileHash,\n\t\t\t\t\tscope,\n\t\t\t\t\tlanguage: CodeLanguageType.C,\n\t\t\t\t\tdefinition: {\n\t\t\t\t\t\tname: enumName,\n\t\t\t\t\t\ttype: \"enum\",\n\t\t\t\t\t},\n\t\t\t\t})\n\t\t\t}\n\t\t})\n\t}\n\n\t// \u5904\u7406 global variables\n\tif (snippetTypes.includes(SnippetType.VariableOrConstant)) {\n\t\tconst variableCaptures = captures.filter((c) => c.name === \"definition.variable\")\n\n\t\tvariableCaptures.forEach((capture) => {\n\t\t\tconst node = capture.node\n\t\t\tconst startLine = node.startPosition.row + 1\n\t\t\tconst endLine = node.endPosition.row + 1\n\t\t\tconst rangeText = sourceCode.substring(node.startIndex, node.endIndex)\n\t\t\tconst snippetHash = generateSnippetHash(filePath, startLine, endLine, rangeText)\n\n\t\t\tif (!seenHashes.has(snippetHash)) {\n\t\t\t\tseenHashes.add(snippetHash)\n\t\t\t\tconst scope = buildScopeChain(node)\n\n\t\t\t\tconst variableNameCapture = captures.find(\n\t\t\t\t\t(c) =>\n\t\t\t\t\t\tc.name === \"name.definition.variable\" &&\n\t\t\t\t\t\tc.node.startIndex >= node.startIndex &&\n\t\t\t\t\t\tc.node.endIndex <= node.endIndex,\n\t\t\t\t)\n\t\t\t\tconst variableName = variableNameCapture\n\t\t\t\t\t? sourceCode.substring(variableNameCapture.node.startIndex, variableNameCapture.node.endIndex)\n\t\t\t\t\t: \"\"\n\n\t\t\t\tsnippets.push({\n\t\t\t\t\ttype: SnippetType.VariableOrConstant,\n\t\t\t\t\tname: variableName,\n\t\t\t\t\trangeText,\n\t\t\t\t\tstartLine,\n\t\t\t\t\tendLine,\n\t\t\t\t\tfilePath,\n\t\t\t\t\tfileHash,\n\t\t\t\t\tscope,\n\t\t\t\t\tlanguage: CodeLanguageType.C,\n\t\t\t\t\tdefinition: {\n\t\t\t\t\t\tname: variableName,\n\t\t\t\t\t\ttype: \"variable\",\n\t\t\t\t\t},\n\t\t\t\t})\n\t\t\t}\n\t\t})\n\t}\n\n\t// \u5904\u7406 static variables\n\tif (snippetTypes.includes(SnippetType.VariableOrConstant)) {\n\t\tconst staticVariableCaptures = captures.filter((c) => c.name === \"definition.static_variable\")\n\n\t\tstaticVariableCaptures.forEach((capture) => {\n\t\t\tconst node = capture.node\n\t\t\tconst startLine = node.startPosition.row + 1\n\t\t\tconst endLine = node.endPosition.row + 1\n\t\t\tconst rangeText = sourceCode.substring(node.startIndex, node.endIndex)\n\t\t\tconst snippetHash = generateSnippetHash(filePath, startLine, endLine, rangeText)\n\n\t\t\tif (!seenHashes.has(snippetHash)) {\n\t\t\t\tseenHashes.add(snippetHash)\n\t\t\t\tconst scope = buildScopeChain(node)\n\n\t\t\t\tconst staticVariableNameCapture = captures.find(\n\t\t\t\t\t(c) =>\n\t\t\t\t\t\tc.name === \"name.definition.variable\" &&\n\t\t\t\t\t\tc.node.startIndex >= node.startIndex &&\n\t\t\t\t\t\tc.node.endIndex <= node.endIndex,\n\t\t\t\t)\n\t\t\t\tconst staticVariableName = staticVariableNameCapture\n\t\t\t\t\t? sourceCode.substring(\n\t\t\t\t\t\t\tstaticVariableNameCapture.node.startIndex,\n\t\t\t\t\t\t\tstaticVariableNameCapture.node.endIndex,\n\t\t\t\t\t\t)\n\t\t\t\t\t: \"\"\n\n\t\t\t\tsnippets.push({\n\t\t\t\t\ttype: SnippetType.VariableOrConstant,\n\t\t\t\t\tname: staticVariableName,\n\t\t\t\t\trangeText,\n\t\t\t\t\tstartLine,\n\t\t\t\t\tendLine,\n\t\t\t\t\tfilePath,\n\t\t\t\t\tfileHash,\n\t\t\t\t\tscope,\n\t\t\t\t\tlanguage: CodeLanguageType.C,\n\t\t\t\t\tdefinition: {\n\t\t\t\t\t\tname: staticVariableName,\n\t\t\t\t\t\ttype: \"static_variable\",\n\t\t\t\t\t},\n\t\t\t\t})\n\t\t\t}\n\t\t})\n\t}\n\n\t// \u5904\u7406 typedef declarations\n\tif (snippetTypes.includes(SnippetType.ClassOrInterfaceOrStructOrEnum)) {\n\t\tconst typedefCaptures = captures.filter((c) => c.name === \"definition.type\")\n\n\t\ttypedefCaptures.forEach((capture) => {\n\t\t\tconst node = capture.node\n\t\t\tconst startLine = node.startPosition.row + 1\n\t\t\tconst endLine = node.endPosition.row + 1\n\t\t\tconst rangeText = sourceCode.substring(node.startIndex, node.endIndex)\n\t\t\tconst snippetHash = generateSnippetHash(filePath, startLine, endLine, rangeText)\n\n\t\t\tif (!seenHashes.has(snippetHash)) {\n\t\t\t\tseenHashes.add(snippetHash)\n\t\t\t\tconst scope = buildScopeChain(node)\n\n\t\t\t\tconst typedefNameCapture = captures.find(\n\t\t\t\t\t(c) =>\n\t\t\t\t\t\tc.name === \"name.definition.type\" &&\n\t\t\t\t\t\tc.node.startIndex >= node.startIndex &&\n\t\t\t\t\t\tc.node.endIndex <= node.endIndex,\n\t\t\t\t)\n\t\t\t\tconst typedefName = typedefNameCapture\n\t\t\t\t\t? sourceCode.substring(typedefNameCapture.node.startIndex, typedefNameCapture.node.endIndex)\n\t\t\t\t\t: \"\"\n\n\t\t\t\tsnippets.push({\n\t\t\t\t\ttype: SnippetType.ClassOrInterfaceOrStructOrEnum,\n\t\t\t\t\tname: typedefName,\n\t\t\t\t\trangeText,\n\t\t\t\t\tstartLine,\n\t\t\t\t\tendLine,\n\t\t\t\t\tfilePath,\n\t\t\t\t\tfileHash,\n\t\t\t\t\tscope,\n\t\t\t\t\tlanguage: CodeLanguageType.C,\n\t\t\t\t\tdefinition: {\n\t\t\t\t\t\tname: typedefName,\n\t\t\t\t\t\ttype: \"typedef\",\n\t\t\t\t\t},\n\t\t\t\t})\n\t\t\t}\n\t\t})\n\t}\n\n\tlogger.info(`Extracted ${snippets.length} C snippets`)\n\treturn snippets\n}\n\n// \u8F85\u52A9\u51FD\u6570\uFF1A\u63D0\u53D6\u51FD\u6570\u53C2\u6570\nfunction extractParametersFromNode(node: Parser.SyntaxNode, sourceCode: string): ParameterInfo[] {\n\tconst parameters: ParameterInfo[] = []\n\n\t// \u904D\u5386\u53C2\u6570\u5217\u8868\u4E2D\u7684\u6BCF\u4E2A\u53C2\u6570\n\tfor (let i = 0; i < node.childCount; i++) {\n\t\tconst child = node.child(i)\n\t\tif (child && child.type === \"parameter_declaration\") {\n\t\t\tconst parameterText = sourceCode.substring(child.startIndex, child.endIndex)\n\t\t\tconst parameterName = extractParameterName(child, sourceCode)\n\n\t\t\tparameters.push({\n\t\t\t\tname: parameterName,\n\t\t\t\ttype: parameterText,\n\t\t\t})\n\t\t}\n\t}\n\n\treturn parameters\n}\n\n// \u8F85\u52A9\u51FD\u6570\uFF1A\u63D0\u53D6\u53C2\u6570\u540D\u79F0\nfunction extractParameterName(node: Parser.SyntaxNode, sourceCode: string): string {\n\t// \u67E5\u627E\u53C2\u6570\u58F0\u660E\u4E2D\u7684\u6807\u8BC6\u7B26\n\tfor (let i = 0; i < node.childCount; i++) {\n\t\tconst child = node.child(i)\n\t\tif (child && child.type === \"identifier\") {\n\t\t\treturn sourceCode.substring(child.startIndex, child.endIndex)\n\t\t}\n\t}\n\treturn \"\"\n}\n\n// \u8F85\u52A9\u51FD\u6570\uFF1A\u63D0\u53D6\u7ED3\u6784\u4F53\u5B57\u6BB5\nfunction extractFieldsFromStructNode(\n\tnode: Parser.SyntaxNode,\n\tsourceCode: string,\n\tcaptures: Parser.QueryCapture[],\n): string[] {\n\tconst fields: string[] = []\n\n\t// \u67E5\u627E\u8BE5\u7ED3\u6784\u4F53\u5185\u7684\u6240\u6709\u5B57\u6BB5\n\tconst fieldCaptures = captures.filter(\n\t\t(c) =>\n\t\t\tc.name === \"name.definition.field\" &&\n\t\t\tc.node.startIndex >= node.startIndex &&\n\t\t\tc.node.endIndex <= node.endIndex,\n\t)\n\n\tfieldCaptures.forEach((capture) => {\n\t\tconst fieldName = sourceCode.substring(capture.node.startIndex, capture.node.endIndex)\n\t\tfields.push(fieldName)\n\t})\n\n\treturn fields\n}\n\n// \u8F85\u52A9\u51FD\u6570\uFF1A\u63D0\u53D6\u679A\u4E3E\u503C\nfunction extractEnumeratorsFromEnumNode(\n\tnode: Parser.SyntaxNode,\n\tsourceCode: string,\n\tcaptures: Parser.QueryCapture[],\n): string[] {\n\tconst enumerators: string[] = []\n\n\t// \u67E5\u627E\u8BE5\u679A\u4E3E\u5185\u7684\u6240\u6709\u679A\u4E3E\u503C\n\tconst enumeratorCaptures = captures.filter(\n\t\t(c) =>\n\t\t\tc.name === \"name.definition.enumerator\" &&\n\t\t\tc.node.startIndex >= node.startIndex &&\n\t\t\tc.node.endIndex <= node.endIndex,\n\t)\n\n\tenumeratorCaptures.forEach((capture) => {\n\t\tconst enumeratorName = sourceCode.substring(capture.node.startIndex, capture.node.endIndex)\n\t\tenumerators.push(enumeratorName)\n\t})\n\n\treturn enumerators\n}\n\n// \u8F85\u52A9\u51FD\u6570\uFF1A\u6839\u636E\u5BB9\u5668\u7C7B\u578B\u751F\u6210\u5BF9\u5E94\u7684\u540D\u79F0capture\u540D\u79F0\nfunction getNameCaptureNameForContainer(containerCaptureName: string): string {\n\tswitch (containerCaptureName) {\n\t\tcase \"definition.struct\":\n\t\t\treturn \"name.definition.struct\"\n\t\tcase \"definition.union\":\n\t\t\treturn \"name.definition.union\"\n\t\tcase \"definition.enum\":\n\t\t\treturn \"name.definition.enum\"\n\t\tdefault:\n\t\t\treturn containerCaptureName\n\t}\n}\n\n// \u8F85\u52A9\u51FD\u6570\uFF1A\u67E5\u627E\u5BB9\u5668\u7684\u540D\u79F0capture\nfunction findNameCaptureForContainer(\n\tcontainerCapture: Parser.QueryCapture,\n\tcaptures: Parser.QueryCapture[],\n\tsourceCode: string,\n): string | null {\n\tconst node = containerCapture.node\n\tconst nameCaptureName = getNameCaptureNameForContainer(containerCapture.name)\n\n\tconst nameCapture = captures.find(\n\t\t(c) => c.name === nameCaptureName && c.node.startIndex >= node.startIndex && c.node.endIndex <= node.endIndex,\n\t)\n\n\treturn nameCapture ? sourceCode.substring(nameCapture.node.startIndex, nameCapture.node.endIndex) : null\n}\n\n// \u7528\u4E8E\u6784\u5EFA\u6982\u89C8\u7684\u51FD\u6570\nexport function buildSummaryFromSnippets(snippets: ISnippetMeta[]): any {\n\tconst summary = {\n\t\tincludes: [] as string[],\n\t\tfunctions: [] as string[],\n\t\tstructs: [] as string[],\n\t\tunions: [] as string[],\n\t\tenums: [] as string[],\n\t\tvariables: [] as string[],\n\t}\n\n\tsnippets.forEach((snippet) => {\n\t\tswitch (snippet.type) {\n\t\t\tcase SnippetType.ImportOrInclude:\n\t\t\t\tsummary.includes.push(snippet.name)\n\t\t\t\tbreak\n\t\t\tcase SnippetType.FunctionOrMethod:\n\t\t\t\tsummary.functions.push(snippet.name)\n\t\t\t\tbreak\n\t\t\tcase SnippetType.ClassOrInterfaceOrStructOrEnum:\n\t\t\t\tif (snippet.rangeText.includes(\"struct\")) {\n\t\t\t\t\tsummary.structs.push(snippet.name)\n\t\t\t\t} else if (snippet.rangeText.includes(\"union\")) {\n\t\t\t\t\tsummary.unions.push(snippet.name)\n\t\t\t\t} else if (snippet.rangeText.includes(\"enum\")) {\n\t\t\t\t\tsummary.enums.push(snippet.name)\n\t\t\t\t}\n\t\t\t\tbreak\n\t\t\tcase SnippetType.VariableOrConstant:\n\t\t\t\tsummary.variables.push(snippet.name)\n\t\t\t\tbreak\n\t\t}\n\t})\n\n\treturn summary\n}\n\n// \u7528\u4E8E\u683C\u5F0F\u5316\u6982\u89C8\u6587\u672C\u7684\u51FD\u6570\nexport function formatOutlineText(summary: any): string {\n\tlet outline = \"\"\n\n\tif (summary.includes.length > 0) {\n\t\toutline += `Includes: ${summary.includes.join(\", \")}\\n`\n\t}\n\n\tif (summary.functions.length > 0) {\n\t\toutline += `Functions: ${summary.functions.join(\", \")}\\n`\n\t}\n\n\tif (summary.structs.length > 0) {\n\t\toutline += `Structs: ${summary.structs.join(\", \")}\\n`\n\t}\n\n\tif (summary.unions.length > 0) {\n\t\toutline += `Unions: ${summary.unions.join(\", \")}\\n`\n\t}\n\n\tif (summary.enums.length > 0) {\n\t\toutline += `Enums: ${summary.enums.join(\", \")}\\n`\n\t}\n\n\tif (summary.variables.length > 0) {\n\t\toutline += `Variables: ${summary.variables.join(\", \")}\\n`\n\t}\n\n\treturn outline\n}\n", "import { SnippetType, ISnippetMeta, ParameterInfo, CodeLanguageType } from \"../types\"\nimport Parser from \"web-tree-sitter\"\nimport { generateSnippetHash, buildScopeChain } from \"./general\"\nimport { Logger } from \"../Logger\"\n\nexport async function extractSnippetsFromCapturesForCPP(\n\tcaptures: Parser.QueryCapture[],\n\tsourceCode: string,\n\tfilePath: string,\n\tfileHash: string,\n\tsnippetTypes: SnippetType[],\n\toptions: { maxSnippetLines: number; minSnippetLines: number },\n): Promise<ISnippetMeta[]> {\n\tconst logger = Logger.getDefaultLogger().with(\"[extractSnippetsFromCapturesForCPP]\")\n\n\tconst snippets: ISnippetMeta[] = []\n\tconst seenHashes = new Set<string>()\n\n\tif (snippetTypes.length === 0) {\n\t\tlogger.warn(`No snippet types provided, skipping`)\n\t\treturn snippets\n\t}\n\n\t// \u6536\u96C6\u6240\u6709 class/struct/union/enum captures \u7528\u4E8E\u786E\u5B9A field \u548C method \u7684\u5F52\u5C5E\n\tconst containerCaptures = captures\n\t\t.filter(\n\t\t\t(c) =>\n\t\t\t\tc.name === \"definition.class\" ||\n\t\t\t\tc.name === \"definition.struct\" ||\n\t\t\t\tc.name === \"definition.union\" ||\n\t\t\t\tc.name === \"definition.enum\" ||\n\t\t\t\tc.name === \"definition.template\",\n\t\t)\n\t\t.map((c) => ({\n\t\t\tnode: c.node,\n\t\t\tstart: c.node.startIndex,\n\t\t\tend: c.node.endIndex,\n\t\t\tname: c.name,\n\t\t\tnameCap: findNameCaptureForContainer(c, captures, sourceCode),\n\t\t}))\n\t\t.filter((c) => c.nameCap) // \u53EA\u4FDD\u7559\u6709\u540D\u79F0\u7684containers\n\n\t// \u5904\u7406 include declarations (imports)\n\tif (snippetTypes.includes(SnippetType.ImportOrInclude)) {\n\t\tcaptures.forEach((capture) => {\n\t\t\tif (capture.name === \"definition.include\") {\n\t\t\t\tconst node = capture.node\n\t\t\t\tconst startLine = node.startPosition.row + 1\n\t\t\t\tconst endLine = node.endPosition.row + 1\n\t\t\t\tconst rangeText = sourceCode.substring(node.startIndex, node.endIndex)\n\t\t\t\tconst snippetHash = generateSnippetHash(filePath, startLine, endLine, rangeText)\n\n\t\t\t\tif (!seenHashes.has(snippetHash)) {\n\t\t\t\t\tseenHashes.add(snippetHash)\n\t\t\t\t\tconst scope = buildScopeChain(node)\n\n\t\t\t\t\tconst includeNameCapture = captures.find(\n\t\t\t\t\t\t(c) =>\n\t\t\t\t\t\t\tc.name === \"name.definition.include\" &&\n\t\t\t\t\t\t\tc.node.startIndex >= node.startIndex &&\n\t\t\t\t\t\t\tc.node.endIndex <= node.endIndex,\n\t\t\t\t\t)\n\t\t\t\t\tconst includeName = includeNameCapture\n\t\t\t\t\t\t? sourceCode.substring(includeNameCapture.node.startIndex, includeNameCapture.node.endIndex)\n\t\t\t\t\t\t: \"\"\n\n\t\t\t\t\tsnippets.push({\n\t\t\t\t\t\ttype: SnippetType.ImportOrInclude,\n\t\t\t\t\t\tname: includeName,\n\t\t\t\t\t\trangeText,\n\t\t\t\t\t\tstartLine,\n\t\t\t\t\t\tendLine,\n\t\t\t\t\t\tfilePath,\n\t\t\t\t\t\tfileHash,\n\t\t\t\t\t\tscope,\n\t\t\t\t\t\tlanguage: CodeLanguageType.CPP,\n\t\t\t\t\t})\n\t\t\t\t}\n\t\t\t}\n\t\t})\n\t}\n\n\t// \u5904\u7406 function definitions and declarations\n\tif (snippetTypes.includes(SnippetType.FunctionOrMethod)) {\n\t\tconst functionCaptures = captures.filter((c) => c.name === \"definition.function\")\n\n\t\tfunctionCaptures.forEach((capture) => {\n\t\t\tconst node = capture.node\n\t\t\tconst startLine = node.startPosition.row + 1\n\t\t\tconst endLine = node.endPosition.row + 1\n\t\t\tconst rangeText = sourceCode.substring(node.startIndex, node.endIndex)\n\t\t\tconst snippetHash = generateSnippetHash(filePath, startLine, endLine, rangeText)\n\n\t\t\tif (!seenHashes.has(snippetHash)) {\n\t\t\t\tseenHashes.add(snippetHash)\n\t\t\t\tconst scope = buildScopeChain(node)\n\n\t\t\t\tconst functionNameCapture = captures.find(\n\t\t\t\t\t(c) =>\n\t\t\t\t\t\tc.name === \"name.definition.function\" &&\n\t\t\t\t\t\tc.node.startIndex >= node.startIndex &&\n\t\t\t\t\t\tc.node.endIndex <= node.endIndex,\n\t\t\t\t)\n\t\t\t\tconst functionName = functionNameCapture\n\t\t\t\t\t? sourceCode.substring(functionNameCapture.node.startIndex, functionNameCapture.node.endIndex)\n\t\t\t\t\t: \"\"\n\n\t\t\t\tconst parametersCapture = captures.find(\n\t\t\t\t\t(c) =>\n\t\t\t\t\t\tc.name === \"parameters.definition.function\" &&\n\t\t\t\t\t\tc.node.startIndex >= node.startIndex &&\n\t\t\t\t\t\tc.node.endIndex <= node.endIndex,\n\t\t\t\t)\n\t\t\t\tconst parameters = parametersCapture\n\t\t\t\t\t? extractParametersFromNode(parametersCapture.node, sourceCode)\n\t\t\t\t\t: []\n\n\t\t\t\tconst bodyCapture = captures.find(\n\t\t\t\t\t(c) =>\n\t\t\t\t\t\tc.name === \"body.definition.function\" &&\n\t\t\t\t\t\tc.node.startIndex >= node.startIndex &&\n\t\t\t\t\t\tc.node.endIndex <= node.endIndex,\n\t\t\t\t)\n\t\t\t\tconst hasBody = !!bodyCapture\n\n\t\t\t\tsnippets.push({\n\t\t\t\t\ttype: SnippetType.FunctionOrMethod,\n\t\t\t\t\tname: functionName,\n\t\t\t\t\trangeText,\n\t\t\t\t\tstartLine,\n\t\t\t\t\tendLine,\n\t\t\t\t\tfilePath,\n\t\t\t\t\tfileHash,\n\t\t\t\t\tscope,\n\t\t\t\t\tlanguage: CodeLanguageType.CPP,\n\t\t\t\t\tparameters,\n\t\t\t\t\tdefinition: {\n\t\t\t\t\t\tname: functionName,\n\t\t\t\t\t\ttype: \"function\",\n\t\t\t\t\t\tparameters,\n\t\t\t\t\t},\n\t\t\t\t})\n\t\t\t}\n\t\t})\n\t}\n\n\t// \u5904\u7406 method definitions and declarations\n\tif (snippetTypes.includes(SnippetType.FunctionOrMethod)) {\n\t\tconst methodCaptures = captures.filter((c) => c.name === \"definition.method\")\n\n\t\tmethodCaptures.forEach((capture) => {\n\t\t\tconst node = capture.node\n\t\t\tconst startLine = node.startPosition.row + 1\n\t\t\tconst endLine = node.endPosition.row + 1\n\t\t\tconst rangeText = sourceCode.substring(node.startIndex, node.endIndex)\n\t\t\tconst snippetHash = generateSnippetHash(filePath, startLine, endLine, rangeText)\n\n\t\t\tif (!seenHashes.has(snippetHash)) {\n\t\t\t\tseenHashes.add(snippetHash)\n\t\t\t\tconst scope = buildScopeChain(node)\n\n\t\t\t\tconst methodNameCapture = captures.find(\n\t\t\t\t\t(c) =>\n\t\t\t\t\t\tc.name === \"name.definition.method\" &&\n\t\t\t\t\t\tc.node.startIndex >= node.startIndex &&\n\t\t\t\t\t\tc.node.endIndex <= node.endIndex,\n\t\t\t\t)\n\t\t\t\tconst methodName = methodNameCapture\n\t\t\t\t\t? sourceCode.substring(methodNameCapture.node.startIndex, methodNameCapture.node.endIndex)\n\t\t\t\t\t: \"\"\n\n\t\t\t\tconst parametersCapture = captures.find(\n\t\t\t\t\t(c) =>\n\t\t\t\t\t\tc.name === \"parameters.definition.method\" &&\n\t\t\t\t\t\tc.node.startIndex >= node.startIndex &&\n\t\t\t\t\t\tc.node.endIndex <= node.endIndex,\n\t\t\t\t)\n\t\t\t\tconst parameters = parametersCapture\n\t\t\t\t\t? extractParametersFromNode(parametersCapture.node, sourceCode)\n\t\t\t\t\t: []\n\n\t\t\t\tconst bodyCapture = captures.find(\n\t\t\t\t\t(c) =>\n\t\t\t\t\t\tc.name === \"body.definition.method\" &&\n\t\t\t\t\t\tc.node.startIndex >= node.startIndex &&\n\t\t\t\t\t\tc.node.endIndex <= node.endIndex,\n\t\t\t\t)\n\t\t\t\tconst hasBody = !!bodyCapture\n\n\t\t\t\t// \u67E5\u627E\u5F52\u5C5E\u7684\u7C7B\u6216\u7ED3\u6784\u4F53\n\t\t\t\tconst parentContainer = findParentContainer(node, containerCaptures)\n\t\t\t\tconst field = parentContainer?.nameCap || undefined\n\n\t\t\t\tsnippets.push({\n\t\t\t\t\ttype: SnippetType.FunctionOrMethod,\n\t\t\t\t\tname: methodName,\n\t\t\t\t\trangeText,\n\t\t\t\t\tstartLine,\n\t\t\t\t\tendLine,\n\t\t\t\t\tfilePath,\n\t\t\t\t\tfileHash,\n\t\t\t\t\tscope,\n\t\t\t\t\tlanguage: CodeLanguageType.CPP,\n\t\t\t\t\tparameters,\n\t\t\t\t\tfield,\n\t\t\t\t\tdefinition: {\n\t\t\t\t\t\tname: methodName,\n\t\t\t\t\t\ttype: \"method\",\n\t\t\t\t\t\tparameters,\n\t\t\t\t\t},\n\t\t\t\t})\n\t\t\t}\n\t\t})\n\t}\n\n\t// \u5904\u7406 constructor definitions\n\tif (snippetTypes.includes(SnippetType.FunctionOrMethod)) {\n\t\tconst constructorCaptures = captures.filter((c) => c.name === \"definition.constructor\")\n\n\t\tconstructorCaptures.forEach((capture) => {\n\t\t\tconst node = capture.node\n\t\t\tconst startLine = node.startPosition.row + 1\n\t\t\tconst endLine = node.endPosition.row + 1\n\t\t\tconst rangeText = sourceCode.substring(node.startIndex, node.endIndex)\n\t\t\tconst snippetHash = generateSnippetHash(filePath, startLine, endLine, rangeText)\n\n\t\t\tif (!seenHashes.has(snippetHash)) {\n\t\t\t\tseenHashes.add(snippetHash)\n\t\t\t\tconst scope = buildScopeChain(node)\n\n\t\t\t\tconst constructorNameCapture = captures.find(\n\t\t\t\t\t(c) =>\n\t\t\t\t\t\tc.name === \"name.definition.constructor\" &&\n\t\t\t\t\t\tc.node.startIndex >= node.startIndex &&\n\t\t\t\t\t\tc.node.endIndex <= node.endIndex,\n\t\t\t\t)\n\t\t\t\tconst constructorName = constructorNameCapture\n\t\t\t\t\t? sourceCode.substring(constructorNameCapture.node.startIndex, constructorNameCapture.node.endIndex)\n\t\t\t\t\t: \"\"\n\n\t\t\t\tconst parametersCapture = captures.find(\n\t\t\t\t\t(c) =>\n\t\t\t\t\t\tc.name === \"parameters.definition.constructor\" &&\n\t\t\t\t\t\tc.node.startIndex >= node.startIndex &&\n\t\t\t\t\t\tc.node.endIndex <= node.endIndex,\n\t\t\t\t)\n\t\t\t\tconst parameters = parametersCapture\n\t\t\t\t\t? extractParametersFromNode(parametersCapture.node, sourceCode)\n\t\t\t\t\t: []\n\n\t\t\t\t// \u67E5\u627E\u5F52\u5C5E\u7684\u7C7B\n\t\t\t\tconst parentContainer = findParentContainer(node, containerCaptures)\n\t\t\t\tconst field = parentContainer?.nameCap || undefined\n\n\t\t\t\tsnippets.push({\n\t\t\t\t\ttype: SnippetType.FunctionOrMethod,\n\t\t\t\t\tname: constructorName,\n\t\t\t\t\trangeText,\n\t\t\t\t\tstartLine,\n\t\t\t\t\tendLine,\n\t\t\t\t\tfilePath,\n\t\t\t\t\tfileHash,\n\t\t\t\t\tscope,\n\t\t\t\t\tlanguage: CodeLanguageType.CPP,\n\t\t\t\t\tparameters,\n\t\t\t\t\tfield,\n\t\t\t\t\tdefinition: {\n\t\t\t\t\t\tname: constructorName,\n\t\t\t\t\t\ttype: \"constructor\",\n\t\t\t\t\t\tparameters,\n\t\t\t\t\t},\n\t\t\t\t})\n\t\t\t}\n\t\t})\n\t}\n\n\t// \u5904\u7406 destructor definitions\n\tif (snippetTypes.includes(SnippetType.FunctionOrMethod)) {\n\t\tconst destructorCaptures = captures.filter((c) => c.name === \"definition.destructor\")\n\n\t\tdestructorCaptures.forEach((capture) => {\n\t\t\tconst node = capture.node\n\t\t\tconst startLine = node.startPosition.row + 1\n\t\t\tconst endLine = node.endPosition.row + 1\n\t\t\tconst rangeText = sourceCode.substring(node.startIndex, node.endIndex)\n\t\t\tconst snippetHash = generateSnippetHash(filePath, startLine, endLine, rangeText)\n\n\t\t\tif (!seenHashes.has(snippetHash)) {\n\t\t\t\tseenHashes.add(snippetHash)\n\t\t\t\tconst scope = buildScopeChain(node)\n\n\t\t\t\tconst destructorNameCapture = captures.find(\n\t\t\t\t\t(c) =>\n\t\t\t\t\t\tc.name === \"name.definition.destructor\" &&\n\t\t\t\t\t\tc.node.startIndex >= node.startIndex &&\n\t\t\t\t\t\tc.node.endIndex <= node.endIndex,\n\t\t\t\t)\n\t\t\t\tconst destructorName = destructorNameCapture\n\t\t\t\t\t? sourceCode.substring(destructorNameCapture.node.startIndex, destructorNameCapture.node.endIndex)\n\t\t\t\t\t: \"\"\n\n\t\t\t\t// \u67E5\u627E\u5F52\u5C5E\u7684\u7C7B\n\t\t\t\tconst parentContainer = findParentContainer(node, containerCaptures)\n\t\t\t\tconst field = parentContainer?.nameCap || undefined\n\n\t\t\t\tsnippets.push({\n\t\t\t\t\ttype: SnippetType.FunctionOrMethod,\n\t\t\t\t\tname: destructorName,\n\t\t\t\t\trangeText,\n\t\t\t\t\tstartLine,\n\t\t\t\t\tendLine,\n\t\t\t\t\tfilePath,\n\t\t\t\t\tfileHash,\n\t\t\t\t\tscope,\n\t\t\t\t\tlanguage: CodeLanguageType.CPP,\n\t\t\t\t\tfield,\n\t\t\t\t\tdefinition: {\n\t\t\t\t\t\tname: destructorName,\n\t\t\t\t\t\ttype: \"destructor\",\n\t\t\t\t\t\tparameters: [],\n\t\t\t\t\t},\n\t\t\t\t})\n\t\t\t}\n\t\t})\n\t}\n\n\t// \u5904\u7406 operator overloads\n\tif (snippetTypes.includes(SnippetType.FunctionOrMethod)) {\n\t\tconst operatorCaptures = captures.filter((c) => c.name === \"definition.operator\")\n\n\t\toperatorCaptures.forEach((capture) => {\n\t\t\tconst node = capture.node\n\t\t\tconst startLine = node.startPosition.row + 1\n\t\t\tconst endLine = node.endPosition.row + 1\n\t\t\tconst rangeText = sourceCode.substring(node.startIndex, node.endIndex)\n\t\t\tconst snippetHash = generateSnippetHash(filePath, startLine, endLine, rangeText)\n\n\t\t\tif (!seenHashes.has(snippetHash)) {\n\t\t\t\tseenHashes.add(snippetHash)\n\t\t\t\tconst scope = buildScopeChain(node)\n\n\t\t\t\tconst operatorNameCapture = captures.find(\n\t\t\t\t\t(c) =>\n\t\t\t\t\t\tc.name === \"name.definition.operator\" &&\n\t\t\t\t\t\tc.node.startIndex >= node.startIndex &&\n\t\t\t\t\t\tc.node.endIndex <= node.endIndex,\n\t\t\t\t)\n\t\t\t\tconst operatorName = operatorNameCapture\n\t\t\t\t\t? sourceCode.substring(operatorNameCapture.node.startIndex, operatorNameCapture.node.endIndex)\n\t\t\t\t\t: \"\"\n\n\t\t\t\tconst parametersCapture = captures.find(\n\t\t\t\t\t(c) =>\n\t\t\t\t\t\tc.name === \"parameters.definition.operator\" &&\n\t\t\t\t\t\tc.node.startIndex >= node.startIndex &&\n\t\t\t\t\t\tc.node.endIndex <= node.endIndex,\n\t\t\t\t)\n\t\t\t\tconst parameters = parametersCapture\n\t\t\t\t\t? extractParametersFromNode(parametersCapture.node, sourceCode)\n\t\t\t\t\t: []\n\n\t\t\t\t// \u67E5\u627E\u5F52\u5C5E\u7684\u7C7B\n\t\t\t\tconst parentContainer = findParentContainer(node, containerCaptures)\n\t\t\t\tconst field = parentContainer?.nameCap || undefined\n\n\t\t\t\tsnippets.push({\n\t\t\t\t\ttype: SnippetType.FunctionOrMethod,\n\t\t\t\t\tname: operatorName,\n\t\t\t\t\trangeText,\n\t\t\t\t\tstartLine,\n\t\t\t\t\tendLine,\n\t\t\t\t\tfilePath,\n\t\t\t\t\tfileHash,\n\t\t\t\t\tscope,\n\t\t\t\t\tlanguage: CodeLanguageType.CPP,\n\t\t\t\t\tparameters,\n\t\t\t\t\tfield,\n\t\t\t\t\tdefinition: {\n\t\t\t\t\t\tname: operatorName,\n\t\t\t\t\t\ttype: \"operator\",\n\t\t\t\t\t\tparameters,\n\t\t\t\t\t},\n\t\t\t\t})\n\t\t\t}\n\t\t})\n\t}\n\n\t// \u5904\u7406 class definitions (\u6392\u9664\u6A21\u677F\u5185\u7684class)\n\tif (snippetTypes.includes(SnippetType.ClassOrInterfaceOrStructOrEnum)) {\n\t\tconst classCaptures = captures.filter((c) => c.name === \"definition.class\")\n\t\tconst templateCaptures = captures.filter((c) => c.name === \"definition.template\")\n\n\t\tclassCaptures.forEach((capture) => {\n\t\t\tconst node = capture.node\n\n\t\t\t// \u68C0\u67E5\u662F\u5426\u88ABtemplate\u5305\u542B\n\t\t\tconst isWithinTemplate = templateCaptures.some((templateCapture) => {\n\t\t\t\treturn (\n\t\t\t\t\ttemplateCapture.node.startIndex <= node.startIndex && node.endIndex <= templateCapture.node.endIndex\n\t\t\t\t)\n\t\t\t})\n\n\t\t\t// \u5982\u679C\u5728template\u5185\uFF0C\u8DF3\u8FC7\uFF08\u7531template\u5904\u7406\uFF09\n\t\t\tif (isWithinTemplate) {\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tconst startLine = node.startPosition.row + 1\n\t\t\tconst endLine = node.endPosition.row + 1\n\t\t\tconst rangeText = sourceCode.substring(node.startIndex, node.endIndex)\n\t\t\tconst snippetHash = generateSnippetHash(filePath, startLine, endLine, rangeText)\n\n\t\t\tif (!seenHashes.has(snippetHash)) {\n\t\t\t\tseenHashes.add(snippetHash)\n\t\t\t\tconst scope = buildScopeChain(node)\n\n\t\t\t\tconst classNameCapture = captures.find(\n\t\t\t\t\t(c) =>\n\t\t\t\t\t\tc.name === \"name.definition.class\" &&\n\t\t\t\t\t\tc.node.startIndex >= node.startIndex &&\n\t\t\t\t\t\tc.node.endIndex <= node.endIndex,\n\t\t\t\t)\n\t\t\t\tconst className = classNameCapture\n\t\t\t\t\t? sourceCode.substring(classNameCapture.node.startIndex, classNameCapture.node.endIndex)\n\t\t\t\t\t: \"\"\n\n\t\t\t\tconst fields = extractFieldsFromContainerNode(node, sourceCode, captures)\n\n\t\t\t\tsnippets.push({\n\t\t\t\t\ttype: SnippetType.ClassOrInterfaceOrStructOrEnum,\n\t\t\t\t\tname: className,\n\t\t\t\t\trangeText,\n\t\t\t\t\tstartLine,\n\t\t\t\t\tendLine,\n\t\t\t\t\tfilePath,\n\t\t\t\t\tfileHash,\n\t\t\t\t\tscope,\n\t\t\t\t\tlanguage: CodeLanguageType.CPP,\n\t\t\t\t\tdefinition: {\n\t\t\t\t\t\tname: className,\n\t\t\t\t\t\ttype: \"class\",\n\t\t\t\t\t},\n\t\t\t\t})\n\t\t\t}\n\t\t})\n\t}\n\n\t// \u5904\u7406 struct definitions\n\tif (snippetTypes.includes(SnippetType.ClassOrInterfaceOrStructOrEnum)) {\n\t\tconst structCaptures = captures.filter((c) => c.name === \"definition.struct\")\n\n\t\tstructCaptures.forEach((capture) => {\n\t\t\tconst node = capture.node\n\t\t\tconst startLine = node.startPosition.row + 1\n\t\t\tconst endLine = node.endPosition.row + 1\n\t\t\tconst rangeText = sourceCode.substring(node.startIndex, node.endIndex)\n\t\t\tconst snippetHash = generateSnippetHash(filePath, startLine, endLine, rangeText)\n\n\t\t\tif (!seenHashes.has(snippetHash)) {\n\t\t\t\tseenHashes.add(snippetHash)\n\t\t\t\tconst scope = buildScopeChain(node)\n\n\t\t\t\tconst structNameCapture = captures.find(\n\t\t\t\t\t(c) =>\n\t\t\t\t\t\tc.name === \"name.definition.struct\" &&\n\t\t\t\t\t\tc.node.startIndex >= node.startIndex &&\n\t\t\t\t\t\tc.node.endIndex <= node.endIndex,\n\t\t\t\t)\n\t\t\t\tconst structName = structNameCapture\n\t\t\t\t\t? sourceCode.substring(structNameCapture.node.startIndex, structNameCapture.node.endIndex)\n\t\t\t\t\t: \"\"\n\n\t\t\t\tconst fields = extractFieldsFromContainerNode(node, sourceCode, captures)\n\n\t\t\t\tsnippets.push({\n\t\t\t\t\ttype: SnippetType.ClassOrInterfaceOrStructOrEnum,\n\t\t\t\t\tname: structName,\n\t\t\t\t\trangeText,\n\t\t\t\t\tstartLine,\n\t\t\t\t\tendLine,\n\t\t\t\t\tfilePath,\n\t\t\t\t\tfileHash,\n\t\t\t\t\tscope,\n\t\t\t\t\tlanguage: CodeLanguageType.CPP,\n\t\t\t\t\tdefinition: {\n\t\t\t\t\t\tname: structName,\n\t\t\t\t\t\ttype: \"struct\",\n\t\t\t\t\t},\n\t\t\t\t})\n\t\t\t}\n\t\t})\n\t}\n\n\t// \u5904\u7406 union definitions\n\tif (snippetTypes.includes(SnippetType.ClassOrInterfaceOrStructOrEnum)) {\n\t\tconst unionCaptures = captures.filter((c) => c.name === \"definition.union\")\n\n\t\tunionCaptures.forEach((capture) => {\n\t\t\tconst node = capture.node\n\t\t\tconst startLine = node.startPosition.row + 1\n\t\t\tconst endLine = node.endPosition.row + 1\n\t\t\tconst rangeText = sourceCode.substring(node.startIndex, node.endIndex)\n\t\t\tconst snippetHash = generateSnippetHash(filePath, startLine, endLine, rangeText)\n\n\t\t\tif (!seenHashes.has(snippetHash)) {\n\t\t\t\tseenHashes.add(snippetHash)\n\t\t\t\tconst scope = buildScopeChain(node)\n\n\t\t\t\tconst unionNameCapture = captures.find(\n\t\t\t\t\t(c) =>\n\t\t\t\t\t\tc.name === \"name.definition.union\" &&\n\t\t\t\t\t\tc.node.startIndex >= node.startIndex &&\n\t\t\t\t\t\tc.node.endIndex <= node.endIndex,\n\t\t\t\t)\n\t\t\t\tconst unionName = unionNameCapture\n\t\t\t\t\t? sourceCode.substring(unionNameCapture.node.startIndex, unionNameCapture.node.endIndex)\n\t\t\t\t\t: \"\"\n\n\t\t\t\tconst fields = extractFieldsFromContainerNode(node, sourceCode, captures)\n\n\t\t\t\tsnippets.push({\n\t\t\t\t\ttype: SnippetType.ClassOrInterfaceOrStructOrEnum,\n\t\t\t\t\tname: unionName,\n\t\t\t\t\trangeText,\n\t\t\t\t\tstartLine,\n\t\t\t\t\tendLine,\n\t\t\t\t\tfilePath,\n\t\t\t\t\tfileHash,\n\t\t\t\t\tscope,\n\t\t\t\t\tlanguage: CodeLanguageType.CPP,\n\t\t\t\t\tdefinition: {\n\t\t\t\t\t\tname: unionName,\n\t\t\t\t\t\ttype: \"union\",\n\t\t\t\t\t},\n\t\t\t\t})\n\t\t\t}\n\t\t})\n\t}\n\n\t// \u5904\u7406 enum definitions\n\tif (snippetTypes.includes(SnippetType.ClassOrInterfaceOrStructOrEnum)) {\n\t\tconst enumCaptures = captures.filter((c) => c.name === \"definition.enum\")\n\n\t\tenumCaptures.forEach((capture) => {\n\t\t\tconst node = capture.node\n\t\t\tconst startLine = node.startPosition.row + 1\n\t\t\tconst endLine = node.endPosition.row + 1\n\t\t\tconst rangeText = sourceCode.substring(node.startIndex, node.endIndex)\n\t\t\tconst snippetHash = generateSnippetHash(filePath, startLine, endLine, rangeText)\n\n\t\t\tif (!seenHashes.has(snippetHash)) {\n\t\t\t\tseenHashes.add(snippetHash)\n\t\t\t\tconst scope = buildScopeChain(node)\n\n\t\t\t\tconst enumNameCapture = captures.find(\n\t\t\t\t\t(c) =>\n\t\t\t\t\t\tc.name === \"name.definition.enum\" &&\n\t\t\t\t\t\tc.node.startIndex >= node.startIndex &&\n\t\t\t\t\t\tc.node.endIndex <= node.endIndex,\n\t\t\t\t)\n\t\t\t\tconst enumName = enumNameCapture\n\t\t\t\t\t? sourceCode.substring(enumNameCapture.node.startIndex, enumNameCapture.node.endIndex)\n\t\t\t\t\t: \"\"\n\n\t\t\t\tconst enumerators = extractEnumeratorsFromEnumNode(node, sourceCode, captures)\n\n\t\t\t\tsnippets.push({\n\t\t\t\t\ttype: SnippetType.ClassOrInterfaceOrStructOrEnum,\n\t\t\t\t\tname: enumName,\n\t\t\t\t\trangeText,\n\t\t\t\t\tstartLine,\n\t\t\t\t\tendLine,\n\t\t\t\t\tfilePath,\n\t\t\t\t\tfileHash,\n\t\t\t\t\tscope,\n\t\t\t\t\tlanguage: CodeLanguageType.CPP,\n\t\t\t\t\tdefinition: {\n\t\t\t\t\t\tname: enumName,\n\t\t\t\t\t\ttype: \"enum\",\n\t\t\t\t\t},\n\t\t\t\t})\n\t\t\t}\n\t\t})\n\t}\n\n\t// \u5904\u7406 template definitions\n\tif (snippetTypes.includes(SnippetType.ClassOrInterfaceOrStructOrEnum)) {\n\t\tconst templateCaptures = captures.filter((c) => c.name === \"definition.template\")\n\n\t\ttemplateCaptures.forEach((capture) => {\n\t\t\tconst node = capture.node\n\t\t\tconst startLine = node.startPosition.row + 1\n\t\t\tconst endLine = node.endPosition.row + 1\n\t\t\tconst rangeText = sourceCode.substring(node.startIndex, node.endIndex)\n\t\t\tconst snippetHash = generateSnippetHash(filePath, startLine, endLine, rangeText)\n\n\t\t\tif (!seenHashes.has(snippetHash)) {\n\t\t\t\tseenHashes.add(snippetHash)\n\t\t\t\tconst scope = buildScopeChain(node)\n\n\t\t\t\t// \u67E5\u627E\u6A21\u677F\u7684\u540D\u79F0\uFF08\u53EF\u80FD\u662F\u7C7B\u3001\u7ED3\u6784\u4F53\u6216\u51FD\u6570\uFF09\n\t\t\t\tconst templateClassNameCapture = captures.find(\n\t\t\t\t\t(c) =>\n\t\t\t\t\t\tc.name === \"name.definition.template.class\" &&\n\t\t\t\t\t\tc.node.startIndex >= node.startIndex &&\n\t\t\t\t\t\tc.node.endIndex <= node.endIndex,\n\t\t\t\t)\n\t\t\t\tconst templateStructNameCapture = captures.find(\n\t\t\t\t\t(c) =>\n\t\t\t\t\t\tc.name === \"name.definition.template.struct\" &&\n\t\t\t\t\t\tc.node.startIndex >= node.startIndex &&\n\t\t\t\t\t\tc.node.endIndex <= node.endIndex,\n\t\t\t\t)\n\t\t\t\tconst templateFunctionNameCapture = captures.find(\n\t\t\t\t\t(c) =>\n\t\t\t\t\t\tc.name === \"name.definition.template.function\" &&\n\t\t\t\t\t\tc.node.startIndex >= node.startIndex &&\n\t\t\t\t\t\tc.node.endIndex <= node.endIndex,\n\t\t\t\t)\n\n\t\t\t\tlet templateName = \"\"\n\t\t\t\tlet templateType = \"template\"\n\t\t\t\tif (templateClassNameCapture) {\n\t\t\t\t\ttemplateName = sourceCode.substring(\n\t\t\t\t\t\ttemplateClassNameCapture.node.startIndex,\n\t\t\t\t\t\ttemplateClassNameCapture.node.endIndex,\n\t\t\t\t\t)\n\t\t\t\t\ttemplateType = \"template_class\"\n\t\t\t\t} else if (templateStructNameCapture) {\n\t\t\t\t\ttemplateName = sourceCode.substring(\n\t\t\t\t\t\ttemplateStructNameCapture.node.startIndex,\n\t\t\t\t\t\ttemplateStructNameCapture.node.endIndex,\n\t\t\t\t\t)\n\t\t\t\t\ttemplateType = \"template_struct\"\n\t\t\t\t} else if (templateFunctionNameCapture) {\n\t\t\t\t\ttemplateName = sourceCode.substring(\n\t\t\t\t\t\ttemplateFunctionNameCapture.node.startIndex,\n\t\t\t\t\t\ttemplateFunctionNameCapture.node.endIndex,\n\t\t\t\t\t)\n\t\t\t\t\ttemplateType = \"template_function\"\n\t\t\t\t}\n\n\t\t\t\tconst parametersCapture = captures.find(\n\t\t\t\t\t(c) =>\n\t\t\t\t\t\tc.name === \"parameters.definition.template\" &&\n\t\t\t\t\t\tc.node.startIndex >= node.startIndex &&\n\t\t\t\t\t\tc.node.endIndex <= node.endIndex,\n\t\t\t\t)\n\t\t\t\tconst templateParameters = parametersCapture\n\t\t\t\t\t? extractTemplateParametersFromNode(parametersCapture.node, sourceCode)\n\t\t\t\t\t: []\n\n\t\t\t\tif (templateType === \"template_function\") {\n\t\t\t\t\t// \u6A21\u677F\u51FD\u6570\u5F52\u7C7B\u4E3A\u51FD\u6570\n\t\t\t\t\tif (snippetTypes.includes(SnippetType.FunctionOrMethod)) {\n\t\t\t\t\t\tconst functionParametersCapture = captures.find(\n\t\t\t\t\t\t\t(c) =>\n\t\t\t\t\t\t\t\tc.name === \"parameters.definition.template.function\" &&\n\t\t\t\t\t\t\t\tc.node.startIndex >= node.startIndex &&\n\t\t\t\t\t\t\t\tc.node.endIndex <= node.endIndex,\n\t\t\t\t\t\t)\n\t\t\t\t\t\tconst functionParameters = functionParametersCapture\n\t\t\t\t\t\t\t? extractParametersFromNode(functionParametersCapture.node, sourceCode)\n\t\t\t\t\t\t\t: []\n\n\t\t\t\t\t\tsnippets.push({\n\t\t\t\t\t\t\ttype: SnippetType.FunctionOrMethod,\n\t\t\t\t\t\t\tname: templateName,\n\t\t\t\t\t\t\trangeText,\n\t\t\t\t\t\t\tstartLine,\n\t\t\t\t\t\t\tendLine,\n\t\t\t\t\t\t\tfilePath,\n\t\t\t\t\t\t\tfileHash,\n\t\t\t\t\t\t\tscope,\n\t\t\t\t\t\t\tlanguage: CodeLanguageType.CPP,\n\t\t\t\t\t\t\tparameters: functionParameters,\n\t\t\t\t\t\t\tdefinition: {\n\t\t\t\t\t\t\t\tname: templateName,\n\t\t\t\t\t\t\t\ttype: templateType,\n\t\t\t\t\t\t\t\tparameters: functionParameters,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t})\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t// \u6A21\u677F\u7C7B/\u7ED3\u6784\u4F53\u5F52\u7C7B\u4E3A\u7C7B\n\t\t\t\t\tsnippets.push({\n\t\t\t\t\t\ttype: SnippetType.ClassOrInterfaceOrStructOrEnum,\n\t\t\t\t\t\tname: templateName,\n\t\t\t\t\t\trangeText,\n\t\t\t\t\t\tstartLine,\n\t\t\t\t\t\tendLine,\n\t\t\t\t\t\tfilePath,\n\t\t\t\t\t\tfileHash,\n\t\t\t\t\t\tscope,\n\t\t\t\t\t\tlanguage: CodeLanguageType.CPP,\n\t\t\t\t\t\tdefinition: {\n\t\t\t\t\t\t\tname: templateName,\n\t\t\t\t\t\t\ttype: templateType,\n\t\t\t\t\t\t},\n\t\t\t\t\t})\n\t\t\t\t}\n\t\t\t}\n\t\t})\n\t}\n\n\t// \u5904\u7406 namespace definitions\n\tif (snippetTypes.includes(SnippetType.ClassOrInterfaceOrStructOrEnum)) {\n\t\tconst namespaceCaptures = captures.filter((c) => c.name === \"definition.namespace\")\n\n\t\tnamespaceCaptures.forEach((capture) => {\n\t\t\tconst node = capture.node\n\t\t\tconst startLine = node.startPosition.row + 1\n\t\t\tconst endLine = node.endPosition.row + 1\n\t\t\tconst rangeText = sourceCode.substring(node.startIndex, node.endIndex)\n\t\t\tconst snippetHash = generateSnippetHash(filePath, startLine, endLine, rangeText)\n\n\t\t\tif (!seenHashes.has(snippetHash)) {\n\t\t\t\tseenHashes.add(snippetHash)\n\t\t\t\tconst scope = buildScopeChain(node)\n\n\t\t\t\tconst namespaceNameCapture = captures.find(\n\t\t\t\t\t(c) =>\n\t\t\t\t\t\tc.name === \"name.definition.namespace\" &&\n\t\t\t\t\t\tc.node.startIndex >= node.startIndex &&\n\t\t\t\t\t\tc.node.endIndex <= node.endIndex,\n\t\t\t\t)\n\t\t\t\tconst namespaceName = namespaceNameCapture\n\t\t\t\t\t? sourceCode.substring(namespaceNameCapture.node.startIndex, namespaceNameCapture.node.endIndex)\n\t\t\t\t\t: \"<anonymous>\"\n\n\t\t\t\tsnippets.push({\n\t\t\t\t\ttype: SnippetType.ClassOrInterfaceOrStructOrEnum,\n\t\t\t\t\tname: namespaceName,\n\t\t\t\t\trangeText,\n\t\t\t\t\tstartLine,\n\t\t\t\t\tendLine,\n\t\t\t\t\tfilePath,\n\t\t\t\t\tfileHash,\n\t\t\t\t\tscope,\n\t\t\t\t\tlanguage: CodeLanguageType.CPP,\n\t\t\t\t\tdefinition: {\n\t\t\t\t\t\tname: namespaceName,\n\t\t\t\t\t\ttype: \"namespace\",\n\t\t\t\t\t},\n\t\t\t\t})\n\t\t\t}\n\t\t})\n\t}\n\n\t// \u5904\u7406 typedef definitions\n\tif (snippetTypes.includes(SnippetType.ClassOrInterfaceOrStructOrEnum)) {\n\t\tconst typedefCaptures = captures.filter((c) => c.name === \"definition.typedef\")\n\n\t\ttypedefCaptures.forEach((capture) => {\n\t\t\tconst node = capture.node\n\t\t\tconst startLine = node.startPosition.row + 1\n\t\t\tconst endLine = node.endPosition.row + 1\n\t\t\tconst rangeText = sourceCode.substring(node.startIndex, node.endIndex)\n\t\t\tconst snippetHash = generateSnippetHash(filePath, startLine, endLine, rangeText)\n\n\t\t\tif (!seenHashes.has(snippetHash)) {\n\t\t\t\tseenHashes.add(snippetHash)\n\t\t\t\tconst scope = buildScopeChain(node)\n\n\t\t\t\tconst typedefNameCapture = captures.find(\n\t\t\t\t\t(c) =>\n\t\t\t\t\t\tc.name === \"name.definition.typedef\" &&\n\t\t\t\t\t\tc.node.startIndex >= node.startIndex &&\n\t\t\t\t\t\tc.node.endIndex <= node.endIndex,\n\t\t\t\t)\n\t\t\t\tconst typedefName = typedefNameCapture\n\t\t\t\t\t? sourceCode.substring(typedefNameCapture.node.startIndex, typedefNameCapture.node.endIndex)\n\t\t\t\t\t: \"\"\n\n\t\t\t\tsnippets.push({\n\t\t\t\t\ttype: SnippetType.ClassOrInterfaceOrStructOrEnum,\n\t\t\t\t\tname: typedefName,\n\t\t\t\t\trangeText,\n\t\t\t\t\tstartLine,\n\t\t\t\t\tendLine,\n\t\t\t\t\tfilePath,\n\t\t\t\t\tfileHash,\n\t\t\t\t\tscope,\n\t\t\t\t\tlanguage: CodeLanguageType.CPP,\n\t\t\t\t\tdefinition: {\n\t\t\t\t\t\tname: typedefName,\n\t\t\t\t\t\ttype: \"typedef\",\n\t\t\t\t\t},\n\t\t\t\t})\n\t\t\t}\n\t\t})\n\t}\n\n\t// \u5904\u7406 using declarations\n\tif (snippetTypes.includes(SnippetType.ClassOrInterfaceOrStructOrEnum)) {\n\t\tconst usingCaptures = captures.filter((c) => c.name === \"definition.using\")\n\n\t\tusingCaptures.forEach((capture) => {\n\t\t\tconst node = capture.node\n\t\t\tconst startLine = node.startPosition.row + 1\n\t\t\tconst endLine = node.endPosition.row + 1\n\t\t\tconst rangeText = sourceCode.substring(node.startIndex, node.endIndex)\n\t\t\tconst snippetHash = generateSnippetHash(filePath, startLine, endLine, rangeText)\n\n\t\t\tif (!seenHashes.has(snippetHash)) {\n\t\t\t\tseenHashes.add(snippetHash)\n\t\t\t\tconst scope = buildScopeChain(node)\n\n\t\t\t\tconst usingNameCapture = captures.find(\n\t\t\t\t\t(c) =>\n\t\t\t\t\t\tc.name === \"name.definition.using\" &&\n\t\t\t\t\t\tc.node.startIndex >= node.startIndex &&\n\t\t\t\t\t\tc.node.endIndex <= node.endIndex,\n\t\t\t\t)\n\t\t\t\tconst usingName = usingNameCapture\n\t\t\t\t\t? sourceCode.substring(usingNameCapture.node.startIndex, usingNameCapture.node.endIndex)\n\t\t\t\t\t: \"\"\n\n\t\t\t\tsnippets.push({\n\t\t\t\t\ttype: SnippetType.ClassOrInterfaceOrStructOrEnum,\n\t\t\t\t\tname: usingName,\n\t\t\t\t\trangeText,\n\t\t\t\t\tstartLine,\n\t\t\t\t\tendLine,\n\t\t\t\t\tfilePath,\n\t\t\t\t\tfileHash,\n\t\t\t\t\tscope,\n\t\t\t\t\tlanguage: CodeLanguageType.CPP,\n\t\t\t\t\tdefinition: {\n\t\t\t\t\t\tname: usingName,\n\t\t\t\t\t\ttype: \"using\",\n\t\t\t\t\t},\n\t\t\t\t})\n\t\t\t}\n\t\t})\n\t}\n\n\t// \u5904\u7406 global variables\n\tif (snippetTypes.includes(SnippetType.VariableOrConstant)) {\n\t\tconst variableCaptures = captures.filter((c) => c.name === \"definition.variable\")\n\n\t\tvariableCaptures.forEach((capture) => {\n\t\t\tconst node = capture.node\n\t\t\tconst startLine = node.startPosition.row + 1\n\t\t\tconst endLine = node.endPosition.row + 1\n\t\t\tconst rangeText = sourceCode.substring(node.startIndex, node.endIndex)\n\t\t\tconst snippetHash = generateSnippetHash(filePath, startLine, endLine, rangeText)\n\n\t\t\tif (!seenHashes.has(snippetHash)) {\n\t\t\t\tseenHashes.add(snippetHash)\n\t\t\t\tconst scope = buildScopeChain(node)\n\n\t\t\t\tconst variableNameCapture = captures.find(\n\t\t\t\t\t(c) =>\n\t\t\t\t\t\tc.name === \"name.definition.variable\" &&\n\t\t\t\t\t\tc.node.startIndex >= node.startIndex &&\n\t\t\t\t\t\tc.node.endIndex <= node.endIndex,\n\t\t\t\t)\n\t\t\t\tconst variableName = variableNameCapture\n\t\t\t\t\t? sourceCode.substring(variableNameCapture.node.startIndex, variableNameCapture.node.endIndex)\n\t\t\t\t\t: \"\"\n\n\t\t\t\tsnippets.push({\n\t\t\t\t\ttype: SnippetType.VariableOrConstant,\n\t\t\t\t\tname: variableName,\n\t\t\t\t\trangeText,\n\t\t\t\t\tstartLine,\n\t\t\t\t\tendLine,\n\t\t\t\t\tfilePath,\n\t\t\t\t\tfileHash,\n\t\t\t\t\tscope,\n\t\t\t\t\tlanguage: CodeLanguageType.CPP,\n\t\t\t\t\tdefinition: {\n\t\t\t\t\t\tname: variableName,\n\t\t\t\t\t\ttype: \"variable\",\n\t\t\t\t\t},\n\t\t\t\t})\n\t\t\t}\n\t\t})\n\t}\n\n\tlogger.info(`Extracted ${snippets.length} C++ snippets`)\n\treturn snippets\n}\n\n// \u8F85\u52A9\u51FD\u6570\uFF1A\u63D0\u53D6\u51FD\u6570\u53C2\u6570\nfunction extractParametersFromNode(node: Parser.SyntaxNode, sourceCode: string): ParameterInfo[] {\n\tconst parameters: ParameterInfo[] = []\n\n\t// \u904D\u5386\u53C2\u6570\u5217\u8868\u4E2D\u7684\u6BCF\u4E2A\u53C2\u6570\n\tfor (let i = 0; i < node.childCount; i++) {\n\t\tconst child = node.child(i)\n\t\tif (child && child.type === \"parameter_declaration\") {\n\t\t\tconst parameterText = sourceCode.substring(child.startIndex, child.endIndex)\n\t\t\tconst parameterName = extractParameterName(child, sourceCode)\n\n\t\t\tparameters.push({\n\t\t\t\tname: parameterName,\n\t\t\t\ttype: parameterText,\n\t\t\t})\n\t\t}\n\t}\n\n\treturn parameters\n}\n\n// \u8F85\u52A9\u51FD\u6570\uFF1A\u63D0\u53D6\u53C2\u6570\u540D\u79F0\nfunction extractParameterName(node: Parser.SyntaxNode, sourceCode: string): string {\n\t// \u67E5\u627E\u53C2\u6570\u58F0\u660E\u4E2D\u7684\u6807\u8BC6\u7B26\n\tfor (let i = 0; i < node.childCount; i++) {\n\t\tconst child = node.child(i)\n\t\tif (child && child.type === \"identifier\") {\n\t\t\treturn sourceCode.substring(child.startIndex, child.endIndex)\n\t\t}\n\t}\n\treturn \"\"\n}\n\n// \u8F85\u52A9\u51FD\u6570\uFF1A\u63D0\u53D6\u6A21\u677F\u53C2\u6570\nfunction extractTemplateParametersFromNode(node: Parser.SyntaxNode, sourceCode: string): ParameterInfo[] {\n\tconst parameters: ParameterInfo[] = []\n\n\t// \u904D\u5386\u6A21\u677F\u53C2\u6570\u5217\u8868\u4E2D\u7684\u6BCF\u4E2A\u53C2\u6570\n\tfor (let i = 0; i < node.childCount; i++) {\n\t\tconst child = node.child(i)\n\t\tif (child && (child.type === \"type_parameter_declaration\" || child.type === \"parameter_declaration\")) {\n\t\t\tconst parameterText = sourceCode.substring(child.startIndex, child.endIndex)\n\t\t\tconst parameterName = extractTemplateParameterName(child, sourceCode)\n\n\t\t\tparameters.push({\n\t\t\t\tname: parameterName,\n\t\t\t\ttype: parameterText,\n\t\t\t})\n\t\t}\n\t}\n\n\treturn parameters\n}\n\n// \u8F85\u52A9\u51FD\u6570\uFF1A\u63D0\u53D6\u6A21\u677F\u53C2\u6570\u540D\u79F0\nfunction extractTemplateParameterName(node: Parser.SyntaxNode, sourceCode: string): string {\n\t// \u67E5\u627E\u6A21\u677F\u53C2\u6570\u58F0\u660E\u4E2D\u7684\u6807\u8BC6\u7B26\n\tfor (let i = 0; i < node.childCount; i++) {\n\t\tconst child = node.child(i)\n\t\tif (child && (child.type === \"type_identifier\" || child.type === \"identifier\")) {\n\t\t\treturn sourceCode.substring(child.startIndex, child.endIndex)\n\t\t}\n\t}\n\treturn \"\"\n}\n\n// \u8F85\u52A9\u51FD\u6570\uFF1A\u63D0\u53D6\u7ED3\u6784\u4F53/\u7C7B/\u8054\u5408\u4F53\u5B57\u6BB5\nfunction extractFieldsFromContainerNode(\n\tnode: Parser.SyntaxNode,\n\tsourceCode: string,\n\tcaptures: Parser.QueryCapture[],\n): string[] {\n\tconst fields: string[] = []\n\n\t// \u67E5\u627E\u8BE5\u5BB9\u5668\u5185\u7684\u6240\u6709\u5B57\u6BB5\n\tconst fieldCaptures = captures.filter(\n\t\t(c) =>\n\t\t\tc.name === \"name.definition.field\" &&\n\t\t\tc.node.startIndex >= node.startIndex &&\n\t\t\tc.node.endIndex <= node.endIndex,\n\t)\n\n\tfieldCaptures.forEach((capture) => {\n\t\tconst fieldName = sourceCode.substring(capture.node.startIndex, capture.node.endIndex)\n\t\tfields.push(fieldName)\n\t})\n\n\treturn fields\n}\n\n// \u8F85\u52A9\u51FD\u6570\uFF1A\u63D0\u53D6\u679A\u4E3E\u503C\nfunction extractEnumeratorsFromEnumNode(\n\tnode: Parser.SyntaxNode,\n\tsourceCode: string,\n\tcaptures: Parser.QueryCapture[],\n): string[] {\n\tconst enumerators: string[] = []\n\n\t// \u67E5\u627E\u8BE5\u679A\u4E3E\u5185\u7684\u6240\u6709\u679A\u4E3E\u503C\n\tconst enumeratorCaptures = captures.filter(\n\t\t(c) =>\n\t\t\tc.name === \"name.definition.enumerator\" &&\n\t\t\tc.node.startIndex >= node.startIndex &&\n\t\t\tc.node.endIndex <= node.endIndex,\n\t)\n\n\tenumeratorCaptures.forEach((capture) => {\n\t\tconst enumeratorName = sourceCode.substring(capture.node.startIndex, capture.node.endIndex)\n\t\tenumerators.push(enumeratorName)\n\t})\n\n\treturn enumerators\n}\n\n// \u8F85\u52A9\u51FD\u6570\uFF1A\u67E5\u627E\u7236\u5BB9\u5668\nfunction findParentContainer(\n\tnode: Parser.SyntaxNode,\n\tcontainerCaptures: Array<{\n\t\tnode: Parser.SyntaxNode\n\t\tstart: number\n\t\tend: number\n\t\tname: string\n\t\tnameCap: string | null\n\t}>,\n): { node: Parser.SyntaxNode; start: number; end: number; name: string; nameCap: string | null } | null {\n\tfor (const container of containerCaptures) {\n\t\tif (container.start <= node.startIndex && node.endIndex <= container.end) {\n\t\t\treturn container\n\t\t}\n\t}\n\treturn null\n}\n\n// \u8F85\u52A9\u51FD\u6570\uFF1A\u6839\u636E\u5BB9\u5668\u7C7B\u578B\u751F\u6210\u5BF9\u5E94\u7684\u540D\u79F0capture\u540D\u79F0\nfunction getNameCaptureNameForContainer(containerCaptureName: string): string {\n\tswitch (containerCaptureName) {\n\t\tcase \"definition.class\":\n\t\t\treturn \"name.definition.class\"\n\t\tcase \"definition.struct\":\n\t\t\treturn \"name.definition.struct\"\n\t\tcase \"definition.union\":\n\t\t\treturn \"name.definition.union\"\n\t\tcase \"definition.enum\":\n\t\t\treturn \"name.definition.enum\"\n\t\tcase \"definition.template\":\n\t\t\treturn \"name.definition.template.class\" // \u9ED8\u8BA4\u67E5\u627E\u7C7B\u6A21\u677F\n\t\tdefault:\n\t\t\treturn containerCaptureName\n\t}\n}\n\n// \u8F85\u52A9\u51FD\u6570\uFF1A\u67E5\u627E\u5BB9\u5668\u7684\u540D\u79F0capture\nfunction findNameCaptureForContainer(\n\tcontainerCapture: Parser.QueryCapture,\n\tcaptures: Parser.QueryCapture[],\n\tsourceCode: string,\n): string | null {\n\tconst node = containerCapture.node\n\tconst nameCaptureName = getNameCaptureNameForContainer(containerCapture.name)\n\n\t// \u5BF9\u4E8E\u6A21\u677F\uFF0C\u53EF\u80FD\u9700\u8981\u67E5\u627E\u4E0D\u540C\u7C7B\u578B\u7684\u540D\u79F0\n\tif (containerCapture.name === \"definition.template\") {\n\t\tconst templateClassNameCapture = captures.find(\n\t\t\t(c) =>\n\t\t\t\tc.name === \"name.definition.template.class\" &&\n\t\t\t\tc.node.startIndex >= node.startIndex &&\n\t\t\t\tc.node.endIndex <= node.endIndex,\n\t\t)\n\t\tif (templateClassNameCapture) {\n\t\t\treturn sourceCode.substring(\n\t\t\t\ttemplateClassNameCapture.node.startIndex,\n\t\t\t\ttemplateClassNameCapture.node.endIndex,\n\t\t\t)\n\t\t}\n\n\t\tconst templateStructNameCapture = captures.find(\n\t\t\t(c) =>\n\t\t\t\tc.name === \"name.definition.template.struct\" &&\n\t\t\t\tc.node.startIndex >= node.startIndex &&\n\t\t\t\tc.node.endIndex <= node.endIndex,\n\t\t)\n\t\tif (templateStructNameCapture) {\n\t\t\treturn sourceCode.substring(\n\t\t\t\ttemplateStructNameCapture.node.startIndex,\n\t\t\t\ttemplateStructNameCapture.node.endIndex,\n\t\t\t)\n\t\t}\n\n\t\tconst templateFunctionNameCapture = captures.find(\n\t\t\t(c) =>\n\t\t\t\tc.name === \"name.definition.template.function\" &&\n\t\t\t\tc.node.startIndex >= node.startIndex &&\n\t\t\t\tc.node.endIndex <= node.endIndex,\n\t\t)\n\t\tif (templateFunctionNameCapture) {\n\t\t\treturn sourceCode.substring(\n\t\t\t\ttemplateFunctionNameCapture.node.startIndex,\n\t\t\t\ttemplateFunctionNameCapture.node.endIndex,\n\t\t\t)\n\t\t}\n\t}\n\n\tconst nameCapture = captures.find(\n\t\t(c) => c.name === nameCaptureName && c.node.startIndex >= node.startIndex && c.node.endIndex <= node.endIndex,\n\t)\n\n\treturn nameCapture ? sourceCode.substring(nameCapture.node.startIndex, nameCapture.node.endIndex) : null\n}\n\n// \u7528\u4E8E\u6784\u5EFA\u6982\u89C8\u7684\u51FD\u6570\nexport function buildSummaryFromSnippets(snippets: ISnippetMeta[]): any {\n\tconst summary = {\n\t\tincludes: [] as string[],\n\t\tnamespaces: [] as string[],\n\t\tclasses: [] as string[],\n\t\tstructs: [] as string[],\n\t\tunions: [] as string[],\n\t\tenums: [] as string[],\n\t\ttemplates: [] as string[],\n\t\tfunctions: [] as string[],\n\t\tmethods: [] as string[],\n\t\tconstructors: [] as string[],\n\t\tdestructors: [] as string[],\n\t\toperators: [] as string[],\n\t\tvariables: [] as string[],\n\t\ttypedefs: [] as string[],\n\t\tusings: [] as string[],\n\t}\n\n\tsnippets.forEach((snippet) => {\n\t\tswitch (snippet.type) {\n\t\t\tcase SnippetType.ImportOrInclude:\n\t\t\t\tsummary.includes.push(snippet.name)\n\t\t\t\tbreak\n\t\t\tcase SnippetType.FunctionOrMethod:\n\t\t\t\tif (snippet.definition?.type === \"function\") {\n\t\t\t\t\tsummary.functions.push(snippet.name)\n\t\t\t\t} else if (snippet.definition?.type === \"method\") {\n\t\t\t\t\tsummary.methods.push(snippet.name)\n\t\t\t\t} else if (snippet.definition?.type === \"constructor\") {\n\t\t\t\t\tsummary.constructors.push(snippet.name)\n\t\t\t\t} else if (snippet.definition?.type === \"destructor\") {\n\t\t\t\t\tsummary.destructors.push(snippet.name)\n\t\t\t\t} else if (snippet.definition?.type === \"operator\") {\n\t\t\t\t\tsummary.operators.push(snippet.name)\n\t\t\t\t} else if (snippet.definition?.type === \"template_function\") {\n\t\t\t\t\tsummary.functions.push(snippet.name)\n\t\t\t\t}\n\t\t\t\tbreak\n\t\t\tcase SnippetType.ClassOrInterfaceOrStructOrEnum:\n\t\t\t\tif (snippet.definition?.type === \"class\") {\n\t\t\t\t\tsummary.classes.push(snippet.name)\n\t\t\t\t} else if (snippet.definition?.type === \"struct\") {\n\t\t\t\t\tsummary.structs.push(snippet.name)\n\t\t\t\t} else if (snippet.definition?.type === \"union\") {\n\t\t\t\t\tsummary.unions.push(snippet.name)\n\t\t\t\t} else if (snippet.definition?.type === \"enum\") {\n\t\t\t\t\tsummary.enums.push(snippet.name)\n\t\t\t\t} else if (\n\t\t\t\t\tsnippet.definition?.type === \"template_class\" ||\n\t\t\t\t\tsnippet.definition?.type === \"template_struct\"\n\t\t\t\t) {\n\t\t\t\t\tsummary.templates.push(snippet.name)\n\t\t\t\t} else if (snippet.definition?.type === \"namespace\") {\n\t\t\t\t\tsummary.namespaces.push(snippet.name)\n\t\t\t\t} else if (snippet.definition?.type === \"typedef\") {\n\t\t\t\t\tsummary.typedefs.push(snippet.name)\n\t\t\t\t} else if (snippet.definition?.type === \"using\") {\n\t\t\t\t\tsummary.usings.push(snippet.name)\n\t\t\t\t}\n\t\t\t\tbreak\n\t\t\tcase SnippetType.VariableOrConstant:\n\t\t\t\tsummary.variables.push(snippet.name)\n\t\t\t\tbreak\n\t\t}\n\t})\n\n\treturn summary\n}\n\n// \u7528\u4E8E\u683C\u5F0F\u5316\u6982\u89C8\u6587\u672C\u7684\u51FD\u6570\nexport function formatOutlineText(summary: any): string {\n\tlet outline = \"\"\n\n\tif (summary.includes.length > 0) {\n\t\toutline += `Includes: ${summary.includes.join(\", \")}\\n`\n\t}\n\n\tif (summary.namespaces.length > 0) {\n\t\toutline += `Namespaces: ${summary.namespaces.join(\", \")}\\n`\n\t}\n\n\tif (summary.classes.length > 0) {\n\t\toutline += `Classes: ${summary.classes.join(\", \")}\\n`\n\t}\n\n\tif (summary.structs.length > 0) {\n\t\toutline += `Structs: ${summary.structs.join(\", \")}\\n`\n\t}\n\n\tif (summary.unions.length > 0) {\n\t\toutline += `Unions: ${summary.unions.join(\", \")}\\n`\n\t}\n\n\tif (summary.enums.length > 0) {\n\t\toutline += `Enums: ${summary.enums.join(\", \")}\\n`\n\t}\n\n\tif (summary.templates.length > 0) {\n\t\toutline += `Templates: ${summary.templates.join(\", \")}\\n`\n\t}\n\n\tif (summary.functions.length > 0) {\n\t\toutline += `Functions: ${summary.functions.join(\", \")}\\n`\n\t}\n\n\tif (summary.methods.length > 0) {\n\t\toutline += `Methods: ${summary.methods.join(\", \")}\\n`\n\t}\n\n\tif (summary.constructors.length > 0) {\n\t\toutline += `Constructors: ${summary.constructors.join(\", \")}\\n`\n\t}\n\n\tif (summary.destructors.length > 0) {\n\t\toutline += `Destructors: ${summary.destructors.join(\", \")}\\n`\n\t}\n\n\tif (summary.operators.length > 0) {\n\t\toutline += `Operators: ${summary.operators.join(\", \")}\\n`\n\t}\n\n\tif (summary.variables.length > 0) {\n\t\toutline += `Variables: ${summary.variables.join(\", \")}\\n`\n\t}\n\n\tif (summary.typedefs.length > 0) {\n\t\toutline += `Typedefs: ${summary.typedefs.join(\", \")}\\n`\n\t}\n\n\tif (summary.usings.length > 0) {\n\t\toutline += `Usings: ${summary.usings.join(\", \")}\\n`\n\t}\n\n\treturn outline\n}\n", "import { CodeLanguageType, SnippetType, ISnippetMeta } from \"../types\"\nimport * as go from \"./go\"\nimport * as python from \"./python\"\nimport * as java from \"./java\"\nimport * as javascript from \"./javascript\"\nimport * as jsx from \"./jsx\"\nimport * as typescript from \"./typescript\"\nimport * as tsx from \"./tsx\"\nimport * as swift from \"./swift\"\nimport * as css from \"./css\"\nimport * as html from \"./html\"\nimport * as kotlin from \"./kotlin\"\nimport * as php from \"./php\"\nimport * as rust from \"./rust\"\nimport * as c from \"./c\"\nimport * as cpp from \"./cpp\"\nimport * as general from \"./general\"\n\nimport Parser from \"web-tree-sitter\"\n\nexport const extractSnippetsFromCaptures: Record<\n\tCodeLanguageType,\n\t(\n\t\tcaptures: Parser.QueryCapture[],\n\t\tsourceCode: string,\n\t\tfilePath: string,\n\t\tfileHash: string,\n\t\tsnippetTypes: SnippetType[],\n\t\toptions: { maxSnippetLines: number; minSnippetLines: number },\n\t) => Promise<ISnippetMeta[]>\n> = {\n\t[CodeLanguageType.Go]: go.extractSnippetsFromCapturesForGo,\n\t[CodeLanguageType.Python]: python.extractSnippetsFromCapturesForPython,\n\t[CodeLanguageType.Java]: java.extractSnippetsFromCapturesForJava,\n\t[CodeLanguageType.JavaScript]: javascript.extractSnippetsFromCapturesForJavaScript,\n\t[CodeLanguageType.JSX]: jsx.extractSnippetsFromCapturesForJSX,\n\t[CodeLanguageType.TypeScript]: typescript.extractSnippetsFromCapturesForTypeScript,\n\t[CodeLanguageType.TSX]: tsx.extractSnippetsFromCapturesForTSX,\n\t[CodeLanguageType.Swift]: swift.extractSnippetsFromCapturesForSwift,\n\t[CodeLanguageType.CSS]: css.extractSnippetsFromCapturesForCSS,\n\t[CodeLanguageType.HTML]: html.extractSnippetsFromCapturesForHTML,\n\t[CodeLanguageType.Kotlin]: kotlin.extractSnippetsFromCapturesForKotlin,\n\t[CodeLanguageType.PHP]: php.extractSnippetsFromCapturesForPHP,\n\t[CodeLanguageType.Rust]: rust.extractSnippetsFromCapturesForRust,\n\t[CodeLanguageType.C]: c.extractSnippetsFromCapturesForC,\n\t[CodeLanguageType.CPP]: cpp.extractSnippetsFromCapturesForCPP,\n\t[CodeLanguageType.Unknown]: general.extractSnippetsFromCapturesForGeneral,\n}\n\nexport const generateOverViewFromSnippets: Record<CodeLanguageType, (snippets: ISnippetMeta[]) => string> = {\n\t[CodeLanguageType.Go]: (snippets: ISnippetMeta[]) => {\n\t\treturn go.formatOutlineText(go.buildSummaryFromSnippets(snippets))\n\t},\n\t[CodeLanguageType.Python]: (snippets: ISnippetMeta[]) => {\n\t\treturn python.formatOutlineText(python.buildSummaryFromSnippets(snippets))\n\t},\n\t[CodeLanguageType.Java]: (snippets: ISnippetMeta[]) => {\n\t\treturn java.formatOutlineText(java.buildSummaryFromSnippets(snippets))\n\t},\n\t[CodeLanguageType.JavaScript]: (snippets: ISnippetMeta[]) => {\n\t\treturn \"\"\n\t},\n\t[CodeLanguageType.JSX]: (snippets: ISnippetMeta[]) => {\n\t\treturn jsx.formatOutlineText(jsx.buildSummaryFromSnippets(snippets))\n\t},\n\t[CodeLanguageType.TypeScript]: (snippets: ISnippetMeta[]) => {\n\t\treturn typescript.formatOutlineText(typescript.buildSummaryFromSnippets(snippets))\n\t},\n\t[CodeLanguageType.TSX]: (snippets: ISnippetMeta[]) => {\n\t\treturn tsx.formatOutlineText(tsx.buildSummaryFromSnippets(snippets))\n\t},\n\t[CodeLanguageType.Swift]: (snippets: ISnippetMeta[]) => {\n\t\treturn swift.formatOutlineText(swift.buildSummaryFromSnippets(snippets))\n\t},\n\t[CodeLanguageType.CSS]: (snippets: ISnippetMeta[]) => {\n\t\treturn css.formatOutlineText(css.buildSummaryFromSnippets(snippets))\n\t},\n\t[CodeLanguageType.HTML]: (snippets: ISnippetMeta[]) => {\n\t\treturn html.formatOutlineText(html.buildSummaryFromSnippets(snippets))\n\t},\n\t[CodeLanguageType.Kotlin]: (snippets: ISnippetMeta[]) => {\n\t\treturn kotlin.formatOutlineText(kotlin.buildSummaryFromSnippets(snippets))\n\t},\n\t[CodeLanguageType.PHP]: (snippets: ISnippetMeta[]) => {\n\t\treturn php.formatOutlineText(php.buildSummaryFromSnippets(snippets))\n\t},\n\t[CodeLanguageType.Rust]: (snippets: ISnippetMeta[]) => {\n\t\treturn rust.formatOutlineText(rust.buildSummaryFromSnippets(snippets))\n\t},\n\t[CodeLanguageType.C]: (snippets: ISnippetMeta[]) => {\n\t\treturn c.formatOutlineText(c.buildSummaryFromSnippets(snippets))\n\t},\n\t[CodeLanguageType.CPP]: (snippets: ISnippetMeta[]) => {\n\t\treturn cpp.formatOutlineText(cpp.buildSummaryFromSnippets(snippets))\n\t},\n\t[CodeLanguageType.Unknown]: (snippets: ISnippetMeta[]) => {\n\t\treturn \"\"\n\t},\n}\n", "/**\n * Go \u8BED\u8A00\u51FD\u6570\u8C03\u7528\u67E5\u8BE2 - \u4EC5\u51FD\u6570\u8C03\u7528\n */\nexport default `(call_expression\n function: (identifier) @function.call.direct)\n\n(call_expression\n function: (selector_expression\n operand: (identifier) @method.call.receiver\n field: (field_identifier) @method.call.name))`\n", "/**\n * TypeScript/JavaScript \u8BED\u8A00\u51FD\u6570\u8C03\u7528\u67E5\u8BE2 - \u51FD\u6570\u8C03\u7528\u5206\u6790\n */\nexport default `\n; \u76F4\u63A5\u51FD\u6570\u8C03\u7528 - function()\n(call_expression\n function: (identifier) @function.call.direct)\n\n; \u65B9\u6CD5\u8C03\u7528 - object.method()\n(call_expression\n function: (member_expression\n object: (identifier) @method.call.receiver\n property: (property_identifier) @method.call.name)\n (#not-match? @method.call.receiver \"^[A-Z]\"))\n\n; \u94FE\u5F0F\u65B9\u6CD5\u8C03\u7528 - object.method1().method2()\n(call_expression\n function: (member_expression\n object: (call_expression)\n property: (property_identifier) @method.call.chain))\n\n; \u9759\u6001\u65B9\u6CD5\u8C03\u7528 - Class.staticMethod() (\u9996\u5B57\u6BCD\u5927\u5199\u7684\u6807\u8BC6\u7B26)\n(call_expression\n function: (member_expression\n object: (identifier) @static.call.class\n property: (property_identifier) @static.call.method)\n (#match? @static.call.class \"^[A-Z]\"))\n\n; \u547D\u540D\u7A7A\u95F4/\u6A21\u5757\u8C03\u7528 - namespace.function()\n(call_expression\n function: (member_expression\n object: (identifier) @namespace.call.name\n property: (property_identifier) @namespace.call.function)\n (#match? @namespace.call.name \"^[A-Z]\")\n (#not-match? @namespace.call.function \"^(constructor|new|create|get|set|add|remove|update|delete)$\"))\n\n; \u5D4C\u5957\u5C5E\u6027\u8C03\u7528 - object.nested.method()\n(call_expression\n function: (member_expression\n object: (member_expression\n object: (identifier) @nested.call.root\n property: (property_identifier) @nested.call.intermediate)\n property: (property_identifier) @nested.call.method))\n\n; this \u65B9\u6CD5\u8C03\u7528 - this.method()\n(call_expression\n function: (member_expression\n object: (this) @this.call.receiver\n property: (property_identifier) @this.call.method))\n\n; super \u65B9\u6CD5\u8C03\u7528 - super.method()\n(call_expression\n function: (member_expression\n object: (super) @super.call.receiver\n property: (property_identifier) @super.call.method))\n\n; \u7BAD\u5934\u51FD\u6570\u8C03\u7528 - (() => {})()\n(call_expression\n function: (arrow_function) @arrow.call.function)\n\n; \u51FD\u6570\u8868\u8FBE\u5F0F\u8C03\u7528 - (function() {})()\n(call_expression\n function: (function_expression) @function.call.expression)\n\n; \u6570\u7EC4\u65B9\u6CD5\u8C03\u7528 - array.map(), array.filter()\n(call_expression\n function: (member_expression\n object: (identifier) @array.call.object\n property: (property_identifier) @array.call.method)\n (#match? @array.call.method \"^(map|filter|reduce|forEach|find|some|every|sort|push|pop|shift|unshift|slice|splice|concat|join|indexOf|includes)$\"))\n\n; Promise \u65B9\u6CD5\u8C03\u7528 - promise.then(), promise.catch() (\u660E\u786E\u7684Promise\u65B9\u6CD5)\n(call_expression\n function: (member_expression\n object: (identifier) @promise.call.object\n property: (property_identifier) @promise.call.method)\n (#match? @promise.call.method \"^(then|catch|finally)$\"))\n\n; \u53EF\u9009\u94FE\u8C03\u7528 - object?.method?.()\n(call_expression\n function: (member_expression\n object: (identifier) @optional.call.receiver\n property: (property_identifier) @optional.call.method))\n\n; \u6784\u9020\u51FD\u6570\u8C03\u7528 - new Constructor()\n(new_expression\n constructor: (identifier) @constructor.call.name)\n\n; \u6CDB\u578B\u51FD\u6570\u8C03\u7528 - genericFunction<T>()\n(call_expression\n function: (identifier) @generic.call.function\n type_arguments: (type_arguments))\n\n; \u6A21\u677F\u5B57\u7B26\u4E32\u4E2D\u7684\u8868\u8FBE\u5F0F\u8C03\u7528\n(template_substitution\n (call_expression\n function: (identifier) @template.call.function))\n\n; await \u8868\u8FBE\u5F0F\u4E2D\u7684\u51FD\u6570\u8C03\u7528\n(await_expression\n (call_expression\n function: (identifier) @await.call.function))\n\n; \u5F02\u6B65\u65B9\u6CD5\u8C03\u7528\n(await_expression\n (call_expression\n function: (member_expression\n object: (identifier) @async.call.receiver\n property: (property_identifier) @async.call.method)))\n`\n", "/**\n * JavaScript \u8BED\u8A00\u51FD\u6570\u8C03\u7528\u67E5\u8BE2 - \u51FD\u6570\u8C03\u7528\u5206\u6790\n */\nexport default `\n; \u76F4\u63A5\u51FD\u6570\u8C03\u7528 - function()\n(call_expression\n function: (identifier) @function.call.direct)\n\n; \u65B9\u6CD5\u8C03\u7528 - object.method()\n(call_expression\n function: (member_expression\n object: (identifier) @method.call.receiver\n property: (property_identifier) @method.call.name)\n (#not-match? @method.call.receiver \"^[A-Z]\"))\n\n; \u94FE\u5F0F\u65B9\u6CD5\u8C03\u7528 - object.method1().method2()\n(call_expression\n function: (member_expression\n object: (call_expression)\n property: (property_identifier) @method.call.chain))\n\n; \u9759\u6001\u65B9\u6CD5\u8C03\u7528 - Class.staticMethod() (\u9996\u5B57\u6BCD\u5927\u5199\u7684\u6807\u8BC6\u7B26)\n(call_expression\n function: (member_expression\n object: (identifier) @static.call.class\n property: (property_identifier) @static.call.method)\n (#match? @static.call.class \"^[A-Z]\"))\n\n; \u547D\u540D\u7A7A\u95F4/\u6A21\u5757\u8C03\u7528 - namespace.function()\n(call_expression\n function: (member_expression\n object: (identifier) @namespace.call.name\n property: (property_identifier) @namespace.call.function)\n (#match? @namespace.call.name \"^[A-Z]\")\n (#not-match? @namespace.call.function \"^(constructor|new|create|get|set|add|remove|update|delete)$\"))\n\n; \u5D4C\u5957\u5C5E\u6027\u8C03\u7528 - object.nested.method()\n(call_expression\n function: (member_expression\n object: (member_expression\n object: (identifier) @nested.call.root\n property: (property_identifier) @nested.call.intermediate)\n property: (property_identifier) @nested.call.method))\n\n; this \u65B9\u6CD5\u8C03\u7528 - this.method()\n(call_expression\n function: (member_expression\n object: (this) @this.call.receiver\n property: (property_identifier) @this.call.method))\n\n; super \u65B9\u6CD5\u8C03\u7528 - super.method()\n(call_expression\n function: (member_expression\n object: (super) @super.call.receiver\n property: (property_identifier) @super.call.method))\n\n; \u7BAD\u5934\u51FD\u6570\u8C03\u7528 - (() => {})()\n(call_expression\n function: (arrow_function) @arrow.call.function)\n\n; \u51FD\u6570\u8868\u8FBE\u5F0F\u8C03\u7528 - (function() {})()\n(call_expression\n function: (function_expression) @function.call.expression)\n\n; \u6570\u7EC4\u65B9\u6CD5\u8C03\u7528 - array.map(), array.filter()\n(call_expression\n function: (member_expression\n object: (identifier) @array.call.object\n property: (property_identifier) @array.call.method)\n (#match? @array.call.method \"^(map|filter|reduce|forEach|find|some|every|sort|push|pop|shift|unshift|slice|splice|concat|join|indexOf|includes)$\"))\n\n; Promise \u65B9\u6CD5\u8C03\u7528 - promise.then(), promise.catch() (\u660E\u786E\u7684Promise\u65B9\u6CD5)\n(call_expression\n function: (member_expression\n object: (identifier) @promise.call.object\n property: (property_identifier) @promise.call.method)\n (#match? @promise.call.method \"^(then|catch|finally)$\"))\n\n; \u53EF\u9009\u94FE\u8C03\u7528 - object?.method?.()\n(call_expression\n function: (member_expression\n object: (identifier) @optional.call.receiver\n property: (property_identifier) @optional.call.method))\n\n; \u6784\u9020\u51FD\u6570\u8C03\u7528 - new Constructor()\n(new_expression\n constructor: (identifier) @constructor.call.name)\n\n; \u6A21\u677F\u5B57\u7B26\u4E32\u4E2D\u7684\u8868\u8FBE\u5F0F\u8C03\u7528\n(template_substitution\n (call_expression\n function: (identifier) @template.call.function))\n\n; await \u8868\u8FBE\u5F0F\u4E2D\u7684\u51FD\u6570\u8C03\u7528\n(await_expression\n (call_expression\n function: (identifier) @await.call.function))\n\n; \u5F02\u6B65\u65B9\u6CD5\u8C03\u7528\n(await_expression\n (call_expression\n function: (member_expression\n object: (identifier) @async.call.receiver\n property: (property_identifier) @async.call.method)))\n`\n", "/**\n * Java \u8BED\u8A00\u51FD\u6570\u8C03\u7528\u67E5\u8BE2 - \u51FD\u6570\u8C03\u7528\u5206\u6790\n */\nexport default `\n; \u76F4\u63A5\u65B9\u6CD5\u8C03\u7528 - method()\n(method_invocation\n name: (identifier) @method.call.direct)\n\n; \u5BF9\u8C61\u65B9\u6CD5\u8C03\u7528 - object.method()\n(method_invocation\n object: (identifier) @method.call.receiver\n name: (identifier) @method.call.name)\n\n; \u94FE\u5F0F\u65B9\u6CD5\u8C03\u7528 - object.method1().method2()\n(method_invocation\n object: (method_invocation)\n name: (identifier) @method.call.chain)\n\n; \u9759\u6001\u65B9\u6CD5\u8C03\u7528 - Class.staticMethod()\n(method_invocation\n object: (identifier) @static.call.class\n name: (identifier) @static.call.method\n (#match? @static.call.class \"^[A-Z]\"))\n\n; this \u65B9\u6CD5\u8C03\u7528 - this.method()\n(method_invocation\n object: (this) @this.call.receiver\n name: (identifier) @this.call.method)\n\n; super \u65B9\u6CD5\u8C03\u7528 - super.method()\n(method_invocation\n object: (super) @super.call.receiver\n name: (identifier) @super.call.method)\n\n; \u6784\u9020\u51FD\u6570\u8C03\u7528 - new Constructor()\n(object_creation_expression\n type: (type_identifier) @constructor.call.name)\n`\n", "/**\n * Python \u8BED\u8A00\u51FD\u6570\u8C03\u7528\u67E5\u8BE2 - \u51FD\u6570\u8C03\u7528\u5206\u6790\n */\nexport default `\n; \u76F4\u63A5\u51FD\u6570\u8C03\u7528 - function()\n(call\n function: (identifier) @function.call.direct)\n\n; \u65B9\u6CD5\u8C03\u7528 - object.method()\n(call\n function: (attribute\n object: (identifier) @method.call.receiver\n attribute: (identifier) @method.call.name))\n\n; \u7C7B\u65B9\u6CD5\u8C03\u7528 - ClassName.method() (\u9996\u5B57\u6BCD\u5927\u5199)\n(call\n function: (attribute\n object: (identifier) @class.call.name\n attribute: (identifier) @class.call.method)\n (#match? @class.call.name \"^[A-Z]\"))\n\n; \u94FE\u5F0F\u65B9\u6CD5\u8C03\u7528 - obj.method1().method2()\n(call\n function: (attribute\n object: (call)\n attribute: (identifier) @method.call.chain))\n\n; self\u65B9\u6CD5\u8C03\u7528 - self.method()\n(call\n function: (attribute\n object: (identifier) @self.call.receiver\n attribute: (identifier) @self.call.method)\n (#eq? @self.call.receiver \"self\"))\n\n; super\u65B9\u6CD5\u8C03\u7528 - super().method()\n(call\n function: (attribute\n object: (call\n function: (identifier) @super.call.function)\n attribute: (identifier) @super.call.method)\n (#eq? @super.call.function \"super\"))\n\n; \u5F02\u6B65\u51FD\u6570\u8C03\u7528 - await function()\n(await\n (call\n function: (identifier) @async.call.function))\n\n; \u5F02\u6B65\u65B9\u6CD5\u8C03\u7528 - await obj.method()\n(await\n (call\n function: (attribute\n object: (identifier) @async.call.receiver\n attribute: (identifier) @async.call.method)))\n\n; \u88C5\u9970\u5668\u51FD\u6570\u8C03\u7528 - @decorator\n(decorator\n (identifier) @decorator.call.function)\n\n; \u88C5\u9970\u5668\u65B9\u6CD5\u8C03\u7528 - @obj.decorator\n(decorator\n (attribute\n object: (identifier) @decorator.call.receiver\n attribute: (identifier) @decorator.call.method))\n\n; \u5217\u8868\u63A8\u5BFC\u5F0F\u4E2D\u7684\u51FD\u6570\u8C03\u7528\n(list_comprehension\n (call\n function: (identifier) @comprehension.call.function))\n\n; \u5217\u8868\u63A8\u5BFC\u5F0F\u4E2D\u7684\u65B9\u6CD5\u8C03\u7528\n(list_comprehension\n (call\n function: (attribute\n object: (identifier) @comprehension.call.receiver\n attribute: (identifier) @comprehension.call.method)))\n\n; \u751F\u6210\u5668\u8868\u8FBE\u5F0F\u4E2D\u7684\u51FD\u6570\u8C03\u7528\n(generator_expression\n (call\n function: (identifier) @generator.call.function))\n\n; \u751F\u6210\u5668\u8868\u8FBE\u5F0F\u4E2D\u7684\u65B9\u6CD5\u8C03\u7528\n(generator_expression\n (call\n function: (attribute\n object: (identifier) @generator.call.receiver\n attribute: (identifier) @generator.call.method)))\n\n; Lambda \u8868\u8FBE\u5F0F\u4E2D\u7684\u51FD\u6570\u8C03\u7528\n(lambda\n (call\n function: (identifier) @lambda.call.function))\n\n; Lambda \u8868\u8FBE\u5F0F\u4E2D\u7684\u65B9\u6CD5\u8C03\u7528\n(lambda\n (call\n function: (attribute\n object: (identifier) @lambda.call.receiver\n attribute: (identifier) @lambda.call.method)))\n\n; \u5D4C\u5957\u5C5E\u6027\u8C03\u7528 - obj.attr.method()\n(call\n function: (attribute\n object: (attribute\n object: (identifier) @nested.call.root\n attribute: (identifier) @nested.call.intermediate)\n attribute: (identifier) @nested.call.method))\n\n; \u51FD\u6570\u4F5C\u4E3A\u53C2\u6570\u7684\u8C03\u7528 - func(other_func)\n(call\n function: (identifier) @function.call.direct\n arguments: (argument_list\n (identifier) @function.call.argument))\n\n; \u65B9\u6CD5\u4F5C\u4E3A\u53C2\u6570\u7684\u8C03\u7528 - func(obj.method)\n(call\n function: (identifier) @function.call.direct\n arguments: (argument_list\n (attribute\n object: (identifier) @method.call.receiver\n attribute: (identifier) @method.call.name)))\n`\n", "/**\n * JSX \u8BED\u8A00\u51FD\u6570\u8C03\u7528\u67E5\u8BE2 - React \u7279\u5B9A\u7684\u51FD\u6570\u8C03\u7528\u5206\u6790\n * \u57FA\u4E8E JavaScript/TypeScript \u8BED\u6CD5\u4F46\u9488\u5BF9 React/JSX \u8FDB\u884C\u4F18\u5316\n * \u4F7F\u7528 TypeScript tree-sitter \u517C\u5BB9\u7684\u8282\u70B9\u7C7B\u578B\uFF08\u4E0D\u5305\u542BJSX\u7279\u5B9A\u8282\u70B9\uFF09\n * \u67E5\u8BE2\u6309\u4F18\u5148\u7EA7\u6392\u5E8F\uFF0C\u66F4\u5177\u4F53\u7684\u67E5\u8BE2\u5728\u524D\u9762\n */\nexport default `\n; === React\u7279\u5B9A\u67E5\u8BE2\uFF08\u4F18\u5148\u7EA7\u6700\u9AD8\uFF09===\n\n; \u9AD8\u9636\u7EC4\u4EF6 HOC \u8C03\u7528 - withRouter(Component), memo(Component) - \u5FC5\u987B\u5728\u76F4\u63A5\u51FD\u6570\u8C03\u7528\u4E4B\u524D\n(call_expression\n function: (identifier) @hoc.call.name\n arguments: (arguments\n (identifier) @hoc.call.component)\n (#match? @hoc.call.name \"^(with[A-Z]|connect|memo|forwardRef)\"))\n\n; React.createElement \u8C03\u7528 - \u5FC5\u987B\u5728\u5176\u4ED6\u65B9\u6CD5\u8C03\u7528\u4E4B\u524D\n(call_expression\n function: (member_expression\n object: (identifier) @react.create.namespace\n property: (property_identifier) @react.create.method)\n (#eq? @react.create.namespace \"React\")\n (#eq? @react.create.method \"createElement\"))\n\n; State \u76F8\u5173 hooks - useState, useReducer\n(call_expression\n function: (identifier) @state.hook.call\n (#match? @state.hook.call \"^(useState|useReducer)$\"))\n\n; Effect \u76F8\u5173 hooks - useEffect, useLayoutEffect\n(call_expression\n function: (identifier) @effect.hook.call\n (#match? @effect.hook.call \"^(useEffect|useLayoutEffect|useInsertionEffect)$\"))\n\n; Memo \u76F8\u5173 hooks - useMemo, useCallback\n(call_expression\n function: (identifier) @memo.hook.call\n (#match? @memo.hook.call \"^(useMemo|useCallback)$\"))\n\n; Ref \u8C03\u7528 - useRef, createRef\n(call_expression\n function: (identifier) @ref.hook.call\n (#match? @ref.hook.call \"^(useRef|createRef)$\"))\n\n; Context \u8C03\u7528 - useContext(ThemeContext)\n(call_expression\n function: (identifier) @context.hook.call\n (#eq? @context.hook.call \"useContext\"))\n\n; \u5176\u4ED6 React Hooks \u8C03\u7528 - \u4E0D\u5728\u4E0A\u8FF0\u7279\u5B9A\u5206\u7C7B\u4E2D\u7684hooks\n(call_expression\n function: (identifier) @react.hook.call\n (#match? @react.hook.call \"^use[A-Z]\")\n (#not-match? @react.hook.call \"^(useState|useReducer|useEffect|useLayoutEffect|useInsertionEffect|useMemo|useCallback|useRef|createRef|useContext)$\"))\n\n; Event handlers \u5728\u8C03\u7528\u8868\u8FBE\u5F0F\u4E2D - handleClick()\n(call_expression\n function: (identifier) @event.handler.function\n (#match? @event.handler.function \"^handle[A-Z]\"))\n\n; === \u5F02\u6B65\u8C03\u7528\uFF08\u4F18\u5148\u7EA7\u8F83\u9AD8\uFF09===\n\n; await \u8868\u8FBE\u5F0F\u4E2D\u7684\u51FD\u6570\u8C03\u7528\n(await_expression\n (call_expression\n function: (identifier) @await.call.function))\n\n; \u5F02\u6B65\u65B9\u6CD5\u8C03\u7528\n(await_expression\n (call_expression\n function: (member_expression\n object: (identifier) @async.call.receiver\n property: (property_identifier) @async.call.method)))\n\n; === \u7279\u5B9A\u65B9\u6CD5\u8C03\u7528\uFF08\u4F18\u5148\u7EA7\u9AD8\u4E8E\u901A\u7528\u65B9\u6CD5\u8C03\u7528\uFF09===\n\n; Promise \u65B9\u6CD5\u8C03\u7528 - promise.then(), promise.catch()\n(call_expression\n function: (member_expression\n object: (identifier) @promise.call.object\n property: (property_identifier) @promise.call.method)\n (#match? @promise.call.method \"^(then|catch|finally)$\"))\n\n; \u6570\u7EC4\u65B9\u6CD5\u8C03\u7528 - array.map(), array.filter()\n(call_expression\n function: (member_expression\n object: (identifier) @array.call.object\n property: (property_identifier) @array.call.method)\n (#match? @array.call.method \"^(map|filter|reduce|forEach|find|some|every|sort|push|pop|shift|unshift|slice|splice|concat|join|indexOf|includes)$\"))\n\n; === \u6784\u9020\u51FD\u6570\u548C\u7C7B\u8C03\u7528 ===\n\n; \u6784\u9020\u51FD\u6570\u8C03\u7528 - new Constructor()\n(new_expression\n constructor: (identifier) @constructor.call.name)\n\n; \u9759\u6001\u65B9\u6CD5\u8C03\u7528 - Class.staticMethod() (\u9996\u5B57\u6BCD\u5927\u5199\u7684\u6807\u8BC6\u7B26)\n(call_expression\n function: (member_expression\n object: (identifier) @static.call.class\n property: (property_identifier) @static.call.method)\n (#match? @static.call.class \"^[A-Z]\"))\n\n; === \u5BF9\u8C61\u65B9\u6CD5\u8C03\u7528 ===\n\n; this \u65B9\u6CD5\u8C03\u7528 - this.method()\n(call_expression\n function: (member_expression\n object: (this) @this.call.receiver\n property: (property_identifier) @this.call.method))\n\n; super \u65B9\u6CD5\u8C03\u7528 - super.method()\n(call_expression\n function: (member_expression\n object: (super) @super.call.receiver\n property: (property_identifier) @super.call.method))\n\n; \u53EF\u9009\u94FE\u8C03\u7528 - object?.method?.()\n(call_expression\n function: (member_expression\n object: (identifier) @optional.call.receiver\n property: (property_identifier) @optional.call.method))\n\n; \u94FE\u5F0F\u65B9\u6CD5\u8C03\u7528 - object.method1().method2()\n(call_expression\n function: (member_expression\n object: (call_expression)\n property: (property_identifier) @method.call.chain))\n\n; \u5D4C\u5957\u5C5E\u6027\u8C03\u7528 - object.nested.method()\n(call_expression\n function: (member_expression\n object: (member_expression\n object: (identifier) @nested.call.root\n property: (property_identifier) @nested.call.intermediate)\n property: (property_identifier) @nested.call.method))\n\n; \u65B9\u6CD5\u8C03\u7528 - object.method()\n(call_expression\n function: (member_expression\n object: (identifier) @method.call.receiver\n property: (property_identifier) @method.call.name)\n (#not-match? @method.call.receiver \"^[A-Z]\"))\n\n; === \u547D\u540D\u7A7A\u95F4\u8C03\u7528 ===\n\n; \u547D\u540D\u7A7A\u95F4/\u6A21\u5757\u8C03\u7528 - namespace.function()\n(call_expression\n function: (member_expression\n object: (identifier) @namespace.call.name\n property: (property_identifier) @namespace.call.function)\n (#match? @namespace.call.name \"^[A-Z]\")\n (#not-match? @namespace.call.function \"^(constructor|new|create|get|set|add|remove|update|delete)$\"))\n\n; === \u7279\u6B8A\u51FD\u6570\u8C03\u7528 ===\n\n; \u7BAD\u5934\u51FD\u6570\u8C03\u7528 - (() => {})()\n(call_expression\n function: (arrow_function) @arrow.call.function)\n\n; \u51FD\u6570\u8868\u8FBE\u5F0F\u8C03\u7528 - (function() {})()\n(call_expression\n function: (function_expression) @function.call.expression)\n\n; \u6A21\u677F\u5B57\u7B26\u4E32\u4E2D\u7684\u8868\u8FBE\u5F0F\u8C03\u7528\n(template_substitution\n (call_expression\n function: (identifier) @template.call.function))\n\n; === \u901A\u7528\u76F4\u63A5\u51FD\u6570\u8C03\u7528\uFF08\u4F18\u5148\u7EA7\u6700\u4F4E\uFF09===\n\n; \u76F4\u63A5\u51FD\u6570\u8C03\u7528 - function()\n(call_expression\n function: (identifier) @function.call.direct)\n`\n", "/**\n * TSX \u8BED\u8A00\u51FD\u6570\u8C03\u7528\u67E5\u8BE2 - React + TypeScript \u7279\u5B9A\u7684\u51FD\u6570\u8C03\u7528\u5206\u6790\n * \u57FA\u4E8E JSX \u67E5\u8BE2\u4F46\u9488\u5BF9 TypeScript \u7279\u6027\u8FDB\u884C\u4F18\u5316\n * \u4F7F\u7528 TypeScript tree-sitter \u517C\u5BB9\u7684\u8282\u70B9\u7C7B\u578B\uFF08\u5305\u542BTSX\u7279\u5B9A\u8282\u70B9\uFF09\n * \u67E5\u8BE2\u6309\u4F18\u5148\u7EA7\u6392\u5E8F\uFF0C\u66F4\u5177\u4F53\u7684\u67E5\u8BE2\u5728\u524D\u9762\n */\nexport default `\n; === React\u7279\u5B9A\u67E5\u8BE2\uFF08\u4F18\u5148\u7EA7\u6700\u9AD8\uFF09===\n\n; \u9AD8\u9636\u7EC4\u4EF6 HOC \u8C03\u7528 - withRouter(Component), memo(Component) - \u5FC5\u987B\u5728\u76F4\u63A5\u51FD\u6570\u8C03\u7528\u4E4B\u524D\n(call_expression\n function: (identifier) @hoc.call.name\n arguments: (arguments\n (identifier) @hoc.call.component)\n (#match? @hoc.call.name \"^(with[A-Z]|connect|memo|forwardRef)\"))\n\n; React.createElement \u8C03\u7528 - \u5FC5\u987B\u5728\u5176\u4ED6\u65B9\u6CD5\u8C03\u7528\u4E4B\u524D\n(call_expression\n function: (member_expression\n object: (identifier) @react.create.namespace\n property: (property_identifier) @react.create.method)\n (#eq? @react.create.namespace \"React\")\n (#eq? @react.create.method \"createElement\"))\n\n; State \u76F8\u5173 hooks - useState, useReducer\n(call_expression\n function: (identifier) @state.hook.call\n (#match? @state.hook.call \"^(useState|useReducer)$\"))\n\n; Effect \u76F8\u5173 hooks - useEffect, useLayoutEffect\n(call_expression\n function: (identifier) @effect.hook.call\n (#match? @effect.hook.call \"^(useEffect|useLayoutEffect|useInsertionEffect)$\"))\n\n; Memo \u76F8\u5173 hooks - useMemo, useCallback\n(call_expression\n function: (identifier) @memo.hook.call\n (#match? @memo.hook.call \"^(useMemo|useCallback)$\"))\n\n; Ref \u8C03\u7528 - useRef, createRef\n(call_expression\n function: (identifier) @ref.hook.call\n (#match? @ref.hook.call \"^(useRef|createRef)$\"))\n\n; Context \u8C03\u7528 - useContext(ThemeContext)\n(call_expression\n function: (identifier) @context.hook.call\n (#eq? @context.hook.call \"useContext\"))\n\n; \u5176\u4ED6 React Hooks \u8C03\u7528 - \u4E0D\u5728\u4E0A\u8FF0\u7279\u5B9A\u5206\u7C7B\u4E2D\u7684hooks\n(call_expression\n function: (identifier) @react.hook.call\n (#match? @react.hook.call \"^use[A-Z]\")\n (#not-match? @react.hook.call \"^(useState|useReducer|useEffect|useLayoutEffect|useInsertionEffect|useMemo|useCallback|useRef|createRef|useContext)$\"))\n\n; Event handlers \u5728\u8C03\u7528\u8868\u8FBE\u5F0F\u4E2D - handleClick()\n(call_expression\n function: (identifier) @event.handler.function\n (#match? @event.handler.function \"^handle[A-Z]\"))\n\n; === TypeScript\u7279\u5B9A\u67E5\u8BE2 ===\n\n; \u6CDB\u578B\u51FD\u6570\u8C03\u7528 - function<T>()\n(call_expression\n function: (identifier) @generic.call.function\n type_arguments: (type_arguments))\n\n; \u6CDB\u578B\u65B9\u6CD5\u8C03\u7528 - object.method<T>()\n(call_expression\n function: (member_expression\n object: (identifier) @generic.call.receiver\n property: (property_identifier) @generic.call.method)\n type_arguments: (type_arguments))\n\n; \u6CDB\u578BPromise\u65B9\u6CD5\u8C03\u7528 - promise.then<T>()\n(call_expression\n function: (member_expression\n object: (identifier) @promise.call.object\n property: (property_identifier) @promise.call.method)\n type_arguments: (type_arguments)\n (#match? @promise.call.method \"^(then|catch|finally)$\"))\n\n; \u7C7B\u578B\u65AD\u8A00\u8C03\u7528 - as Type\n(as_expression) @type.assertion\n\n; === \u5F02\u6B65\u8C03\u7528\uFF08\u4F18\u5148\u7EA7\u8F83\u9AD8\uFF09===\n\n; await \u8868\u8FBE\u5F0F\u4E2D\u7684\u51FD\u6570\u8C03\u7528\n(await_expression\n (call_expression\n function: (identifier) @await.call.function))\n\n; \u5F02\u6B65\u65B9\u6CD5\u8C03\u7528\n(await_expression\n (call_expression\n function: (member_expression\n object: (identifier) @async.call.receiver\n property: (property_identifier) @async.call.method)))\n\n; === \u7279\u5B9A\u65B9\u6CD5\u8C03\u7528\uFF08\u4F18\u5148\u7EA7\u9AD8\u4E8E\u901A\u7528\u65B9\u6CD5\u8C03\u7528\uFF09===\n\n; Promise \u65B9\u6CD5\u8C03\u7528 - promise.then(), promise.catch()\n(call_expression\n function: (member_expression\n object: (identifier) @promise.call.object\n property: (property_identifier) @promise.call.method)\n (#match? @promise.call.method \"^(then|catch|finally)$\"))\n\n; \u6570\u7EC4\u65B9\u6CD5\u8C03\u7528 - array.map(), array.filter()\n(call_expression\n function: (member_expression\n object: (identifier) @array.call.object\n property: (property_identifier) @array.call.method)\n (#match? @array.call.method \"^(map|filter|reduce|forEach|find|some|every|sort|push|pop|shift|unshift|slice|splice|concat|join|indexOf|includes)$\"))\n\n; === \u6784\u9020\u51FD\u6570\u548C\u7C7B\u8C03\u7528 ===\n\n; \u6784\u9020\u51FD\u6570\u8C03\u7528 - new Constructor()\n(new_expression\n constructor: (identifier) @constructor.call.name)\n\n; \u6CDB\u578B\u6784\u9020\u51FD\u6570\u8C03\u7528 - new Constructor<T>()\n(new_expression\n constructor: (identifier) @generic.constructor.call.name\n type_arguments: (type_arguments))\n\n; \u9759\u6001\u65B9\u6CD5\u8C03\u7528 - Class.staticMethod() (\u9996\u5B57\u6BCD\u5927\u5199\u7684\u6807\u8BC6\u7B26)\n(call_expression\n function: (member_expression\n object: (identifier) @static.call.class\n property: (property_identifier) @static.call.method)\n (#match? @static.call.class \"^[A-Z]\"))\n\n; === \u5BF9\u8C61\u65B9\u6CD5\u8C03\u7528 ===\n\n; this \u65B9\u6CD5\u8C03\u7528 - this.method()\n(call_expression\n function: (member_expression\n object: (this) @this.call.receiver\n property: (property_identifier) @this.call.method))\n\n; super \u65B9\u6CD5\u8C03\u7528 - super.method()\n(call_expression\n function: (member_expression\n object: (super) @super.call.receiver\n property: (property_identifier) @super.call.method))\n\n; \u53EF\u9009\u94FE\u8C03\u7528 - object?.method?.()\n(call_expression\n function: (member_expression\n object: (identifier) @optional.call.receiver\n property: (property_identifier) @optional.call.method))\n\n; \u94FE\u5F0F\u65B9\u6CD5\u8C03\u7528 - object.method1().method2()\n(call_expression\n function: (member_expression\n object: (call_expression)\n property: (property_identifier) @method.call.chain))\n\n; \u5D4C\u5957\u5C5E\u6027\u8C03\u7528 - object.nested.method()\n(call_expression\n function: (member_expression\n object: (member_expression\n object: (identifier) @nested.call.root\n property: (property_identifier) @nested.call.intermediate)\n property: (property_identifier) @nested.call.method))\n\n; \u65B9\u6CD5\u8C03\u7528 - object.method()\n(call_expression\n function: (member_expression\n object: (identifier) @method.call.receiver\n property: (property_identifier) @method.call.name)\n (#not-match? @method.call.receiver \"^[A-Z]\"))\n\n; === \u547D\u540D\u7A7A\u95F4\u8C03\u7528 ===\n\n; \u547D\u540D\u7A7A\u95F4/\u6A21\u5757\u8C03\u7528 - namespace.function()\n(call_expression\n function: (member_expression\n object: (identifier) @namespace.call.name\n property: (property_identifier) @namespace.call.function)\n (#match? @namespace.call.name \"^[A-Z]\")\n (#not-match? @namespace.call.function \"^(constructor|new|create|get|set|add|remove|update|delete)$\"))\n\n; === \u7279\u6B8A\u51FD\u6570\u8C03\u7528 ===\n\n; \u7BAD\u5934\u51FD\u6570\u8C03\u7528 - (() => {})()\n(call_expression\n function: (arrow_function) @arrow.call.function)\n\n; \u51FD\u6570\u8868\u8FBE\u5F0F\u8C03\u7528 - (function() {})()\n(call_expression\n function: (function_expression) @function.call.expression)\n\n; \u6A21\u677F\u5B57\u7B26\u4E32\u4E2D\u7684\u8868\u8FBE\u5F0F\u8C03\u7528\n(template_substitution\n (call_expression\n function: (identifier) @template.call.function))\n\n; === \u901A\u7528\u76F4\u63A5\u51FD\u6570\u8C03\u7528\uFF08\u4F18\u5148\u7EA7\u6700\u4F4E\uFF09===\n\n; \u76F4\u63A5\u51FD\u6570\u8C03\u7528 - function()\n(call_expression\n function: (identifier) @function.call.direct)\n`\n", "// CTCode/src/autocompletion/v2/capturesProcess/functionQuery/analyzer.ts\n\nimport Parser from \"web-tree-sitter\"\nimport { CodeLanguageType, ISnippetMeta, SnippetType } from \"../types\"\n\nexport interface FunctionCallInfo {\n\tcalledFunctionName: string\n\tcallType: \"direct\" | \"method\" | \"package\" | \"literal\"\n\treceiver?: string // \u5BF9\u4E8E\u65B9\u6CD5\u8C03\u7528\uFF0C\u63A5\u6536\u8005\u7684\u540D\u79F0\n\tpackageQualifier?: string // \u5BF9\u4E8E\u5305\u51FD\u6570\u8C03\u7528\uFF0C\u5305\u7684\u540D\u79F0\n\tline: number\n\tcolumn: number\n}\n\nexport interface FunctionCallAnalysisResult {\n\tfunctionCalls: FunctionCallInfo[]\n\tscopeInfo: {\n\t\tpackageName?: string\n\t\ttypeName?: string // \u5982\u679C\u51FD\u6570\u662F\u67D0\u4E2A\u7C7B\u578B\u7684\u65B9\u6CD5\n\t\tfunctionName: string\n\t}\n}\n\nexport function dependenciesCapturesProcessForGo(captures: Parser.QueryCapture[]): ISnippetMeta[] {\n\tconst result = analyzeGoFunctionCalls(captures)\n\treturn result.functionCalls.map((call) => ({\n\t\tname: call.calledFunctionName,\n\t\ttype: SnippetType.FunctionOrMethod,\n\t\tfilePath: \"\",\n\t\tstartLine: call.line,\n\t\tendLine: call.line,\n\t\tstartPosition: {\n\t\t\trow: call.line,\n\t\t\tcolumn: call.column,\n\t\t},\n\t\tendPosition: {\n\t\t\trow: call.line,\n\t\t\tcolumn: call.column,\n\t\t},\n\t\trangeText: \"\",\n\t\tfileHash: \"\",\n\t}))\n}\n\n/**\n * \u5206\u6790 Go \u8BED\u8A00\u7684\u51FD\u6570\u8C03\u7528\n */\nfunction analyzeGoFunctionCalls(captures: Parser.QueryCapture[]): FunctionCallAnalysisResult {\n\tconst functionCalls: FunctionCallInfo[] = []\n\tconst scopeInfo = {\n\t\tpackageName: undefined as string | undefined,\n\t\ttypeName: undefined as string | undefined,\n\t\tfunctionName: \"unknown\",\n\t}\n\n\tconsole.log(`[analyzeGoFunctionCalls] Processing ${captures.length} captures`)\n\n\t// \u7528\u4E8E\u4E34\u65F6\u5B58\u50A8\u540C\u4E00\u884C\u7684\u65B9\u6CD5\u8C03\u7528\u4FE1\u606F\n\tconst methodCallsByLine = new Map<\n\t\tnumber,\n\t\t{\n\t\t\tfunctionName?: string\n\t\t\treceiver?: string\n\t\t}\n\t>()\n\n\t// \u5904\u7406\u5404\u79CD\u7C7B\u578B\u7684\u6355\u83B7\n\tfor (const capture of captures) {\n\t\tconst node = capture.node\n\t\tconst captureText = node.text.trim()\n\t\tconst line = node.startPosition.row\n\n\t\tconsole.log(`[analyzeGoFunctionCalls] Processing capture: ${capture.name} = \"${captureText}\"`)\n\n\t\tswitch (capture.name) {\n\t\t\tcase \"function.call.direct\":\n\t\t\t\t// \u76F4\u63A5\u51FD\u6570\u8C03\u7528\n\t\t\t\tconsole.log(`[analyzeGoFunctionCalls] Adding direct function call: ${captureText}`)\n\t\t\t\tfunctionCalls.push({\n\t\t\t\t\tcalledFunctionName: captureText,\n\t\t\t\t\tcallType: \"direct\",\n\t\t\t\t\tline: line + 1,\n\t\t\t\t\tcolumn: node.startPosition.column,\n\t\t\t\t})\n\t\t\t\tbreak\n\n\t\t\tcase \"method.call.name\":\n\t\t\t\t// \u65B9\u6CD5\u8C03\u7528\u7684\u65B9\u6CD5\u540D\n\t\t\t\tif (!methodCallsByLine.has(line)) {\n\t\t\t\t\tmethodCallsByLine.set(line, {})\n\t\t\t\t}\n\t\t\t\tmethodCallsByLine.get(line)!.functionName = captureText\n\t\t\t\tbreak\n\n\t\t\tcase \"method.call.receiver\":\n\t\t\t\t// \u65B9\u6CD5\u8C03\u7528\u7684\u63A5\u6536\u8005\n\t\t\t\tif (!methodCallsByLine.has(line)) {\n\t\t\t\t\tmethodCallsByLine.set(line, {})\n\t\t\t\t}\n\t\t\t\tmethodCallsByLine.get(line)!.receiver = captureText\n\t\t\t\tbreak\n\n\t\t\tdefault:\n\t\t\t\tconsole.log(`[analyzeGoFunctionCalls] Unhandled capture type: ${capture.name}`)\n\t\t\t\tbreak\n\t\t}\n\t}\n\n\t// \u5904\u7406\u65B9\u6CD5\u8C03\u7528\u4FE1\u606F\n\tfor (const [line, callInfo] of methodCallsByLine) {\n\t\tif (callInfo.functionName && callInfo.receiver) {\n\t\t\tconsole.log(`[analyzeGoFunctionCalls] Adding method call: ${callInfo.receiver}.${callInfo.functionName}`)\n\t\t\tfunctionCalls.push({\n\t\t\t\tcalledFunctionName: callInfo.functionName,\n\t\t\t\tcallType: \"method\",\n\t\t\t\treceiver: callInfo.receiver,\n\t\t\t\tline: line + 1,\n\t\t\t\tcolumn: 0,\n\t\t\t})\n\t\t}\n\t}\n\n\tconsole.log(\n\t\t`[analyzeGoFunctionCalls] Final result: ${functionCalls.length} function calls, scope: ${JSON.stringify(scopeInfo)}`,\n\t)\n\n\treturn { functionCalls, scopeInfo }\n}\n\nexport function filterRelevantFunctionCalls(\n\tcallAnalysis: FunctionCallAnalysisResult,\n\tallFunctions: ISnippetMeta[],\n\tcurrentFunction: ISnippetMeta,\n\tlanguage: CodeLanguageType,\n): ISnippetMeta[] {\n\tconst relevantFunctions: ISnippetMeta[] = []\n\n\tfor (const call of callAnalysis.functionCalls) {\n\t\t// \u67E5\u627E\u5BF9\u5E94\u7684\u51FD\u6570\u5B9A\u4E49\n\t\tconst targetFunction = findTargetFunction(call, allFunctions, callAnalysis.scopeInfo, language)\n\n\t\tif (targetFunction && targetFunction.name !== currentFunction.name) {\n\t\t\t// \u68C0\u67E5\u662F\u5426\u5DF2\u7ECF\u6DFB\u52A0\u8FC7\n\t\t\tif (!relevantFunctions.find((f) => f.name === targetFunction.name)) {\n\t\t\t\trelevantFunctions.push(targetFunction)\n\t\t\t\tconsole.log(\n\t\t\t\t\t`[FunctionCallAnalyzer] Found relevant function call: ${call.calledFunctionName} (${call.callType})`,\n\t\t\t\t)\n\t\t\t}\n\t\t}\n\t}\n\n\treturn relevantFunctions\n}\n\n/**\n * \u67E5\u627E\u76EE\u6807\u51FD\u6570\u5B9A\u4E49\n */\nfunction findTargetFunction(\n\tcall: FunctionCallInfo,\n\tallFunctions: ISnippetMeta[],\n\tscopeInfo: FunctionCallAnalysisResult[\"scopeInfo\"],\n\tlanguage: CodeLanguageType,\n): ISnippetMeta | null {\n\tswitch (language) {\n\t\tcase CodeLanguageType.Go:\n\t\t\treturn findGoTargetFunction(call, allFunctions, scopeInfo)\n\t\tdefault:\n\t\t\t// \u901A\u7528\u67E5\u627E\u903B\u8F91\n\t\t\treturn allFunctions.find((func) => func.name === call.calledFunctionName) || null\n\t}\n}\n\n/**\n * \u67E5\u627E Go \u8BED\u8A00\u7684\u76EE\u6807\u51FD\u6570\n */\nfunction findGoTargetFunction(\n\tcall: FunctionCallInfo,\n\tallFunctions: ISnippetMeta[],\n\tscopeInfo: FunctionCallAnalysisResult[\"scopeInfo\"],\n): ISnippetMeta | null {\n\tswitch (call.callType) {\n\t\tcase \"direct\":\n\t\t\t// \u76F4\u63A5\u51FD\u6570\u8C03\u7528\uFF1A\u67E5\u627E\u540C\u5305\u7684\u51FD\u6570\n\t\t\treturn (\n\t\t\t\tallFunctions.find(\n\t\t\t\t\t(func) => func.name === call.calledFunctionName && !func.scope?.length, // \u5305\u7EA7\u51FD\u6570\u901A\u5E38\u6CA1\u6709\u989D\u5916\u7684\u4F5C\u7528\u57DF\n\t\t\t\t) || null\n\t\t\t)\n\n\t\tcase \"method\":\n\t\t\t// \u65B9\u6CD5\u8C03\u7528\uFF1A\u67E5\u627E\u540C\u7C7B\u578B\u7684\u65B9\u6CD5\n\t\t\tif (call.receiver === \"this\" || call.receiver === scopeInfo.typeName) {\n\t\t\t\t// \u540C\u7C7B\u578B\u7684\u65B9\u6CD5\u8C03\u7528\n\t\t\t\treturn (\n\t\t\t\t\tallFunctions.find(\n\t\t\t\t\t\t(func) =>\n\t\t\t\t\t\t\tfunc.name === call.calledFunctionName && func.scope?.includes(scopeInfo.typeName || \"\"),\n\t\t\t\t\t) || null\n\t\t\t\t)\n\t\t\t}\n\t\t\tbreak\n\n\t\tcase \"package\":\n\t\t\t// \u5305\u51FD\u6570\u8C03\u7528\uFF1A\u901A\u5E38\u662F\u5916\u90E8\u5305\uFF0C\u4E0D\u5305\u542B\u5728\u540C\u6587\u4EF6\u4E0A\u4E0B\u6587\u4E2D\n\t\t\treturn null\n\n\t\tcase \"literal\":\n\t\t\t// \u51FD\u6570\u5B57\u9762\u91CF\u8C03\u7528\uFF1A\u901A\u5E38\u4E0D\u9700\u8981\u5305\u542B\u5728\u4E0A\u4E0B\u6587\u4E2D\n\t\t\treturn null\n\t}\n\n\treturn null\n}\n", "import Parser from \"web-tree-sitter\"\nimport { CodeLanguageType, ISnippetMeta, SnippetType } from \"../types\"\n\nexport interface TypeScriptFunctionCallInfo {\n\tcalledFunctionName: string\n\tcallType:\n\t\t| \"direct\"\n\t\t| \"method\"\n\t\t| \"static\"\n\t\t| \"namespace\"\n\t\t| \"constructor\"\n\t\t| \"chain\"\n\t\t| \"this\"\n\t\t| \"super\"\n\t\t| \"arrow\"\n\t\t| \"async\"\n\t\t| \"array\"\n\t\t| \"promise\"\n\t\t| \"optional\"\n\t\t| \"generic\"\n\t\t| \"template\"\n\t\t| \"nested\"\n\treceiver?: string // \u5BF9\u4E8E\u65B9\u6CD5\u8C03\u7528\uFF0C\u63A5\u6536\u8005\u7684\u540D\u79F0\n\tclassName?: string // \u5BF9\u4E8E\u9759\u6001\u65B9\u6CD5\u8C03\u7528\uFF0C\u7C7B\u7684\u540D\u79F0\n\tnamespace?: string // \u5BF9\u4E8E\u547D\u540D\u7A7A\u95F4\u8C03\u7528\uFF0C\u547D\u540D\u7A7A\u95F4\u7684\u540D\u79F0\n\tline: number\n\tcolumn: number\n\tisAsync?: boolean // \u662F\u5426\u662F\u5F02\u6B65\u8C03\u7528\n\tisOptional?: boolean // \u662F\u5426\u662F\u53EF\u9009\u94FE\u8C03\u7528\n\tisGeneric?: boolean // \u662F\u5426\u662F\u6CDB\u578B\u8C03\u7528\n}\n\nexport interface TypeScriptFunctionCallAnalysisResult {\n\tfunctionCalls: TypeScriptFunctionCallInfo[]\n\tscopeInfo: {\n\t\tmoduleName?: string\n\t\tclassName?: string // \u5982\u679C\u51FD\u6570\u662F\u67D0\u4E2A\u7C7B\u7684\u65B9\u6CD5\n\t\tfunctionName: string\n\t\tisAsync?: boolean\n\t}\n}\n\nexport function dependenciesCapturesProcessForTypeScript(captures: Parser.QueryCapture[]): ISnippetMeta[] {\n\tconst result = analyzeTypeScriptFunctionCalls(captures)\n\treturn result.functionCalls.map((call) => ({\n\t\tname: call.calledFunctionName,\n\t\ttype: SnippetType.FunctionOrMethod,\n\t\tfilePath: \"\",\n\t\tstartLine: call.line,\n\t\tendLine: call.line,\n\t\tstartPosition: {\n\t\t\trow: call.line,\n\t\t\tcolumn: call.column,\n\t\t},\n\t\tendPosition: {\n\t\t\trow: call.line,\n\t\t\tcolumn: call.column,\n\t\t},\n\t\trangeText: \"\",\n\t\tfileHash: \"\",\n\t\tdefinition: {\n\t\t\tname: call.calledFunctionName,\n\t\t\ttype: call.callType,\n\t\t},\n\t\tfield: call.className || call.namespace,\n\t\tsignature: `${call.calledFunctionName}()`,\n\t\tlanguage: CodeLanguageType.TypeScript,\n\t}))\n}\n\n/**\n * \u5206\u6790 TypeScript/JavaScript \u7684\u51FD\u6570\u8C03\u7528\n */\nfunction analyzeTypeScriptFunctionCalls(captures: Parser.QueryCapture[]): TypeScriptFunctionCallAnalysisResult {\n\tconst functionCalls: TypeScriptFunctionCallInfo[] = []\n\tconst scopeInfo = {\n\t\tmoduleName: undefined as string | undefined,\n\t\tclassName: undefined as string | undefined,\n\t\tfunctionName: \"unknown\",\n\t\tisAsync: false,\n\t}\n\n\t// \u7528\u4E8E\u4E34\u65F6\u5B58\u50A8\u8C03\u7528\u4FE1\u606F\uFF0C\u6309\u4F4D\u7F6E\u5206\u7EC4\n\tconst callGroups = new Map<string, { [key: string]: string }>()\n\n\t// \u7528\u4E8E\u4E34\u65F6\u5B58\u50A8\u540C\u4E00\u884C\u7684\u8C03\u7528\u4FE1\u606F\n\tconst callsByLine = new Map<\n\t\tnumber,\n\t\t{\n\t\t\tfunctionName?: string\n\t\t\treceiver?: string\n\t\t\tclassName?: string\n\t\t\tnamespace?: string\n\t\t\tcallType?: TypeScriptFunctionCallInfo[\"callType\"]\n\t\t\tisAsync?: boolean\n\t\t\tisOptional?: boolean\n\t\t\tisGeneric?: boolean\n\t\t}\n\t>()\n\n\t// \u5904\u7406\u5404\u79CD\u7C7B\u578B\u7684\u6355\u83B7\n\tfor (const capture of captures) {\n\t\tconst node = capture.node\n\t\tconst captureText = node.text.trim()\n\t\tconst line = node.startPosition.row\n\n\t\tswitch (capture.name) {\n\t\t\tcase \"function.call.direct\":\n\t\t\t\t// \u76F4\u63A5\u51FD\u6570\u8C03\u7528\n\n\t\t\t\tfunctionCalls.push({\n\t\t\t\t\tcalledFunctionName: captureText,\n\t\t\t\t\tcallType: \"direct\",\n\t\t\t\t\tline: line + 1,\n\t\t\t\t\tcolumn: node.startPosition.column,\n\t\t\t\t})\n\t\t\t\tbreak\n\n\t\t\tcase \"method.call.name\":\n\t\t\t\t// \u65B9\u6CD5\u8C03\u7528\u7684\u65B9\u6CD5\u540D\n\t\t\t\tif (!callsByLine.has(line)) {\n\t\t\t\t\tcallsByLine.set(line, {})\n\t\t\t\t}\n\t\t\t\tconst methodCall = callsByLine.get(line)!\n\t\t\t\tmethodCall.functionName = captureText\n\t\t\t\tmethodCall.callType = \"method\"\n\t\t\t\tbreak\n\n\t\t\tcase \"method.call.receiver\":\n\t\t\t\t// \u65B9\u6CD5\u8C03\u7528\u7684\u63A5\u6536\u8005\n\t\t\t\tif (!callsByLine.has(line)) {\n\t\t\t\t\tcallsByLine.set(line, {})\n\t\t\t\t}\n\t\t\t\tcallsByLine.get(line)!.receiver = captureText\n\t\t\t\tbreak\n\n\t\t\tcase \"static.call.class\":\n\t\t\t\t// \u9759\u6001\u65B9\u6CD5\u8C03\u7528\u7684\u7C7B\u540D\n\t\t\t\tif (!callsByLine.has(line)) {\n\t\t\t\t\tcallsByLine.set(line, {})\n\t\t\t\t}\n\t\t\t\tconst staticCall = callsByLine.get(line)!\n\t\t\t\tstaticCall.className = captureText\n\t\t\t\tstaticCall.callType = \"static\"\n\t\t\t\tbreak\n\n\t\t\tcase \"static.call.method\":\n\t\t\t\t// \u9759\u6001\u65B9\u6CD5\u8C03\u7528\u7684\u65B9\u6CD5\u540D\n\t\t\t\tif (!callsByLine.has(line)) {\n\t\t\t\t\tcallsByLine.set(line, {})\n\t\t\t\t}\n\t\t\t\tcallsByLine.get(line)!.functionName = captureText\n\t\t\t\tbreak\n\n\t\t\tcase \"namespace.call.name\":\n\t\t\t\t// \u547D\u540D\u7A7A\u95F4\u8C03\u7528\u7684\u547D\u540D\u7A7A\u95F4\u540D\n\t\t\t\tif (!callsByLine.has(line)) {\n\t\t\t\t\tcallsByLine.set(line, {})\n\t\t\t\t}\n\t\t\t\tconst namespaceCall = callsByLine.get(line)!\n\t\t\t\tnamespaceCall.namespace = captureText\n\t\t\t\tnamespaceCall.callType = \"namespace\"\n\t\t\t\tbreak\n\n\t\t\tcase \"namespace.call.function\":\n\t\t\t\t// \u547D\u540D\u7A7A\u95F4\u8C03\u7528\u7684\u51FD\u6570\u540D\n\t\t\t\tif (!callsByLine.has(line)) {\n\t\t\t\t\tcallsByLine.set(line, {})\n\t\t\t\t}\n\t\t\t\tcallsByLine.get(line)!.functionName = captureText\n\t\t\t\tbreak\n\n\t\t\tcase \"this.call.method\":\n\t\t\t\t// this\u65B9\u6CD5\u8C03\u7528\n\n\t\t\t\tfunctionCalls.push({\n\t\t\t\t\tcalledFunctionName: captureText,\n\t\t\t\t\tcallType: \"this\",\n\t\t\t\t\treceiver: \"this\",\n\t\t\t\t\tline: line + 1,\n\t\t\t\t\tcolumn: node.startPosition.column,\n\t\t\t\t})\n\t\t\t\tbreak\n\n\t\t\tcase \"super.call.method\":\n\t\t\t\t// super\u65B9\u6CD5\u8C03\u7528\n\n\t\t\t\tfunctionCalls.push({\n\t\t\t\t\tcalledFunctionName: captureText,\n\t\t\t\t\tcallType: \"super\",\n\t\t\t\t\treceiver: \"super\",\n\t\t\t\t\tline: line + 1,\n\t\t\t\t\tcolumn: node.startPosition.column,\n\t\t\t\t})\n\t\t\t\tbreak\n\n\t\t\tcase \"constructor.call.name\":\n\t\t\t\t// \u6784\u9020\u51FD\u6570\u8C03\u7528\n\n\t\t\t\tfunctionCalls.push({\n\t\t\t\t\tcalledFunctionName: captureText,\n\t\t\t\t\tcallType: \"constructor\",\n\t\t\t\t\tline: line + 1,\n\t\t\t\t\tcolumn: node.startPosition.column,\n\t\t\t\t})\n\t\t\t\tbreak\n\n\t\t\tcase \"method.call.chain\":\n\t\t\t\t// \u94FE\u5F0F\u65B9\u6CD5\u8C03\u7528\n\n\t\t\t\tfunctionCalls.push({\n\t\t\t\t\tcalledFunctionName: captureText,\n\t\t\t\t\tcallType: \"chain\",\n\t\t\t\t\tline: line + 1,\n\t\t\t\t\tcolumn: node.startPosition.column,\n\t\t\t\t})\n\t\t\t\tbreak\n\n\t\t\tcase \"array.call.method\":\n\t\t\t\t// \u6570\u7EC4\u65B9\u6CD5\u8C03\u7528\n\t\t\t\tif (!callsByLine.has(line)) {\n\t\t\t\t\tcallsByLine.set(line, {})\n\t\t\t\t}\n\t\t\t\tconst arrayCall = callsByLine.get(line)!\n\t\t\t\tarrayCall.functionName = captureText\n\t\t\t\tarrayCall.callType = \"array\"\n\t\t\t\tbreak\n\n\t\t\tcase \"array.call.object\":\n\t\t\t\t// \u6570\u7EC4\u5BF9\u8C61\n\t\t\t\tif (!callsByLine.has(line)) {\n\t\t\t\t\tcallsByLine.set(line, {})\n\t\t\t\t}\n\t\t\t\tcallsByLine.get(line)!.receiver = captureText\n\t\t\t\tbreak\n\n\t\t\tcase \"promise.call.method\":\n\t\t\t\t// Promise\u65B9\u6CD5\u8C03\u7528 - \u4F7F\u7528\u7B80\u5355\u7684\u6309\u884C\u5206\u7EC4\n\t\t\t\tconst promiseGroupKey = `promise-${line}`\n\t\t\t\tif (!callGroups.has(promiseGroupKey)) {\n\t\t\t\t\tcallGroups.set(promiseGroupKey, {})\n\t\t\t\t}\n\t\t\t\tcallGroups.get(promiseGroupKey)![\"method\"] = captureText\n\t\t\t\tcallGroups.get(promiseGroupKey)![\"line\"] = line.toString()\n\t\t\t\tcallGroups.get(promiseGroupKey)![\"column\"] = node.startPosition.column.toString()\n\t\t\t\tbreak\n\n\t\t\tcase \"promise.call.object\":\n\t\t\t\t// Promise\u5BF9\u8C61\n\t\t\t\tconst promiseObjGroupKey = `promise-${line}`\n\t\t\t\tif (!callGroups.has(promiseObjGroupKey)) {\n\t\t\t\t\tcallGroups.set(promiseObjGroupKey, {})\n\t\t\t\t}\n\t\t\t\tcallGroups.get(promiseObjGroupKey)![\"receiver\"] = captureText\n\t\t\t\tbreak\n\n\t\t\tcase \"await.call.function\":\n\t\t\t\t// await\u51FD\u6570\u8C03\u7528\n\n\t\t\t\tfunctionCalls.push({\n\t\t\t\t\tcalledFunctionName: captureText,\n\t\t\t\t\tcallType: \"async\",\n\t\t\t\t\tisAsync: true,\n\t\t\t\t\tline: line + 1,\n\t\t\t\t\tcolumn: node.startPosition.column,\n\t\t\t\t})\n\t\t\t\tbreak\n\n\t\t\tcase \"async.call.method\":\n\t\t\t\t// \u5F02\u6B65\u65B9\u6CD5\u8C03\u7528\n\t\t\t\tif (!callsByLine.has(line)) {\n\t\t\t\t\tcallsByLine.set(line, {})\n\t\t\t\t}\n\t\t\t\tconst asyncCall = callsByLine.get(line)!\n\t\t\t\tasyncCall.functionName = captureText\n\t\t\t\tasyncCall.callType = \"async\"\n\t\t\t\tasyncCall.isAsync = true\n\t\t\t\tbreak\n\n\t\t\tcase \"async.call.receiver\":\n\t\t\t\t// \u5F02\u6B65\u65B9\u6CD5\u63A5\u6536\u8005\n\t\t\t\tif (!callsByLine.has(line)) {\n\t\t\t\t\tcallsByLine.set(line, {})\n\t\t\t\t}\n\t\t\t\tcallsByLine.get(line)!.receiver = captureText\n\t\t\t\tbreak\n\n\t\t\tcase \"optional.call.method\":\n\t\t\t\t// \u53EF\u9009\u94FE\u65B9\u6CD5\u8C03\u7528\n\t\t\t\tif (!callsByLine.has(line)) {\n\t\t\t\t\tcallsByLine.set(line, {})\n\t\t\t\t}\n\t\t\t\tconst optionalCall = callsByLine.get(line)!\n\t\t\t\toptionalCall.functionName = captureText\n\t\t\t\toptionalCall.callType = \"optional\"\n\t\t\t\toptionalCall.isOptional = true\n\t\t\t\tbreak\n\n\t\t\tcase \"optional.call.receiver\":\n\t\t\t\t// \u53EF\u9009\u94FE\u63A5\u6536\u8005\n\t\t\t\tif (!callsByLine.has(line)) {\n\t\t\t\t\tcallsByLine.set(line, {})\n\t\t\t\t}\n\t\t\t\tcallsByLine.get(line)!.receiver = captureText\n\t\t\t\tbreak\n\n\t\t\tcase \"generic.call.function\":\n\t\t\t\t// \u6CDB\u578B\u51FD\u6570\u8C03\u7528\n\t\t\t\tconsole.log(`[analyzeTypeScriptFunctionCalls] Adding generic function call: ${captureText}`)\n\t\t\t\tfunctionCalls.push({\n\t\t\t\t\tcalledFunctionName: captureText,\n\t\t\t\t\tcallType: \"generic\",\n\t\t\t\t\tisGeneric: true,\n\t\t\t\t\tline: line + 1,\n\t\t\t\t\tcolumn: node.startPosition.column,\n\t\t\t\t})\n\t\t\t\tbreak\n\n\t\t\tcase \"template.call.function\":\n\t\t\t\t// \u6A21\u677F\u5B57\u7B26\u4E32\u4E2D\u7684\u51FD\u6570\u8C03\u7528\n\t\t\t\tconsole.log(`[analyzeTypeScriptFunctionCalls] Adding template function call: ${captureText}`)\n\t\t\t\tfunctionCalls.push({\n\t\t\t\t\tcalledFunctionName: captureText,\n\t\t\t\t\tcallType: \"template\",\n\t\t\t\t\tline: line + 1,\n\t\t\t\t\tcolumn: node.startPosition.column,\n\t\t\t\t})\n\t\t\t\tbreak\n\n\t\t\tcase \"nested.call.root\":\n\t\t\t\t// \u5D4C\u5957\u8C03\u7528\u7684\u6839\u5BF9\u8C61\n\t\t\t\tif (!callsByLine.has(line)) {\n\t\t\t\t\tcallsByLine.set(line, {})\n\t\t\t\t}\n\t\t\t\tconst nestedCall = callsByLine.get(line)!\n\t\t\t\tnestedCall.receiver = captureText\n\t\t\t\tnestedCall.callType = \"nested\"\n\t\t\t\tbreak\n\n\t\t\tcase \"nested.call.method\":\n\t\t\t\t// \u5D4C\u5957\u8C03\u7528\u7684\u65B9\u6CD5\n\t\t\t\tif (!callsByLine.has(line)) {\n\t\t\t\t\tcallsByLine.set(line, {})\n\t\t\t\t}\n\t\t\t\tcallsByLine.get(line)!.functionName = captureText\n\t\t\t\tbreak\n\n\t\t\tdefault:\n\t\t\t\tbreak\n\t\t}\n\t}\n\n\t// \u5904\u7406\u72EC\u7ACB\u7684\u8C03\u7528\u7EC4\n\tfor (const [groupKey, group] of callGroups) {\n\t\tif (groupKey.startsWith(\"promise-\") && group[\"method\"] && group[\"receiver\"]) {\n\t\t\tfunctionCalls.push({\n\t\t\t\tcalledFunctionName: group[\"method\"],\n\t\t\t\tcallType: \"promise\",\n\t\t\t\treceiver: group[\"receiver\"],\n\t\t\t\tline: parseInt(group[\"line\"]) + 1,\n\t\t\t\tcolumn: parseInt(group[\"column\"]),\n\t\t\t})\n\t\t}\n\t}\n\n\t// \u5904\u7406\u590D\u5408\u8C03\u7528\u4FE1\u606F - \u652F\u6301\u591A\u4E2A\u72EC\u7ACB\u7684\u51FD\u6570\u8C03\u7528\n\tconst processedCalls = new Set<string>() // \u9632\u6B62\u91CD\u590D\u5904\u7406\n\n\tfor (const [line, callInfo] of callsByLine) {\n\t\tif (callInfo.functionName) {\n\t\t\t// \u68C0\u67E5\u662F\u5426\u6709\u660E\u786E\u7684\u7279\u6B8A\u7C7B\u578B\u6807\u8BC6\n\t\t\tconst callTypes = []\n\n\t\t\t// Promise\u8C03\u7528\u4F18\u5148\u7EA7\u6700\u9AD8\n\t\t\tif (callInfo.callType === \"promise\") {\n\t\t\t\tcallTypes.push({\n\t\t\t\t\ttype: \"promise\" as TypeScriptFunctionCallInfo[\"callType\"],\n\t\t\t\t\treceiver: callInfo.receiver,\n\t\t\t\t\tfunctionName: callInfo.functionName,\n\t\t\t\t})\n\t\t\t}\n\n\t\t\t// \u6570\u7EC4\u8C03\u7528\n\t\t\tif (callInfo.callType === \"array\") {\n\t\t\t\tcallTypes.push({\n\t\t\t\t\ttype: \"array\" as TypeScriptFunctionCallInfo[\"callType\"],\n\t\t\t\t\treceiver: callInfo.receiver,\n\t\t\t\t\tfunctionName: callInfo.functionName,\n\t\t\t\t})\n\t\t\t}\n\n\t\t\t// \u9759\u6001\u8C03\u7528 (\u6709className)\n\t\t\tif (callInfo.className) {\n\t\t\t\tcallTypes.push({\n\t\t\t\t\ttype: \"static\" as TypeScriptFunctionCallInfo[\"callType\"],\n\t\t\t\t\treceiver: callInfo.className,\n\t\t\t\t\tfunctionName: callInfo.functionName,\n\t\t\t\t\tclassName: callInfo.className,\n\t\t\t\t})\n\t\t\t}\n\n\t\t\t// \u547D\u540D\u7A7A\u95F4\u8C03\u7528\n\t\t\tif (callInfo.namespace) {\n\t\t\t\tcallTypes.push({\n\t\t\t\t\ttype: \"namespace\" as TypeScriptFunctionCallInfo[\"callType\"],\n\t\t\t\t\treceiver: callInfo.namespace,\n\t\t\t\t\tfunctionName: callInfo.functionName,\n\t\t\t\t\tnamespace: callInfo.namespace,\n\t\t\t\t})\n\t\t\t}\n\n\t\t\t// \u5F02\u6B65\u8C03\u7528\n\t\t\tif (callInfo.isAsync) {\n\t\t\t\tcallTypes.push({\n\t\t\t\t\ttype: \"async\" as TypeScriptFunctionCallInfo[\"callType\"],\n\t\t\t\t\treceiver: callInfo.receiver,\n\t\t\t\t\tfunctionName: callInfo.functionName,\n\t\t\t\t\tisAsync: true,\n\t\t\t\t})\n\t\t\t}\n\n\t\t\t// \u5D4C\u5957\u8C03\u7528\n\t\t\tif (callInfo.callType === \"nested\") {\n\t\t\t\tcallTypes.push({\n\t\t\t\t\ttype: \"nested\" as TypeScriptFunctionCallInfo[\"callType\"],\n\t\t\t\t\treceiver: callInfo.receiver,\n\t\t\t\t\tfunctionName: callInfo.functionName,\n\t\t\t\t})\n\t\t\t}\n\n\t\t\t// \u5982\u679C\u6CA1\u6709\u7279\u6B8A\u7C7B\u578B\uFF0C\u9ED8\u8BA4\u4E3A\u666E\u901A\u65B9\u6CD5\u8C03\u7528\n\t\t\tif (callTypes.length === 0 && callInfo.receiver) {\n\t\t\t\tcallTypes.push({\n\t\t\t\t\ttype: \"method\" as TypeScriptFunctionCallInfo[\"callType\"],\n\t\t\t\t\treceiver: callInfo.receiver,\n\t\t\t\t\tfunctionName: callInfo.functionName,\n\t\t\t\t})\n\t\t\t}\n\n\t\t\t// \u4E3A\u6BCF\u4E2A\u8BC6\u522B\u7684\u8C03\u7528\u7C7B\u578B\u521B\u5EFA\u8BB0\u5F55\n\t\t\tfor (const callType of callTypes) {\n\t\t\t\tconst callKey = `${line}-${callType.type}-${callType.functionName}-${callType.receiver || \"\"}`\n\t\t\t\tif (!processedCalls.has(callKey)) {\n\t\t\t\t\tprocessedCalls.add(callKey)\n\n\t\t\t\t\tfunctionCalls.push({\n\t\t\t\t\t\tcalledFunctionName: callType.functionName,\n\t\t\t\t\t\tcallType: callType.type,\n\t\t\t\t\t\treceiver: callType.receiver,\n\t\t\t\t\t\tclassName: callType.className,\n\t\t\t\t\t\tnamespace: callType.namespace,\n\t\t\t\t\t\tline: line + 1,\n\t\t\t\t\t\tcolumn: 0,\n\t\t\t\t\t\tisAsync: callType.isAsync,\n\t\t\t\t\t\tisOptional: callInfo.isOptional,\n\t\t\t\t\t\tisGeneric: callInfo.isGeneric,\n\t\t\t\t\t})\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn { functionCalls, scopeInfo }\n}\n\nexport function filterRelevantTypeScriptFunctionCalls(\n\tcallAnalysis: TypeScriptFunctionCallAnalysisResult,\n\tallFunctions: ISnippetMeta[],\n\tcurrentFunction: ISnippetMeta,\n\tlanguage: CodeLanguageType,\n): ISnippetMeta[] {\n\tconst relevantFunctions: ISnippetMeta[] = []\n\n\tfor (const call of callAnalysis.functionCalls) {\n\t\t// \u67E5\u627E\u5BF9\u5E94\u7684\u51FD\u6570\u5B9A\u4E49\n\t\tconst targetFunction = findTypeScriptTargetFunction(call, allFunctions, callAnalysis.scopeInfo)\n\n\t\tif (targetFunction && targetFunction.name !== currentFunction.name) {\n\t\t\t// \u68C0\u67E5\u662F\u5426\u5DF2\u7ECF\u6DFB\u52A0\u8FC7\n\t\t\tif (!relevantFunctions.find((f) => f.name === targetFunction.name)) {\n\t\t\t\trelevantFunctions.push(targetFunction)\n\t\t\t\tconsole.log(\n\t\t\t\t\t`[TypeScriptFunctionCallAnalyzer] Found relevant function call: ${call.calledFunctionName} (${call.callType})`,\n\t\t\t\t)\n\t\t\t}\n\t\t}\n\t}\n\n\treturn relevantFunctions\n}\n\n/**\n * \u67E5\u627E TypeScript \u7684\u76EE\u6807\u51FD\u6570\n */\nfunction findTypeScriptTargetFunction(\n\tcall: TypeScriptFunctionCallInfo,\n\tallFunctions: ISnippetMeta[],\n\tscopeInfo: TypeScriptFunctionCallAnalysisResult[\"scopeInfo\"],\n): ISnippetMeta | null {\n\tswitch (call.callType) {\n\t\tcase \"direct\":\n\t\t\t// \u76F4\u63A5\u51FD\u6570\u8C03\u7528\uFF1A\u67E5\u627E\u540C\u6A21\u5757\u7684\u51FD\u6570\n\t\t\treturn (\n\t\t\t\tallFunctions.find(\n\t\t\t\t\t(func) => func.name === call.calledFunctionName && !func.field, // \u6A21\u5757\u7EA7\u51FD\u6570\u901A\u5E38\u6CA1\u6709field\n\t\t\t\t) || null\n\t\t\t)\n\n\t\tcase \"method\":\n\t\tcase \"this\":\n\t\t\t// \u65B9\u6CD5\u8C03\u7528\uFF1A\u67E5\u627E\u540C\u7C7B\u7684\u65B9\u6CD5\n\t\t\tif (call.receiver === \"this\" || call.receiver === scopeInfo.className) {\n\t\t\t\treturn (\n\t\t\t\t\tallFunctions.find(\n\t\t\t\t\t\t(func) => func.name === call.calledFunctionName && func.field === scopeInfo.className,\n\t\t\t\t\t) || null\n\t\t\t\t)\n\t\t\t}\n\t\t\tbreak\n\n\t\tcase \"static\":\n\t\t\t// \u9759\u6001\u65B9\u6CD5\u8C03\u7528\uFF1A\u67E5\u627E\u6307\u5B9A\u7C7B\u7684\u9759\u6001\u65B9\u6CD5\n\t\t\treturn (\n\t\t\t\tallFunctions.find((func) => func.name === call.calledFunctionName && func.field === call.className) ||\n\t\t\t\tnull\n\t\t\t)\n\n\t\tcase \"namespace\":\n\t\t\t// \u547D\u540D\u7A7A\u95F4\u8C03\u7528\uFF1A\u67E5\u627E\u6307\u5B9A\u547D\u540D\u7A7A\u95F4\u7684\u51FD\u6570\n\t\t\treturn (\n\t\t\t\tallFunctions.find((func) => func.name === call.calledFunctionName && func.field === call.namespace) ||\n\t\t\t\tnull\n\t\t\t)\n\n\t\tcase \"constructor\":\n\t\t\t// \u6784\u9020\u51FD\u6570\u8C03\u7528\uFF1A\u67E5\u627E\u7C7B\u5B9A\u4E49\n\t\t\treturn allFunctions.find((func) => func.name === call.calledFunctionName) || null\n\n\t\tcase \"super\":\n\t\t\t// super\u8C03\u7528\uFF1A\u901A\u5E38\u662F\u7236\u7C7B\u65B9\u6CD5\uFF0C\u53EF\u80FD\u4E0D\u5728\u540C\u6587\u4EF6\u4E2D\n\t\t\treturn null\n\n\t\tcase \"chain\":\n\t\tcase \"array\":\n\t\tcase \"promise\":\n\t\tcase \"optional\":\n\t\tcase \"async\":\n\t\tcase \"generic\":\n\t\tcase \"template\":\n\t\tcase \"nested\":\n\t\t\t// \u8FD9\u4E9B\u8C03\u7528\u7C7B\u578B\u901A\u5E38\u662F\u5185\u7F6E\u65B9\u6CD5\u6216\u94FE\u5F0F\u8C03\u7528\uFF0C\u4E0D\u9700\u8981\u5305\u542B\u5728\u4E0A\u4E0B\u6587\u4E2D\n\t\t\treturn null\n\t}\n\n\treturn null\n}\n", "import Parser from \"web-tree-sitter\"\nimport { CodeLanguageType, ISnippetMeta, SnippetType } from \"../types\"\n\nexport interface JavaScriptFunctionCallInfo {\n\tcalledFunctionName: string\n\tcallType:\n\t\t| \"direct\"\n\t\t| \"method\"\n\t\t| \"static\"\n\t\t| \"namespace\"\n\t\t| \"constructor\"\n\t\t| \"chain\"\n\t\t| \"this\"\n\t\t| \"super\"\n\t\t| \"arrow\"\n\t\t| \"async\"\n\t\t| \"array\"\n\t\t| \"promise\"\n\t\t| \"optional\"\n\t\t| \"template\"\n\t\t| \"nested\"\n\treceiver?: string // \u5BF9\u4E8E\u65B9\u6CD5\u8C03\u7528\uFF0C\u63A5\u6536\u8005\u7684\u540D\u79F0\n\tclassName?: string // \u5BF9\u4E8E\u9759\u6001\u65B9\u6CD5\u8C03\u7528\uFF0C\u7C7B\u7684\u540D\u79F0\n\tnamespace?: string // \u5BF9\u4E8E\u547D\u540D\u7A7A\u95F4\u8C03\u7528\uFF0C\u547D\u540D\u7A7A\u95F4\u7684\u540D\u79F0\n\tline: number\n\tcolumn: number\n\tisAsync?: boolean // \u662F\u5426\u662F\u5F02\u6B65\u8C03\u7528\n\tisOptional?: boolean // \u662F\u5426\u662F\u53EF\u9009\u94FE\u8C03\u7528\n}\n\nexport interface JavaScriptFunctionCallAnalysisResult {\n\tfunctionCalls: JavaScriptFunctionCallInfo[]\n\tscopeInfo: {\n\t\tmoduleName?: string\n\t\tclassName?: string // \u5982\u679C\u51FD\u6570\u662F\u67D0\u4E2A\u7C7B\u7684\u65B9\u6CD5\n\t\tfunctionName: string\n\t\tisAsync?: boolean\n\t}\n}\n\nexport function dependenciesCapturesProcessForJavaScript(captures: Parser.QueryCapture[]): ISnippetMeta[] {\n\tconst result = analyzeJavaScriptFunctionCalls(captures)\n\treturn result.functionCalls.map((call) => ({\n\t\tname: call.calledFunctionName,\n\t\ttype: SnippetType.FunctionOrMethod,\n\t\tfilePath: \"\",\n\t\tstartLine: call.line,\n\t\tendLine: call.line,\n\t\tstartPosition: {\n\t\t\trow: call.line,\n\t\t\tcolumn: call.column,\n\t\t},\n\t\tendPosition: {\n\t\t\trow: call.line,\n\t\t\tcolumn: call.column,\n\t\t},\n\t\trangeText: \"\",\n\t\tfileHash: \"\",\n\t\tdefinition: {\n\t\t\tname: call.calledFunctionName,\n\t\t\ttype: call.callType,\n\t\t},\n\t\tfield: call.className || call.namespace,\n\t\tsignature: `${call.calledFunctionName}()`,\n\t\tlanguage: CodeLanguageType.JavaScript,\n\t}))\n}\n\n/**\n * \u5206\u6790 JavaScript \u8BED\u8A00\u7684\u51FD\u6570\u8C03\u7528\n */\nfunction analyzeJavaScriptFunctionCalls(captures: Parser.QueryCapture[]): JavaScriptFunctionCallAnalysisResult {\n\tconst functionCalls: JavaScriptFunctionCallInfo[] = []\n\tconst scopeInfo = {\n\t\tmoduleName: undefined as string | undefined,\n\t\tclassName: undefined as string | undefined,\n\t\tfunctionName: \"unknown\",\n\t\tisAsync: false,\n\t}\n\n\t// \u7528\u4E8E\u4E34\u65F6\u5B58\u50A8\u540C\u4E00\u884C\u7684\u65B9\u6CD5\u8C03\u7528\u4FE1\u606F\n\tconst callsByLine = new Map<\n\t\tnumber,\n\t\t{\n\t\t\tfunctionName?: string\n\t\t\treceiver?: string\n\t\t\tclassName?: string\n\t\t\tnamespace?: string\n\t\t\tcallType?: JavaScriptFunctionCallInfo[\"callType\"]\n\t\t\tisAsync?: boolean\n\t\t\tisOptional?: boolean\n\t\t}\n\t>()\n\n\t// \u5904\u7406\u5404\u79CD\u7C7B\u578B\u7684\u6355\u83B7\n\tfor (const capture of captures) {\n\t\tconst node = capture.node\n\t\tconst captureText = node.text.trim()\n\t\tconst line = node.startPosition.row\n\n\t\tswitch (capture.name) {\n\t\t\tcase \"function.call.direct\":\n\t\t\t\t// \u76F4\u63A5\u51FD\u6570\u8C03\u7528\n\t\t\t\tfunctionCalls.push({\n\t\t\t\t\tcalledFunctionName: captureText,\n\t\t\t\t\tcallType: \"direct\",\n\t\t\t\t\tline: line + 1,\n\t\t\t\t\tcolumn: node.startPosition.column,\n\t\t\t\t})\n\t\t\t\tbreak\n\n\t\t\tcase \"method.call.name\":\n\t\t\t\t// \u65B9\u6CD5\u8C03\u7528\u7684\u65B9\u6CD5\u540D\n\t\t\t\tif (!callsByLine.has(line)) {\n\t\t\t\t\tcallsByLine.set(line, {})\n\t\t\t\t}\n\t\t\t\tconst methodCall = callsByLine.get(line)!\n\t\t\t\tmethodCall.functionName = captureText\n\t\t\t\tmethodCall.callType = \"method\"\n\t\t\t\tbreak\n\n\t\t\tcase \"method.call.receiver\":\n\t\t\t\t// \u65B9\u6CD5\u8C03\u7528\u7684\u63A5\u6536\u8005\n\t\t\t\tif (!callsByLine.has(line)) {\n\t\t\t\t\tcallsByLine.set(line, {})\n\t\t\t\t}\n\t\t\t\tcallsByLine.get(line)!.receiver = captureText\n\t\t\t\tbreak\n\n\t\t\tcase \"static.call.class\":\n\t\t\t\t// \u9759\u6001\u65B9\u6CD5\u8C03\u7528\u7684\u7C7B\u540D\n\t\t\t\tif (!callsByLine.has(line)) {\n\t\t\t\t\tcallsByLine.set(line, {})\n\t\t\t\t}\n\t\t\t\tconst staticCall = callsByLine.get(line)!\n\t\t\t\tstaticCall.className = captureText\n\t\t\t\tstaticCall.callType = \"static\"\n\t\t\t\tbreak\n\n\t\t\tcase \"static.call.method\":\n\t\t\t\t// \u9759\u6001\u65B9\u6CD5\u8C03\u7528\u7684\u65B9\u6CD5\u540D\n\t\t\t\tif (!callsByLine.has(line)) {\n\t\t\t\t\tcallsByLine.set(line, {})\n\t\t\t\t}\n\t\t\t\tcallsByLine.get(line)!.functionName = captureText\n\t\t\t\tbreak\n\n\t\t\tcase \"this.call.method\":\n\t\t\t\t// this\u65B9\u6CD5\u8C03\u7528\n\t\t\t\tfunctionCalls.push({\n\t\t\t\t\tcalledFunctionName: captureText,\n\t\t\t\t\tcallType: \"this\",\n\t\t\t\t\treceiver: \"this\",\n\t\t\t\t\tline: line + 1,\n\t\t\t\t\tcolumn: node.startPosition.column,\n\t\t\t\t})\n\t\t\t\tbreak\n\n\t\t\tcase \"super.call.receiver\":\n\t\t\t\t// super\u65B9\u6CD5\u8C03\u7528\u7684\u63A5\u6536\u8005\n\t\t\t\tif (!callsByLine.has(line)) {\n\t\t\t\t\tcallsByLine.set(line, {})\n\t\t\t\t}\n\t\t\t\tcallsByLine.get(line)!.receiver = \"super\"\n\t\t\t\tbreak\n\n\t\t\tcase \"super.call.method\":\n\t\t\t\t// super\u65B9\u6CD5\u8C03\u7528\u7684\u65B9\u6CD5\u540D\n\t\t\t\tif (!callsByLine.has(line)) {\n\t\t\t\t\tcallsByLine.set(line, {})\n\t\t\t\t}\n\t\t\t\tconst superCall = callsByLine.get(line)!\n\t\t\t\tsuperCall.functionName = captureText\n\t\t\t\tsuperCall.callType = \"super\"\n\t\t\t\tbreak\n\n\t\t\tcase \"constructor.call.name\":\n\t\t\t\t// \u6784\u9020\u51FD\u6570\u8C03\u7528\n\t\t\t\tfunctionCalls.push({\n\t\t\t\t\tcalledFunctionName: captureText,\n\t\t\t\t\tcallType: \"constructor\",\n\t\t\t\t\tline: line + 1,\n\t\t\t\t\tcolumn: node.startPosition.column,\n\t\t\t\t})\n\t\t\t\tbreak\n\n\t\t\tcase \"method.call.chain\":\n\t\t\t\t// \u94FE\u5F0F\u65B9\u6CD5\u8C03\u7528\n\t\t\t\tfunctionCalls.push({\n\t\t\t\t\tcalledFunctionName: captureText,\n\t\t\t\t\tcallType: \"chain\",\n\t\t\t\t\tline: line + 1,\n\t\t\t\t\tcolumn: node.startPosition.column,\n\t\t\t\t})\n\t\t\t\tbreak\n\n\t\t\tcase \"namespace.call.name\":\n\t\t\t\t// \u547D\u540D\u7A7A\u95F4\u8C03\u7528\u7684\u547D\u540D\u7A7A\u95F4\u540D\n\t\t\t\tif (!callsByLine.has(line)) {\n\t\t\t\t\tcallsByLine.set(line, {})\n\t\t\t\t}\n\t\t\t\tconst namespaceCall = callsByLine.get(line)!\n\t\t\t\tnamespaceCall.namespace = captureText\n\t\t\t\tnamespaceCall.callType = \"namespace\"\n\t\t\t\tbreak\n\n\t\t\tcase \"namespace.call.function\":\n\t\t\t\t// \u547D\u540D\u7A7A\u95F4\u8C03\u7528\u7684\u51FD\u6570\u540D\n\t\t\t\tif (!callsByLine.has(line)) {\n\t\t\t\t\tcallsByLine.set(line, {})\n\t\t\t\t}\n\t\t\t\tcallsByLine.get(line)!.functionName = captureText\n\t\t\t\tbreak\n\n\t\t\tcase \"arrow.call.function\":\n\t\t\t\t// \u7BAD\u5934\u51FD\u6570\u8C03\u7528\n\t\t\t\tfunctionCalls.push({\n\t\t\t\t\tcalledFunctionName: \"arrow_function\",\n\t\t\t\t\tcallType: \"arrow\",\n\t\t\t\t\tline: line + 1,\n\t\t\t\t\tcolumn: node.startPosition.column,\n\t\t\t\t})\n\t\t\t\tbreak\n\n\t\t\tcase \"function.call.expression\":\n\t\t\t\t// \u51FD\u6570\u8868\u8FBE\u5F0F\u8C03\u7528\n\t\t\t\tfunctionCalls.push({\n\t\t\t\t\tcalledFunctionName: \"function_expression\",\n\t\t\t\t\tcallType: \"arrow\", // \u5F52\u7C7B\u4E3A\u7BAD\u5934\u51FD\u6570\u7C7B\u578B\n\t\t\t\t\tline: line + 1,\n\t\t\t\t\tcolumn: node.startPosition.column,\n\t\t\t\t})\n\t\t\t\tbreak\n\n\t\t\tcase \"array.call.method\":\n\t\t\t\t// \u6570\u7EC4\u65B9\u6CD5\u8C03\u7528\n\t\t\t\tif (!callsByLine.has(line)) {\n\t\t\t\t\tcallsByLine.set(line, {})\n\t\t\t\t}\n\t\t\t\tconst arrayCall = callsByLine.get(line)!\n\t\t\t\tarrayCall.functionName = captureText\n\t\t\t\tarrayCall.callType = \"array\"\n\t\t\t\tbreak\n\n\t\t\tcase \"array.call.object\":\n\t\t\t\t// \u6570\u7EC4\u65B9\u6CD5\u8C03\u7528\u7684\u5BF9\u8C61\n\t\t\t\tif (!callsByLine.has(line)) {\n\t\t\t\t\tcallsByLine.set(line, {})\n\t\t\t\t}\n\t\t\t\tcallsByLine.get(line)!.receiver = captureText\n\t\t\t\tbreak\n\n\t\t\tcase \"promise.call.method\":\n\t\t\t\t// Promise \u65B9\u6CD5\u8C03\u7528\n\t\t\t\tif (!callsByLine.has(line)) {\n\t\t\t\t\tcallsByLine.set(line, {})\n\t\t\t\t}\n\t\t\t\tconst promiseCall = callsByLine.get(line)!\n\t\t\t\tpromiseCall.functionName = captureText\n\t\t\t\tpromiseCall.callType = \"promise\"\n\t\t\t\tbreak\n\n\t\t\tcase \"promise.call.object\":\n\t\t\t\t// Promise \u65B9\u6CD5\u8C03\u7528\u7684\u5BF9\u8C61\n\t\t\t\tif (!callsByLine.has(line)) {\n\t\t\t\t\tcallsByLine.set(line, {})\n\t\t\t\t}\n\t\t\t\tcallsByLine.get(line)!.receiver = captureText\n\t\t\t\tbreak\n\n\t\t\tcase \"template.call.function\":\n\t\t\t\t// \u6A21\u677F\u5B57\u7B26\u4E32\u4E2D\u7684\u51FD\u6570\u8C03\u7528\n\t\t\t\tfunctionCalls.push({\n\t\t\t\t\tcalledFunctionName: captureText,\n\t\t\t\t\tcallType: \"template\",\n\t\t\t\t\tline: line + 1,\n\t\t\t\t\tcolumn: node.startPosition.column,\n\t\t\t\t})\n\t\t\t\tbreak\n\n\t\t\tcase \"optional.call.receiver\":\n\t\t\t\t// \u53EF\u9009\u94FE\u8C03\u7528\u7684\u63A5\u6536\u8005\n\t\t\t\tif (!callsByLine.has(line)) {\n\t\t\t\t\tcallsByLine.set(line, {})\n\t\t\t\t}\n\t\t\t\tconst optionalCall = callsByLine.get(line)!\n\t\t\t\toptionalCall.receiver = captureText\n\t\t\t\toptionalCall.isOptional = true\n\t\t\t\tbreak\n\n\t\t\tcase \"optional.call.method\":\n\t\t\t\t// \u53EF\u9009\u94FE\u8C03\u7528\u7684\u65B9\u6CD5\u540D\n\t\t\t\tif (!callsByLine.has(line)) {\n\t\t\t\t\tcallsByLine.set(line, {})\n\t\t\t\t}\n\t\t\t\tconst optionalMethodCall = callsByLine.get(line)!\n\t\t\t\toptionalMethodCall.functionName = captureText\n\t\t\t\toptionalMethodCall.callType = \"optional\"\n\t\t\t\tbreak\n\n\t\t\tcase \"await.call.function\":\n\t\t\t\t// await \u8868\u8FBE\u5F0F\u4E2D\u7684\u51FD\u6570\u8C03\u7528\n\t\t\t\tfunctionCalls.push({\n\t\t\t\t\tcalledFunctionName: captureText,\n\t\t\t\t\tcallType: \"async\",\n\t\t\t\t\tisAsync: true,\n\t\t\t\t\tline: line + 1,\n\t\t\t\t\tcolumn: node.startPosition.column,\n\t\t\t\t})\n\t\t\t\tbreak\n\n\t\t\tcase \"async.call.receiver\":\n\t\t\t\t// \u5F02\u6B65\u65B9\u6CD5\u8C03\u7528\u7684\u63A5\u6536\u8005\n\t\t\t\tif (!callsByLine.has(line)) {\n\t\t\t\t\tcallsByLine.set(line, {})\n\t\t\t\t}\n\t\t\t\tconst asyncCall = callsByLine.get(line)!\n\t\t\t\tasyncCall.receiver = captureText\n\t\t\t\tasyncCall.isAsync = true\n\t\t\t\tbreak\n\n\t\t\tcase \"async.call.method\":\n\t\t\t\t// \u5F02\u6B65\u65B9\u6CD5\u8C03\u7528\u7684\u65B9\u6CD5\u540D\n\t\t\t\tif (!callsByLine.has(line)) {\n\t\t\t\t\tcallsByLine.set(line, {})\n\t\t\t\t}\n\t\t\t\tconst asyncMethodCall = callsByLine.get(line)!\n\t\t\t\tasyncMethodCall.functionName = captureText\n\t\t\t\tasyncMethodCall.callType = \"async\"\n\t\t\t\tbreak\n\n\t\t\tcase \"nested.call.method\":\n\t\t\t\t// \u5D4C\u5957\u5C5E\u6027\u8C03\u7528\n\t\t\t\tif (!callsByLine.has(line)) {\n\t\t\t\t\tcallsByLine.set(line, {})\n\t\t\t\t}\n\t\t\t\tconst nestedCall = callsByLine.get(line)!\n\t\t\t\tnestedCall.functionName = captureText\n\t\t\t\tnestedCall.callType = \"nested\"\n\t\t\t\tbreak\n\n\t\t\tcase \"nested.call.root\":\n\t\t\t\t// \u5D4C\u5957\u5C5E\u6027\u8C03\u7528\u7684\u6839\u5BF9\u8C61\n\t\t\t\tif (!callsByLine.has(line)) {\n\t\t\t\t\tcallsByLine.set(line, {})\n\t\t\t\t}\n\t\t\t\tcallsByLine.get(line)!.receiver = captureText\n\t\t\t\tbreak\n\n\t\t\tdefault:\n\t\t\t\t// \u5FFD\u7565\u672A\u77E5\u7684\u6355\u83B7\u7C7B\u578B\n\t\t\t\tbreak\n\t\t}\n\t}\n\n\t// \u5904\u7406\u6309\u884C\u5206\u7EC4\u7684\u590D\u5408\u8C03\u7528\n\tfor (const [line, callInfo] of callsByLine) {\n\t\tif (callInfo.functionName) {\n\t\t\tfunctionCalls.push({\n\t\t\t\tcalledFunctionName: callInfo.functionName,\n\t\t\t\tcallType: callInfo.callType || \"method\",\n\t\t\t\treceiver: callInfo.receiver,\n\t\t\t\tclassName: callInfo.className,\n\t\t\t\tnamespace: callInfo.namespace,\n\t\t\t\tline: line + 1,\n\t\t\t\tcolumn: 0,\n\t\t\t\tisAsync: callInfo.isAsync,\n\t\t\t\tisOptional: callInfo.isOptional,\n\t\t\t})\n\t\t}\n\t}\n\n\treturn {\n\t\tfunctionCalls,\n\t\tscopeInfo,\n\t}\n}\n", "import Parser from \"web-tree-sitter\"\nimport { CodeLanguageType, ISnippetMeta, SnippetType } from \"../types\"\n\nexport interface JavaFunctionCallInfo {\n\tcalledFunctionName: string\n\tcallType:\n\t\t| \"direct\"\n\t\t| \"method\"\n\t\t| \"static\"\n\t\t| \"field\"\n\t\t| \"constructor\"\n\t\t| \"this\"\n\t\t| \"super\"\n\t\t| \"chain\"\n\t\t| \"lambda\"\n\t\t| \"stream\"\n\t\t| \"array\"\n\t\t| \"collection\"\n\t\t| \"inner\"\n\t\t| \"package\"\n\t\t| \"generic\"\n\t\t| \"exception\"\n\treceiver?: string // \u5BF9\u4E8E\u65B9\u6CD5\u8C03\u7528\uFF0C\u63A5\u6536\u8005\u7684\u540D\u79F0\n\tclassName?: string // \u5BF9\u4E8E\u9759\u6001\u65B9\u6CD5\u8C03\u7528\uFF0C\u7C7B\u7684\u540D\u79F0\n\tpackageName?: string // \u5BF9\u4E8E\u5305\u9650\u5B9A\u8C03\u7528\uFF0C\u5305\u7684\u540D\u79F0\n\tfieldName?: string // \u5BF9\u4E8E\u5B57\u6BB5\u8BBF\u95EE\u540E\u7684\u65B9\u6CD5\u8C03\u7528\uFF0C\u5B57\u6BB5\u7684\u540D\u79F0\n\tline: number\n\tcolumn: number\n\tisGeneric?: boolean // \u662F\u5426\u662F\u6CDB\u578B\u8C03\u7528\n\tisException?: boolean // \u662F\u5426\u5728\u5F02\u5E38\u5904\u7406\u4E2D\n}\n\nexport interface JavaFunctionCallAnalysisResult {\n\tfunctionCalls: JavaFunctionCallInfo[]\n\tscopeInfo: {\n\t\tpackageName?: string\n\t\tclassName?: string // \u5982\u679C\u51FD\u6570\u662F\u67D0\u4E2A\u7C7B\u7684\u65B9\u6CD5\n\t\tfunctionName: string\n\t}\n}\n\nexport function dependenciesCapturesProcessForJava(captures: Parser.QueryCapture[]): ISnippetMeta[] {\n\tconst result = analyzeJavaFunctionCalls(captures)\n\treturn result.functionCalls.map((call) => ({\n\t\tname: call.calledFunctionName,\n\t\ttype: SnippetType.FunctionOrMethod,\n\t\tfilePath: \"\",\n\t\tstartLine: call.line,\n\t\tendLine: call.line,\n\t\tstartPosition: {\n\t\t\trow: call.line,\n\t\t\tcolumn: call.column,\n\t\t},\n\t\tendPosition: {\n\t\t\trow: call.line,\n\t\t\tcolumn: call.column,\n\t\t},\n\t\trangeText: \"\",\n\t\tfileHash: \"\",\n\t\tdefinition: {\n\t\t\tname: call.calledFunctionName,\n\t\t\ttype: call.callType,\n\t\t},\n\t\tfield: call.className || call.packageName,\n\t\tsignature: `${call.calledFunctionName}()`,\n\t\tlanguage: CodeLanguageType.Java,\n\t}))\n}\n\n/**\n * \u5206\u6790 Java \u8BED\u8A00\u7684\u51FD\u6570\u8C03\u7528\n */\nfunction analyzeJavaFunctionCalls(captures: Parser.QueryCapture[]): JavaFunctionCallAnalysisResult {\n\tconst functionCalls: JavaFunctionCallInfo[] = []\n\tconst scopeInfo = {\n\t\tpackageName: undefined as string | undefined,\n\t\tclassName: undefined as string | undefined,\n\t\tfunctionName: \"unknown\",\n\t}\n\n\t// \u7528\u4E8E\u4E34\u65F6\u5B58\u50A8\u540C\u4E00\u884C\u7684\u65B9\u6CD5\u8C03\u7528\u4FE1\u606F\n\tconst callsByLine = new Map<\n\t\tnumber,\n\t\t{\n\t\t\tfunctionName?: string\n\t\t\treceiver?: string\n\t\t\tclassName?: string\n\t\t\tpackageName?: string\n\t\t\tfieldName?: string\n\t\t\tcallType?: JavaFunctionCallInfo[\"callType\"]\n\t\t\tisGeneric?: boolean\n\t\t\tisException?: boolean\n\t\t}\n\t>()\n\n\t// \u5904\u7406\u5404\u79CD\u7C7B\u578B\u7684\u6355\u83B7\n\tfor (const capture of captures) {\n\t\tconst node = capture.node\n\t\tconst captureText = node.text.trim()\n\t\tconst line = node.startPosition.row\n\n\t\tswitch (capture.name) {\n\t\t\tcase \"method.call.direct\":\n\t\t\t\t// \u76F4\u63A5\u65B9\u6CD5\u8C03\u7528\n\t\t\t\tfunctionCalls.push({\n\t\t\t\t\tcalledFunctionName: captureText,\n\t\t\t\t\tcallType: \"direct\",\n\t\t\t\t\tline: line + 1,\n\t\t\t\t\tcolumn: node.startPosition.column,\n\t\t\t\t})\n\t\t\t\tbreak\n\n\t\t\tcase \"method.call.name\":\n\t\t\t\t// \u65B9\u6CD5\u8C03\u7528\u7684\u65B9\u6CD5\u540D\n\t\t\t\tif (!callsByLine.has(line)) {\n\t\t\t\t\tcallsByLine.set(line, {})\n\t\t\t\t}\n\t\t\t\tconst methodCall = callsByLine.get(line)!\n\t\t\t\tmethodCall.functionName = captureText\n\t\t\t\tmethodCall.callType = \"method\"\n\t\t\t\tbreak\n\n\t\t\tcase \"method.call.receiver\":\n\t\t\t\t// \u65B9\u6CD5\u8C03\u7528\u7684\u63A5\u6536\u8005\n\t\t\t\tif (!callsByLine.has(line)) {\n\t\t\t\t\tcallsByLine.set(line, {})\n\t\t\t\t}\n\t\t\t\tcallsByLine.get(line)!.receiver = captureText\n\t\t\t\tbreak\n\n\t\t\tcase \"static.call.class\":\n\t\t\t\t// \u9759\u6001\u65B9\u6CD5\u8C03\u7528\u7684\u7C7B\u540D\n\t\t\t\tif (!callsByLine.has(line)) {\n\t\t\t\t\tcallsByLine.set(line, {})\n\t\t\t\t}\n\t\t\t\tconst staticCall = callsByLine.get(line)!\n\t\t\t\tstaticCall.className = captureText\n\t\t\t\tstaticCall.callType = \"static\"\n\t\t\t\tbreak\n\n\t\t\tcase \"static.call.method\":\n\t\t\t\t// \u9759\u6001\u65B9\u6CD5\u8C03\u7528\u7684\u65B9\u6CD5\u540D\n\t\t\t\tif (!callsByLine.has(line)) {\n\t\t\t\t\tcallsByLine.set(line, {})\n\t\t\t\t}\n\t\t\t\tcallsByLine.get(line)!.functionName = captureText\n\t\t\t\tbreak\n\n\t\t\tcase \"this.call.method\":\n\t\t\t\t// this\u65B9\u6CD5\u8C03\u7528\n\t\t\t\tfunctionCalls.push({\n\t\t\t\t\tcalledFunctionName: captureText,\n\t\t\t\t\tcallType: \"this\",\n\t\t\t\t\treceiver: \"this\",\n\t\t\t\t\tline: line + 1,\n\t\t\t\t\tcolumn: node.startPosition.column,\n\t\t\t\t})\n\t\t\t\tbreak\n\n\t\t\tcase \"super.call.method\":\n\t\t\t\t// super\u65B9\u6CD5\u8C03\u7528\n\t\t\t\tfunctionCalls.push({\n\t\t\t\t\tcalledFunctionName: captureText,\n\t\t\t\t\tcallType: \"super\",\n\t\t\t\t\treceiver: \"super\",\n\t\t\t\t\tline: line + 1,\n\t\t\t\t\tcolumn: node.startPosition.column,\n\t\t\t\t})\n\t\t\t\tbreak\n\n\t\t\tcase \"constructor.call.name\":\n\t\t\t\t// \u6784\u9020\u51FD\u6570\u8C03\u7528\n\t\t\t\tfunctionCalls.push({\n\t\t\t\t\tcalledFunctionName: captureText,\n\t\t\t\t\tcallType: \"constructor\",\n\t\t\t\t\tline: line + 1,\n\t\t\t\t\tcolumn: node.startPosition.column,\n\t\t\t\t})\n\t\t\t\tbreak\n\n\t\t\tcase \"method.call.chain\":\n\t\t\t\t// \u94FE\u5F0F\u65B9\u6CD5\u8C03\u7528\n\t\t\t\tfunctionCalls.push({\n\t\t\t\t\tcalledFunctionName: captureText,\n\t\t\t\t\tcallType: \"chain\",\n\t\t\t\t\tline: line + 1,\n\t\t\t\t\tcolumn: node.startPosition.column,\n\t\t\t\t})\n\t\t\t\tbreak\n\n\t\t\tdefault:\n\t\t\t\tbreak\n\t\t}\n\t}\n\n\t// \u5904\u7406\u590D\u5408\u8C03\u7528\u4FE1\u606F\n\tfor (const [line, callInfo] of callsByLine) {\n\t\tif (callInfo.functionName) {\n\t\t\tconst callData: JavaFunctionCallInfo = {\n\t\t\t\tcalledFunctionName: callInfo.functionName,\n\t\t\t\tcallType: callInfo.callType || \"method\",\n\t\t\t\treceiver: callInfo.receiver,\n\t\t\t\tclassName: callInfo.className,\n\t\t\t\tpackageName: callInfo.packageName,\n\t\t\t\tfieldName: callInfo.fieldName,\n\t\t\t\tline: line + 1,\n\t\t\t\tcolumn: 0,\n\t\t\t\tisGeneric: callInfo.isGeneric,\n\t\t\t\tisException: callInfo.isException,\n\t\t\t}\n\n\t\t\tfunctionCalls.push(callData)\n\t\t}\n\t}\n\n\treturn { functionCalls, scopeInfo }\n}\n\nexport function filterRelevantJavaFunctionCalls(\n\tcallAnalysis: JavaFunctionCallAnalysisResult,\n\tallFunctions: ISnippetMeta[],\n\tcurrentFunction: ISnippetMeta,\n\tlanguage: CodeLanguageType,\n): ISnippetMeta[] {\n\tconst relevantFunctions: ISnippetMeta[] = []\n\n\tfor (const call of callAnalysis.functionCalls) {\n\t\t// \u67E5\u627E\u5BF9\u5E94\u7684\u51FD\u6570\u5B9A\u4E49\n\t\tconst targetFunction = findJavaTargetFunction(call, allFunctions, callAnalysis.scopeInfo)\n\n\t\tif (targetFunction && targetFunction.name !== currentFunction.name) {\n\t\t\t// \u68C0\u67E5\u662F\u5426\u5DF2\u7ECF\u6DFB\u52A0\u8FC7\n\t\t\tif (!relevantFunctions.find((f) => f.name === targetFunction.name)) {\n\t\t\t\trelevantFunctions.push(targetFunction)\n\t\t\t}\n\t\t}\n\t}\n\n\treturn relevantFunctions\n}\n\n/**\n * \u67E5\u627E Java \u8BED\u8A00\u7684\u76EE\u6807\u51FD\u6570\n */\nfunction findJavaTargetFunction(\n\tcall: JavaFunctionCallInfo,\n\tallFunctions: ISnippetMeta[],\n\tscopeInfo: JavaFunctionCallAnalysisResult[\"scopeInfo\"],\n): ISnippetMeta | null {\n\tswitch (call.callType) {\n\t\tcase \"direct\":\n\t\t\t// \u76F4\u63A5\u65B9\u6CD5\u8C03\u7528\uFF1A\u67E5\u627E\u540C\u7C7B\u7684\u65B9\u6CD5\n\t\t\treturn (\n\t\t\t\tallFunctions.find(\n\t\t\t\t\t(func) => func.name === call.calledFunctionName && func.field === scopeInfo.className,\n\t\t\t\t) || null\n\t\t\t)\n\n\t\tcase \"method\":\n\t\t\t// \u65B9\u6CD5\u8C03\u7528\uFF1A\u67E5\u627E\u6307\u5B9A\u5BF9\u8C61\u7684\u65B9\u6CD5\n\t\t\tif (call.receiver === scopeInfo.className) {\n\t\t\t\t// \u540C\u7C7B\u5B9E\u4F8B\u65B9\u6CD5\u8C03\u7528\n\t\t\t\treturn (\n\t\t\t\t\tallFunctions.find(\n\t\t\t\t\t\t(func) => func.name === call.calledFunctionName && func.field === scopeInfo.className,\n\t\t\t\t\t) || null\n\t\t\t\t)\n\t\t\t}\n\t\t\tbreak\n\n\t\tcase \"this\":\n\t\t\t// this\u65B9\u6CD5\u8C03\u7528\uFF1A\u67E5\u627E\u540C\u7C7B\u7684\u65B9\u6CD5\n\t\t\treturn (\n\t\t\t\tallFunctions.find(\n\t\t\t\t\t(func) => func.name === call.calledFunctionName && func.field === scopeInfo.className,\n\t\t\t\t) || null\n\t\t\t)\n\n\t\tcase \"static\":\n\t\t\t// \u9759\u6001\u65B9\u6CD5\u8C03\u7528\uFF1A\u67E5\u627E\u6307\u5B9A\u7C7B\u7684\u9759\u6001\u65B9\u6CD5\n\t\t\treturn (\n\t\t\t\tallFunctions.find((func) => func.name === call.calledFunctionName && func.field === call.className) ||\n\t\t\t\tnull\n\t\t\t)\n\n\t\tcase \"field\":\n\t\t\t// \u5B57\u6BB5\u8BBF\u95EE\u540E\u7684\u65B9\u6CD5\u8C03\u7528\uFF1A\u901A\u5E38\u662F\u5176\u4ED6\u7C7B\u7684\u65B9\u6CD5\uFF0C\u53EF\u80FD\u4E0D\u5728\u540C\u6587\u4EF6\u4E2D\n\t\t\treturn null\n\n\t\tcase \"constructor\":\n\t\t\t// \u6784\u9020\u51FD\u6570\u8C03\u7528\uFF1A\u67E5\u627E\u7C7B\u5B9A\u4E49\n\t\t\treturn allFunctions.find((func) => func.name === call.calledFunctionName) || null\n\n\t\tcase \"super\":\n\t\t\t// super\u8C03\u7528\uFF1A\u901A\u5E38\u662F\u7236\u7C7B\u65B9\u6CD5\uFF0C\u53EF\u80FD\u4E0D\u5728\u540C\u6587\u4EF6\u4E2D\n\t\t\treturn null\n\n\t\tcase \"chain\":\n\t\tcase \"lambda\":\n\t\tcase \"stream\":\n\t\tcase \"array\":\n\t\tcase \"collection\":\n\t\tcase \"inner\":\n\t\tcase \"package\":\n\t\tcase \"generic\":\n\t\tcase \"exception\":\n\t\t\t// \u8FD9\u4E9B\u8C03\u7528\u7C7B\u578B\u901A\u5E38\u6D89\u53CA\u5185\u7F6E\u65B9\u6CD5\u3001\u5916\u90E8\u7C7B\u6216\u590D\u6742\u8C03\u7528\u94FE\uFF0C\u4E0D\u9700\u8981\u5305\u542B\u5728\u4E0A\u4E0B\u6587\u4E2D\n\t\t\treturn null\n\t}\n\n\treturn null\n}\n", "import Parser from \"web-tree-sitter\"\nimport { CodeLanguageType, ISnippetMeta, SnippetType } from \"../types\"\n\nexport interface PythonFunctionCallInfo {\n\tcalledFunctionName: string\n\tcallType:\n\t\t| \"direct\"\n\t\t| \"method\"\n\t\t| \"class\"\n\t\t| \"self\"\n\t\t| \"super\"\n\t\t| \"async\"\n\t\t| \"decorator\"\n\t\t| \"chain\"\n\t\t| \"comprehension\"\n\t\t| \"generator\"\n\t\t| \"lambda\"\n\t\t| \"nested\"\n\t\t| \"argument\"\n\treceiver?: string // \u5BF9\u4E8E\u65B9\u6CD5\u8C03\u7528\uFF0C\u63A5\u6536\u8005\u7684\u540D\u79F0\n\tclassName?: string // \u5BF9\u4E8E\u7C7B\u65B9\u6CD5\u8C03\u7528\uFF0C\u7C7B\u7684\u540D\u79F0\n\tline: number\n\tcolumn: number\n\tisAsync?: boolean // \u662F\u5426\u662F\u5F02\u6B65\u8C03\u7528\n\tisDecorator?: boolean // \u662F\u5426\u662F\u88C5\u9970\u5668\u8C03\u7528\n}\n\nexport interface PythonFunctionCallAnalysisResult {\n\tfunctionCalls: PythonFunctionCallInfo[]\n\tscopeInfo: {\n\t\tmoduleName?: string\n\t\tclassName?: string // \u5982\u679C\u51FD\u6570\u662F\u67D0\u4E2A\u7C7B\u7684\u65B9\u6CD5\n\t\tfunctionName: string\n\t\tisAsync?: boolean\n\t}\n}\n\nexport function dependenciesCapturesProcessForPython(captures: Parser.QueryCapture[]): ISnippetMeta[] {\n\tconst result = analyzePythonFunctionCalls(captures)\n\treturn result.functionCalls.map((call) => ({\n\t\tname: call.calledFunctionName,\n\t\ttype: SnippetType.FunctionOrMethod,\n\t\tfilePath: \"\",\n\t\tstartLine: call.line,\n\t\tendLine: call.line,\n\t\tstartPosition: {\n\t\t\trow: call.line,\n\t\t\tcolumn: call.column,\n\t\t},\n\t\tendPosition: {\n\t\t\trow: call.line,\n\t\t\tcolumn: call.column,\n\t\t},\n\t\trangeText: \"\",\n\t\tfileHash: \"\",\n\t\tdefinition: {\n\t\t\tname: call.calledFunctionName,\n\t\t\ttype: call.callType,\n\t\t},\n\t\tfield: call.className,\n\t\tsignature: `${call.calledFunctionName}()`,\n\t\tlanguage: CodeLanguageType.Python,\n\t}))\n}\n\n/**\n * \u5206\u6790 Python \u8BED\u8A00\u7684\u51FD\u6570\u8C03\u7528\n */\nfunction analyzePythonFunctionCalls(captures: Parser.QueryCapture[]): PythonFunctionCallAnalysisResult {\n\tconst functionCalls: PythonFunctionCallInfo[] = []\n\tconst scopeInfo = {\n\t\tmoduleName: undefined as string | undefined,\n\t\tclassName: undefined as string | undefined,\n\t\tfunctionName: \"unknown\",\n\t\tisAsync: false,\n\t}\n\n\tconsole.log(`[analyzePythonFunctionCalls] Processing ${captures.length} captures`)\n\n\t// \u7528\u4E8E\u4E34\u65F6\u5B58\u50A8\u540C\u4E00\u884C\u7684\u8C03\u7528\u4FE1\u606F\n\tconst callsByLine = new Map<\n\t\tnumber,\n\t\t{\n\t\t\tfunctionName?: string\n\t\t\treceiver?: string\n\t\t\tclassName?: string\n\t\t\tcallType?: PythonFunctionCallInfo[\"callType\"]\n\t\t\tisAsync?: boolean\n\t\t\tisDecorator?: boolean\n\t\t\tintermediate?: string // \u7528\u4E8E\u5D4C\u5957\u8C03\u7528\n\t\t\troot?: string // \u7528\u4E8E\u5D4C\u5957\u8C03\u7528\n\t\t}\n\t>()\n\n\t// \u5904\u7406\u5404\u79CD\u7C7B\u578B\u7684\u6355\u83B7\n\tfor (const capture of captures) {\n\t\tconst node = capture.node\n\t\tconst captureText = node.text.trim()\n\t\tconst line = node.startPosition.row\n\n\t\tconsole.log(`[analyzePythonFunctionCalls] Processing capture: ${capture.name} = \"${captureText}\"`)\n\n\t\tswitch (capture.name) {\n\t\t\tcase \"function.call.direct\":\n\t\t\t\t// \u76F4\u63A5\u51FD\u6570\u8C03\u7528\n\t\t\t\tconsole.log(`[analyzePythonFunctionCalls] Adding direct function call: ${captureText}`)\n\t\t\t\tif (!callsByLine.has(line)) {\n\t\t\t\t\tcallsByLine.set(line, {})\n\t\t\t\t}\n\t\t\t\tconst directCall = callsByLine.get(line)!\n\t\t\t\t// \u603B\u662F\u8BBE\u7F6E\u51FD\u6570\u540D\u79F0\uFF0C\u4F46\u53EA\u6709\u5728\u6CA1\u6709\u5176\u4ED6\u7C7B\u578B\u65F6\u624D\u8BBE\u7F6E\u4E3A\u76F4\u63A5\u8C03\u7528\n\t\t\t\tif (!directCall.functionName) {\n\t\t\t\t\tdirectCall.functionName = captureText\n\t\t\t\t}\n\t\t\t\tif (!directCall.callType) {\n\t\t\t\t\tdirectCall.callType = \"direct\"\n\t\t\t\t}\n\t\t\t\tbreak\n\n\t\t\tcase \"method.call.name\":\n\t\t\t\t// \u65B9\u6CD5\u8C03\u7528\u7684\u65B9\u6CD5\u540D\n\t\t\t\tif (!callsByLine.has(line)) {\n\t\t\t\t\tcallsByLine.set(line, {})\n\t\t\t\t}\n\t\t\t\tconst methodCall = callsByLine.get(line)!\n\t\t\t\tmethodCall.functionName = captureText\n\t\t\t\tmethodCall.callType = \"method\"\n\t\t\t\tbreak\n\n\t\t\tcase \"method.call.receiver\":\n\t\t\t\t// \u65B9\u6CD5\u8C03\u7528\u7684\u63A5\u6536\u8005\n\t\t\t\tif (!callsByLine.has(line)) {\n\t\t\t\t\tcallsByLine.set(line, {})\n\t\t\t\t}\n\t\t\t\tcallsByLine.get(line)!.receiver = captureText\n\t\t\t\tbreak\n\n\t\t\tcase \"class.call.name\":\n\t\t\t\t// \u7C7B\u65B9\u6CD5\u8C03\u7528\u7684\u7C7B\u540D\n\t\t\t\tif (!callsByLine.has(line)) {\n\t\t\t\t\tcallsByLine.set(line, {})\n\t\t\t\t}\n\t\t\t\tconst classCall = callsByLine.get(line)!\n\t\t\t\tclassCall.className = captureText\n\t\t\t\tclassCall.callType = \"class\"\n\t\t\t\tbreak\n\n\t\t\tcase \"class.call.method\":\n\t\t\t\t// \u7C7B\u65B9\u6CD5\u8C03\u7528\u7684\u65B9\u6CD5\u540D\n\t\t\t\tif (!callsByLine.has(line)) {\n\t\t\t\t\tcallsByLine.set(line, {})\n\t\t\t\t}\n\t\t\t\tcallsByLine.get(line)!.functionName = captureText\n\t\t\t\tbreak\n\n\t\t\tcase \"self.call.receiver\":\n\t\t\t\t// self\u65B9\u6CD5\u8C03\u7528\u7684\u63A5\u6536\u8005\n\t\t\t\tif (!callsByLine.has(line)) {\n\t\t\t\t\tcallsByLine.set(line, {})\n\t\t\t\t}\n\t\t\t\tconst selfCall = callsByLine.get(line)!\n\t\t\t\tselfCall.receiver = captureText\n\t\t\t\tselfCall.callType = \"self\"\n\t\t\t\tbreak\n\n\t\t\tcase \"self.call.method\":\n\t\t\t\t// self\u65B9\u6CD5\u8C03\u7528\u7684\u65B9\u6CD5\u540D\n\t\t\t\tif (!callsByLine.has(line)) {\n\t\t\t\t\tcallsByLine.set(line, {})\n\t\t\t\t}\n\t\t\t\tcallsByLine.get(line)!.functionName = captureText\n\t\t\t\tbreak\n\n\t\t\tcase \"super.call.function\":\n\t\t\t\t// super\u8C03\u7528\u7684\u51FD\u6570\u540D\n\t\t\t\tif (!callsByLine.has(line)) {\n\t\t\t\t\tcallsByLine.set(line, {})\n\t\t\t\t}\n\t\t\t\tconst superCall = callsByLine.get(line)!\n\t\t\t\tsuperCall.receiver = \"super\"\n\t\t\t\tsuperCall.callType = \"super\"\n\t\t\t\tbreak\n\n\t\t\tcase \"super.call.method\":\n\t\t\t\t// super\u8C03\u7528\u7684\u65B9\u6CD5\u540D\n\t\t\t\tif (!callsByLine.has(line)) {\n\t\t\t\t\tcallsByLine.set(line, {})\n\t\t\t\t}\n\t\t\t\tcallsByLine.get(line)!.functionName = captureText\n\t\t\t\tbreak\n\n\t\t\tcase \"async.call.function\":\n\t\t\t\t// \u5F02\u6B65\u51FD\u6570\u8C03\u7528\n\t\t\t\tconsole.log(`[analyzePythonFunctionCalls] Adding async function call: ${captureText}`)\n\t\t\t\tif (!callsByLine.has(line)) {\n\t\t\t\t\tcallsByLine.set(line, {})\n\t\t\t\t}\n\t\t\t\tconst asyncDirectCall = callsByLine.get(line)!\n\t\t\t\tasyncDirectCall.functionName = captureText\n\t\t\t\tasyncDirectCall.callType = \"async\"\n\t\t\t\tasyncDirectCall.isAsync = true\n\t\t\t\tbreak\n\n\t\t\tcase \"async.call.receiver\":\n\t\t\t\t// \u5F02\u6B65\u65B9\u6CD5\u8C03\u7528\u7684\u63A5\u6536\u8005\n\t\t\t\tif (!callsByLine.has(line)) {\n\t\t\t\t\tcallsByLine.set(line, {})\n\t\t\t\t}\n\t\t\t\tconst asyncCall = callsByLine.get(line)!\n\t\t\t\tasyncCall.receiver = captureText\n\t\t\t\tasyncCall.callType = \"async\"\n\t\t\t\tasyncCall.isAsync = true\n\t\t\t\tbreak\n\n\t\t\tcase \"async.call.method\":\n\t\t\t\t// \u5F02\u6B65\u65B9\u6CD5\u8C03\u7528\u7684\u65B9\u6CD5\u540D\n\t\t\t\tif (!callsByLine.has(line)) {\n\t\t\t\t\tcallsByLine.set(line, {})\n\t\t\t\t}\n\t\t\t\tcallsByLine.get(line)!.functionName = captureText\n\t\t\t\tbreak\n\n\t\t\tcase \"decorator.call.function\":\n\t\t\t\t// \u88C5\u9970\u5668\u51FD\u6570\u8C03\u7528\n\t\t\t\tconsole.log(`[analyzePythonFunctionCalls] Adding decorator function call: ${captureText}`)\n\t\t\t\tif (!callsByLine.has(line)) {\n\t\t\t\t\tcallsByLine.set(line, {})\n\t\t\t\t}\n\t\t\t\tconst decoratorDirectCall = callsByLine.get(line)!\n\t\t\t\tdecoratorDirectCall.functionName = captureText\n\t\t\t\tdecoratorDirectCall.callType = \"decorator\"\n\t\t\t\tdecoratorDirectCall.isDecorator = true\n\t\t\t\tbreak\n\n\t\t\tcase \"decorator.call.receiver\":\n\t\t\t\t// \u88C5\u9970\u5668\u65B9\u6CD5\u8C03\u7528\u7684\u63A5\u6536\u8005\n\t\t\t\tif (!callsByLine.has(line)) {\n\t\t\t\t\tcallsByLine.set(line, {})\n\t\t\t\t}\n\t\t\t\tconst decoratorCall = callsByLine.get(line)!\n\t\t\t\tdecoratorCall.receiver = captureText\n\t\t\t\tdecoratorCall.callType = \"decorator\"\n\t\t\t\tdecoratorCall.isDecorator = true\n\t\t\t\tbreak\n\n\t\t\tcase \"decorator.call.method\":\n\t\t\t\t// \u88C5\u9970\u5668\u65B9\u6CD5\u8C03\u7528\u7684\u65B9\u6CD5\u540D\n\t\t\t\tif (!callsByLine.has(line)) {\n\t\t\t\t\tcallsByLine.set(line, {})\n\t\t\t\t}\n\t\t\t\tcallsByLine.get(line)!.functionName = captureText\n\t\t\t\tbreak\n\n\t\t\tcase \"method.call.chain\":\n\t\t\t\t// \u94FE\u5F0F\u65B9\u6CD5\u8C03\u7528\n\t\t\t\tconsole.log(`[analyzePythonFunctionCalls] Adding chain method call: ${captureText}`)\n\t\t\t\tif (!callsByLine.has(line)) {\n\t\t\t\t\tcallsByLine.set(line, {})\n\t\t\t\t}\n\t\t\t\tconst chainCall = callsByLine.get(line)!\n\t\t\t\tchainCall.functionName = captureText\n\t\t\t\tchainCall.callType = \"chain\"\n\t\t\t\tbreak\n\n\t\t\tcase \"comprehension.call.function\":\n\t\t\t\t// \u63A8\u5BFC\u5F0F\u4E2D\u7684\u51FD\u6570\u8C03\u7528\n\t\t\t\tconsole.log(`[analyzePythonFunctionCalls] Adding comprehension function call: ${captureText}`)\n\t\t\t\tif (!callsByLine.has(line)) {\n\t\t\t\t\tcallsByLine.set(line, {})\n\t\t\t\t}\n\t\t\t\tconst comprehensionDirectCall = callsByLine.get(line)!\n\t\t\t\tcomprehensionDirectCall.functionName = captureText\n\t\t\t\tcomprehensionDirectCall.callType = \"comprehension\"\n\t\t\t\tbreak\n\n\t\t\tcase \"comprehension.call.receiver\":\n\t\t\t\t// \u63A8\u5BFC\u5F0F\u4E2D\u7684\u65B9\u6CD5\u8C03\u7528\u63A5\u6536\u8005\n\t\t\t\tif (!callsByLine.has(line)) {\n\t\t\t\t\tcallsByLine.set(line, {})\n\t\t\t\t}\n\t\t\t\tconst comprehensionCall = callsByLine.get(line)!\n\t\t\t\tcomprehensionCall.receiver = captureText\n\t\t\t\tcomprehensionCall.callType = \"comprehension\"\n\t\t\t\tbreak\n\n\t\t\tcase \"comprehension.call.method\":\n\t\t\t\t// \u63A8\u5BFC\u5F0F\u4E2D\u7684\u65B9\u6CD5\u8C03\u7528\u65B9\u6CD5\u540D\n\t\t\t\tif (!callsByLine.has(line)) {\n\t\t\t\t\tcallsByLine.set(line, {})\n\t\t\t\t}\n\t\t\t\tcallsByLine.get(line)!.functionName = captureText\n\t\t\t\tbreak\n\n\t\t\tcase \"generator.call.function\":\n\t\t\t\t// \u751F\u6210\u5668\u8868\u8FBE\u5F0F\u4E2D\u7684\u51FD\u6570\u8C03\u7528\n\t\t\t\tconsole.log(`[analyzePythonFunctionCalls] Adding generator function call: ${captureText}`)\n\t\t\t\tif (!callsByLine.has(line)) {\n\t\t\t\t\tcallsByLine.set(line, {})\n\t\t\t\t}\n\t\t\t\tconst generatorDirectCall = callsByLine.get(line)!\n\t\t\t\tgeneratorDirectCall.functionName = captureText\n\t\t\t\tgeneratorDirectCall.callType = \"generator\"\n\t\t\t\tbreak\n\n\t\t\tcase \"generator.call.receiver\":\n\t\t\t\t// \u751F\u6210\u5668\u8868\u8FBE\u5F0F\u4E2D\u7684\u65B9\u6CD5\u8C03\u7528\u63A5\u6536\u8005\n\t\t\t\tif (!callsByLine.has(line)) {\n\t\t\t\t\tcallsByLine.set(line, {})\n\t\t\t\t}\n\t\t\t\tconst generatorCall = callsByLine.get(line)!\n\t\t\t\tgeneratorCall.receiver = captureText\n\t\t\t\tgeneratorCall.callType = \"generator\"\n\t\t\t\tbreak\n\n\t\t\tcase \"generator.call.method\":\n\t\t\t\t// \u751F\u6210\u5668\u8868\u8FBE\u5F0F\u4E2D\u7684\u65B9\u6CD5\u8C03\u7528\u65B9\u6CD5\u540D\n\t\t\t\tif (!callsByLine.has(line)) {\n\t\t\t\t\tcallsByLine.set(line, {})\n\t\t\t\t}\n\t\t\t\tcallsByLine.get(line)!.functionName = captureText\n\t\t\t\tbreak\n\n\t\t\tcase \"lambda.call.function\":\n\t\t\t\t// Lambda \u8868\u8FBE\u5F0F\u4E2D\u7684\u51FD\u6570\u8C03\u7528\n\t\t\t\tconsole.log(`[analyzePythonFunctionCalls] Adding lambda function call: ${captureText}`)\n\t\t\t\tif (!callsByLine.has(line)) {\n\t\t\t\t\tcallsByLine.set(line, {})\n\t\t\t\t}\n\t\t\t\tconst lambdaDirectCall = callsByLine.get(line)!\n\t\t\t\tlambdaDirectCall.functionName = captureText\n\t\t\t\tlambdaDirectCall.callType = \"lambda\"\n\t\t\t\tbreak\n\n\t\t\tcase \"lambda.call.receiver\":\n\t\t\t\t// Lambda \u8868\u8FBE\u5F0F\u4E2D\u7684\u65B9\u6CD5\u8C03\u7528\u63A5\u6536\u8005\n\t\t\t\tif (!callsByLine.has(line)) {\n\t\t\t\t\tcallsByLine.set(line, {})\n\t\t\t\t}\n\t\t\t\tconst lambdaCall = callsByLine.get(line)!\n\t\t\t\tlambdaCall.receiver = captureText\n\t\t\t\tlambdaCall.callType = \"lambda\"\n\t\t\t\tbreak\n\n\t\t\tcase \"lambda.call.method\":\n\t\t\t\t// Lambda \u8868\u8FBE\u5F0F\u4E2D\u7684\u65B9\u6CD5\u8C03\u7528\u65B9\u6CD5\u540D\n\t\t\t\tif (!callsByLine.has(line)) {\n\t\t\t\t\tcallsByLine.set(line, {})\n\t\t\t\t}\n\t\t\t\tcallsByLine.get(line)!.functionName = captureText\n\t\t\t\tbreak\n\n\t\t\tcase \"nested.call.root\":\n\t\t\t\t// \u5D4C\u5957\u8C03\u7528\u7684\u6839\u5BF9\u8C61\n\t\t\t\tif (!callsByLine.has(line)) {\n\t\t\t\t\tcallsByLine.set(line, {})\n\t\t\t\t}\n\t\t\t\tconst nestedCall = callsByLine.get(line)!\n\t\t\t\tnestedCall.root = captureText\n\t\t\t\tnestedCall.callType = \"nested\"\n\t\t\t\tbreak\n\n\t\t\tcase \"nested.call.intermediate\":\n\t\t\t\t// \u5D4C\u5957\u8C03\u7528\u7684\u4E2D\u95F4\u5C5E\u6027\n\t\t\t\tif (!callsByLine.has(line)) {\n\t\t\t\t\tcallsByLine.set(line, {})\n\t\t\t\t}\n\t\t\t\tcallsByLine.get(line)!.intermediate = captureText\n\t\t\t\tbreak\n\n\t\t\tcase \"nested.call.method\":\n\t\t\t\t// \u5D4C\u5957\u8C03\u7528\u7684\u65B9\u6CD5\u540D\n\t\t\t\tif (!callsByLine.has(line)) {\n\t\t\t\t\tcallsByLine.set(line, {})\n\t\t\t\t}\n\t\t\t\tcallsByLine.get(line)!.functionName = captureText\n\t\t\t\tbreak\n\n\t\t\tcase \"function.call.argument\":\n\t\t\t\t// \u51FD\u6570\u4F5C\u4E3A\u53C2\u6570\u8C03\u7528\n\t\t\t\tconsole.log(`[analyzePythonFunctionCalls] Adding argument function call: ${captureText}`)\n\t\t\t\tif (!callsByLine.has(line)) {\n\t\t\t\t\tcallsByLine.set(line, {})\n\t\t\t\t}\n\t\t\t\tconst argumentCall = callsByLine.get(line)!\n\t\t\t\targumentCall.functionName = captureText\n\t\t\t\targumentCall.callType = \"argument\"\n\t\t\t\tbreak\n\n\t\t\tdefault:\n\t\t\t\tconsole.log(`[analyzePythonFunctionCalls] Unhandled capture type: ${capture.name}`)\n\t\t\t\tbreak\n\t\t}\n\t}\n\n\t// \u5904\u7406\u590D\u5408\u8C03\u7528\u4FE1\u606F\n\tconst processedCalls = new Set<string>() // \u9632\u6B62\u91CD\u590D\u5904\u7406\n\n\tfor (const [line, callInfo] of callsByLine) {\n\t\tif (callInfo.functionName) {\n\t\t\t// \u786E\u5B9A\u6700\u7EC8\u7684\u8C03\u7528\u7C7B\u578B\uFF0C\u4F18\u5148\u7EA7\u5904\u7406\n\t\t\tlet finalCallType = callInfo.callType!\n\n\t\t\t// \u7279\u6B8A\u5904\u7406\uFF1A\u5982\u679C\u6709\u591A\u79CD\u7C7B\u578B\u6807\u8BB0\uFF0C\u6309\u4F18\u5148\u7EA7\u9009\u62E9\n\t\t\tif (callInfo.isDecorator) {\n\t\t\t\tfinalCallType = \"decorator\"\n\t\t\t} else if (callInfo.isAsync) {\n\t\t\t\tfinalCallType = \"async\"\n\t\t\t} else if (callInfo.receiver === \"self\") {\n\t\t\t\tfinalCallType = \"self\"\n\t\t\t} else if (callInfo.className) {\n\t\t\t\tfinalCallType = \"class\"\n\t\t\t} else if (callInfo.receiver && callInfo.callType === \"method\") {\n\t\t\t\t// \u6709\u63A5\u6536\u8005\u7684\u65B9\u6CD5\u8C03\u7528\n\t\t\t\tfinalCallType = \"method\"\n\t\t\t}\n\n\t\t\t// \u6784\u5EFA\u552F\u4E00\u952E\n\t\t\tconst callKey = `${line}-${finalCallType}-${callInfo.functionName}-${callInfo.receiver || \"\"}-${callInfo.className || \"\"}`\n\n\t\t\tif (!processedCalls.has(callKey)) {\n\t\t\t\tprocessedCalls.add(callKey)\n\n\t\t\t\t// \u6784\u5EFA\u63A5\u6536\u8005\u4FE1\u606F\n\t\t\t\tlet receiver = callInfo.receiver\n\t\t\t\tif (finalCallType === \"nested\" && callInfo.root && callInfo.intermediate) {\n\t\t\t\t\treceiver = `${callInfo.root}.${callInfo.intermediate}`\n\t\t\t\t}\n\n\t\t\t\tfunctionCalls.push({\n\t\t\t\t\tcalledFunctionName: callInfo.functionName,\n\t\t\t\t\tcallType: finalCallType,\n\t\t\t\t\treceiver: receiver,\n\t\t\t\t\tclassName: callInfo.className,\n\t\t\t\t\tline: line + 1,\n\t\t\t\t\tcolumn: 0,\n\t\t\t\t\tisAsync: callInfo.isAsync,\n\t\t\t\t\tisDecorator: callInfo.isDecorator,\n\t\t\t\t})\n\n\t\t\t\tconsole.log(\n\t\t\t\t\t`[analyzePythonFunctionCalls] Adding ${finalCallType} call: ${callInfo.functionName} (receiver: ${receiver || \"none\"})`,\n\t\t\t\t)\n\t\t\t}\n\t\t}\n\t}\n\n\tconsole.log(\n\t\t`[analyzePythonFunctionCalls] Final result: ${functionCalls.length} function calls, scope: ${JSON.stringify(scopeInfo)}`,\n\t)\n\n\treturn { functionCalls, scopeInfo }\n}\n\nexport function filterRelevantPythonFunctionCalls(\n\tcallAnalysis: PythonFunctionCallAnalysisResult,\n\tallFunctions: ISnippetMeta[],\n\tcurrentFunction: ISnippetMeta,\n\tlanguage: CodeLanguageType,\n): ISnippetMeta[] {\n\tconst relevantFunctions: ISnippetMeta[] = []\n\n\tfor (const call of callAnalysis.functionCalls) {\n\t\t// \u67E5\u627E\u5BF9\u5E94\u7684\u51FD\u6570\u5B9A\u4E49\n\t\tconst targetFunction = findPythonTargetFunction(call, allFunctions, callAnalysis.scopeInfo)\n\n\t\tif (targetFunction && targetFunction.name !== currentFunction.name) {\n\t\t\t// \u68C0\u67E5\u662F\u5426\u5DF2\u7ECF\u6DFB\u52A0\u8FC7\n\t\t\tif (!relevantFunctions.find((f) => f.name === targetFunction.name)) {\n\t\t\t\trelevantFunctions.push(targetFunction)\n\t\t\t\tconsole.log(\n\t\t\t\t\t`[PythonFunctionCallAnalyzer] Found relevant function call: ${call.calledFunctionName} (${call.callType})`,\n\t\t\t\t)\n\t\t\t}\n\t\t}\n\t}\n\n\treturn relevantFunctions\n}\n\n/**\n * \u67E5\u627E Python \u7684\u76EE\u6807\u51FD\u6570\n */\nfunction findPythonTargetFunction(\n\tcall: PythonFunctionCallInfo,\n\tallFunctions: ISnippetMeta[],\n\tscopeInfo: PythonFunctionCallAnalysisResult[\"scopeInfo\"],\n): ISnippetMeta | null {\n\tswitch (call.callType) {\n\t\tcase \"direct\":\n\t\t\t// \u76F4\u63A5\u51FD\u6570\u8C03\u7528\uFF1A\u67E5\u627E\u540C\u6A21\u5757\u7684\u51FD\u6570\n\t\t\treturn (\n\t\t\t\tallFunctions.find(\n\t\t\t\t\t(func) => func.name === call.calledFunctionName && !func.field, // \u6A21\u5757\u7EA7\u51FD\u6570\u901A\u5E38\u6CA1\u6709field\n\t\t\t\t) || null\n\t\t\t)\n\n\t\tcase \"method\":\n\t\t\t// \u65B9\u6CD5\u8C03\u7528\uFF1A\u67E5\u627E\u5BF9\u5E94\u63A5\u6536\u8005\u7684\u65B9\u6CD5\n\t\t\tif (call.receiver) {\n\t\t\t\treturn (\n\t\t\t\t\tallFunctions.find(\n\t\t\t\t\t\t(func) => func.name === call.calledFunctionName && func.field === call.receiver,\n\t\t\t\t\t) || null\n\t\t\t\t)\n\t\t\t}\n\t\t\tbreak\n\n\t\tcase \"self\":\n\t\t\t// self\u65B9\u6CD5\u8C03\u7528\uFF1A\u67E5\u627E\u540C\u7C7B\u7684\u65B9\u6CD5\n\t\t\treturn (\n\t\t\t\tallFunctions.find(\n\t\t\t\t\t(func) => func.name === call.calledFunctionName && func.field === scopeInfo.className,\n\t\t\t\t) || null\n\t\t\t)\n\n\t\tcase \"class\":\n\t\t\t// \u7C7B\u65B9\u6CD5\u8C03\u7528\uFF1A\u67E5\u627E\u6307\u5B9A\u7C7B\u7684\u65B9\u6CD5\n\t\t\treturn (\n\t\t\t\tallFunctions.find((func) => func.name === call.calledFunctionName && func.field === call.className) ||\n\t\t\t\tnull\n\t\t\t)\n\n\t\tcase \"super\":\n\t\t\t// super\u8C03\u7528\uFF1A\u901A\u5E38\u662F\u7236\u7C7B\u65B9\u6CD5\uFF0C\u53EF\u80FD\u4E0D\u5728\u540C\u6587\u4EF6\u4E2D\n\t\t\treturn null\n\n\t\tcase \"async\":\n\t\t\t// \u5F02\u6B65\u8C03\u7528\uFF1A\u6309\u7167\u666E\u901A\u51FD\u6570\u6216\u65B9\u6CD5\u5904\u7406\n\t\t\tif (call.receiver) {\n\t\t\t\treturn (\n\t\t\t\t\tallFunctions.find(\n\t\t\t\t\t\t(func) => func.name === call.calledFunctionName && func.field === call.receiver,\n\t\t\t\t\t) || null\n\t\t\t\t)\n\t\t\t} else {\n\t\t\t\treturn allFunctions.find((func) => func.name === call.calledFunctionName && !func.field) || null\n\t\t\t}\n\n\t\tcase \"decorator\":\n\t\t\t// \u88C5\u9970\u5668\u8C03\u7528\uFF1A\u67E5\u627E\u88C5\u9970\u5668\u51FD\u6570\n\t\t\tif (call.receiver) {\n\t\t\t\treturn (\n\t\t\t\t\tallFunctions.find(\n\t\t\t\t\t\t(func) => func.name === call.calledFunctionName && func.field === call.receiver,\n\t\t\t\t\t) || null\n\t\t\t\t)\n\t\t\t} else {\n\t\t\t\treturn allFunctions.find((func) => func.name === call.calledFunctionName && !func.field) || null\n\t\t\t}\n\n\t\tcase \"chain\":\n\t\tcase \"comprehension\":\n\t\tcase \"generator\":\n\t\tcase \"lambda\":\n\t\tcase \"nested\":\n\t\tcase \"argument\":\n\t\t\t// \u8FD9\u4E9B\u8C03\u7528\u7C7B\u578B\u901A\u5E38\u662F\u590D\u6742\u8868\u8FBE\u5F0F\u6216\u5185\u8054\u8C03\u7528\uFF0C\u6839\u636E\u5177\u4F53\u60C5\u51B5\u5904\u7406\n\t\t\tif (call.receiver) {\n\t\t\t\treturn (\n\t\t\t\t\tallFunctions.find(\n\t\t\t\t\t\t(func) => func.name === call.calledFunctionName && func.field === call.receiver,\n\t\t\t\t\t) || null\n\t\t\t\t)\n\t\t\t} else {\n\t\t\t\treturn allFunctions.find((func) => func.name === call.calledFunctionName && !func.field) || null\n\t\t\t}\n\t}\n\n\treturn null\n}\n", "import Parser from \"web-tree-sitter\"\nimport { CodeLanguageType, ISnippetMeta, SnippetType } from \"../types\"\n\nexport interface JSXFunctionCallInfo {\n\tcalledFunctionName: string\n\tcallType:\n\t\t| \"direct\"\n\t\t| \"method\"\n\t\t| \"static\"\n\t\t| \"namespace\"\n\t\t| \"constructor\"\n\t\t| \"chain\"\n\t\t| \"this\"\n\t\t| \"super\"\n\t\t| \"arrow\"\n\t\t| \"async\"\n\t\t| \"array\"\n\t\t| \"promise\"\n\t\t| \"optional\"\n\t\t| \"template\"\n\t\t| \"nested\"\n\t\t| \"react_hook\"\n\t\t| \"react_component\"\n\t\t| \"jsx_component\"\n\t\t| \"event_handler\"\n\t\t| \"react_create\"\n\t\t| \"hoc\"\n\t\t| \"context_hook\"\n\t\t| \"ref_hook\"\n\t\t| \"state_hook\"\n\t\t| \"effect_hook\"\n\t\t| \"memo_hook\"\n\t\t| \"devtools\"\n\treceiver?: string // \u5BF9\u4E8E\u65B9\u6CD5\u8C03\u7528\uFF0C\u63A5\u6536\u8005\u7684\u540D\u79F0\n\tclassName?: string // \u5BF9\u4E8E\u9759\u6001\u65B9\u6CD5\u8C03\u7528\uFF0C\u7C7B\u7684\u540D\u79F0\n\tnamespace?: string // \u5BF9\u4E8E\u547D\u540D\u7A7A\u95F4\u8C03\u7528\uFF0C\u547D\u540D\u7A7A\u95F4\u7684\u540D\u79F0\n\tcomponent?: string // \u5BF9\u4E8EReact\u7EC4\u4EF6\u8C03\u7528\uFF0C\u7EC4\u4EF6\u7684\u540D\u79F0\n\tcontext?: string // \u5BF9\u4E8EContext hooks\uFF0Ccontext\u7684\u540D\u79F0\n\tline: number\n\tcolumn: number\n\tisAsync?: boolean // \u662F\u5426\u662F\u5F02\u6B65\u8C03\u7528\n\tisOptional?: boolean // \u662F\u5426\u662F\u53EF\u9009\u94FE\u8C03\u7528\n\tisReactSpecific?: boolean // \u662F\u5426\u662FReact\u7279\u5B9A\u7684\u8C03\u7528\n}\n\nexport interface JSXFunctionCallAnalysisResult {\n\tfunctionCalls: JSXFunctionCallInfo[]\n\tscopeInfo: {\n\t\tmoduleName?: string\n\t\tcomponentName?: string // \u5982\u679C\u51FD\u6570\u662F\u67D0\u4E2AReact\u7EC4\u4EF6\u7684\u4E00\u90E8\u5206\n\t\tfunctionName: string\n\t\tisAsync?: boolean\n\t\tisReactComponent?: boolean // \u662F\u5426\u662FReact\u7EC4\u4EF6\n\t}\n}\n\nexport function dependenciesCapturesProcessForJSX(captures: Parser.QueryCapture[]): ISnippetMeta[] {\n\tconst result = analyzeJSXFunctionCalls(captures)\n\treturn result.functionCalls.map((call) => ({\n\t\tname: call.calledFunctionName,\n\t\ttype: SnippetType.FunctionOrMethod,\n\t\tfilePath: \"\",\n\t\tstartLine: call.line,\n\t\tendLine: call.line,\n\t\tstartPosition: {\n\t\t\trow: call.line,\n\t\t\tcolumn: call.column,\n\t\t},\n\t\tendPosition: {\n\t\t\trow: call.line,\n\t\t\tcolumn: call.column,\n\t\t},\n\t\trangeText: \"\",\n\t\tfileHash: \"\",\n\t\tdefinition: {\n\t\t\tname: call.calledFunctionName,\n\t\t\ttype: call.callType,\n\t\t\tisAsync: call.isAsync,\n\t\t},\n\t\tfield: call.className || call.namespace || call.component || call.context,\n\t\tsignature: buildSignatureForJSXCall(call),\n\t\tlanguage: CodeLanguageType.JSX,\n\t}))\n}\n\n/**\n * \u4E3AJSX\u51FD\u6570\u8C03\u7528\u6784\u5EFA\u7B7E\u540D\n */\nfunction buildSignatureForJSXCall(call: JSXFunctionCallInfo): string {\n\tswitch (call.callType) {\n\t\tcase \"react_hook\":\n\t\t\treturn `${call.calledFunctionName}() // React Hook`\n\t\tcase \"react_component\":\n\t\t\treturn `${call.calledFunctionName}() // React Component`\n\t\tcase \"event_handler\":\n\t\t\treturn `${call.calledFunctionName}() // Event Handler`\n\t\tcase \"react_create\":\n\t\t\treturn `React.createElement(${call.component}) // React.createElement`\n\t\tcase \"hoc\":\n\t\t\treturn `${call.calledFunctionName}(${call.component}) // Higher-Order Component`\n\t\tcase \"context_hook\":\n\t\t\treturn `useContext(${call.context}) // Context Hook`\n\t\tcase \"ref_hook\":\n\t\t\treturn `${call.calledFunctionName}() // Ref Hook`\n\t\tcase \"state_hook\":\n\t\t\treturn `${call.calledFunctionName}() // State Hook`\n\t\tcase \"effect_hook\":\n\t\t\treturn `${call.calledFunctionName}() // Effect Hook`\n\t\tcase \"memo_hook\":\n\t\t\treturn `${call.calledFunctionName}() // Memo Hook`\n\t\tdefault:\n\t\t\treturn `${call.calledFunctionName}()`\n\t}\n}\n\n/**\n * \u5206\u6790 JSX \u8BED\u8A00\u7684\u51FD\u6570\u8C03\u7528\uFF0C\u5305\u62ECReact\u7279\u6709\u7684\u6A21\u5F0F\n */\nfunction analyzeJSXFunctionCalls(captures: Parser.QueryCapture[]): JSXFunctionCallAnalysisResult {\n\tconst functionCalls: JSXFunctionCallInfo[] = []\n\tconst scopeInfo = {\n\t\tmoduleName: undefined as string | undefined,\n\t\tcomponentName: undefined as string | undefined,\n\t\tfunctionName: \"unknown\",\n\t\tisAsync: false,\n\t\tisReactComponent: false,\n\t}\n\n\t// \u7528\u4E8E\u4E34\u65F6\u5B58\u50A8\u540C\u4E00\u884C\u7684\u65B9\u6CD5\u8C03\u7528\u4FE1\u606F\n\tconst callsByLine = new Map<\n\t\tnumber,\n\t\t{\n\t\t\tfunctionName?: string\n\t\t\treceiver?: string\n\t\t\tclassName?: string\n\t\t\tnamespace?: string\n\t\t\tcomponent?: string\n\t\t\tcontext?: string\n\t\t\tcallType?: JSXFunctionCallInfo[\"callType\"]\n\t\t\tisAsync?: boolean\n\t\t\tisOptional?: boolean\n\t\t\tisReactSpecific?: boolean\n\t\t}\n\t>()\n\n\t// \u7528\u4E8E\u8DDF\u8E2A\u5DF2\u5904\u7406\u7684\u51FD\u6570\u8C03\u7528\uFF0C\u907F\u514D\u91CD\u590D\n\tconst processedCalls = new Set<string>()\n\n\t// \u6309\u7167\u4F18\u5148\u7EA7\u5206\u7EC4\u5904\u7406\u6355\u83B7\n\tconst priorityGroups = {\n\t\thoc: [] as Parser.QueryCapture[],\n\t\treactCreate: [] as Parser.QueryCapture[],\n\t\treactHooks: [] as Parser.QueryCapture[],\n\t\teventHandlers: [] as Parser.QueryCapture[],\n\t\tawaitCalls: [] as Parser.QueryCapture[],\n\t\tarrayMethods: [] as Parser.QueryCapture[],\n\t\tpromiseMethods: [] as Parser.QueryCapture[],\n\t\tdirectCalls: [] as Parser.QueryCapture[],\n\t\tmethodCalls: [] as Parser.QueryCapture[],\n\t\tother: [] as Parser.QueryCapture[],\n\t}\n\n\t// \u5C06\u6355\u83B7\u5206\u7C7B\u5230\u4F18\u5148\u7EA7\u7EC4\n\tfor (const capture of captures) {\n\t\tswitch (capture.name) {\n\t\t\tcase \"hoc.call.name\":\n\t\t\tcase \"hoc.call.component\":\n\t\t\t\tpriorityGroups.hoc.push(capture)\n\t\t\t\tbreak\n\t\t\tcase \"react.create.namespace\":\n\t\t\tcase \"react.create.method\":\n\t\t\t\tpriorityGroups.reactCreate.push(capture)\n\t\t\t\tbreak\n\t\t\tcase \"state.hook.call\":\n\t\t\tcase \"effect.hook.call\":\n\t\t\tcase \"memo.hook.call\":\n\t\t\tcase \"ref.hook.call\":\n\t\t\tcase \"context.hook.call\":\n\t\t\tcase \"react.hook.call\":\n\t\t\t\tpriorityGroups.reactHooks.push(capture)\n\t\t\t\tbreak\n\t\t\tcase \"event.handler.function\":\n\t\t\t\tpriorityGroups.eventHandlers.push(capture)\n\t\t\t\tbreak\n\t\t\tcase \"await.call.function\":\n\t\t\tcase \"async.call.receiver\":\n\t\t\tcase \"async.call.method\":\n\t\t\t\tpriorityGroups.awaitCalls.push(capture)\n\t\t\t\tbreak\n\t\t\tcase \"array.call.method\":\n\t\t\tcase \"array.call.object\":\n\t\t\t\tpriorityGroups.arrayMethods.push(capture)\n\t\t\t\tbreak\n\t\t\tcase \"promise.call.method\":\n\t\t\tcase \"promise.call.object\":\n\t\t\t\tpriorityGroups.promiseMethods.push(capture)\n\t\t\t\tbreak\n\t\t\tcase \"function.call.direct\":\n\t\t\t\tpriorityGroups.directCalls.push(capture)\n\t\t\t\tbreak\n\t\t\tcase \"method.call.name\":\n\t\t\tcase \"method.call.receiver\":\n\t\t\tcase \"method.call.chain\":\n\t\t\tcase \"optional.call.receiver\":\n\t\t\tcase \"optional.call.method\":\n\t\t\tcase \"static.call.class\":\n\t\t\tcase \"static.call.method\":\n\t\t\t\tpriorityGroups.methodCalls.push(capture)\n\t\t\t\tbreak\n\t\t\tdefault:\n\t\t\t\tpriorityGroups.other.push(capture)\n\t\t\t\tbreak\n\t\t}\n\t}\n\n\t// \u6309\u4F18\u5148\u7EA7\u987A\u5E8F\u5904\u7406\u7EC4\n\tconst allGroups = [\n\t\tpriorityGroups.hoc,\n\t\tpriorityGroups.reactCreate,\n\t\tpriorityGroups.reactHooks,\n\t\tpriorityGroups.eventHandlers,\n\t\tpriorityGroups.awaitCalls,\n\t\tpriorityGroups.arrayMethods,\n\t\tpriorityGroups.promiseMethods,\n\t\tpriorityGroups.methodCalls,\n\t\tpriorityGroups.other,\n\t\tpriorityGroups.directCalls, // \u76F4\u63A5\u8C03\u7528\u653E\u6700\u540E\uFF0C\u4F18\u5148\u7EA7\u6700\u4F4E\n\t]\n\n\tfor (const group of allGroups) {\n\t\tfor (const capture of group) {\n\t\t\tconst node = capture.node\n\t\t\tconst captureText = node.text.trim()\n\t\t\tconst line = node.startPosition.row\n\t\t\tconst callKey = `${line}-${node.startPosition.column}-${captureText}-${capture.name}`\n\n\t\t\t// \u8DF3\u8FC7\u5DF2\u7ECF\u5904\u7406\u7684\u8C03\u7528 - \u7528\u66F4\u5177\u4F53\u7684key\u907F\u514D\u51B2\u7A81\n\t\t\tif (processedCalls.has(callKey)) {\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\t// \u5BF9\u4E8E\u76F4\u63A5\u51FD\u6570\u8C03\u7528\uFF0C\u68C0\u67E5\u662F\u5426\u5DF2\u7ECF\u88AB\u66F4\u9AD8\u4F18\u5148\u7EA7\u7684\u67E5\u8BE2\u5904\u7406\n\t\t\tif (capture.name === \"function.call.direct\") {\n\t\t\t\tconst generalCallKey = `${line}-${captureText}`\n\t\t\t\tlet isAlreadyProcessed = false\n\n\t\t\t\t// \u68C0\u67E5\u662F\u5426\u5DF2\u7ECF\u6709\u76F8\u540C\u7684\u51FD\u6570\u8C03\u7528\u88AB\u5904\u7406\n\t\t\t\tfor (const existingKey of processedCalls) {\n\t\t\t\t\tif (existingKey.includes(generalCallKey)) {\n\t\t\t\t\t\tisAlreadyProcessed = true\n\t\t\t\t\t\tbreak\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// \u68C0\u67E5\u662F\u5426\u5728callsByLine\u4E2D\u5DF2\u7ECF\u6709\u540C\u4E00\u884C\u7684\u540C\u540D\u51FD\u6570\n\t\t\t\tconst lineCall = callsByLine.get(line)\n\t\t\t\tif (lineCall?.functionName === captureText) {\n\t\t\t\t\tisAlreadyProcessed = true\n\t\t\t\t}\n\n\t\t\t\tif (isAlreadyProcessed) {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tswitch (capture.name) {\n\t\t\t\tcase \"hoc.call.name\":\n\t\t\t\t\t// \u9AD8\u9636\u7EC4\u4EF6\u8C03\u7528\u7684HOC\u540D\n\t\t\t\t\tif (!callsByLine.has(line)) {\n\t\t\t\t\t\tcallsByLine.set(line, {})\n\t\t\t\t\t}\n\t\t\t\t\tconst hocCall = callsByLine.get(line)!\n\t\t\t\t\thocCall.functionName = captureText\n\t\t\t\t\thocCall.callType = \"hoc\"\n\t\t\t\t\thocCall.isReactSpecific = true\n\t\t\t\t\tbreak\n\n\t\t\t\tcase \"hoc.call.component\":\n\t\t\t\t\t// \u9AD8\u9636\u7EC4\u4EF6\u8C03\u7528\u7684\u7EC4\u4EF6\u53C2\u6570\n\t\t\t\t\tif (!callsByLine.has(line)) {\n\t\t\t\t\t\tcallsByLine.set(line, {})\n\t\t\t\t\t}\n\t\t\t\t\tcallsByLine.get(line)!.component = captureText\n\t\t\t\t\tbreak\n\n\t\t\t\tcase \"react.create.method\":\n\t\t\t\t\t// React.createElement \u65B9\u6CD5\n\t\t\t\t\tif (!callsByLine.has(line)) {\n\t\t\t\t\t\tcallsByLine.set(line, {})\n\t\t\t\t\t}\n\t\t\t\t\tconst createCall = callsByLine.get(line)!\n\t\t\t\t\tcreateCall.functionName = captureText\n\t\t\t\t\tcreateCall.callType = \"react_create\"\n\t\t\t\t\tcreateCall.isReactSpecific = true\n\t\t\t\t\tbreak\n\n\t\t\t\tcase \"state.hook.call\":\n\t\t\t\t\t// State Hook \u8C03\u7528\n\t\t\t\t\tfunctionCalls.push({\n\t\t\t\t\t\tcalledFunctionName: captureText,\n\t\t\t\t\t\tcallType: \"state_hook\",\n\t\t\t\t\t\tline: line + 1,\n\t\t\t\t\t\tcolumn: node.startPosition.column,\n\t\t\t\t\t\tisReactSpecific: true,\n\t\t\t\t\t})\n\t\t\t\t\tprocessedCalls.add(callKey)\n\t\t\t\t\tbreak\n\n\t\t\t\tcase \"effect.hook.call\":\n\t\t\t\t\t// Effect Hook \u8C03\u7528\n\t\t\t\t\tfunctionCalls.push({\n\t\t\t\t\t\tcalledFunctionName: captureText,\n\t\t\t\t\t\tcallType: \"effect_hook\",\n\t\t\t\t\t\tline: line + 1,\n\t\t\t\t\t\tcolumn: node.startPosition.column,\n\t\t\t\t\t\tisReactSpecific: true,\n\t\t\t\t\t})\n\t\t\t\t\tprocessedCalls.add(callKey)\n\t\t\t\t\tbreak\n\n\t\t\t\tcase \"memo.hook.call\":\n\t\t\t\t\t// Memo Hook \u8C03\u7528\n\t\t\t\t\tfunctionCalls.push({\n\t\t\t\t\t\tcalledFunctionName: captureText,\n\t\t\t\t\t\tcallType: \"memo_hook\",\n\t\t\t\t\t\tline: line + 1,\n\t\t\t\t\t\tcolumn: node.startPosition.column,\n\t\t\t\t\t\tisReactSpecific: true,\n\t\t\t\t\t})\n\t\t\t\t\tprocessedCalls.add(callKey)\n\t\t\t\t\tbreak\n\n\t\t\t\tcase \"ref.hook.call\":\n\t\t\t\t\t// Ref Hook \u8C03\u7528\n\t\t\t\t\tfunctionCalls.push({\n\t\t\t\t\t\tcalledFunctionName: captureText,\n\t\t\t\t\t\tcallType: \"ref_hook\",\n\t\t\t\t\t\tline: line + 1,\n\t\t\t\t\t\tcolumn: node.startPosition.column,\n\t\t\t\t\t\tisReactSpecific: true,\n\t\t\t\t\t})\n\t\t\t\t\tprocessedCalls.add(callKey)\n\t\t\t\t\tbreak\n\n\t\t\t\tcase \"context.hook.call\":\n\t\t\t\t\t// Context Hook \u8C03\u7528\n\t\t\t\t\tfunctionCalls.push({\n\t\t\t\t\t\tcalledFunctionName: captureText,\n\t\t\t\t\t\tcallType: \"context_hook\",\n\t\t\t\t\t\tline: line + 1,\n\t\t\t\t\t\tcolumn: node.startPosition.column,\n\t\t\t\t\t\tisReactSpecific: true,\n\t\t\t\t\t})\n\t\t\t\t\tprocessedCalls.add(callKey)\n\t\t\t\t\tbreak\n\n\t\t\t\tcase \"react.hook.call\":\n\t\t\t\t\t// React Hook \u8C03\u7528\n\t\t\t\t\tfunctionCalls.push({\n\t\t\t\t\t\tcalledFunctionName: captureText,\n\t\t\t\t\t\tcallType: \"react_hook\",\n\t\t\t\t\t\tline: line + 1,\n\t\t\t\t\t\tcolumn: node.startPosition.column,\n\t\t\t\t\t\tisReactSpecific: true,\n\t\t\t\t\t})\n\t\t\t\t\tprocessedCalls.add(callKey)\n\t\t\t\t\tbreak\n\n\t\t\t\tcase \"event.handler.function\":\n\t\t\t\t\t// \u4E8B\u4EF6\u5904\u7406\u5668\u51FD\u6570\n\t\t\t\t\tfunctionCalls.push({\n\t\t\t\t\t\tcalledFunctionName: captureText,\n\t\t\t\t\t\tcallType: \"event_handler\",\n\t\t\t\t\t\tline: line + 1,\n\t\t\t\t\t\tcolumn: node.startPosition.column,\n\t\t\t\t\t\tisReactSpecific: true,\n\t\t\t\t\t})\n\t\t\t\t\tprocessedCalls.add(callKey)\n\t\t\t\t\tbreak\n\n\t\t\t\tcase \"await.call.function\":\n\t\t\t\t\t// await \u8868\u8FBE\u5F0F\u4E2D\u7684\u51FD\u6570\u8C03\u7528\n\t\t\t\t\tfunctionCalls.push({\n\t\t\t\t\t\tcalledFunctionName: captureText,\n\t\t\t\t\t\tcallType: \"async\",\n\t\t\t\t\t\tisAsync: true,\n\t\t\t\t\t\tline: line + 1,\n\t\t\t\t\t\tcolumn: node.startPosition.column,\n\t\t\t\t\t})\n\t\t\t\t\tprocessedCalls.add(callKey)\n\t\t\t\t\tbreak\n\n\t\t\t\tcase \"promise.call.method\":\n\t\t\t\t\t// Promise \u65B9\u6CD5\u8C03\u7528\n\t\t\t\t\tif (!callsByLine.has(line)) {\n\t\t\t\t\t\tcallsByLine.set(line, {})\n\t\t\t\t\t}\n\t\t\t\t\tconst promiseCall = callsByLine.get(line)!\n\t\t\t\t\tpromiseCall.functionName = captureText\n\t\t\t\t\tpromiseCall.callType = \"promise\"\n\t\t\t\t\tbreak\n\n\t\t\t\tcase \"promise.call.object\":\n\t\t\t\t\t// Promise \u65B9\u6CD5\u8C03\u7528\u7684\u5BF9\u8C61\n\t\t\t\t\tif (!callsByLine.has(line)) {\n\t\t\t\t\t\tcallsByLine.set(line, {})\n\t\t\t\t\t}\n\t\t\t\t\tcallsByLine.get(line)!.receiver = captureText\n\t\t\t\t\tbreak\n\n\t\t\t\tcase \"array.call.method\":\n\t\t\t\t\t// \u6570\u7EC4\u65B9\u6CD5\u8C03\u7528\n\t\t\t\t\tif (!callsByLine.has(line)) {\n\t\t\t\t\t\tcallsByLine.set(line, {})\n\t\t\t\t\t}\n\t\t\t\t\tconst arrayCall = callsByLine.get(line)!\n\t\t\t\t\tarrayCall.functionName = captureText\n\t\t\t\t\tarrayCall.callType = \"array\"\n\t\t\t\t\tbreak\n\n\t\t\t\tcase \"array.call.object\":\n\t\t\t\t\t// \u6570\u7EC4\u65B9\u6CD5\u8C03\u7528\u7684\u5BF9\u8C61\n\t\t\t\t\tif (!callsByLine.has(line)) {\n\t\t\t\t\t\tcallsByLine.set(line, {})\n\t\t\t\t\t}\n\t\t\t\t\tcallsByLine.get(line)!.receiver = captureText\n\t\t\t\t\tbreak\n\n\t\t\t\tcase \"async.call.receiver\":\n\t\t\t\t\t// \u5F02\u6B65\u65B9\u6CD5\u8C03\u7528\u7684\u63A5\u6536\u8005\n\t\t\t\t\tif (!callsByLine.has(line)) {\n\t\t\t\t\t\tcallsByLine.set(line, {})\n\t\t\t\t\t}\n\t\t\t\t\tconst asyncCall = callsByLine.get(line)!\n\t\t\t\t\tasyncCall.receiver = captureText\n\t\t\t\t\tasyncCall.isAsync = true\n\t\t\t\t\tbreak\n\n\t\t\t\tcase \"async.call.method\":\n\t\t\t\t\t// \u5F02\u6B65\u65B9\u6CD5\u8C03\u7528\u7684\u65B9\u6CD5\u540D\n\t\t\t\t\tif (!callsByLine.has(line)) {\n\t\t\t\t\t\tcallsByLine.set(line, {})\n\t\t\t\t\t}\n\t\t\t\t\tconst asyncMethodCall = callsByLine.get(line)!\n\t\t\t\t\tasyncMethodCall.functionName = captureText\n\t\t\t\t\tasyncMethodCall.callType = \"async\"\n\t\t\t\t\tbreak\n\n\t\t\t\tcase \"method.call.name\":\n\t\t\t\t\t// \u65B9\u6CD5\u8C03\u7528\u7684\u65B9\u6CD5\u540D\n\t\t\t\t\tif (!callsByLine.has(line)) {\n\t\t\t\t\t\tcallsByLine.set(line, {})\n\t\t\t\t\t}\n\t\t\t\t\tconst methodCall = callsByLine.get(line)!\n\t\t\t\t\t// \u53EA\u6709\u5F53\u6CA1\u6709\u66F4\u9AD8\u4F18\u5148\u7EA7\u7684callType\u65F6\u624D\u8BBE\u7F6E\u4E3Amethod\n\t\t\t\t\tif (!methodCall.callType) {\n\t\t\t\t\t\tmethodCall.functionName = captureText\n\t\t\t\t\t\tmethodCall.callType = \"method\"\n\t\t\t\t\t}\n\t\t\t\t\tbreak\n\n\t\t\t\tcase \"method.call.receiver\":\n\t\t\t\t\t// \u65B9\u6CD5\u8C03\u7528\u7684\u63A5\u6536\u8005\n\t\t\t\t\tif (!callsByLine.has(line)) {\n\t\t\t\t\t\tcallsByLine.set(line, {})\n\t\t\t\t\t}\n\t\t\t\t\tcallsByLine.get(line)!.receiver = captureText\n\t\t\t\t\tbreak\n\n\t\t\t\tcase \"static.call.class\":\n\t\t\t\t\t// \u9759\u6001\u65B9\u6CD5\u8C03\u7528\u7684\u7C7B\u540D\n\t\t\t\t\tif (!callsByLine.has(line)) {\n\t\t\t\t\t\tcallsByLine.set(line, {})\n\t\t\t\t\t}\n\t\t\t\t\tconst staticClassCall = callsByLine.get(line)!\n\t\t\t\t\t// \u53EA\u6709\u5F53\u6CA1\u6709\u66F4\u9AD8\u4F18\u5148\u7EA7\u7684callType\u65F6\u624D\u8BBE\u7F6E\u4E3Astatic\n\t\t\t\t\tif (!staticClassCall.callType || staticClassCall.callType === \"method\") {\n\t\t\t\t\t\tstaticClassCall.className = captureText\n\t\t\t\t\t\tstaticClassCall.callType = \"static\"\n\t\t\t\t\t}\n\t\t\t\t\tbreak\n\n\t\t\t\tcase \"static.call.method\":\n\t\t\t\t\t// \u9759\u6001\u65B9\u6CD5\u8C03\u7528\u7684\u65B9\u6CD5\u540D\n\t\t\t\t\tif (!callsByLine.has(line)) {\n\t\t\t\t\t\tcallsByLine.set(line, {})\n\t\t\t\t\t}\n\t\t\t\t\tconst staticMethodCall = callsByLine.get(line)!\n\t\t\t\t\t// \u53EA\u6709\u5F53\u6CA1\u6709\u66F4\u9AD8\u4F18\u5148\u7EA7\u7684callType\u65F6\u624D\u8BBE\u7F6E\u4E3Astatic\n\t\t\t\t\tif (!staticMethodCall.callType || staticMethodCall.callType === \"method\") {\n\t\t\t\t\t\tstaticMethodCall.functionName = captureText\n\t\t\t\t\t\tstaticMethodCall.callType = \"static\"\n\t\t\t\t\t}\n\t\t\t\t\tbreak\n\n\t\t\t\tcase \"optional.call.receiver\":\n\t\t\t\t\t// \u53EF\u9009\u94FE\u8C03\u7528\u7684\u63A5\u6536\u8005\n\t\t\t\t\tif (!callsByLine.has(line)) {\n\t\t\t\t\t\tcallsByLine.set(line, {})\n\t\t\t\t\t}\n\t\t\t\t\tconst optionalCall = callsByLine.get(line)!\n\t\t\t\t\toptionalCall.receiver = captureText\n\t\t\t\t\toptionalCall.isOptional = true\n\t\t\t\t\tbreak\n\n\t\t\t\tcase \"optional.call.method\":\n\t\t\t\t\t// \u53EF\u9009\u94FE\u8C03\u7528\u7684\u65B9\u6CD5\u540D - \u53EA\u5728\u5B9E\u9645\u68C0\u6D4B\u5230\u53EF\u9009\u94FE\u65F6\u4F7F\u7528\n\t\t\t\t\tif (!callsByLine.has(line)) {\n\t\t\t\t\t\tcallsByLine.set(line, {})\n\t\t\t\t\t}\n\t\t\t\t\tconst optionalMethodCall = callsByLine.get(line)!\n\t\t\t\t\t// \u6682\u65F6\u7981\u7528\u53EF\u9009\u94FE\u68C0\u6D4B\uFF0C\u56E0\u4E3A\u5B83\u4E0E\u666E\u901A\u65B9\u6CD5\u8C03\u7528\u51B2\u7A81\n\t\t\t\t\t// TODO: \u9700\u8981\u66F4\u7CBE\u786E\u7684\u53EF\u9009\u94FE\u68C0\u6D4B\u903B\u8F91\n\t\t\t\t\t// if (!optionalMethodCall.callType || optionalMethodCall.callType === \"method\") {\n\t\t\t\t\t// optionalMethodCall.functionName = captureText\n\t\t\t\t\t// optionalMethodCall.callType = \"optional\"\n\t\t\t\t\t// }\n\t\t\t\t\tbreak\n\n\t\t\t\tcase \"function.call.direct\":\n\t\t\t\t\t// \u76F4\u63A5\u51FD\u6570\u8C03\u7528 - \u53EA\u6709\u5728\u6CA1\u6709\u88AB\u66F4\u9AD8\u4F18\u5148\u7EA7\u5904\u7406\u65F6\u624D\u5904\u7406\n\t\t\t\t\tfunctionCalls.push({\n\t\t\t\t\t\tcalledFunctionName: captureText,\n\t\t\t\t\t\tcallType: \"direct\",\n\t\t\t\t\t\tline: line + 1,\n\t\t\t\t\t\tcolumn: node.startPosition.column,\n\t\t\t\t\t})\n\t\t\t\t\tprocessedCalls.add(callKey)\n\t\t\t\t\tbreak\n\n\t\t\t\tcase \"method.call.chain\":\n\t\t\t\t\t// \u94FE\u5F0F\u65B9\u6CD5\u8C03\u7528 - \u68C0\u67E5\u662F\u5426\u662Fpromise\u65B9\u6CD5\n\t\t\t\t\tif (!callsByLine.has(line)) {\n\t\t\t\t\t\tcallsByLine.set(line, {})\n\t\t\t\t\t}\n\t\t\t\t\tconst chainCall = callsByLine.get(line)!\n\t\t\t\t\t// \u68C0\u67E5\u662F\u5426\u662Fpromise\u65B9\u6CD5\n\t\t\t\t\tif (captureText.match(/^(then|catch|finally)$/)) {\n\t\t\t\t\t\tchainCall.functionName = captureText\n\t\t\t\t\t\tchainCall.callType = \"promise\"\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// \u53EA\u6709\u5F53\u6CA1\u6709\u66F4\u9AD8\u4F18\u5148\u7EA7\u7684callType\u65F6\u624D\u8BBE\u7F6E\u4E3Achain\n\t\t\t\t\t\tif (!chainCall.callType) {\n\t\t\t\t\t\t\tchainCall.functionName = captureText\n\t\t\t\t\t\t\tchainCall.callType = \"chain\"\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tbreak\n\n\t\t\t\t// \u5176\u4ED6\u60C5\u51B5\u5904\u7406...\n\t\t\t\tdefault:\n\t\t\t\t\t// \u5904\u7406\u5176\u4ED6\u7C7B\u578B\u7684\u6355\u83B7\n\t\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}\n\n\t// \u5904\u7406\u6309\u884C\u5206\u7EC4\u7684\u590D\u5408\u8C03\u7528\n\tfor (const [line, callInfo] of callsByLine) {\n\t\tif (callInfo.functionName) {\n\t\t\tconst callKey = `${line}-0-${callInfo.functionName}-compound`\n\t\t\tif (!processedCalls.has(callKey)) {\n\t\t\t\tfunctionCalls.push({\n\t\t\t\t\tcalledFunctionName: callInfo.functionName,\n\t\t\t\t\tcallType: callInfo.callType || \"method\",\n\t\t\t\t\treceiver: callInfo.receiver,\n\t\t\t\t\tclassName: callInfo.className,\n\t\t\t\t\tnamespace: callInfo.namespace,\n\t\t\t\t\tcomponent: callInfo.component,\n\t\t\t\t\tcontext: callInfo.context,\n\t\t\t\t\tline: line + 1,\n\t\t\t\t\tcolumn: 0,\n\t\t\t\t\tisAsync: callInfo.isAsync,\n\t\t\t\t\tisOptional: callInfo.isOptional,\n\t\t\t\t\tisReactSpecific: callInfo.isReactSpecific,\n\t\t\t\t})\n\t\t\t\tprocessedCalls.add(callKey)\n\t\t\t}\n\t\t}\n\t}\n\n\treturn {\n\t\tfunctionCalls,\n\t\tscopeInfo,\n\t}\n}\n", "import Parser from \"web-tree-sitter\"\nimport { CodeLanguageType, ISnippetMeta, SnippetType } from \"../types\"\n\nexport interface TSXFunctionCallInfo {\n\tcalledFunctionName: string\n\tcallType:\n\t\t| \"direct\"\n\t\t| \"method\"\n\t\t| \"static\"\n\t\t| \"namespace\"\n\t\t| \"constructor\"\n\t\t| \"chain\"\n\t\t| \"this\"\n\t\t| \"super\"\n\t\t| \"arrow\"\n\t\t| \"async\"\n\t\t| \"array\"\n\t\t| \"promise\"\n\t\t| \"optional\"\n\t\t| \"template\"\n\t\t| \"nested\"\n\t\t| \"react_hook\"\n\t\t| \"react_component\"\n\t\t| \"tsx_component\"\n\t\t| \"event_handler\"\n\t\t| \"react_create\"\n\t\t| \"hoc\"\n\t\t| \"context_hook\"\n\t\t| \"ref_hook\"\n\t\t| \"state_hook\"\n\t\t| \"effect_hook\"\n\t\t| \"memo_hook\"\n\t\t| \"generic_call\"\n\t\t| \"generic_method\"\n\t\t| \"type_assertion\"\n\t\t| \"devtools\"\n\treceiver?: string // \u5BF9\u4E8E\u65B9\u6CD5\u8C03\u7528\uFF0C\u63A5\u6536\u8005\u7684\u540D\u79F0\n\tclassName?: string // \u5BF9\u4E8E\u9759\u6001\u65B9\u6CD5\u8C03\u7528\uFF0C\u7C7B\u7684\u540D\u79F0\n\tnamespace?: string // \u5BF9\u4E8E\u547D\u540D\u7A7A\u95F4\u8C03\u7528\uFF0C\u547D\u540D\u7A7A\u95F4\u7684\u540D\u79F0\n\tcomponent?: string // \u5BF9\u4E8EReact\u7EC4\u4EF6\u8C03\u7528\uFF0C\u7EC4\u4EF6\u7684\u540D\u79F0\n\tcontext?: string // \u5BF9\u4E8EContext hooks\uFF0Ccontext\u7684\u540D\u79F0\n\ttypeArgument?: string // \u5BF9\u4E8E\u6CDB\u578B\u8C03\u7528\uFF0C\u7C7B\u578B\u53C2\u6570\n\tline: number\n\tcolumn: number\n\tisAsync?: boolean // \u662F\u5426\u662F\u5F02\u6B65\u8C03\u7528\n\tisOptional?: boolean // \u662F\u5426\u662F\u53EF\u9009\u94FE\u8C03\u7528\n\tisReactSpecific?: boolean // \u662F\u5426\u662FReact\u7279\u5B9A\u7684\u8C03\u7528\n\tisGeneric?: boolean // \u662F\u5426\u662F\u6CDB\u578B\u8C03\u7528\n}\n\nexport interface TSXFunctionCallAnalysisResult {\n\tfunctionCalls: TSXFunctionCallInfo[]\n\tscopeInfo: {\n\t\tmoduleName?: string\n\t\tcomponentName?: string // \u5982\u679C\u51FD\u6570\u662F\u67D0\u4E2AReact\u7EC4\u4EF6\u7684\u4E00\u90E8\u5206\n\t\tfunctionName: string\n\t\tisAsync?: boolean\n\t\tisReactComponent?: boolean // \u662F\u5426\u662FReact\u7EC4\u4EF6\n\t\tisTypeScript?: boolean // \u662F\u5426\u662FTypeScript\u7279\u6027\n\t}\n}\n\nexport function dependenciesCapturesProcessForTSX(captures: Parser.QueryCapture[]): ISnippetMeta[] {\n\tconst result = analyzeTSXFunctionCalls(captures)\n\treturn result.functionCalls.map((call) => {\n\t\tconst def: any = {\n\t\t\tname: call.calledFunctionName,\n\t\t\ttype: call.callType,\n\t\t\tisAsync: call.isAsync,\n\t\t}\n\t\tif (call.isGeneric) def.isGeneric = true\n\t\tif (call.isReactSpecific) def.isReactSpecific = true\n\t\treturn {\n\t\t\tname: call.calledFunctionName,\n\t\t\ttype: SnippetType.FunctionOrMethod,\n\t\t\tfilePath: \"\",\n\t\t\tstartLine: call.line,\n\t\t\tendLine: call.line,\n\t\t\tstartPosition: {\n\t\t\t\trow: call.line,\n\t\t\t\tcolumn: call.column,\n\t\t\t},\n\t\t\tendPosition: {\n\t\t\t\trow: call.line,\n\t\t\t\tcolumn: call.column,\n\t\t\t},\n\t\t\trangeText: \"\",\n\t\t\tfileHash: \"\",\n\t\t\tdefinition: def,\n\t\t\tfield: call.className || call.namespace || call.component || call.context || call.typeArgument,\n\t\t\tsignature: buildSignatureForTSXCall(call),\n\t\t\tlanguage: CodeLanguageType.TSX,\n\t\t}\n\t})\n}\n\n/**\n * \u4E3ATSX\u51FD\u6570\u8C03\u7528\u6784\u5EFA\u7B7E\u540D\n */\nfunction buildSignatureForTSXCall(call: TSXFunctionCallInfo): string {\n\tswitch (call.callType) {\n\t\tcase \"react_hook\":\n\t\t\treturn `${call.calledFunctionName}() // React Hook`\n\t\tcase \"react_component\":\n\t\t\treturn `${call.calledFunctionName}() // React Component`\n\t\tcase \"tsx_component\":\n\t\t\treturn `${call.calledFunctionName}() // TSX Component`\n\t\tcase \"event_handler\":\n\t\t\treturn `${call.calledFunctionName}() // Event Handler`\n\t\tcase \"react_create\":\n\t\t\treturn `React.createElement(${call.component}) // React.createElement`\n\t\tcase \"hoc\":\n\t\t\treturn `${call.calledFunctionName}(${call.component}) // Higher-Order Component`\n\t\tcase \"context_hook\":\n\t\t\treturn `useContext(${call.context}) // Context Hook`\n\t\tcase \"ref_hook\":\n\t\t\treturn `${call.calledFunctionName}() // Ref Hook`\n\t\tcase \"state_hook\":\n\t\t\treturn `${call.calledFunctionName}() // State Hook`\n\t\tcase \"effect_hook\":\n\t\t\treturn `${call.calledFunctionName}() // Effect Hook`\n\t\tcase \"memo_hook\":\n\t\t\treturn `${call.calledFunctionName}() // Memo Hook`\n\t\tcase \"generic_call\":\n\t\t\treturn `${call.calledFunctionName}<${call.typeArgument}>() // Generic Function`\n\t\tcase \"generic_method\":\n\t\t\treturn `${call.receiver}.${call.calledFunctionName}<${call.typeArgument}>() // Generic Method`\n\t\tcase \"type_assertion\":\n\t\t\treturn `as ${call.typeArgument} // Type Assertion`\n\t\tdefault:\n\t\t\treturn `${call.calledFunctionName}()`\n\t}\n}\n\n/**\n * \u5206\u6790 TSX \u8BED\u8A00\u7684\u51FD\u6570\u8C03\u7528\uFF0C\u5305\u62ECReact\u548CTypeScript\u7279\u6709\u7684\u6A21\u5F0F\n */\nfunction analyzeTSXFunctionCalls(captures: Parser.QueryCapture[]): TSXFunctionCallAnalysisResult {\n\tconst functionCalls: TSXFunctionCallInfo[] = []\n\tconst scopeInfo = {\n\t\tmoduleName: undefined as string | undefined,\n\t\tcomponentName: undefined as string | undefined,\n\t\tfunctionName: \"unknown\",\n\t\tisAsync: false,\n\t\tisReactComponent: false,\n\t\tisTypeScript: true,\n\t}\n\n\t// \u7528\u4E8E\u4E34\u65F6\u5B58\u50A8\u540C\u4E00\u884C\u7684\u65B9\u6CD5\u8C03\u7528\u4FE1\u606F\n\tconst callsByLine = new Map<\n\t\tnumber,\n\t\t{\n\t\t\tfunctionName?: string\n\t\t\treceiver?: string\n\t\t\tclassName?: string\n\t\t\tnamespace?: string\n\t\t\tcomponent?: string\n\t\t\tcontext?: string\n\t\t\ttypeArgument?: string\n\t\t\tcallType?: TSXFunctionCallInfo[\"callType\"]\n\t\t\tisAsync?: boolean\n\t\t\tisOptional?: boolean\n\t\t\tisReactSpecific?: boolean\n\t\t\tisGeneric?: boolean\n\t\t}\n\t>()\n\n\t// \u7528\u4E8E\u8DDF\u8E2A\u5DF2\u5904\u7406\u7684\u51FD\u6570\u8C03\u7528\uFF0C\u907F\u514D\u91CD\u590D\n\tconst processedCalls = new Set<string>()\n\n\t// \u6309\u7167\u4F18\u5148\u7EA7\u5206\u7EC4\u5904\u7406\u6355\u83B7\n\tconst priorityGroups = {\n\t\thoc: [] as Parser.QueryCapture[],\n\t\treactCreate: [] as Parser.QueryCapture[],\n\t\treactHooks: [] as Parser.QueryCapture[],\n\t\teventHandlers: [] as Parser.QueryCapture[],\n\t\tgenericCalls: [] as Parser.QueryCapture[],\n\t\ttypeAssertions: [] as Parser.QueryCapture[],\n\t\tawaitCalls: [] as Parser.QueryCapture[],\n\t\tarrayMethods: [] as Parser.QueryCapture[],\n\t\tpromiseMethods: [] as Parser.QueryCapture[],\n\t\tdirectCalls: [] as Parser.QueryCapture[],\n\t\tmethodCalls: [] as Parser.QueryCapture[],\n\t\tother: [] as Parser.QueryCapture[],\n\t}\n\n\t// \u5C06\u6355\u83B7\u5206\u7C7B\u5230\u4F18\u5148\u7EA7\u7EC4\n\tfor (const capture of captures) {\n\t\tswitch (capture.name) {\n\t\t\tcase \"hoc.call.name\":\n\t\t\tcase \"hoc.call.component\":\n\t\t\t\tpriorityGroups.hoc.push(capture)\n\t\t\t\tbreak\n\t\t\tcase \"react.create.namespace\":\n\t\t\tcase \"react.create.method\":\n\t\t\t\tpriorityGroups.reactCreate.push(capture)\n\t\t\t\tbreak\n\t\t\tcase \"state.hook.call\":\n\t\t\tcase \"effect.hook.call\":\n\t\t\tcase \"memo.hook.call\":\n\t\t\tcase \"ref.hook.call\":\n\t\t\tcase \"context.hook.call\":\n\t\t\tcase \"react.hook.call\":\n\t\t\t\tpriorityGroups.reactHooks.push(capture)\n\t\t\t\tbreak\n\t\t\tcase \"event.handler.function\":\n\t\t\t\tpriorityGroups.eventHandlers.push(capture)\n\t\t\t\tbreak\n\t\t\tcase \"generic.call.function\":\n\t\t\tcase \"generic.call.receiver\":\n\t\t\tcase \"generic.call.method\":\n\t\t\tcase \"generic.constructor.call.name\":\n\t\t\t\tpriorityGroups.genericCalls.push(capture)\n\t\t\t\tbreak\n\t\t\tcase \"type.assertion.type\":\n\t\t\t\tpriorityGroups.typeAssertions.push(capture)\n\t\t\t\tbreak\n\t\t\tcase \"await.call.function\":\n\t\t\tcase \"async.call.receiver\":\n\t\t\tcase \"async.call.method\":\n\t\t\t\tpriorityGroups.awaitCalls.push(capture)\n\t\t\t\tbreak\n\t\t\tcase \"array.call.method\":\n\t\t\tcase \"array.call.object\":\n\t\t\t\tpriorityGroups.arrayMethods.push(capture)\n\t\t\t\tbreak\n\t\t\tcase \"promise.call.method\":\n\t\t\tcase \"promise.call.object\":\n\t\t\t\tpriorityGroups.promiseMethods.push(capture)\n\t\t\t\tbreak\n\t\t\tcase \"function.call.direct\":\n\t\t\t\tpriorityGroups.directCalls.push(capture)\n\t\t\t\tbreak\n\t\t\tcase \"method.call.name\":\n\t\t\tcase \"method.call.receiver\":\n\t\t\tcase \"method.call.chain\":\n\t\t\tcase \"optional.call.receiver\":\n\t\t\tcase \"optional.call.method\":\n\t\t\tcase \"static.call.class\":\n\t\t\tcase \"static.call.method\":\n\t\t\t\tpriorityGroups.methodCalls.push(capture)\n\t\t\t\tbreak\n\t\t\tdefault:\n\t\t\t\tpriorityGroups.other.push(capture)\n\t\t\t\tbreak\n\t\t}\n\t}\n\n\t// \u6309\u4F18\u5148\u7EA7\u987A\u5E8F\u5904\u7406\u7EC4\n\tconst allGroups = [\n\t\tpriorityGroups.hoc,\n\t\tpriorityGroups.reactCreate,\n\t\tpriorityGroups.reactHooks,\n\t\tpriorityGroups.eventHandlers,\n\t\tpriorityGroups.genericCalls,\n\t\tpriorityGroups.typeAssertions,\n\t\tpriorityGroups.awaitCalls,\n\t\tpriorityGroups.arrayMethods,\n\t\tpriorityGroups.promiseMethods,\n\t\tpriorityGroups.methodCalls,\n\t\tpriorityGroups.other,\n\t\tpriorityGroups.directCalls, // \u76F4\u63A5\u8C03\u7528\u653E\u6700\u540E\uFF0C\u4F18\u5148\u7EA7\u6700\u4F4E\n\t]\n\n\tfor (const group of allGroups) {\n\t\tfor (const capture of group) {\n\t\t\tconst node = capture.node\n\t\t\tconst captureText = node.text.trim()\n\t\t\tconst line = node.startPosition.row\n\t\t\tconst callKey = `${line}-${node.startPosition.column}-${captureText}-${capture.name}`\n\n\t\t\t// \u8DF3\u8FC7\u5DF2\u7ECF\u5904\u7406\u7684\u8C03\u7528 - \u7528\u66F4\u5177\u4F53\u7684key\u907F\u514D\u51B2\u7A81\n\t\t\tif (processedCalls.has(callKey)) {\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\t// \u5BF9\u4E8E\u76F4\u63A5\u51FD\u6570\u8C03\u7528\uFF0C\u68C0\u67E5\u662F\u5426\u5DF2\u7ECF\u88AB\u66F4\u9AD8\u4F18\u5148\u7EA7\u7684\u67E5\u8BE2\u5904\u7406\n\t\t\tif (capture.name === \"function.call.direct\") {\n\t\t\t\tconst generalCallKey = `${line}-${captureText}`\n\t\t\t\tlet isAlreadyProcessed = false\n\n\t\t\t\t// \u68C0\u67E5\u662F\u5426\u5DF2\u7ECF\u6709\u76F8\u540C\u7684\u51FD\u6570\u8C03\u7528\u88AB\u5904\u7406\n\t\t\t\tfor (const existingKey of processedCalls) {\n\t\t\t\t\tif (existingKey.includes(generalCallKey)) {\n\t\t\t\t\t\tisAlreadyProcessed = true\n\t\t\t\t\t\tbreak\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// \u68C0\u67E5\u662F\u5426\u5728callsByLine\u4E2D\u5DF2\u7ECF\u6709\u540C\u4E00\u884C\u7684\u540C\u540D\u51FD\u6570\n\t\t\t\tconst lineCall = callsByLine.get(line)\n\t\t\t\tif (lineCall?.functionName === captureText) {\n\t\t\t\t\tisAlreadyProcessed = true\n\t\t\t\t}\n\n\t\t\t\tif (isAlreadyProcessed) {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tswitch (capture.name) {\n\t\t\t\tcase \"hoc.call.name\":\n\t\t\t\t\t// \u9AD8\u9636\u7EC4\u4EF6\u8C03\u7528\u7684HOC\u540D\n\t\t\t\t\tif (!callsByLine.has(line)) {\n\t\t\t\t\t\tcallsByLine.set(line, {})\n\t\t\t\t\t}\n\t\t\t\t\tconst hocCall = callsByLine.get(line)!\n\t\t\t\t\thocCall.functionName = captureText\n\t\t\t\t\thocCall.callType = \"hoc\"\n\t\t\t\t\thocCall.isReactSpecific = true\n\t\t\t\t\tbreak\n\n\t\t\t\tcase \"hoc.call.component\":\n\t\t\t\t\t// \u9AD8\u9636\u7EC4\u4EF6\u8C03\u7528\u7684\u7EC4\u4EF6\u53C2\u6570\n\t\t\t\t\tif (!callsByLine.has(line)) {\n\t\t\t\t\t\tcallsByLine.set(line, {})\n\t\t\t\t\t}\n\t\t\t\t\tcallsByLine.get(line)!.component = captureText\n\t\t\t\t\tbreak\n\n\t\t\t\tcase \"react.create.method\":\n\t\t\t\t\t// React.createElement \u65B9\u6CD5\n\t\t\t\t\tif (!callsByLine.has(line)) {\n\t\t\t\t\t\tcallsByLine.set(line, {})\n\t\t\t\t\t}\n\t\t\t\t\tconst createCall = callsByLine.get(line)!\n\t\t\t\t\tcreateCall.functionName = captureText\n\t\t\t\t\tcreateCall.callType = \"react_create\"\n\t\t\t\t\tcreateCall.isReactSpecific = true\n\t\t\t\t\tbreak\n\n\t\t\t\tcase \"state.hook.call\":\n\t\t\t\t\t// State Hook \u8C03\u7528\n\t\t\t\t\tfunctionCalls.push({\n\t\t\t\t\t\tcalledFunctionName: captureText,\n\t\t\t\t\t\tcallType: \"state_hook\",\n\t\t\t\t\t\tline: line + 1,\n\t\t\t\t\t\tcolumn: node.startPosition.column,\n\t\t\t\t\t\tisReactSpecific: true,\n\t\t\t\t\t})\n\t\t\t\t\tprocessedCalls.add(callKey)\n\t\t\t\t\tbreak\n\n\t\t\t\tcase \"effect.hook.call\":\n\t\t\t\t\t// Effect Hook \u8C03\u7528\n\t\t\t\t\tfunctionCalls.push({\n\t\t\t\t\t\tcalledFunctionName: captureText,\n\t\t\t\t\t\tcallType: \"effect_hook\",\n\t\t\t\t\t\tline: line + 1,\n\t\t\t\t\t\tcolumn: node.startPosition.column,\n\t\t\t\t\t\tisReactSpecific: true,\n\t\t\t\t\t})\n\t\t\t\t\tprocessedCalls.add(callKey)\n\t\t\t\t\tbreak\n\n\t\t\t\tcase \"memo.hook.call\":\n\t\t\t\t\t// Memo Hook \u8C03\u7528\n\t\t\t\t\tfunctionCalls.push({\n\t\t\t\t\t\tcalledFunctionName: captureText,\n\t\t\t\t\t\tcallType: \"memo_hook\",\n\t\t\t\t\t\tline: line + 1,\n\t\t\t\t\t\tcolumn: node.startPosition.column,\n\t\t\t\t\t\tisReactSpecific: true,\n\t\t\t\t\t})\n\t\t\t\t\tprocessedCalls.add(callKey)\n\t\t\t\t\tbreak\n\n\t\t\t\tcase \"ref.hook.call\":\n\t\t\t\t\t// Ref Hook \u8C03\u7528\n\t\t\t\t\tfunctionCalls.push({\n\t\t\t\t\t\tcalledFunctionName: captureText,\n\t\t\t\t\t\tcallType: \"ref_hook\",\n\t\t\t\t\t\tline: line + 1,\n\t\t\t\t\t\tcolumn: node.startPosition.column,\n\t\t\t\t\t\tisReactSpecific: true,\n\t\t\t\t\t})\n\t\t\t\t\tprocessedCalls.add(callKey)\n\t\t\t\t\tbreak\n\n\t\t\t\tcase \"context.hook.call\":\n\t\t\t\t\t// Context Hook \u8C03\u7528\n\t\t\t\t\tfunctionCalls.push({\n\t\t\t\t\t\tcalledFunctionName: captureText,\n\t\t\t\t\t\tcallType: \"context_hook\",\n\t\t\t\t\t\tline: line + 1,\n\t\t\t\t\t\tcolumn: node.startPosition.column,\n\t\t\t\t\t\tisReactSpecific: true,\n\t\t\t\t\t})\n\t\t\t\t\tprocessedCalls.add(callKey)\n\t\t\t\t\tbreak\n\n\t\t\t\tcase \"react.hook.call\":\n\t\t\t\t\t// React Hook \u8C03\u7528\n\t\t\t\t\tfunctionCalls.push({\n\t\t\t\t\t\tcalledFunctionName: captureText,\n\t\t\t\t\t\tcallType: \"react_hook\",\n\t\t\t\t\t\tline: line + 1,\n\t\t\t\t\t\tcolumn: node.startPosition.column,\n\t\t\t\t\t\tisReactSpecific: true,\n\t\t\t\t\t})\n\t\t\t\t\tprocessedCalls.add(callKey)\n\t\t\t\t\tbreak\n\n\t\t\t\tcase \"event.handler.function\":\n\t\t\t\t\t// \u4E8B\u4EF6\u5904\u7406\u5668\u51FD\u6570\n\t\t\t\t\tconsole.log(\n\t\t\t\t\t\t`[DEBUG] Event handler captured: ${captureText} at line ${line + 1}, column ${node.startPosition.column}`,\n\t\t\t\t\t)\n\t\t\t\t\tfunctionCalls.push({\n\t\t\t\t\t\tcalledFunctionName: captureText,\n\t\t\t\t\t\tcallType: \"event_handler\",\n\t\t\t\t\t\tline: line + 1,\n\t\t\t\t\t\tcolumn: node.startPosition.column,\n\t\t\t\t\t\tisReactSpecific: true,\n\t\t\t\t\t})\n\t\t\t\t\tprocessedCalls.add(callKey)\n\t\t\t\t\tbreak\n\n\t\t\t\tcase \"generic.call.function\":\n\t\t\t\t\t// \u6CDB\u578B\u51FD\u6570\u8C03\u7528\n\t\t\t\t\tif (!callsByLine.has(line)) {\n\t\t\t\t\t\tcallsByLine.set(line, {})\n\t\t\t\t\t}\n\t\t\t\t\tconst genericCall = callsByLine.get(line)!\n\t\t\t\t\tgenericCall.functionName = captureText\n\t\t\t\t\tgenericCall.callType = \"generic_call\"\n\t\t\t\t\tgenericCall.isGeneric = true\n\t\t\t\t\tbreak\n\n\t\t\t\tcase \"generic.call.receiver\":\n\t\t\t\t\t// \u6CDB\u578B\u65B9\u6CD5\u8C03\u7528\u7684\u63A5\u6536\u8005\n\t\t\t\t\tif (!callsByLine.has(line)) {\n\t\t\t\t\t\tcallsByLine.set(line, {})\n\t\t\t\t\t}\n\t\t\t\t\tcallsByLine.get(line)!.receiver = captureText\n\t\t\t\t\tbreak\n\n\t\t\t\tcase \"generic.call.method\":\n\t\t\t\t\t// \u6CDB\u578B\u65B9\u6CD5\u8C03\u7528\u7684\u65B9\u6CD5\u540D\n\t\t\t\t\tif (!callsByLine.has(line)) {\n\t\t\t\t\t\tcallsByLine.set(line, {})\n\t\t\t\t\t}\n\t\t\t\t\tconst genericMethodCall = callsByLine.get(line)!\n\t\t\t\t\tgenericMethodCall.functionName = captureText\n\t\t\t\t\tgenericMethodCall.callType = \"generic_method\"\n\t\t\t\t\tgenericMethodCall.isGeneric = true\n\t\t\t\t\tbreak\n\n\t\t\t\tcase \"generic.constructor.call.name\":\n\t\t\t\t\t// \u6CDB\u578B\u6784\u9020\u51FD\u6570\u8C03\u7528\n\t\t\t\t\tif (!callsByLine.has(line)) {\n\t\t\t\t\t\tcallsByLine.set(line, {})\n\t\t\t\t\t}\n\t\t\t\t\tconst genericConstructorCall = callsByLine.get(line)!\n\t\t\t\t\tgenericConstructorCall.functionName = captureText\n\t\t\t\t\tgenericConstructorCall.callType = \"constructor\"\n\t\t\t\t\tgenericConstructorCall.isGeneric = true\n\t\t\t\t\tbreak\n\n\t\t\t\tcase \"type.assertion.type\":\n\t\t\t\t\t// \u7C7B\u578B\u65AD\u8A00\n\t\t\t\t\tfunctionCalls.push({\n\t\t\t\t\t\tcalledFunctionName: \"as\",\n\t\t\t\t\t\tcallType: \"type_assertion\",\n\t\t\t\t\t\ttypeArgument: captureText,\n\t\t\t\t\t\tline: line + 1,\n\t\t\t\t\t\tcolumn: node.startPosition.column,\n\t\t\t\t\t})\n\t\t\t\t\tprocessedCalls.add(callKey)\n\t\t\t\t\tbreak\n\n\t\t\t\tcase \"await.call.function\":\n\t\t\t\t\t// await \u8868\u8FBE\u5F0F\u4E2D\u7684\u51FD\u6570\u8C03\u7528\n\t\t\t\t\tfunctionCalls.push({\n\t\t\t\t\t\tcalledFunctionName: captureText,\n\t\t\t\t\t\tcallType: \"async\",\n\t\t\t\t\t\tisAsync: true,\n\t\t\t\t\t\tline: line + 1,\n\t\t\t\t\t\tcolumn: node.startPosition.column,\n\t\t\t\t\t})\n\t\t\t\t\tprocessedCalls.add(callKey)\n\t\t\t\t\tbreak\n\n\t\t\t\tcase \"promise.call.method\":\n\t\t\t\t\t// Promise \u65B9\u6CD5\u8C03\u7528\n\t\t\t\t\tconsole.log(\n\t\t\t\t\t\t`[DEBUG] Promise method captured: ${captureText} at line ${line + 1}, column ${node.startPosition.column}`,\n\t\t\t\t\t)\n\t\t\t\t\tif (!callsByLine.has(line)) {\n\t\t\t\t\t\tcallsByLine.set(line, {})\n\t\t\t\t\t}\n\t\t\t\t\tconst promiseCall = callsByLine.get(line)!\n\t\t\t\t\tpromiseCall.functionName = captureText\n\t\t\t\t\tpromiseCall.callType = \"promise\"\n\t\t\t\t\tbreak\n\n\t\t\t\tcase \"promise.call.object\":\n\t\t\t\t\t// Promise \u65B9\u6CD5\u8C03\u7528\u7684\u5BF9\u8C61\n\t\t\t\t\tif (!callsByLine.has(line)) {\n\t\t\t\t\t\tcallsByLine.set(line, {})\n\t\t\t\t\t}\n\t\t\t\t\tcallsByLine.get(line)!.receiver = captureText\n\t\t\t\t\tbreak\n\n\t\t\t\tcase \"array.call.method\":\n\t\t\t\t\t// \u6570\u7EC4\u65B9\u6CD5\u8C03\u7528\n\t\t\t\t\tif (!callsByLine.has(line)) {\n\t\t\t\t\t\tcallsByLine.set(line, {})\n\t\t\t\t\t}\n\t\t\t\t\tconst arrayCall = callsByLine.get(line)!\n\t\t\t\t\tarrayCall.functionName = captureText\n\t\t\t\t\tarrayCall.callType = \"array\"\n\t\t\t\t\tbreak\n\n\t\t\t\tcase \"array.call.object\":\n\t\t\t\t\t// \u6570\u7EC4\u65B9\u6CD5\u8C03\u7528\u7684\u5BF9\u8C61\n\t\t\t\t\tif (!callsByLine.has(line)) {\n\t\t\t\t\t\tcallsByLine.set(line, {})\n\t\t\t\t\t}\n\t\t\t\t\tcallsByLine.get(line)!.receiver = captureText\n\t\t\t\t\tbreak\n\n\t\t\t\tcase \"async.call.receiver\":\n\t\t\t\t\t// \u5F02\u6B65\u65B9\u6CD5\u8C03\u7528\u7684\u63A5\u6536\u8005\n\t\t\t\t\tif (!callsByLine.has(line)) {\n\t\t\t\t\t\tcallsByLine.set(line, {})\n\t\t\t\t\t}\n\t\t\t\t\tconst asyncCall = callsByLine.get(line)!\n\t\t\t\t\tasyncCall.receiver = captureText\n\t\t\t\t\tasyncCall.isAsync = true\n\t\t\t\t\tbreak\n\n\t\t\t\tcase \"async.call.method\":\n\t\t\t\t\t// \u5F02\u6B65\u65B9\u6CD5\u8C03\u7528\u7684\u65B9\u6CD5\u540D\n\t\t\t\t\tif (!callsByLine.has(line)) {\n\t\t\t\t\t\tcallsByLine.set(line, {})\n\t\t\t\t\t}\n\t\t\t\t\tconst asyncMethodCall = callsByLine.get(line)!\n\t\t\t\t\tasyncMethodCall.functionName = captureText\n\t\t\t\t\tasyncMethodCall.callType = \"async\"\n\t\t\t\t\tbreak\n\n\t\t\t\tcase \"method.call.name\":\n\t\t\t\t\t// \u65B9\u6CD5\u8C03\u7528\u7684\u65B9\u6CD5\u540D\n\t\t\t\t\tif (!callsByLine.has(line)) {\n\t\t\t\t\t\tcallsByLine.set(line, {})\n\t\t\t\t\t}\n\t\t\t\t\tconst methodCall = callsByLine.get(line)!\n\t\t\t\t\t// \u53EA\u6709\u5F53\u6CA1\u6709\u66F4\u9AD8\u4F18\u5148\u7EA7\u7684callType\u65F6\u624D\u8BBE\u7F6E\u4E3Amethod\n\t\t\t\t\tif (!methodCall.callType) {\n\t\t\t\t\t\tmethodCall.functionName = captureText\n\t\t\t\t\t\tmethodCall.callType = \"method\"\n\t\t\t\t\t}\n\t\t\t\t\tbreak\n\n\t\t\t\tcase \"method.call.receiver\":\n\t\t\t\t\t// \u65B9\u6CD5\u8C03\u7528\u7684\u63A5\u6536\u8005\n\t\t\t\t\tif (!callsByLine.has(line)) {\n\t\t\t\t\t\tcallsByLine.set(line, {})\n\t\t\t\t\t}\n\t\t\t\t\tcallsByLine.get(line)!.receiver = captureText\n\t\t\t\t\tbreak\n\n\t\t\t\tcase \"static.call.class\":\n\t\t\t\t\t// \u9759\u6001\u65B9\u6CD5\u8C03\u7528\u7684\u7C7B\u540D\n\t\t\t\t\tif (!callsByLine.has(line)) {\n\t\t\t\t\t\tcallsByLine.set(line, {})\n\t\t\t\t\t}\n\t\t\t\t\tconst staticClassCall = callsByLine.get(line)!\n\t\t\t\t\t// \u53EA\u6709\u5F53\u6CA1\u6709\u66F4\u9AD8\u4F18\u5148\u7EA7\u7684callType\u65F6\u624D\u8BBE\u7F6E\u4E3Astatic\n\t\t\t\t\tif (!staticClassCall.callType || staticClassCall.callType === \"method\") {\n\t\t\t\t\t\tstaticClassCall.className = captureText\n\t\t\t\t\t\tstaticClassCall.callType = \"static\"\n\t\t\t\t\t}\n\t\t\t\t\tbreak\n\n\t\t\t\tcase \"static.call.method\":\n\t\t\t\t\t// \u9759\u6001\u65B9\u6CD5\u8C03\u7528\u7684\u65B9\u6CD5\u540D\n\t\t\t\t\tfunctionCalls.push({\n\t\t\t\t\t\tcalledFunctionName: captureText,\n\t\t\t\t\t\tcallType: \"static\",\n\t\t\t\t\t\tline: line + 1,\n\t\t\t\t\t\tcolumn: node.startPosition.column,\n\t\t\t\t\t})\n\t\t\t\t\tprocessedCalls.add(callKey)\n\t\t\t\t\tbreak\n\n\t\t\t\tcase \"optional.call.receiver\":\n\t\t\t\t\t// \u53EF\u9009\u94FE\u8C03\u7528\u7684\u63A5\u6536\u8005\n\t\t\t\t\tif (!callsByLine.has(line)) {\n\t\t\t\t\t\tcallsByLine.set(line, {})\n\t\t\t\t\t}\n\t\t\t\t\tconst optionalCall = callsByLine.get(line)!\n\t\t\t\t\toptionalCall.receiver = captureText\n\t\t\t\t\toptionalCall.isOptional = true\n\t\t\t\t\tbreak\n\n\t\t\t\tcase \"optional.call.method\":\n\t\t\t\t\t// \u53EF\u9009\u94FE\u8C03\u7528\u7684\u65B9\u6CD5\u540D - \u53EA\u5728\u5B9E\u9645\u68C0\u6D4B\u5230\u53EF\u9009\u94FE\u65F6\u4F7F\u7528\n\t\t\t\t\tif (!callsByLine.has(line)) {\n\t\t\t\t\t\tcallsByLine.set(line, {})\n\t\t\t\t\t}\n\t\t\t\t\tconst optionalMethodCall = callsByLine.get(line)!\n\t\t\t\t\t// \u6682\u65F6\u7981\u7528\u53EF\u9009\u94FE\u68C0\u6D4B\uFF0C\u56E0\u4E3A\u5B83\u4E0E\u666E\u901A\u65B9\u6CD5\u8C03\u7528\u51B2\u7A81\n\t\t\t\t\t// TODO: \u9700\u8981\u66F4\u7CBE\u786E\u7684\u53EF\u9009\u94FE\u68C0\u6D4B\u903B\u8F91\n\t\t\t\t\t// if (!optionalMethodCall.callType || optionalMethodCall.callType === \"method\") {\n\t\t\t\t\t// optionalMethodCall.functionName = captureText\n\t\t\t\t\t// optionalMethodCall.callType = \"optional\"\n\t\t\t\t\t// }\n\t\t\t\t\tbreak\n\n\t\t\t\tcase \"function.call.direct\":\n\t\t\t\t\t// \u76F4\u63A5\u51FD\u6570\u8C03\u7528 - \u53EA\u6709\u5728\u6CA1\u6709\u88AB\u66F4\u9AD8\u4F18\u5148\u7EA7\u5904\u7406\u65F6\u624D\u5904\u7406\n\t\t\t\t\tfunctionCalls.push({\n\t\t\t\t\t\tcalledFunctionName: captureText,\n\t\t\t\t\t\tcallType: \"direct\",\n\t\t\t\t\t\tline: line + 1,\n\t\t\t\t\t\tcolumn: node.startPosition.column,\n\t\t\t\t\t})\n\t\t\t\t\tprocessedCalls.add(callKey)\n\t\t\t\t\tbreak\n\n\t\t\t\tcase \"method.call.chain\":\n\t\t\t\t\t// \u94FE\u5F0F\u65B9\u6CD5\u8C03\u7528 - \u68C0\u67E5\u662F\u5426\u662Fpromise\u65B9\u6CD5\n\t\t\t\t\tif (!callsByLine.has(line)) {\n\t\t\t\t\t\tcallsByLine.set(line, {})\n\t\t\t\t\t}\n\t\t\t\t\tconst chainCall = callsByLine.get(line)!\n\t\t\t\t\t// \u68C0\u67E5\u662F\u5426\u662Fpromise\u65B9\u6CD5\n\t\t\t\t\tif (captureText.match(/^(then|catch|finally)$/)) {\n\t\t\t\t\t\tchainCall.functionName = captureText\n\t\t\t\t\t\tchainCall.callType = \"promise\"\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// \u53EA\u6709\u5F53\u6CA1\u6709\u66F4\u9AD8\u4F18\u5148\u7EA7\u7684callType\u65F6\u624D\u8BBE\u7F6E\u4E3Achain\n\t\t\t\t\t\tif (!chainCall.callType) {\n\t\t\t\t\t\t\tchainCall.functionName = captureText\n\t\t\t\t\t\t\tchainCall.callType = \"chain\"\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tbreak\n\n\t\t\t\t// \u5176\u4ED6\u60C5\u51B5\u5904\u7406...\n\t\t\t\tdefault:\n\t\t\t\t\t// \u5904\u7406\u5176\u4ED6\u7C7B\u578B\u7684\u6355\u83B7\n\t\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}\n\n\t// \u5904\u7406\u6309\u884C\u5206\u7EC4\u7684\u590D\u5408\u8C03\u7528\n\tfor (const [line, callInfo] of callsByLine) {\n\t\tif (callInfo.functionName) {\n\t\t\tconst callKey = `${line}-0-${callInfo.functionName}-compound`\n\t\t\tif (!processedCalls.has(callKey)) {\n\t\t\t\tlet callType = callInfo.callType\n\t\t\t\t// 1. event_handler\u7C7B\u578B\u76F4\u63A5\u63A8\u5165\n\t\t\t\tif (callType === \"event_handler\") {\n\t\t\t\t\t// do nothing, \u4FDD\u6301event_handler\n\t\t\t\t} else if (callType === \"promise\") {\n\t\t\t\t\t// 2. promise\u7C7B\u578B\u76F4\u63A5\u63A8\u5165\n\t\t\t\t\t// do nothing, \u4FDD\u6301promise\n\t\t\t\t} else if (callInfo.className && (callType === \"generic_method\" || callType === \"method\")) {\n\t\t\t\t\t// 3. \u53EA\u8981className\u5B58\u5728\u4E14callType\u4E3Ageneric_method\u6216method\u90FD\u8F6C\u4E3Astatic\n\t\t\t\t\tcallType = \"static\"\n\t\t\t\t}\n\t\t\t\tfunctionCalls.push({\n\t\t\t\t\tcalledFunctionName: callInfo.functionName,\n\t\t\t\t\tcallType: callType || \"method\",\n\t\t\t\t\treceiver: callInfo.receiver,\n\t\t\t\t\tclassName: callInfo.className,\n\t\t\t\t\tnamespace: callInfo.namespace,\n\t\t\t\t\tcomponent: callInfo.component,\n\t\t\t\t\tcontext: callInfo.context,\n\t\t\t\t\ttypeArgument: callInfo.typeArgument,\n\t\t\t\t\tline: line + 1,\n\t\t\t\t\tcolumn: 0,\n\t\t\t\t\tisAsync: callInfo.isAsync,\n\t\t\t\t\tisOptional: callInfo.isOptional,\n\t\t\t\t\tisReactSpecific: callInfo.isReactSpecific,\n\t\t\t\t\tisGeneric: callInfo.isGeneric,\n\t\t\t\t})\n\t\t\t\tprocessedCalls.add(callKey)\n\t\t\t}\n\t\t}\n\t}\n\n\t// \u5904\u7406as_expression\u7C7B\u578B\u65AD\u8A00\uFF08@type.assertion\uFF09\n\tfor (const capture of captures) {\n\t\tif (capture.name === \"type.assertion\") {\n\t\t\tconst node = capture.node\n\t\t\tfunctionCalls.push({\n\t\t\t\tcalledFunctionName: \"as\",\n\t\t\t\tcallType: \"type_assertion\",\n\t\t\t\tline: node.startPosition.row + 1,\n\t\t\t\tcolumn: node.startPosition.column,\n\t\t\t})\n\t\t}\n\t}\n\n\treturn {\n\t\tfunctionCalls,\n\t\tscopeInfo,\n\t}\n}\n", "import { CodeLanguageType } from \"../types\"\nimport * as queries from \"./queries\"\nimport Parser from \"web-tree-sitter\"\nimport { ISnippetMeta } from \"../types\"\nimport { dependenciesCapturesProcessForGo } from \"./go\"\nimport { dependenciesCapturesProcessForTypeScript } from \"./typescript\"\nimport { dependenciesCapturesProcessForJavaScript } from \"./javascript\"\nimport { dependenciesCapturesProcessForJava } from \"./java\"\nimport { dependenciesCapturesProcessForPython } from \"./python\"\nimport { dependenciesCapturesProcessForJSX } from \"./jsx\"\nimport { dependenciesCapturesProcessForTSX } from \"./tsx\"\n\nexport const dependenciesCapturesQueries: Record<CodeLanguageType, string | null> = {\n\t[CodeLanguageType.Go]: queries.goQuery,\n\t[CodeLanguageType.Python]: queries.pythonQuery,\n\t[CodeLanguageType.TypeScript]: queries.typescriptQuery,\n\t[CodeLanguageType.JavaScript]: queries.javascriptQuery,\n\t[CodeLanguageType.Java]: queries.javaQuery,\n\t[CodeLanguageType.JSX]: queries.jsxQuery,\n\t[CodeLanguageType.TSX]: queries.tsxQuery,\n\t[CodeLanguageType.Swift]: null,\n\t[CodeLanguageType.CSS]: null,\n\t[CodeLanguageType.HTML]: null,\n\t[CodeLanguageType.Kotlin]: null,\n\t[CodeLanguageType.PHP]: null,\n\t[CodeLanguageType.Rust]: null,\n\t[CodeLanguageType.C]: null,\n\t[CodeLanguageType.CPP]: null,\n\t[CodeLanguageType.Unknown]: null,\n}\n\nexport const dependenciesProcessors: Record<\n\tCodeLanguageType,\n\t(captures: Parser.QueryCapture[]) => ISnippetMeta[] | null\n> = {\n\t[CodeLanguageType.Go]: dependenciesCapturesProcessForGo,\n\t[CodeLanguageType.Python]: dependenciesCapturesProcessForPython,\n\t[CodeLanguageType.TypeScript]: dependenciesCapturesProcessForTypeScript,\n\t[CodeLanguageType.JavaScript]: dependenciesCapturesProcessForJavaScript,\n\t[CodeLanguageType.Java]: dependenciesCapturesProcessForJava,\n\t[CodeLanguageType.JSX]: dependenciesCapturesProcessForJSX,\n\t[CodeLanguageType.TSX]: dependenciesCapturesProcessForTSX,\n\t[CodeLanguageType.Swift]: (captures: Parser.QueryCapture[]) => [],\n\t[CodeLanguageType.CSS]: (captures: Parser.QueryCapture[]) => [],\n\t[CodeLanguageType.HTML]: (captures: Parser.QueryCapture[]) => [],\n\t[CodeLanguageType.Kotlin]: (captures: Parser.QueryCapture[]) => [],\n\t[CodeLanguageType.PHP]: (captures: Parser.QueryCapture[]) => [],\n\t[CodeLanguageType.Rust]: (captures: Parser.QueryCapture[]) => [],\n\t[CodeLanguageType.C]: (captures: Parser.QueryCapture[]) => [],\n\t[CodeLanguageType.CPP]: (captures: Parser.QueryCapture[]) => [],\n\t[CodeLanguageType.Unknown]: (captures: Parser.QueryCapture[]) => [],\n}\n", "import { CodeLanguageType } from \"../types\"\n\nconst lineCommentSymbols = {\n\t[CodeLanguageType.Go]: \"//\",\n\t[CodeLanguageType.Python]: \"#\",\n\t[CodeLanguageType.TypeScript]: \"//\",\n\t[CodeLanguageType.JavaScript]: \"//\",\n\t[CodeLanguageType.Java]: \"//\",\n\t[CodeLanguageType.Unknown]: \"\",\n}\n\nexport function formatCodeWithLanguageWithLineComment(text: string, language: CodeLanguageType): string {\n\tif (language === CodeLanguageType.Unknown) {\n\t\treturn text\n\t}\n\tconst lineCommentSymbol = lineCommentSymbols[language]\n\tif (!lineCommentSymbol) {\n\t\treturn text\n\t}\n\n\tconst lines = text.split(\"\\n\")\n\tconst formattedLines = lines.map((line) => {\n\t\treturn `${lineCommentSymbol} ${line}`\n\t})\n\treturn formattedLines.join(\"\\n\")\n}\n", "import * as fs from \"fs/promises\"\nimport * as path from \"path\"\nimport type { Dirent } from \"fs\"\n\nexport interface TreeViewOptions {\n\tshowDotDirs?: boolean\n\tallowOtherExtensions?: boolean\n}\n\n// \u7F13\u5B58.gitignore\u89C4\u5219\nconst gitignoreCache = new Map<\n\tstring,\n\t{ mtimeMs: number; rules: string[]; filter: (p: string, isDir: boolean) => boolean }\n>()\n\nasync function getGitignoreFilter(dirPathRoot: string): Promise<(p: string, isDir: boolean) => boolean> {\n\tconst gitignorePath = path.join(dirPathRoot, \".gitignore\")\n\ttry {\n\t\tconst stat = await fs.stat(gitignorePath)\n\t\tconst cached = gitignoreCache.get(gitignorePath)\n\t\tif (cached && cached.mtimeMs === stat.mtimeMs) {\n\t\t\treturn cached.filter\n\t\t}\n\t\tconst content = await fs.readFile(gitignorePath, \"utf8\")\n\t\tconst rules = content\n\t\t\t.split(/\\r?\\n/)\n\t\t\t.map((l) => l.trim())\n\t\t\t.filter((l) => l && !l.startsWith(\"#\"))\n\t\t// \u7B80\u5355\u5B9E\u73B0\uFF1A\u53EA\u652F\u6301\u524D\u7F00\u5339\u914D\u548C\u76EE\u5F55\u5339\u914D\n\t\tconst matchers = rules.map((rule) => {\n\t\t\tif (rule.endsWith(\"/\")) {\n\t\t\t\t// \u76EE\u5F55\n\t\t\t\tconst dirRule = rule.replace(/\\/$/, \"\")\n\t\t\t\treturn (p: string, isDir: boolean) => isDir && p.includes(dirRule)\n\t\t\t} else {\n\t\t\t\treturn (p: string, isDir: boolean) => p.includes(rule)\n\t\t\t}\n\t\t})\n\t\tconst filter = (p: string, isDir: boolean) => !matchers.some((fn) => fn(p, isDir))\n\t\tgitignoreCache.set(gitignorePath, { mtimeMs: stat.mtimeMs, rules, filter })\n\t\treturn filter\n\t} catch {\n\t\t// \u6CA1\u6709.gitignore\n\t\treturn () => true\n\t}\n}\n\n/**\n * \u53D7\u9650tree\u547D\u4EE4\u5B9E\u73B0\n * @param dirPathRoot \u6839\u76EE\u5F55\n * @param filePaths \u9700\u8981\u5C55\u5F00\u7684\u6587\u4EF6\u8DEF\u5F84\uFF08\u7EDD\u5BF9\u6216\u76F8\u5BF9dirPathRoot\uFF09\n * @param limitNum \u6BCF\u5C42\u6700\u591A\u663E\u793A\u591A\u5C11\u9879\n * @param maxDepth \u6700\u5927\u9012\u5F52\u6DF1\u5EA6\n * @param options \u989D\u5916\u9009\u9879\n * @returns tree\u7ED3\u6784\u5B57\u7B26\u4E32\n */\nexport async function treeView(\n\tdirPathRoot: string,\n\tfilePaths: string[],\n\tlimitNum: number,\n\tmaxDepth: number,\n\toptions: TreeViewOptions = {},\n): Promise<string> {\n\tconst { showDotDirs = false, allowOtherExtensions = false } = options\n\t// 1. \u5F52\u4E00\u5316filePaths\u4E3A\u7EDD\u5BF9\u8DEF\u5F84\n\tconst absRoot = path.resolve(dirPathRoot)\n\tconst normFilePaths = filePaths.map((fp) => path.resolve(dirPathRoot, fp))\n\t// 2. \u9700\u8981\u91CD\u70B9\u5C55\u5F00\u7684\u6240\u6709\u76EE\u5F55\u96C6\u5408\uFF08filePaths\u7684\u6240\u6709\u7236\u76EE\u5F55\uFF09\n\tconst expandDirs = new Set<string>()\n\t// 3. \u9700\u8981\u663E\u793A\u6240\u6709\u540C\u7EA7\u6587\u4EF6/\u76EE\u5F55\u7684\u76EE\u5F55\u96C6\u5408\uFF08filePaths\u7684\u7236\u76EE\u5F55\uFF09\n\tconst siblingDirs = new Set<string>()\n\t// 4. \u8BB0\u5F55\u6BCF\u4E2AfilePath\u7684\u540E\u7F00\u540D\u96C6\u5408\n\tconst fileExts = new Map<string, Set<string>>()\n\tfor (const fileAbs of normFilePaths) {\n\t\tlet cur = path.dirname(fileAbs)\n\t\tsiblingDirs.add(cur) // filePaths\u7684\u7236\u76EE\u5F55\n\t\tif (!fileExts.has(cur)) fileExts.set(cur, new Set())\n\t\tfileExts.get(cur)!.add(path.extname(fileAbs))\n\t\twhile (cur.startsWith(absRoot)) {\n\t\t\texpandDirs.add(cur)\n\t\t\tif (cur === absRoot) break\n\t\t\tcur = path.dirname(cur)\n\t\t}\n\t}\n\n\t// \u83B7\u53D6.gitignore\u8FC7\u6EE4\u5668\n\tconst gitignoreFilter = await getGitignoreFilter(absRoot)\n\n\t// \u9012\u5F52\u904D\u5386\uFF0C\u751F\u6210tree\u98CE\u683C\u7B26\u53F7\n\tasync function walk(dir: string, depth: number, prefix: string, isLast: boolean): Promise<string[]> {\n\t\tif (depth > maxDepth) {\n\t\t\tconst entries = (await fs.readdir(dir, { withFileTypes: true })) as Dirent[]\n\t\t\treturn [prefix + ellipsisLine(entries.length, \"(\u8D85\u51FA\u6DF1\u5EA6)\")]\n\t\t}\n\t\tlet entries: Dirent[] = []\n\t\ttry {\n\t\t\tentries = (await fs.readdir(dir, { withFileTypes: true })) as Dirent[]\n\t\t} catch {\n\t\t\treturn [prefix + \"[\u65E0\u6CD5\u8BFB\u53D6\u76EE\u5F55]\"]\n\t\t}\n\t\t// \u8FC7\u6EE4.\u5F00\u5934\u7684\u76EE\u5F55\uFF08\u9664\u975EfilePaths\u7684\u67D0\u4E2A\u6587\u4EF6\u5728\u8BE5\u76EE\u5F55\u4E0B\uFF09\n\t\tconst isSiblingDir = siblingDirs.has(dir)\n\t\tif (!showDotDirs && !isSiblingDir) {\n\t\t\tentries = entries.filter((e) => !e.name.startsWith(\".\"))\n\t\t}\n\t\t// \u8FC7\u6EE4.gitignore\n\t\tentries = entries.filter((e) =>\n\t\t\tgitignoreFilter(path.relative(absRoot, path.join(dir, e.name)), e.isDirectory()),\n\t\t)\n\t\t// \u6392\u5E8F\uFF1A\n\t\t// 1. \u9700\u8981\u5C55\u5F00\u7684\u76EE\u5F55\uFF08expandDirs\uFF09\u4F18\u5148\u6587\u4EF6\uFF0C\u518D\u76EE\u5F55\uFF0C\u518D\u540D\u79F0\n\t\t// 2. \u5176\u5B83\u76EE\u5F55\u4F18\u5148\u76EE\u5F55\uFF0C\u518D\u6587\u4EF6\uFF0C\u518D\u540D\u79F0\n\t\tentries.sort((a, b) => {\n\t\t\tconst aPath = path.join(dir, a.name)\n\t\t\tconst bPath = path.join(dir, b.name)\n\t\t\tconst aExpand = expandDirs.has(dir)\n\t\t\tconst bExpand = expandDirs.has(dir)\n\t\t\tif (aExpand && bExpand) {\n\t\t\t\t// \u9700\u8981\u5C55\u5F00\u7684\u76EE\u5F55\uFF0C\u6587\u4EF6\u4F18\u5148\n\t\t\t\tif (a.isDirectory() !== b.isDirectory()) return Number(a.isDirectory()) - Number(b.isDirectory())\n\t\t\t\treturn a.name.localeCompare(b.name)\n\t\t\t} else {\n\t\t\t\t// \u5176\u5B83\u76EE\u5F55\uFF0C\u76EE\u5F55\u4F18\u5148\n\t\t\t\tif (a.isDirectory() !== b.isDirectory()) return Number(b.isDirectory()) - Number(a.isDirectory())\n\t\t\t\treturn a.name.localeCompare(b.name)\n\t\t\t}\n\t\t})\n\t\tconst lines: string[] = []\n\t\tlet shown = 0\n\t\tlet omitted = 0\n\t\t// \u5224\u65AD\u5F53\u524D\u76EE\u5F55\u662F\u5426\u4E3AfilePaths\u7684\u7236\u76EE\u5F55\uFF08\u9700\u8981\u663E\u793A\u6240\u6709\u540C\u7EA7\u6587\u4EF6/\u76EE\u5F55\uFF09\n\t\tconst showAllSiblings = isSiblingDir\n\t\t// \u83B7\u53D6\u5F53\u524D\u76EE\u5F55\u9700\u8981\u7684\u540E\u7F00\u540D\u96C6\u5408\uFF08\u5982\u679C\u6709\uFF09\n\t\tconst requiredExts = fileExts.get(dir)\n\n\t\tif (showAllSiblings) {\n\t\t\t// \u5148\u5206\u7EC4\u6587\u4EF6\u548C\u76EE\u5F55\uFF0C\u4F18\u5148\u663E\u793A\u76EE\u6807\u6587\u4EF6\n\t\t\tconst siblingFiles = entries.filter(\n\t\t\t\t(e) =>\n\t\t\t\t\t!e.isDirectory() &&\n\t\t\t\t\t(allowOtherExtensions || !requiredExts || requiredExts.has(path.extname(e.name))),\n\t\t\t)\n\t\t\tconst siblingDirs = entries.filter((e) => e.isDirectory())\n\t\t\t// \u6587\u4EF6\u4F18\u5148\n\t\t\tfor (let i = 0; i < siblingFiles.length && shown < limitNum; i++, shown++) {\n\t\t\t\tconst entry = siblingFiles[i]\n\t\t\t\tconst isEntryLast =\n\t\t\t\t\tshown === limitNum - 1 ||\n\t\t\t\t\t(i === siblingFiles.length - 1 && shown + siblingDirs.length >= limitNum) ||\n\t\t\t\t\tshown === siblingFiles.length + siblingDirs.length - 1\n\t\t\t\tconst branch = isEntryLast ? \"\u2514\u2500\u2500 \" : \"\u251C\u2500\u2500 \"\n\t\t\t\tlines.push(prefix + branch + entry.name)\n\t\t\t}\n\t\t\t// \u76EE\u5F55\n\t\t\tfor (let i = 0; i < siblingDirs.length && shown < limitNum; i++, shown++) {\n\t\t\t\tconst entry = siblingDirs[i]\n\t\t\t\tconst entryPath = path.join(dir, entry.name)\n\t\t\t\tconst isEntryLast =\n\t\t\t\t\tshown === limitNum - 1 ||\n\t\t\t\t\ti === siblingDirs.length - 1 ||\n\t\t\t\t\tshown === siblingFiles.length + siblingDirs.length - 1\n\t\t\t\tconst branch = isEntryLast ? \"\u2514\u2500\u2500 \" : \"\u251C\u2500\u2500 \"\n\t\t\t\tconst nextPrefix = prefix + (isEntryLast ? \" \" : \"\u2502 \")\n\t\t\t\tif (expandDirs.has(entryPath)) {\n\t\t\t\t\tlines.push(prefix + branch + entry.name + \"/\")\n\t\t\t\t\tconst sub = await walk(entryPath, depth + 1, nextPrefix, isEntryLast)\n\t\t\t\t\tlines.push(...sub)\n\t\t\t\t} else {\n\t\t\t\t\tconst subEntries = (await fs.readdir(entryPath, { withFileTypes: true })) as Dirent[]\n\t\t\t\t\t// \u8FC7\u6EE4.gitignore\n\t\t\t\t\tconst filteredSubEntries = subEntries.filter((e) =>\n\t\t\t\t\t\tgitignoreFilter(path.relative(absRoot, path.join(entryPath, e.name)), e.isDirectory()),\n\t\t\t\t\t)\n\t\t\t\t\tlines.push(prefix + branch + entry.name + `/ ...(${filteredSubEntries.length}\u9879)`)\n\t\t\t\t}\n\t\t\t}\n\t\t\tconst total = siblingFiles.length + siblingDirs.length\n\t\t\tif (shown < total) {\n\t\t\t\tlines.push(prefix + ellipsisLine(total - shown))\n\t\t\t}\n\t\t\treturn lines\n\t\t}\n\t\tfor (let i = 0; i < entries.length; i++) {\n\t\t\tconst entry = entries[i]\n\t\t\tconst entryPath = path.join(dir, entry.name)\n\t\t\tconst isDir = entry.isDirectory()\n\t\t\tconst isEntryLast = shown === limitNum - 1 || i === entries.length - 1 || shown === entries.length - 1\n\t\t\tif (shown >= limitNum) {\n\t\t\t\tomitted = entries.length - shown\n\t\t\t\tlines.push(prefix + ellipsisLine(omitted))\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tconst branch = isEntryLast ? \"\u2514\u2500\u2500 \" : \"\u251C\u2500\u2500 \"\n\t\t\tconst nextPrefix = prefix + (isEntryLast ? \" \" : \"\u2502 \")\n\t\t\tif (isDir) {\n\t\t\t\tif (expandDirs.has(entryPath)) {\n\t\t\t\t\tlines.push(prefix + branch + entry.name + \"/\")\n\t\t\t\t\tconst sub = await walk(entryPath, depth + 1, nextPrefix, isEntryLast)\n\t\t\t\t\tlines.push(...sub)\n\t\t\t\t} else {\n\t\t\t\t\tconst subEntries = (await fs.readdir(entryPath, { withFileTypes: true })) as Dirent[]\n\t\t\t\t\t// \u8FC7\u6EE4.gitignore\n\t\t\t\t\tconst filteredSubEntries = subEntries.filter((e) =>\n\t\t\t\t\t\tgitignoreFilter(path.relative(absRoot, path.join(entryPath, e.name)), e.isDirectory()),\n\t\t\t\t\t)\n\t\t\t\t\tlines.push(prefix + branch + entry.name + `/ ...(${filteredSubEntries.length}\u9879)`)\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// \u5982\u679C\u662FfilePaths\u7684\u7236\u76EE\u5F55\uFF0C\u663E\u793A\u6240\u6709\u540C\u7EA7\u6587\u4EF6\uFF0C\u5426\u5219\u53EA\u663E\u793AfilePaths\u672C\u8EAB\n\t\t\t\tif (showAllSiblings) {\n\t\t\t\t\t// \u53EA\u663E\u793A\u76F8\u540C\u540E\u7F00\uFF0C\u9664\u975EallowOtherExtensions\u4E3Atrue\n\t\t\t\t\tif (allowOtherExtensions || !requiredExts || requiredExts.has(path.extname(entry.name))) {\n\t\t\t\t\t\tlines.push(prefix + branch + entry.name)\n\t\t\t\t\t}\n\t\t\t\t} else if (normFilePaths.includes(entryPath)) {\n\t\t\t\t\tlines.push(prefix + branch + entry.name)\n\t\t\t\t}\n\t\t\t}\n\t\t\tshown++\n\t\t}\n\t\treturn lines\n\t}\n\n\tfunction ellipsisLine(count: number, note?: string) {\n\t\treturn `...(${count}\u9879${note ? note : \"\"})`\n\t}\n\n\t// \u6839\u76EE\u5F55\u540D\n\tconst rootName = path.basename(absRoot) || absRoot\n\tconst lines = await walk(absRoot, 1, \"\", true)\n\treturn [rootName + \"/\", ...lines].join(\"\\n\")\n}\n", "#!/usr/bin/env node\nconst { program } = require(\"commander\") \n\nimport { CodeSnippets } from \"../autocompletion/v2/CodeSnippets\"\nimport { CodeLanguageType, ICodeFiles, SnippetType } from \"../autocompletion/v2/types\";\nimport { CodeContext } from \"../autocompletion/v2/CodeContext\"\n\nconst codeContext = new CodeContext()\n\nfunction getExtension(filePath: string): string {\n return filePath.substring(filePath.lastIndexOf(\".\") + 1, filePath.length) \n}\nasync function index(codeFiles: ICodeFiles, maxSnippetLines?: number): Promise<CodeSnippets> {\n const maxLines = maxSnippetLines || 100 \n const allSnippets = new CodeSnippets() \n\n const indexPromises = codeFiles.files.map(async (file) => {\n try {\n if (file.language === undefined || !Object.values(CodeLanguageType).includes(file.language as CodeLanguageType)) {\n console.log(`Unsupported language: ${file.language}`)\n return new CodeSnippets()\n }\n // \u8BFB\u53D6\u6587\u4EF6\u5185\u5BB9\n const content = file.content\n if (!content) {\n console.log(`Content is empty for file: ${file.filePath}`)\n return new CodeSnippets()\n }\n file.fileExtension = getExtension(file.filePath) \n\n // \u5BF9\u6BCF\u4E2A\u6587\u4EF6\u8FDB\u884C chunk\n const fileSnippets = await codeContext.chunk(content, {\n file: file,\n maxSnippetLines: maxLines,\n snippetTypes: [\n SnippetType.FunctionOrMethod,\n SnippetType.ClassOrInterfaceOrStructOrEnum,\n SnippetType.VariableOrConstant,\n SnippetType.ImportOrInclude,\n ]\n })\n return fileSnippets\n } catch (error) {\n return new CodeSnippets()\n }\n })\n\n // \u7B49\u5F85\u6240\u6709\u6587\u4EF6\u5904\u7406\u5B8C\u6210\n const fileSnippetsArray = await Promise.all(indexPromises)\n\n // \u5408\u5E76\u6240\u6709\u7247\u6BB5\n for (const fileSnippets of fileSnippetsArray) {\n await allSnippets.merge(fileSnippets)\n }\n\n return allSnippets\n}\n\nprogram\n .command(\"index <input> \") \n .option(\"-m <number>\", \"--maxlines <number>\", \"Maximum number of lines for each snippet\")\n .description(\"Index the given files.\") \n .action(async (input: string, cmd: any) => {\n const codeFiles: ICodeFiles = { files: JSON.parse(input) }\n\n const indexResult = await index(\n codeFiles,\n cmd.maxlines ? parseInt(cmd.maxlines, 10) : undefined\n )\n \n console.log(`${JSON.stringify(indexResult.getSnippets(), null, 2)}`)\n })\n\nprogram.parse(process.argv) "],
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA,QAAI,SAAO,WAAS,SAAO,SAAO,CAAC;AAAnC,QAAqC,aAAW,WAAU;AAAC,UAAI,aAAY,WAAS,YAAU,OAAO,SAAO,EAAC,eAAc,OAAO,SAAS,cAAa,IAAE;AAAA,MAAK,MAAM,OAAM;AAAA,QAAC,cAAa;AAAC,eAAK,WAAW;AAAA,QAAC;AAAA,QAAC,aAAY;AAAC,gBAAM,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AChD;AAEA,UAAQ,IAAI,GAAG,KAAK,UAAU,YAAY,YAAY,GAAG,MAAM,CAAC,CAAC,EAAE;AACvE,CAAC;AAEL,QAAQ,MAAM,QAAQ,IAAI;",
"names": ["e", "t", "_", "s", "r", "a", "o", "n", "l", "exports", "exports", "name", "exports", "cmd", "args", "exports", "flags", "name", "str", "exports", "i", "exports", "path", "fs", "process", "name", "args", "err", "flags", "i", "index", "option", "exports", "name", "flags", "name", "i", "CodeLanguageType", "path", "crypto", "Parser", "i", "i", "crypto", "name", "path", "name", "name", "i", "buildSummaryFromSnippets", "formatOutlineText", "name", "buildSummaryFromSnippets", "formatOutlineText", "i", "name", "i", "methodText", "scope", "isInsideFunction", "rangeText", "snippetHash", "field", "variableType", "definitionText", "name", "buildSummaryFromSnippets", "formatOutlineText", "c", "name", "buildSummaryFromSnippets", "formatOutlineText", "out", "name", "buildSummaryFromSnippets", "formatOutlineText", "out", "name", "node", "i", "buildSummaryFromSnippets", "formatOutlineText", "i", "name", "index", "node", "args", "buildSummaryFromSnippets", "formatOutlineText", "func", "getNodeText", "findChildByType", "i", "name", "buildSummaryFromSnippets", "formatOutlineText", "crypto", "name", "buildSummaryFromSnippets", "formatOutlineText", "name", "removeParentheses", "i", "buildSummaryFromSnippets", "formatOutlineText", "name", "removeParentheses", "i", "param", "parts", "buildSummaryFromSnippets", "formatOutlineText", "func", "findNameCaptureForContainer", "i", "buildSummaryFromSnippets", "formatOutlineText", "findNameCaptureForContainer", "extractParametersFromNode", "extractEnumeratorsFromEnumNode", "i", "extractParameterName", "getNameCaptureNameForContainer", "buildSummaryFromSnippets", "formatOutlineText", "formatOutlineText", "buildSummaryFromSnippets", "go_default", "typescript_default", "javascript_default", "java_default", "python_default", "jsx_default", "tsx_default", "go_default", "python_default", "typescript_default", "javascript_default", "java_default", "jsx_default", "tsx_default", "fs", "path", "stat", "entries", "lines", "siblingDirs", "i"]
}