snow-ai 0.4.15 → 0.4.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundle/cli.mjs +477445 -0
- package/bundle/sql-wasm.wasm +0 -0
- package/package.json +31 -26
- package/dist/agents/codebaseIndexAgent.d.ts +0 -102
- package/dist/agents/codebaseIndexAgent.js +0 -641
- package/dist/agents/codebaseReviewAgent.d.ts +0 -61
- package/dist/agents/codebaseReviewAgent.js +0 -301
- package/dist/agents/compactAgent.d.ts +0 -55
- package/dist/agents/compactAgent.js +0 -306
- package/dist/agents/promptOptimizeAgent.d.ts +0 -54
- package/dist/agents/promptOptimizeAgent.js +0 -268
- package/dist/agents/reviewAgent.d.ts +0 -50
- package/dist/agents/reviewAgent.js +0 -265
- package/dist/agents/summaryAgent.d.ts +0 -57
- package/dist/agents/summaryAgent.js +0 -260
- package/dist/api/anthropic.d.ts +0 -44
- package/dist/api/anthropic.js +0 -598
- package/dist/api/chat.d.ts +0 -73
- package/dist/api/chat.js +0 -386
- package/dist/api/embedding.d.ts +0 -34
- package/dist/api/embedding.js +0 -80
- package/dist/api/gemini.d.ts +0 -31
- package/dist/api/gemini.js +0 -445
- package/dist/api/models.d.ts +0 -15
- package/dist/api/models.js +0 -139
- package/dist/api/responses.d.ts +0 -38
- package/dist/api/responses.js +0 -515
- package/dist/api/systemPrompt.d.ts +0 -4
- package/dist/api/systemPrompt.js +0 -408
- package/dist/api/types.d.ts +0 -53
- package/dist/api/types.js +0 -4
- package/dist/app.d.ts +0 -8
- package/dist/app.js +0 -112
- package/dist/cli.d.ts +0 -2
- package/dist/cli.js +0 -199
- package/dist/hooks/useAgentPicker.d.ts +0 -14
- package/dist/hooks/useAgentPicker.js +0 -119
- package/dist/hooks/useClipboard.d.ts +0 -4
- package/dist/hooks/useClipboard.js +0 -175
- package/dist/hooks/useCommandHandler.d.ts +0 -35
- package/dist/hooks/useCommandHandler.js +0 -346
- package/dist/hooks/useCommandPanel.d.ts +0 -17
- package/dist/hooks/useCommandPanel.js +0 -114
- package/dist/hooks/useConversation.d.ts +0 -49
- package/dist/hooks/useConversation.js +0 -1052
- package/dist/hooks/useFilePicker.d.ts +0 -18
- package/dist/hooks/useFilePicker.js +0 -224
- package/dist/hooks/useGlobalExit.d.ts +0 -5
- package/dist/hooks/useGlobalExit.js +0 -34
- package/dist/hooks/useGlobalNavigation.d.ts +0 -6
- package/dist/hooks/useGlobalNavigation.js +0 -17
- package/dist/hooks/useHistoryNavigation.d.ts +0 -35
- package/dist/hooks/useHistoryNavigation.js +0 -133
- package/dist/hooks/useInputBuffer.d.ts +0 -6
- package/dist/hooks/useInputBuffer.js +0 -45
- package/dist/hooks/useKeyboardInput.d.ts +0 -80
- package/dist/hooks/useKeyboardInput.js +0 -608
- package/dist/hooks/useSessionManagement.d.ts +0 -10
- package/dist/hooks/useSessionManagement.js +0 -43
- package/dist/hooks/useSessionSave.d.ts +0 -8
- package/dist/hooks/useSessionSave.js +0 -63
- package/dist/hooks/useSnapshotState.d.ts +0 -26
- package/dist/hooks/useSnapshotState.js +0 -28
- package/dist/hooks/useStreamingState.d.ts +0 -33
- package/dist/hooks/useStreamingState.js +0 -105
- package/dist/hooks/useTerminalFocus.d.ts +0 -28
- package/dist/hooks/useTerminalFocus.js +0 -87
- package/dist/hooks/useTerminalSize.d.ts +0 -4
- package/dist/hooks/useTerminalSize.js +0 -20
- package/dist/hooks/useTodoPicker.d.ts +0 -16
- package/dist/hooks/useTodoPicker.js +0 -94
- package/dist/hooks/useToolConfirmation.d.ts +0 -19
- package/dist/hooks/useToolConfirmation.js +0 -61
- package/dist/hooks/useVSCodeState.d.ts +0 -8
- package/dist/hooks/useVSCodeState.js +0 -81
- package/dist/i18n/I18nContext.d.ts +0 -14
- package/dist/i18n/I18nContext.js +0 -24
- package/dist/i18n/index.d.ts +0 -3
- package/dist/i18n/index.js +0 -2
- package/dist/i18n/lang/en.d.ts +0 -2
- package/dist/i18n/lang/en.js +0 -502
- package/dist/i18n/lang/es.d.ts +0 -2
- package/dist/i18n/lang/es.js +0 -502
- package/dist/i18n/lang/ja.d.ts +0 -2
- package/dist/i18n/lang/ja.js +0 -502
- package/dist/i18n/lang/ko.d.ts +0 -2
- package/dist/i18n/lang/ko.js +0 -502
- package/dist/i18n/lang/zh-TW.d.ts +0 -2
- package/dist/i18n/lang/zh-TW.js +0 -502
- package/dist/i18n/lang/zh.d.ts +0 -2
- package/dist/i18n/lang/zh.js +0 -502
- package/dist/i18n/translations.d.ts +0 -2
- package/dist/i18n/translations.js +0 -14
- package/dist/i18n/types.d.ts +0 -478
- package/dist/i18n/types.js +0 -1
- package/dist/mcp/aceCodeSearch.d.ts +0 -247
- package/dist/mcp/aceCodeSearch.js +0 -1058
- package/dist/mcp/bash.d.ts +0 -50
- package/dist/mcp/bash.js +0 -153
- package/dist/mcp/codebaseSearch.d.ts +0 -44
- package/dist/mcp/codebaseSearch.js +0 -275
- package/dist/mcp/filesystem.d.ts +0 -392
- package/dist/mcp/filesystem.js +0 -1445
- package/dist/mcp/ideDiagnostics.d.ts +0 -36
- package/dist/mcp/ideDiagnostics.js +0 -90
- package/dist/mcp/notebook.d.ts +0 -10
- package/dist/mcp/notebook.js +0 -367
- package/dist/mcp/subagent.d.ts +0 -37
- package/dist/mcp/subagent.js +0 -113
- package/dist/mcp/todo.d.ts +0 -46
- package/dist/mcp/todo.js +0 -511
- package/dist/mcp/types/aceCodeSearch.types.d.ts +0 -92
- package/dist/mcp/types/aceCodeSearch.types.js +0 -4
- package/dist/mcp/types/bash.types.d.ts +0 -13
- package/dist/mcp/types/bash.types.js +0 -4
- package/dist/mcp/types/filesystem.types.d.ts +0 -210
- package/dist/mcp/types/filesystem.types.js +0 -27
- package/dist/mcp/types/todo.types.d.ts +0 -27
- package/dist/mcp/types/todo.types.js +0 -4
- package/dist/mcp/types/websearch.types.d.ts +0 -30
- package/dist/mcp/types/websearch.types.js +0 -4
- package/dist/mcp/utils/aceCodeSearch/filesystem.utils.d.ts +0 -34
- package/dist/mcp/utils/aceCodeSearch/filesystem.utils.js +0 -146
- package/dist/mcp/utils/aceCodeSearch/language.utils.d.ts +0 -14
- package/dist/mcp/utils/aceCodeSearch/language.utils.js +0 -418
- package/dist/mcp/utils/aceCodeSearch/search.utils.d.ts +0 -31
- package/dist/mcp/utils/aceCodeSearch/search.utils.js +0 -136
- package/dist/mcp/utils/aceCodeSearch/symbol.utils.d.ts +0 -20
- package/dist/mcp/utils/aceCodeSearch/symbol.utils.js +0 -141
- package/dist/mcp/utils/bash/security.utils.d.ts +0 -20
- package/dist/mcp/utils/bash/security.utils.js +0 -34
- package/dist/mcp/utils/filesystem/batch-operations.utils.d.ts +0 -39
- package/dist/mcp/utils/filesystem/batch-operations.utils.js +0 -182
- package/dist/mcp/utils/filesystem/code-analysis.utils.d.ts +0 -18
- package/dist/mcp/utils/filesystem/code-analysis.utils.js +0 -165
- package/dist/mcp/utils/filesystem/match-finder.utils.d.ts +0 -16
- package/dist/mcp/utils/filesystem/match-finder.utils.js +0 -85
- package/dist/mcp/utils/filesystem/office-parser.utils.d.ts +0 -43
- package/dist/mcp/utils/filesystem/office-parser.utils.js +0 -163
- package/dist/mcp/utils/filesystem/path-fixer.utils.d.ts +0 -7
- package/dist/mcp/utils/filesystem/path-fixer.utils.js +0 -60
- package/dist/mcp/utils/filesystem/similarity.utils.d.ts +0 -22
- package/dist/mcp/utils/filesystem/similarity.utils.js +0 -75
- package/dist/mcp/utils/todo/date.utils.d.ts +0 -9
- package/dist/mcp/utils/todo/date.utils.js +0 -14
- package/dist/mcp/utils/websearch/browser.utils.d.ts +0 -8
- package/dist/mcp/utils/websearch/browser.utils.js +0 -58
- package/dist/mcp/utils/websearch/text.utils.d.ts +0 -16
- package/dist/mcp/utils/websearch/text.utils.js +0 -39
- package/dist/mcp/websearch.d.ts +0 -88
- package/dist/mcp/websearch.js +0 -375
- package/dist/test/logger-test.d.ts +0 -1
- package/dist/test/logger-test.js +0 -7
- package/dist/types/index.d.ts +0 -15
- package/dist/types/index.js +0 -1
- package/dist/ui/components/AgentPickerPanel.d.ts +0 -10
- package/dist/ui/components/AgentPickerPanel.js +0 -74
- package/dist/ui/components/ChatInput.d.ts +0 -46
- package/dist/ui/components/ChatInput.js +0 -379
- package/dist/ui/components/CommandPanel.d.ts +0 -15
- package/dist/ui/components/CommandPanel.js +0 -80
- package/dist/ui/components/DiffViewer.d.ts +0 -11
- package/dist/ui/components/DiffViewer.js +0 -178
- package/dist/ui/components/FileList.d.ts +0 -15
- package/dist/ui/components/FileList.js +0 -360
- package/dist/ui/components/FileRollbackConfirmation.d.ts +0 -8
- package/dist/ui/components/FileRollbackConfirmation.js +0 -108
- package/dist/ui/components/HelpPanel.d.ts +0 -2
- package/dist/ui/components/HelpPanel.js +0 -67
- package/dist/ui/components/MCPInfoPanel.d.ts +0 -2
- package/dist/ui/components/MCPInfoPanel.js +0 -108
- package/dist/ui/components/MCPInfoScreen.d.ts +0 -7
- package/dist/ui/components/MCPInfoScreen.js +0 -115
- package/dist/ui/components/MarkdownRenderer.d.ts +0 -6
- package/dist/ui/components/MarkdownRenderer.js +0 -70
- package/dist/ui/components/Menu.d.ts +0 -17
- package/dist/ui/components/Menu.js +0 -88
- package/dist/ui/components/MessageList.d.ts +0 -56
- package/dist/ui/components/MessageList.js +0 -97
- package/dist/ui/components/PendingMessages.d.ts +0 -13
- package/dist/ui/components/PendingMessages.js +0 -29
- package/dist/ui/components/PendingToolCalls.d.ts +0 -11
- package/dist/ui/components/PendingToolCalls.js +0 -35
- package/dist/ui/components/ScrollableSelectInput.d.ts +0 -29
- package/dist/ui/components/ScrollableSelectInput.js +0 -157
- package/dist/ui/components/SessionListPanel.d.ts +0 -7
- package/dist/ui/components/SessionListPanel.js +0 -175
- package/dist/ui/components/SessionListScreen.d.ts +0 -7
- package/dist/ui/components/SessionListScreen.js +0 -217
- package/dist/ui/components/SessionListScreenWrapper.d.ts +0 -7
- package/dist/ui/components/SessionListScreenWrapper.js +0 -14
- package/dist/ui/components/ShimmerText.d.ts +0 -9
- package/dist/ui/components/ShimmerText.js +0 -30
- package/dist/ui/components/TodoPickerPanel.d.ts +0 -14
- package/dist/ui/components/TodoPickerPanel.js +0 -119
- package/dist/ui/components/TodoTree.d.ts +0 -15
- package/dist/ui/components/TodoTree.js +0 -60
- package/dist/ui/components/ToolConfirmation.d.ts +0 -21
- package/dist/ui/components/ToolConfirmation.js +0 -204
- package/dist/ui/components/ToolResultPreview.d.ts +0 -13
- package/dist/ui/components/ToolResultPreview.js +0 -337
- package/dist/ui/components/UsagePanel.d.ts +0 -2
- package/dist/ui/components/UsagePanel.js +0 -394
- package/dist/ui/contexts/ThemeContext.d.ts +0 -13
- package/dist/ui/contexts/ThemeContext.js +0 -28
- package/dist/ui/pages/ChatScreen.d.ts +0 -6
- package/dist/ui/pages/ChatScreen.js +0 -1495
- package/dist/ui/pages/CodeBaseConfigScreen.d.ts +0 -8
- package/dist/ui/pages/CodeBaseConfigScreen.js +0 -350
- package/dist/ui/pages/ConfigScreen.d.ts +0 -8
- package/dist/ui/pages/ConfigScreen.js +0 -1101
- package/dist/ui/pages/CustomHeadersScreen.d.ts +0 -6
- package/dist/ui/pages/CustomHeadersScreen.js +0 -502
- package/dist/ui/pages/HeadlessModeScreen.d.ts +0 -7
- package/dist/ui/pages/HeadlessModeScreen.js +0 -381
- package/dist/ui/pages/LanguageSettingsScreen.d.ts +0 -7
- package/dist/ui/pages/LanguageSettingsScreen.js +0 -91
- package/dist/ui/pages/MCPConfigScreen.d.ts +0 -6
- package/dist/ui/pages/MCPConfigScreen.js +0 -55
- package/dist/ui/pages/ProxyConfigScreen.d.ts +0 -8
- package/dist/ui/pages/ProxyConfigScreen.js +0 -149
- package/dist/ui/pages/SensitiveCommandConfigScreen.d.ts +0 -7
- package/dist/ui/pages/SensitiveCommandConfigScreen.js +0 -271
- package/dist/ui/pages/SubAgentConfigScreen.d.ts +0 -9
- package/dist/ui/pages/SubAgentConfigScreen.js +0 -435
- package/dist/ui/pages/SubAgentListScreen.d.ts +0 -9
- package/dist/ui/pages/SubAgentListScreen.js +0 -131
- package/dist/ui/pages/SystemPromptConfigScreen.d.ts +0 -6
- package/dist/ui/pages/SystemPromptConfigScreen.js +0 -326
- package/dist/ui/pages/ThemeSettingsScreen.d.ts +0 -7
- package/dist/ui/pages/ThemeSettingsScreen.js +0 -106
- package/dist/ui/pages/WelcomeScreen.d.ts +0 -7
- package/dist/ui/pages/WelcomeScreen.js +0 -217
- package/dist/ui/themes/index.d.ts +0 -23
- package/dist/ui/themes/index.js +0 -140
- package/dist/utils/apiConfig.d.ts +0 -126
- package/dist/utils/apiConfig.js +0 -423
- package/dist/utils/autoCompress.d.ts +0 -15
- package/dist/utils/autoCompress.js +0 -24
- package/dist/utils/chatExporter.d.ts +0 -9
- package/dist/utils/chatExporter.js +0 -118
- package/dist/utils/checkpointManager.d.ts +0 -74
- package/dist/utils/checkpointManager.js +0 -181
- package/dist/utils/codebaseConfig.d.ts +0 -16
- package/dist/utils/codebaseConfig.js +0 -67
- package/dist/utils/codebaseDatabase.d.ts +0 -102
- package/dist/utils/codebaseDatabase.js +0 -333
- package/dist/utils/codebaseSearchEvents.d.ts +0 -16
- package/dist/utils/codebaseSearchEvents.js +0 -13
- package/dist/utils/commandExecutor.d.ts +0 -13
- package/dist/utils/commandExecutor.js +0 -26
- package/dist/utils/commands/agent.d.ts +0 -2
- package/dist/utils/commands/agent.js +0 -12
- package/dist/utils/commands/clear.d.ts +0 -2
- package/dist/utils/commands/clear.js +0 -12
- package/dist/utils/commands/compact.d.ts +0 -2
- package/dist/utils/commands/compact.js +0 -12
- package/dist/utils/commands/export.d.ts +0 -2
- package/dist/utils/commands/export.js +0 -12
- package/dist/utils/commands/help.d.ts +0 -2
- package/dist/utils/commands/help.js +0 -11
- package/dist/utils/commands/home.d.ts +0 -2
- package/dist/utils/commands/home.js +0 -34
- package/dist/utils/commands/ide.d.ts +0 -2
- package/dist/utils/commands/ide.js +0 -32
- package/dist/utils/commands/init.d.ts +0 -2
- package/dist/utils/commands/init.js +0 -93
- package/dist/utils/commands/mcp.d.ts +0 -2
- package/dist/utils/commands/mcp.js +0 -12
- package/dist/utils/commands/resume.d.ts +0 -2
- package/dist/utils/commands/resume.js +0 -12
- package/dist/utils/commands/review.d.ts +0 -2
- package/dist/utils/commands/review.js +0 -81
- package/dist/utils/commands/role.d.ts +0 -2
- package/dist/utils/commands/role.js +0 -37
- package/dist/utils/commands/todoPicker.d.ts +0 -2
- package/dist/utils/commands/todoPicker.js +0 -12
- package/dist/utils/commands/usage.d.ts +0 -2
- package/dist/utils/commands/usage.js +0 -12
- package/dist/utils/commands/yolo.d.ts +0 -2
- package/dist/utils/commands/yolo.js +0 -12
- package/dist/utils/configManager.d.ts +0 -45
- package/dist/utils/configManager.js +0 -303
- package/dist/utils/contextCompressor.d.ts +0 -16
- package/dist/utils/contextCompressor.js +0 -334
- package/dist/utils/devMode.d.ts +0 -13
- package/dist/utils/devMode.js +0 -54
- package/dist/utils/escapeHandler.d.ts +0 -79
- package/dist/utils/escapeHandler.js +0 -153
- package/dist/utils/fileDialog.d.ts +0 -9
- package/dist/utils/fileDialog.js +0 -74
- package/dist/utils/fileUtils.d.ts +0 -40
- package/dist/utils/fileUtils.js +0 -185
- package/dist/utils/historyManager.d.ts +0 -45
- package/dist/utils/historyManager.js +0 -159
- package/dist/utils/incrementalSnapshot.d.ts +0 -109
- package/dist/utils/incrementalSnapshot.js +0 -383
- package/dist/utils/index.d.ts +0 -11
- package/dist/utils/index.js +0 -18
- package/dist/utils/languageConfig.d.ts +0 -21
- package/dist/utils/languageConfig.js +0 -61
- package/dist/utils/logger.d.ts +0 -37
- package/dist/utils/logger.js +0 -122
- package/dist/utils/mcpToolsManager.d.ts +0 -52
- package/dist/utils/mcpToolsManager.js +0 -878
- package/dist/utils/messageFormatter.d.ts +0 -12
- package/dist/utils/messageFormatter.js +0 -115
- package/dist/utils/notebookManager.d.ts +0 -59
- package/dist/utils/notebookManager.js +0 -213
- package/dist/utils/patch-highlight.d.ts +0 -5
- package/dist/utils/patch-highlight.js +0 -23
- package/dist/utils/processManager.d.ts +0 -27
- package/dist/utils/processManager.js +0 -75
- package/dist/utils/proxyUtils.d.ts +0 -15
- package/dist/utils/proxyUtils.js +0 -50
- package/dist/utils/resourceMonitor.d.ts +0 -65
- package/dist/utils/resourceMonitor.js +0 -175
- package/dist/utils/retryUtils.d.ts +0 -49
- package/dist/utils/retryUtils.js +0 -303
- package/dist/utils/sensitiveCommandManager.d.ts +0 -53
- package/dist/utils/sensitiveCommandManager.js +0 -308
- package/dist/utils/sessionConverter.d.ts +0 -7
- package/dist/utils/sessionConverter.js +0 -306
- package/dist/utils/sessionManager.d.ts +0 -53
- package/dist/utils/sessionManager.js +0 -371
- package/dist/utils/subAgentConfig.d.ts +0 -50
- package/dist/utils/subAgentConfig.js +0 -221
- package/dist/utils/subAgentExecutor.d.ts +0 -40
- package/dist/utils/subAgentExecutor.js +0 -434
- package/dist/utils/terminal.d.ts +0 -5
- package/dist/utils/terminal.js +0 -13
- package/dist/utils/textBuffer.d.ts +0 -99
- package/dist/utils/textBuffer.js +0 -547
- package/dist/utils/textUtils.d.ts +0 -37
- package/dist/utils/textUtils.js +0 -102
- package/dist/utils/themeConfig.d.ts +0 -21
- package/dist/utils/themeConfig.js +0 -61
- package/dist/utils/todoPreprocessor.d.ts +0 -5
- package/dist/utils/todoPreprocessor.js +0 -18
- package/dist/utils/todoScanner.d.ts +0 -8
- package/dist/utils/todoScanner.js +0 -148
- package/dist/utils/toolDisplayConfig.d.ts +0 -16
- package/dist/utils/toolDisplayConfig.js +0 -47
- package/dist/utils/toolExecutor.d.ts +0 -37
- package/dist/utils/toolExecutor.js +0 -224
- package/dist/utils/usageLogger.d.ts +0 -11
- package/dist/utils/usageLogger.js +0 -114
- package/dist/utils/vscodeConnection.d.ts +0 -76
- package/dist/utils/vscodeConnection.js +0 -430
- package/dist/utils/workspaceSnapshot.d.ts +0 -63
- package/dist/utils/workspaceSnapshot.js +0 -300
|
@@ -1,418 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Language configuration utilities for ACE Code Search
|
|
3
|
-
*/
|
|
4
|
-
/**
|
|
5
|
-
* Language-specific parsers configuration
|
|
6
|
-
*/
|
|
7
|
-
export const LANGUAGE_CONFIG = {
|
|
8
|
-
typescript: {
|
|
9
|
-
extensions: ['.ts', '.tsx', '.mts', '.cts'],
|
|
10
|
-
parser: 'typescript',
|
|
11
|
-
symbolPatterns: {
|
|
12
|
-
function: /(?:export\s+)?(?:async\s+)?(?:function\s+(\w+)|(?:const|let|var)\s+(\w+)\s*=\s*(?:async\s+)?\([^)]*\)\s*=>)|(?:@\w+\s+)*(?:public|private|protected|static)?\s*(?:async)?\s*(\w+)\s*[<(]/,
|
|
13
|
-
class: /(?:export\s+)?(?:abstract\s+)?(?:class|interface)\s+(\w+)|(?:export\s+)?type\s+(\w+)\s*=|(?:export\s+)?enum\s+(\w+)|(?:export\s+)?namespace\s+(\w+)/,
|
|
14
|
-
variable: /(?:export\s+)?(?:const|let|var)\s+(\w+)\s*(?::|=)|(?:@\w+\s+)*(?:public|private|protected|readonly|static)?\s+(\w+)\s*[?:]/,
|
|
15
|
-
import: /import\s+(?:type\s+)?(?:{[^}]+}|\w+|\*\s+as\s+\w+)\s+from\s+['"]([^'"]+)['"]/,
|
|
16
|
-
export: /export\s+(?:default\s+)?(?:class|function|const|let|var|interface|type|enum|namespace|abstract\s+class)\s+(\w+)/,
|
|
17
|
-
},
|
|
18
|
-
},
|
|
19
|
-
javascript: {
|
|
20
|
-
extensions: ['.js', '.jsx', '.mjs', '.cjs', '.es', '.es6'],
|
|
21
|
-
parser: 'javascript',
|
|
22
|
-
symbolPatterns: {
|
|
23
|
-
function: /(?:export\s+)?(?:async\s+)?(?:function\s*\*?\s+(\w+)|(?:const|let|var)\s+(\w+)\s*=\s*(?:async\s+)?(?:function\s*\*?\s*)?(?:\([^)]*\)\s*=>|\([^)]*\)\s*\{))|(\w+)\s*\([^)]*\)\s*\{/,
|
|
24
|
-
class: /(?:export\s+)?class\s+(\w+)/,
|
|
25
|
-
variable: /(?:export\s+)?(?:const|let|var)\s+(\w+)\s*=/,
|
|
26
|
-
import: /import\s+(?:{[^}]+}|\w+|\*\s+as\s+\w+)\s+from\s+['"]([^'"]+)['"]/,
|
|
27
|
-
export: /export\s+(?:default\s+)?(?:class|function|const|let|var)\s+(\w+)/,
|
|
28
|
-
},
|
|
29
|
-
},
|
|
30
|
-
python: {
|
|
31
|
-
extensions: ['.py', '.pyx', '.pyi', '.pyw', '.pyz'],
|
|
32
|
-
parser: 'python',
|
|
33
|
-
symbolPatterns: {
|
|
34
|
-
function: /(?:@\w+\s+)*(?:async\s+)?def\s+(\w+)\s*\(/,
|
|
35
|
-
class: /(?:@\w+\s+)*class\s+(\w+)\s*[(:]/,
|
|
36
|
-
variable: /^(?:[\t ]*)([\w_][\w\d_]*)\s*(?::.*)?=\s*(?![=\s])|^([\w_][\w\d_]*)\s*:\s*(?!.*=)/m,
|
|
37
|
-
import: /(?:from\s+([\w.]+)\s+import\s+[\w, *]+|import\s+([\w.]+(?:\s+as\s+\w+)?))/,
|
|
38
|
-
export: /^(?:__all__\s*=|def\s+(\w+)|class\s+(\w+))/, // Python exports via __all__ or top-level
|
|
39
|
-
},
|
|
40
|
-
},
|
|
41
|
-
go: {
|
|
42
|
-
extensions: ['.go'],
|
|
43
|
-
parser: 'go',
|
|
44
|
-
symbolPatterns: {
|
|
45
|
-
function: /func\s+(?:\([^)]+\)\s+)?(\w+)\s*[<(]/,
|
|
46
|
-
class: /type\s+(\w+)\s+(?:struct|interface)/,
|
|
47
|
-
variable: /(?:var|const)\s+(\w+)\s+[\w\[\]*{]|(?:var|const)\s+\(\s*(\w+)/,
|
|
48
|
-
import: /import\s+(?:"([^"]+)"|_\s+"([^"]+)"|\w+\s+"([^"]+)")/,
|
|
49
|
-
export: /^(?:func|type|var|const)\s+([A-Z]\w+)|^type\s+([A-Z]\w+)\s+(?:struct|interface)/, // Go exports start with capital letter
|
|
50
|
-
},
|
|
51
|
-
},
|
|
52
|
-
rust: {
|
|
53
|
-
extensions: ['.rs'],
|
|
54
|
-
parser: 'rust',
|
|
55
|
-
symbolPatterns: {
|
|
56
|
-
function: /(?:pub(?:\s*\([^)]+\))?\s+)?(?:unsafe\s+)?(?:async\s+)?(?:const\s+)?(?:extern\s+(?:"[^"]+"\s+)?)?fn\s+(\w+)\s*[<(]/,
|
|
57
|
-
class: /(?:pub(?:\s*\([^)]+\))?\s+)?(?:struct|enum|trait|union|type)\s+(\w+)|impl(?:\s+<[^>]+>)?\s+(?:\w+::)*(\w+)/,
|
|
58
|
-
variable: /(?:pub(?:\s*\([^)]+\))?\s+)?(?:static|const|mut)?\s*(?:let\s+(?:mut\s+)?)?(\w+)\s*[:=]/,
|
|
59
|
-
import: /use\s+([^;]+);|extern\s+crate\s+(\w+);/,
|
|
60
|
-
export: /pub(?:\s*\([^)]+\))?\s+(?:fn|struct|enum|trait|const|static|type|mod|use)\s+(\w+)/,
|
|
61
|
-
},
|
|
62
|
-
},
|
|
63
|
-
java: {
|
|
64
|
-
extensions: ['.java'],
|
|
65
|
-
parser: 'java',
|
|
66
|
-
symbolPatterns: {
|
|
67
|
-
function: /(?:@\w+\s+)*(?:public|private|protected|static|final|synchronized|native|abstract|\s)+[\w<>\[\]]+\s+(\w+)\s*\([^)]*\)\s*(?:throws\s+[\w,\s]+)?\s*[{;]/,
|
|
68
|
-
class: /(?:@\w+\s+)*(?:public|private|protected)?\s*(?:abstract|final|static)?\s*(?:class|interface|enum|record|@interface)\s+(\w+)/,
|
|
69
|
-
variable: /(?:@\w+\s+)*(?:public|private|protected|static|final|transient|volatile|\s)+[\w<>\[\]]+\s+(\w+)\s*[=;]/,
|
|
70
|
-
import: /import\s+(?:static\s+)?([\w.*]+);/,
|
|
71
|
-
export: /public\s+(?:class|interface|enum|record|@interface)\s+(\w+)/,
|
|
72
|
-
},
|
|
73
|
-
},
|
|
74
|
-
csharp: {
|
|
75
|
-
extensions: ['.cs'],
|
|
76
|
-
parser: 'csharp',
|
|
77
|
-
symbolPatterns: {
|
|
78
|
-
function: /(?:\[[\w\s,()]+\]\s+)*(?:public|private|protected|internal|static|virtual|override|abstract|async|\s)+[\w<>\[\]?]+\s+(\w+)\s*[<(]/,
|
|
79
|
-
class: /(?:\[[\w\s,()]+\]\s+)*(?:public|private|protected|internal)?\s*(?:abstract|sealed|static|partial)?\s*(?:class|interface|struct|record|enum)\s+(\w+)/,
|
|
80
|
-
variable: /(?:\[[\w\s,()]+\]\s+)*(?:public|private|protected|internal|static|readonly|const|volatile|\s)+[\w<>\[\]?]+\s+(\w+)\s*[{=;]|(?:public|private|protected|internal)?\s*[\w<>\[\]?]+\s+(\w+)\s*\{\s*get/,
|
|
81
|
-
import: /using\s+(?:static\s+)?([\w.]+);/,
|
|
82
|
-
export: /public\s+(?:class|interface|enum|struct|record|delegate)\s+(\w+)/,
|
|
83
|
-
},
|
|
84
|
-
},
|
|
85
|
-
c: {
|
|
86
|
-
extensions: ['.c', '.h'],
|
|
87
|
-
parser: 'c',
|
|
88
|
-
symbolPatterns: {
|
|
89
|
-
function: /(?:static|extern|inline)?\s*[\w\s\*]+\s+(\w+)\s*\([^)]*\)\s*\{/,
|
|
90
|
-
class: /(?:struct|union|enum)\s+(\w+)\s*\{/,
|
|
91
|
-
variable: /(?:extern|static|const)?\s*[\w\s\*]+\s+(\w+)\s*[=;]/,
|
|
92
|
-
import: /#include\s+[<"]([^>"]+)[>"]/,
|
|
93
|
-
export: /^[\w\s\*]+\s+(\w+)\s*\([^)]*\)\s*;/, // Function declarations
|
|
94
|
-
},
|
|
95
|
-
},
|
|
96
|
-
cpp: {
|
|
97
|
-
extensions: ['.cpp', '.cc', '.cxx', '.hpp', '.hh', '.hxx', '.h++', '.c++'],
|
|
98
|
-
parser: 'cpp',
|
|
99
|
-
symbolPatterns: {
|
|
100
|
-
function: /(?:static|extern|inline|virtual|explicit|constexpr)?\s*[\w\s\*&:<>,]+\s+(\w+)\s*\([^)]*\)\s*(?:const)?\s*(?:override)?\s*\{/,
|
|
101
|
-
class: /(?:class|struct|union|enum\s+class|enum\s+struct)\s+(\w+)(?:\s*:\s*(?:public|private|protected)\s+[\w,\s<>]+)?\s*\{/,
|
|
102
|
-
variable: /(?:extern|static|const|constexpr|inline)?\s*[\w\s\*&:<>,]+\s+(\w+)\s*[=;]/,
|
|
103
|
-
import: /#include\s+[<"]([^>"]+)[>"]/,
|
|
104
|
-
export: /^[\w\s\*&:<>,]+\s+(\w+)\s*\([^)]*\)\s*;/,
|
|
105
|
-
},
|
|
106
|
-
},
|
|
107
|
-
php: {
|
|
108
|
-
extensions: ['.php', '.phtml', '.php3', '.php4', '.php5', '.phps'],
|
|
109
|
-
parser: 'php',
|
|
110
|
-
symbolPatterns: {
|
|
111
|
-
function: /(?:public|private|protected|static)?\s*function\s+(\w+)\s*\(/,
|
|
112
|
-
class: /(?:abstract|final)?\s*class\s+(\w+)(?:\s+extends\s+\w+)?(?:\s+implements\s+[\w,\s]+)?\s*\{/,
|
|
113
|
-
variable: /(?:public|private|protected|static)?\s*\$(\w+)\s*[=;]/,
|
|
114
|
-
import: /(?:require|require_once|include|include_once)\s*[('"]([^'"]+)['"]/,
|
|
115
|
-
export: /^(?:public\s+)?(?:function|class|interface|trait)\s+(\w+)/,
|
|
116
|
-
},
|
|
117
|
-
},
|
|
118
|
-
ruby: {
|
|
119
|
-
extensions: ['.rb', '.rake', '.gemspec', '.ru', '.rbw'],
|
|
120
|
-
parser: 'ruby',
|
|
121
|
-
symbolPatterns: {
|
|
122
|
-
function: /def\s+(?:self\.)?(\w+)/,
|
|
123
|
-
class: /class\s+(\w+)(?:\s+<\s+[\w:]+)?/,
|
|
124
|
-
variable: /(?:@|@@|\$)?(\w+)\s*=(?!=)/,
|
|
125
|
-
import: /require(?:_relative)?\s+['"]([^'"]+)['"]/,
|
|
126
|
-
export: /module_function\s+:(\w+)|^def\s+(\w+)/, // Ruby's module exports
|
|
127
|
-
},
|
|
128
|
-
},
|
|
129
|
-
swift: {
|
|
130
|
-
extensions: ['.swift'],
|
|
131
|
-
parser: 'swift',
|
|
132
|
-
symbolPatterns: {
|
|
133
|
-
function: /(?:public|private|internal|fileprivate|open)?\s*(?:static|class)?\s*func\s+(\w+)\s*[<(]/,
|
|
134
|
-
class: /(?:public|private|internal|fileprivate|open)?\s*(?:final)?\s*(?:class|struct|enum|protocol|actor)\s+(\w+)/,
|
|
135
|
-
variable: /(?:public|private|internal|fileprivate|open)?\s*(?:static|class)?\s*(?:let|var)\s+(\w+)\s*[:=]/,
|
|
136
|
-
import: /import\s+(?:class|struct|enum|protocol)?\s*([\w.]+)/,
|
|
137
|
-
export: /public\s+(?:func|class|struct|enum|protocol|var|let)\s+(\w+)/,
|
|
138
|
-
},
|
|
139
|
-
},
|
|
140
|
-
kotlin: {
|
|
141
|
-
extensions: ['.kt', '.kts'],
|
|
142
|
-
parser: 'kotlin',
|
|
143
|
-
symbolPatterns: {
|
|
144
|
-
function: /(?:public|private|protected|internal)?\s*(?:suspend|inline|infix|operator)?\s*fun\s+(\w+)\s*[<(]/,
|
|
145
|
-
class: /(?:public|private|protected|internal)?\s*(?:abstract|open|final|sealed|data|inline|value)?\s*(?:class|interface|object|enum\s+class)\s+(\w+)/,
|
|
146
|
-
variable: /(?:public|private|protected|internal)?\s*(?:const)?\s*(?:val|var)\s+(\w+)\s*[:=]/,
|
|
147
|
-
import: /import\s+([\w.]+)/,
|
|
148
|
-
export: /^(?:public\s+)?(?:fun|class|interface|object|val|var)\s+(\w+)/,
|
|
149
|
-
},
|
|
150
|
-
},
|
|
151
|
-
dart: {
|
|
152
|
-
extensions: ['.dart'],
|
|
153
|
-
parser: 'dart',
|
|
154
|
-
symbolPatterns: {
|
|
155
|
-
function: /(?:static|abstract|external)?\s*[\w<>?,\s]+\s+(\w+)\s*\([^)]*\)\s*(?:async|sync\*)?\s*\{/,
|
|
156
|
-
class: /(?:abstract)?\s*class\s+(\w+)(?:\s+extends\s+[\w<>]+)?(?:\s+with\s+[\w,\s<>]+)?(?:\s+implements\s+[\w,\s<>]+)?\s*\{/,
|
|
157
|
-
variable: /(?:static|final|const|late)?\s*(?:var|[\w<>?,\s]+)\s+(\w+)\s*[=;]/,
|
|
158
|
-
import: /import\s+['"]([^'"]+)['"]/,
|
|
159
|
-
export: /^(?:class|abstract\s+class|enum|mixin)\s+(\w+)/,
|
|
160
|
-
},
|
|
161
|
-
},
|
|
162
|
-
shell: {
|
|
163
|
-
extensions: ['.sh', '.bash', '.zsh', '.ksh', '.fish'],
|
|
164
|
-
parser: 'shell',
|
|
165
|
-
symbolPatterns: {
|
|
166
|
-
function: /(?:function\s+)?(\w+)\s*\(\s*\)\s*\{/,
|
|
167
|
-
class: /^$/, // Shell doesn't have classes
|
|
168
|
-
variable: /(?:export\s+)?(\w+)=/,
|
|
169
|
-
import: /(?:source|\.)\s+([^\s;]+)/,
|
|
170
|
-
export: /export\s+(?:function\s+)?(\w+)/,
|
|
171
|
-
},
|
|
172
|
-
},
|
|
173
|
-
scala: {
|
|
174
|
-
extensions: ['.scala', '.sc'],
|
|
175
|
-
parser: 'scala',
|
|
176
|
-
symbolPatterns: {
|
|
177
|
-
function: /def\s+(\w+)\s*[:\[(]/,
|
|
178
|
-
class: /(?:sealed|abstract|final|implicit)?\s*(?:class|trait|object|case\s+class|case\s+object)\s+(\w+)/,
|
|
179
|
-
variable: /(?:val|var|lazy\s+val)\s+(\w+)\s*[:=]/,
|
|
180
|
-
import: /import\s+([\w.{},\s=>]+)/,
|
|
181
|
-
export: /^(?:object|class|trait)\s+(\w+)/,
|
|
182
|
-
},
|
|
183
|
-
},
|
|
184
|
-
r: {
|
|
185
|
-
extensions: ['.r', '.R', '.rmd', '.Rmd'],
|
|
186
|
-
parser: 'r',
|
|
187
|
-
symbolPatterns: {
|
|
188
|
-
function: /(\w+)\s*<-\s*function\s*\(|^(\w+)\s*=\s*function\s*\(/,
|
|
189
|
-
class: /setClass\s*\(\s*['"](\w+)['"]/,
|
|
190
|
-
variable: /(\w+)\s*(?:<-|=)\s*(?!function)/,
|
|
191
|
-
import: /(?:library|require)\s*\(\s*['"]?(\w+)['"]?\s*\)/,
|
|
192
|
-
export: /^(\w+)\s*<-\s*function/, // R exports at top level
|
|
193
|
-
},
|
|
194
|
-
},
|
|
195
|
-
lua: {
|
|
196
|
-
extensions: ['.lua'],
|
|
197
|
-
parser: 'lua',
|
|
198
|
-
symbolPatterns: {
|
|
199
|
-
function: /(?:local\s+)?function\s+(?:[\w.]+[.:])?(\w+)\s*\(/,
|
|
200
|
-
class: /(\w+)\s*=\s*\{\s*\}|(\w+)\s*=\s*class\s*\(/,
|
|
201
|
-
variable: /(?:local\s+)?(\w+)\s*=/,
|
|
202
|
-
import: /require\s*\(?['"]([^'"]+)['"]\)?/,
|
|
203
|
-
export: /return\s+(\w+)|module\s*\(\s*['"]([^'"]+)['"]/,
|
|
204
|
-
},
|
|
205
|
-
},
|
|
206
|
-
perl: {
|
|
207
|
-
extensions: ['.pl', '.pm', '.t', '.pod'],
|
|
208
|
-
parser: 'perl',
|
|
209
|
-
symbolPatterns: {
|
|
210
|
-
function: /sub\s+(\w+)\s*\{/,
|
|
211
|
-
class: /package\s+([\w:]+)\s*;/,
|
|
212
|
-
variable: /(?:my|our|local)\s*[\$@%](\w+)\s*=/,
|
|
213
|
-
import: /(?:use|require)\s+([\w:]+)/,
|
|
214
|
-
export: /^sub\s+(\w+)|our\s+[\$@%](\w+)/,
|
|
215
|
-
},
|
|
216
|
-
},
|
|
217
|
-
objectivec: {
|
|
218
|
-
extensions: ['.m', '.mm', '.h'],
|
|
219
|
-
parser: 'objectivec',
|
|
220
|
-
symbolPatterns: {
|
|
221
|
-
function: /[-+]\s*\([^)]+\)\s*(\w+)(?::|;|\s*\{)/,
|
|
222
|
-
class: /@(?:interface|implementation|protocol)\s+(\w+)/,
|
|
223
|
-
variable: /@property\s+[^;]+\s+(\w+);|^[\w\s\*]+\s+(\w+)\s*[=;]/,
|
|
224
|
-
import: /#import\s+[<"]([^>"]+)[>"]/,
|
|
225
|
-
export: /@interface\s+(\w+)|@protocol\s+(\w+)/,
|
|
226
|
-
},
|
|
227
|
-
},
|
|
228
|
-
haskell: {
|
|
229
|
-
extensions: ['.hs', '.lhs'],
|
|
230
|
-
parser: 'haskell',
|
|
231
|
-
symbolPatterns: {
|
|
232
|
-
function: /^(\w+)\s*::/,
|
|
233
|
-
class: /(?:class|instance)\s+(\w+)/,
|
|
234
|
-
variable: /^(\w+)\s*=/,
|
|
235
|
-
import: /import\s+(?:qualified\s+)?([\w.]+)/,
|
|
236
|
-
export: /module\s+[\w.]+\s*\(([^)]+)\)/,
|
|
237
|
-
},
|
|
238
|
-
},
|
|
239
|
-
elixir: {
|
|
240
|
-
extensions: ['.ex', '.exs'],
|
|
241
|
-
parser: 'elixir',
|
|
242
|
-
symbolPatterns: {
|
|
243
|
-
function: /def(?:p|macro|macrop)?\s+(\w+)(?:\(|,|\s+do)/,
|
|
244
|
-
class: /defmodule\s+([\w.]+)\s+do/,
|
|
245
|
-
variable: /@(\w+)\s+|(\w+)\s*=\s*(?!fn)/,
|
|
246
|
-
import: /(?:import|alias|require|use)\s+([\w.]+)/,
|
|
247
|
-
export: /^def\s+(\w+)/,
|
|
248
|
-
},
|
|
249
|
-
},
|
|
250
|
-
clojure: {
|
|
251
|
-
extensions: ['.clj', '.cljs', '.cljc', '.edn'],
|
|
252
|
-
parser: 'clojure',
|
|
253
|
-
symbolPatterns: {
|
|
254
|
-
function: /\(defn-?\s+(\w+)/,
|
|
255
|
-
class: /\(defrecord\s+(\w+)|\(deftype\s+(\w+)|\(defprotocol\s+(\w+)/,
|
|
256
|
-
variable: /\(def\s+(\w+)/,
|
|
257
|
-
import: /\(:require\s+\[([^\]]+)\]/,
|
|
258
|
-
export: /\(defn-?\s+(\w+)/,
|
|
259
|
-
},
|
|
260
|
-
},
|
|
261
|
-
fsharp: {
|
|
262
|
-
extensions: ['.fs', '.fsx', '.fsi'],
|
|
263
|
-
parser: 'fsharp',
|
|
264
|
-
symbolPatterns: {
|
|
265
|
-
function: /let\s+(?:rec\s+)?(\w+)(?:\s+\w+)*\s*=/,
|
|
266
|
-
class: /type\s+(\w+)\s*(?:=|<|\()/,
|
|
267
|
-
variable: /let\s+(?:mutable\s+)?(\w+)\s*=/,
|
|
268
|
-
import: /open\s+([\w.]+)/,
|
|
269
|
-
export: /^(?:let|type)\s+(\w+)/,
|
|
270
|
-
},
|
|
271
|
-
},
|
|
272
|
-
vbnet: {
|
|
273
|
-
extensions: ['.vb', '.vbs'],
|
|
274
|
-
parser: 'vbnet',
|
|
275
|
-
symbolPatterns: {
|
|
276
|
-
function: /(?:Public|Private|Protected|Friend)?\s*(?:Shared)?\s*(?:Function|Sub)\s+(\w+)/i,
|
|
277
|
-
class: /(?:Public|Private|Protected|Friend)?\s*(?:MustInherit|NotInheritable)?\s*Class\s+(\w+)/i,
|
|
278
|
-
variable: /(?:Public|Private|Protected|Friend|Dim|Const)?\s*(\w+)\s+As\s+/i,
|
|
279
|
-
import: /Imports\s+([\w.]+)/i,
|
|
280
|
-
export: /Public\s+(?:Class|Module|Function|Sub)\s+(\w+)/i,
|
|
281
|
-
},
|
|
282
|
-
},
|
|
283
|
-
matlab: {
|
|
284
|
-
extensions: ['.m', '.mlx'],
|
|
285
|
-
parser: 'matlab',
|
|
286
|
-
symbolPatterns: {
|
|
287
|
-
function: /function\s+(?:\[[^\]]+\]\s*=\s*|[\w,\s]+\s*=\s*)?(\w+)\s*\(/,
|
|
288
|
-
class: /classdef\s+(\w+)/,
|
|
289
|
-
variable: /(\w+)\s*=\s*(?!function)/,
|
|
290
|
-
import: /import\s+([\w.*]+)/,
|
|
291
|
-
export: /^function\s+(?:\[[^\]]+\]\s*=\s*)?(\w+)/,
|
|
292
|
-
},
|
|
293
|
-
},
|
|
294
|
-
sql: {
|
|
295
|
-
extensions: ['.sql', '.ddl', '.dml'],
|
|
296
|
-
parser: 'sql',
|
|
297
|
-
symbolPatterns: {
|
|
298
|
-
function: /CREATE\s+(?:OR\s+REPLACE\s+)?(?:FUNCTION|PROCEDURE)\s+(\w+)/i,
|
|
299
|
-
class: /CREATE\s+(?:TABLE|VIEW)\s+(\w+)/i,
|
|
300
|
-
variable: /DECLARE\s+@?(\w+)/i,
|
|
301
|
-
import: /^$/, // SQL doesn't have imports
|
|
302
|
-
export: /^CREATE\s+(?:FUNCTION|PROCEDURE|VIEW)\s+(\w+)/i,
|
|
303
|
-
},
|
|
304
|
-
},
|
|
305
|
-
html: {
|
|
306
|
-
extensions: ['.html', '.htm', '.xhtml'],
|
|
307
|
-
parser: 'html',
|
|
308
|
-
symbolPatterns: {
|
|
309
|
-
function: /<script[^>]*>[\s\S]*?function\s+(\w+)/,
|
|
310
|
-
class: /class\s*=\s*["']([^"']+)["']/,
|
|
311
|
-
variable: /id\s*=\s*["']([^"']+)["']/,
|
|
312
|
-
import: /<(?:link|script)[^>]+(?:href|src)\s*=\s*["']([^"']+)["']/,
|
|
313
|
-
export: /<(?:div|section|article|header|footer)[^>]+id\s*=\s*["']([^"']+)["']/,
|
|
314
|
-
},
|
|
315
|
-
},
|
|
316
|
-
css: {
|
|
317
|
-
extensions: ['.css', '.scss', '.sass', '.less', '.styl'],
|
|
318
|
-
parser: 'css',
|
|
319
|
-
symbolPatterns: {
|
|
320
|
-
function: /@mixin\s+(\w+)|@function\s+(\w+)/,
|
|
321
|
-
class: /\.(\w+(?:-\w+)*)\s*\{/,
|
|
322
|
-
variable: /--(\w+(?:-\w+)*):|@(\w+):|(\$\w+):/,
|
|
323
|
-
import: /@import\s+(?:url\()?['"]([^'"]+)['"]/,
|
|
324
|
-
export: /@mixin\s+(\w+)|@function\s+(\w+)/,
|
|
325
|
-
},
|
|
326
|
-
},
|
|
327
|
-
vue: {
|
|
328
|
-
extensions: ['.vue'],
|
|
329
|
-
parser: 'vue',
|
|
330
|
-
symbolPatterns: {
|
|
331
|
-
function: /<script[^>]*>[\s\S]*?(?:export\s+default\s*\{[\s\S]*?)?(?:function|const|let|var)\s+(\w+)|methods\s*:\s*\{[\s\S]*?(\w+)\s*\(/,
|
|
332
|
-
class: /<template[^>]*>[\s\S]*?<(\w+)/,
|
|
333
|
-
variable: /<script[^>]*>[\s\S]*?(?:data\s*\(\s*\)\s*\{[\s\S]*?return\s*\{[\s\S]*?(\w+)|(?:const|let|var)\s+(\w+)\s*=)/,
|
|
334
|
-
import: /<script[^>]*>[\s\S]*?import\s+(?:{[^}]+}|\w+)\s+from\s+['"]([^'"]+)['"]/,
|
|
335
|
-
export: /<script[^>]*>[\s\S]*?export\s+default/,
|
|
336
|
-
},
|
|
337
|
-
},
|
|
338
|
-
svelte: {
|
|
339
|
-
extensions: ['.svelte'],
|
|
340
|
-
parser: 'svelte',
|
|
341
|
-
symbolPatterns: {
|
|
342
|
-
function: /<script[^>]*>[\s\S]*?(?:function|const|let|var)\s+(\w+)\s*[=(]/,
|
|
343
|
-
class: /<[\w-]+/,
|
|
344
|
-
variable: /<script[^>]*>[\s\S]*?(?:let|const|var)\s+(\w+)\s*=/,
|
|
345
|
-
import: /<script[^>]*>[\s\S]*?import\s+(?:{[^}]+}|\w+)\s+from\s+['"]([^'"]+)['"]/,
|
|
346
|
-
export: /<script[^>]*>[\s\S]*?export\s+(?:let|const|function)\s+(\w+)/,
|
|
347
|
-
},
|
|
348
|
-
},
|
|
349
|
-
xml: {
|
|
350
|
-
extensions: ['.xml', '.xsd', '.xsl', '.xslt', '.svg'],
|
|
351
|
-
parser: 'xml',
|
|
352
|
-
symbolPatterns: {
|
|
353
|
-
function: /<xsl:template[^>]+name\s*=\s*["']([^"']+)["']/,
|
|
354
|
-
class: /<(?:xsd:)?(?:complexType|simpleType)[^>]+name\s*=\s*["']([^"']+)["']/,
|
|
355
|
-
variable: /<(?:xsd:)?element[^>]+name\s*=\s*["']([^"']+)["']/,
|
|
356
|
-
import: /<(?:xsd:)?import[^>]+schemaLocation\s*=\s*["']([^"']+)["']/,
|
|
357
|
-
export: /<(?:xsd:)?element[^>]+name\s*=\s*["']([^"']+)["']/,
|
|
358
|
-
},
|
|
359
|
-
},
|
|
360
|
-
yaml: {
|
|
361
|
-
extensions: ['.yaml', '.yml'],
|
|
362
|
-
parser: 'yaml',
|
|
363
|
-
symbolPatterns: {
|
|
364
|
-
function: /^(\w+):\s*\|/m,
|
|
365
|
-
class: /^(\w+):$/m,
|
|
366
|
-
variable: /^(\w+):\s*[^|>]/m,
|
|
367
|
-
import: /^$/, // YAML doesn't have imports
|
|
368
|
-
export: /^(\w+):$/m,
|
|
369
|
-
},
|
|
370
|
-
},
|
|
371
|
-
json: {
|
|
372
|
-
extensions: ['.json', '.jsonc', '.json5'],
|
|
373
|
-
parser: 'json',
|
|
374
|
-
symbolPatterns: {
|
|
375
|
-
function: /^$/,
|
|
376
|
-
class: /^$/,
|
|
377
|
-
variable: /"(\w+)"\s*:/,
|
|
378
|
-
import: /^$/,
|
|
379
|
-
export: /^$/,
|
|
380
|
-
},
|
|
381
|
-
},
|
|
382
|
-
toml: {
|
|
383
|
-
extensions: ['.toml'],
|
|
384
|
-
parser: 'toml',
|
|
385
|
-
symbolPatterns: {
|
|
386
|
-
function: /^$/,
|
|
387
|
-
class: /^\[(\w+(?:\.\w+)*)\]/,
|
|
388
|
-
variable: /^(\w+)\s*=/,
|
|
389
|
-
import: /^$/,
|
|
390
|
-
export: /^\[(\w+(?:\.\w+)*)\]/,
|
|
391
|
-
},
|
|
392
|
-
},
|
|
393
|
-
markdown: {
|
|
394
|
-
extensions: ['.md', '.markdown', '.mdown', '.mkd'],
|
|
395
|
-
parser: 'markdown',
|
|
396
|
-
symbolPatterns: {
|
|
397
|
-
function: /```[\w]*\n[\s\S]*?function\s+(\w+)/,
|
|
398
|
-
class: /^#{1,6}\s+(.+)$/m,
|
|
399
|
-
variable: /\[([^\]]+)\]:/,
|
|
400
|
-
import: /\[([^\]]+)\]\(([^)]+)\)/,
|
|
401
|
-
export: /^#{1,6}\s+(.+)$/m,
|
|
402
|
-
},
|
|
403
|
-
},
|
|
404
|
-
};
|
|
405
|
-
/**
|
|
406
|
-
* Detect programming language from file extension
|
|
407
|
-
* @param filePath - File path to detect language from
|
|
408
|
-
* @returns Language name or null if not supported
|
|
409
|
-
*/
|
|
410
|
-
export function detectLanguage(filePath) {
|
|
411
|
-
const ext = filePath.substring(filePath.lastIndexOf('.')).toLowerCase();
|
|
412
|
-
for (const [lang, config] of Object.entries(LANGUAGE_CONFIG)) {
|
|
413
|
-
if (config.extensions.includes(ext)) {
|
|
414
|
-
return lang;
|
|
415
|
-
}
|
|
416
|
-
}
|
|
417
|
-
return null;
|
|
418
|
-
}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Search utilities for ACE Code Search
|
|
3
|
-
*/
|
|
4
|
-
import type { TextSearchResult } from '../../types/aceCodeSearch.types.js';
|
|
5
|
-
/**
|
|
6
|
-
* Check if a command is available in the system PATH
|
|
7
|
-
* @param command - Command to check
|
|
8
|
-
* @returns Promise resolving to true if command is available
|
|
9
|
-
*/
|
|
10
|
-
export declare function isCommandAvailable(command: string): Promise<boolean>;
|
|
11
|
-
/**
|
|
12
|
-
* Parse grep output (format: filePath:lineNumber:lineContent)
|
|
13
|
-
* @param output - Grep output string
|
|
14
|
-
* @param basePath - Base path for relative path calculation
|
|
15
|
-
* @returns Array of search results
|
|
16
|
-
*/
|
|
17
|
-
export declare function parseGrepOutput(output: string, basePath: string): TextSearchResult[];
|
|
18
|
-
/**
|
|
19
|
-
* Convert glob pattern to RegExp
|
|
20
|
-
* Supports: *, **, ?, [abc], {js,ts}
|
|
21
|
-
* @param glob - Glob pattern
|
|
22
|
-
* @returns Regular expression
|
|
23
|
-
*/
|
|
24
|
-
export declare function globToRegex(glob: string): RegExp;
|
|
25
|
-
/**
|
|
26
|
-
* Calculate fuzzy match score for symbol name
|
|
27
|
-
* @param symbolName - Symbol name to score
|
|
28
|
-
* @param query - Search query
|
|
29
|
-
* @returns Score (0-100, higher is better)
|
|
30
|
-
*/
|
|
31
|
-
export declare function calculateFuzzyScore(symbolName: string, query: string): number;
|
|
@@ -1,136 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Search utilities for ACE Code Search
|
|
3
|
-
*/
|
|
4
|
-
import { spawn } from 'child_process';
|
|
5
|
-
import { EOL } from 'os';
|
|
6
|
-
import * as path from 'path';
|
|
7
|
-
/**
|
|
8
|
-
* Check if a command is available in the system PATH
|
|
9
|
-
* @param command - Command to check
|
|
10
|
-
* @returns Promise resolving to true if command is available
|
|
11
|
-
*/
|
|
12
|
-
export function isCommandAvailable(command) {
|
|
13
|
-
return new Promise(resolve => {
|
|
14
|
-
try {
|
|
15
|
-
let child;
|
|
16
|
-
if (process.platform === 'win32') {
|
|
17
|
-
// Windows: where is an executable, no shell needed
|
|
18
|
-
child = spawn('where', [command], {
|
|
19
|
-
stdio: 'ignore',
|
|
20
|
-
windowsHide: true,
|
|
21
|
-
});
|
|
22
|
-
}
|
|
23
|
-
else {
|
|
24
|
-
// Unix/Linux: Use 'which' command instead of 'command -v'
|
|
25
|
-
// 'which' is an external executable, not a shell builtin
|
|
26
|
-
child = spawn('which', [command], {
|
|
27
|
-
stdio: 'ignore',
|
|
28
|
-
});
|
|
29
|
-
}
|
|
30
|
-
child.on('close', code => resolve(code === 0));
|
|
31
|
-
child.on('error', () => resolve(false));
|
|
32
|
-
}
|
|
33
|
-
catch {
|
|
34
|
-
resolve(false);
|
|
35
|
-
}
|
|
36
|
-
});
|
|
37
|
-
}
|
|
38
|
-
/**
|
|
39
|
-
* Parse grep output (format: filePath:lineNumber:lineContent)
|
|
40
|
-
* @param output - Grep output string
|
|
41
|
-
* @param basePath - Base path for relative path calculation
|
|
42
|
-
* @returns Array of search results
|
|
43
|
-
*/
|
|
44
|
-
export function parseGrepOutput(output, basePath) {
|
|
45
|
-
const results = [];
|
|
46
|
-
if (!output)
|
|
47
|
-
return results;
|
|
48
|
-
const lines = output.split(EOL);
|
|
49
|
-
for (const line of lines) {
|
|
50
|
-
if (!line.trim())
|
|
51
|
-
continue;
|
|
52
|
-
// Find first and second colon indices
|
|
53
|
-
const firstColonIndex = line.indexOf(':');
|
|
54
|
-
if (firstColonIndex === -1)
|
|
55
|
-
continue;
|
|
56
|
-
const secondColonIndex = line.indexOf(':', firstColonIndex + 1);
|
|
57
|
-
if (secondColonIndex === -1)
|
|
58
|
-
continue;
|
|
59
|
-
// Extract parts
|
|
60
|
-
const filePathRaw = line.substring(0, firstColonIndex);
|
|
61
|
-
const lineNumberStr = line.substring(firstColonIndex + 1, secondColonIndex);
|
|
62
|
-
const lineContent = line.substring(secondColonIndex + 1);
|
|
63
|
-
const lineNumber = parseInt(lineNumberStr, 10);
|
|
64
|
-
if (isNaN(lineNumber))
|
|
65
|
-
continue;
|
|
66
|
-
const absoluteFilePath = path.resolve(basePath, filePathRaw);
|
|
67
|
-
const relativeFilePath = path.relative(basePath, absoluteFilePath);
|
|
68
|
-
results.push({
|
|
69
|
-
filePath: relativeFilePath || path.basename(absoluteFilePath),
|
|
70
|
-
line: lineNumber,
|
|
71
|
-
column: 1, // grep doesn't provide column info, default to 1
|
|
72
|
-
content: lineContent.trim(),
|
|
73
|
-
});
|
|
74
|
-
}
|
|
75
|
-
return results;
|
|
76
|
-
}
|
|
77
|
-
/**
|
|
78
|
-
* Convert glob pattern to RegExp
|
|
79
|
-
* Supports: *, **, ?, [abc], {js,ts}
|
|
80
|
-
* @param glob - Glob pattern
|
|
81
|
-
* @returns Regular expression
|
|
82
|
-
*/
|
|
83
|
-
export function globToRegex(glob) {
|
|
84
|
-
// Escape special regex characters except glob wildcards
|
|
85
|
-
let pattern = glob
|
|
86
|
-
.replace(/[.+^${}()|[\]\\]/g, '\\$&') // Escape regex special chars
|
|
87
|
-
.replace(/\*\*/g, '<<<DOUBLESTAR>>>') // Temporarily replace **
|
|
88
|
-
.replace(/\*/g, '[^/]*') // * matches anything except /
|
|
89
|
-
.replace(/<<<DOUBLESTAR>>>/g, '.*') // ** matches everything
|
|
90
|
-
.replace(/\?/g, '[^/]'); // ? matches single char except /
|
|
91
|
-
// Handle {js,ts} alternatives
|
|
92
|
-
pattern = pattern.replace(/\\{([^}]+)\\}/g, (_, alternatives) => {
|
|
93
|
-
return '(' + alternatives.split(',').join('|') + ')';
|
|
94
|
-
});
|
|
95
|
-
// Handle [abc] character classes (already valid regex)
|
|
96
|
-
pattern = pattern.replace(/\\\[([^\]]+)\\\]/g, '[$1]');
|
|
97
|
-
return new RegExp(pattern, 'i');
|
|
98
|
-
}
|
|
99
|
-
/**
|
|
100
|
-
* Calculate fuzzy match score for symbol name
|
|
101
|
-
* @param symbolName - Symbol name to score
|
|
102
|
-
* @param query - Search query
|
|
103
|
-
* @returns Score (0-100, higher is better)
|
|
104
|
-
*/
|
|
105
|
-
export function calculateFuzzyScore(symbolName, query) {
|
|
106
|
-
const nameLower = symbolName.toLowerCase();
|
|
107
|
-
const queryLower = query.toLowerCase();
|
|
108
|
-
// Exact match
|
|
109
|
-
if (nameLower === queryLower)
|
|
110
|
-
return 100;
|
|
111
|
-
// Starts with
|
|
112
|
-
if (nameLower.startsWith(queryLower))
|
|
113
|
-
return 80;
|
|
114
|
-
// Contains
|
|
115
|
-
if (nameLower.includes(queryLower))
|
|
116
|
-
return 60;
|
|
117
|
-
// Camel case match (e.g., "gfc" matches "getFileContent")
|
|
118
|
-
const camelCaseMatch = symbolName
|
|
119
|
-
.split(/(?=[A-Z])/)
|
|
120
|
-
.map(s => s[0]?.toLowerCase() || '')
|
|
121
|
-
.join('');
|
|
122
|
-
if (camelCaseMatch.includes(queryLower))
|
|
123
|
-
return 40;
|
|
124
|
-
// Fuzzy match
|
|
125
|
-
let score = 0;
|
|
126
|
-
let queryIndex = 0;
|
|
127
|
-
for (let i = 0; i < nameLower.length && queryIndex < queryLower.length; i++) {
|
|
128
|
-
if (nameLower[i] === queryLower[queryIndex]) {
|
|
129
|
-
score += 20;
|
|
130
|
-
queryIndex++;
|
|
131
|
-
}
|
|
132
|
-
}
|
|
133
|
-
if (queryIndex === queryLower.length)
|
|
134
|
-
return score;
|
|
135
|
-
return 0;
|
|
136
|
-
}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Symbol parsing utilities for ACE Code Search
|
|
3
|
-
*/
|
|
4
|
-
import type { CodeSymbol } from '../../types/aceCodeSearch.types.js';
|
|
5
|
-
/**
|
|
6
|
-
* Get context lines around a specific line
|
|
7
|
-
* @param lines - All lines in file
|
|
8
|
-
* @param lineIndex - Target line index (0-based)
|
|
9
|
-
* @param contextSize - Number of lines before and after
|
|
10
|
-
* @returns Context string
|
|
11
|
-
*/
|
|
12
|
-
export declare function getContext(lines: string[], lineIndex: number, contextSize: number): string;
|
|
13
|
-
/**
|
|
14
|
-
* Parse file content to extract code symbols using regex patterns
|
|
15
|
-
* @param filePath - Path to file
|
|
16
|
-
* @param content - File content
|
|
17
|
-
* @param basePath - Base path for relative path calculation
|
|
18
|
-
* @returns Array of code symbols
|
|
19
|
-
*/
|
|
20
|
-
export declare function parseFileSymbols(filePath: string, content: string, basePath: string): Promise<CodeSymbol[]>;
|