@startuml js_plugin_actual
!define COMPONENT_INTERFACE <<Component Interface>>
!define NOT_IMPLEMENTED <<Not Implemented>>
!includeurl https://raw.githubusercontent.com/plantuml-stdlib/C4-PlantUML/master/C4_Component.puml
title JavaScript Plugin - Code Level (Actual Implementation)
package "mcp_server.plugins.js_plugin" <<Component>> {
' ========================================
' ACTUAL Implementation
' ========================================
class Plugin implements IPlugin #LightGreen {
+lang: str = "javascript"
-_ts: TreeSitterWrapper
-_indexer: FuzzyIndexer
-_sqlite_store: Optional[SQLiteStore]
-_repository_id: Optional[int]
-_indexed_files: int = 0
--
+__init__(sqlite_store: Optional[SQLiteStore] = None)
+supports(path: str | Path) -> bool
+indexFile(path: str | Path, content: str) -> IndexShard
+getDefinition(symbol: str) -> SymbolDef | None
+findReferences(symbol: str) -> List[Reference]
+search(query: str, opts: SearchOpts | None) -> List[SearchResult]
+get_indexed_count() -> int
-_preindex() -> None
-_extract_symbols(tree: Tree, source: str, file_path: str) -> List[Dict]
-_get_symbol_context(node: Node, source: str) -> Tuple[str, str]
-_normalize_import_path(import_path: str, file_path: str) -> str
-_extract_imports(tree: Tree, source: str, file_path: str) -> Dict[str, str]
-_get_function_params(node: Node, source: str) -> str
-_get_node_modifiers(node: Node, source: str) -> str
-_get_node_identifier(node: Node, source: str) -> str
-_get_parent_context(node: Node, source: str) -> Optional[str]
}
' ========================================
' Supported File Types
' ========================================
note right of Plugin #LightGreen
IMPLEMENTED:
- JavaScript (.js, .mjs)
- TypeScript (.ts, .tsx)
- JSX (.jsx)
- Tree-sitter parsing
- Symbol extraction
- Import tracking
- SQLite persistence
- Function signatures
- Class methods
- Variables/constants
- Type definitions
- Interfaces
- Enums
end note
' ========================================
' Symbol Types Extracted
' ========================================
class SymbolTypes <<enumeration>> #LightGreen {
function_declaration
function_expression
arrow_function
method_definition
class_declaration
interface_declaration
type_alias_declaration
enum_declaration
variable_declarator
lexical_declaration
import_statement
export_statement
}
' ========================================
' External Dependencies
' ========================================
class TreeSitterWrapper #LightGreen {
-parser: Parser
-language: Language
--
+parse(content: str) -> Tree
+extract_symbols(tree: Tree, source: str) -> List[Symbol]
}
class FuzzyIndexer #LightGreen {
+add_file(path: str, content: str) -> None
+add_symbol(symbol_name: str, file_path: str, line_number: int, metadata: Dict) -> None
+search(query: str, limit: int = 20) -> List[Dict]
+search_symbols(query: str, limit: int = 20) -> List[Dict]
}
' ========================================
' What's Actually Implemented
' ========================================
note left of SymbolTypes
Full support for:
- ES6+ syntax
- TypeScript syntax
- JSX/TSX syntax
- Module imports/exports
- Async/await
- Generators
- Decorators
- Type annotations
end note
' ========================================
' What's Missing
' ========================================
note bottom of Plugin #FF6B6B
NOT IMPLEMENTED:
- No semantic analysis
- No type inference
- No cross-file references
- No dependency graph
- No call hierarchy
- No dead code detection
- No minified code handling
- No source map support
- No CommonJS require() tracking
- No dynamic import tracking
- No webpack alias resolution
end note
' ========================================
' Relationships
' ========================================
Plugin --> TreeSitterWrapper : parses with
Plugin --> FuzzyIndexer : indexes with
Plugin --> SQLiteStore : persists to
Plugin ..> SymbolTypes : extracts
Plugin ..> IndexShard : returns
Plugin ..> SymbolDef : returns
Plugin ..> Reference : yields
Plugin ..> SearchResult : yields
}
' ========================================
' Implementation Status Legend
' ========================================
legend right
|<#90EE90>| Implemented |
|<#FFD700>| Partially Implemented |
|<#FFA500>| Stub Only |
|<#FF6B6B>| Not Implemented |
endlegend
@enduml