How pherrymason/c3-lsp works
Project Type Analysis
This is a Language Server Protocol implementation, which is a specialized type of client-server application that provides language features to IDEs and text editors. The project consists of two main components:
• A server component (written in Go)
• A client component (VSCode extension)
Main Components
a) Client Layer:
• VSCode Extension (in /client/vscode)
• Connection to other potential editor clients (extensibility point)
b) Server Core (/server):
• LSP Protocol Handler (/server/internal/lsp/server)
• Project State Management (/server/internal/lsp/project_state)
• Symbol Management System (/server/pkg/symbols)
c) Language Processing:
• AST Processing (/server/internal/lsp/ast)
• CST Processing (/server/internal/lsp/cst)
• Parser System (/server/pkg/parser)
d) Feature Implementations:
• Search System (/server/internal/lsp/search)
• Symbol Table (/server/pkg/symbols_table)
• Document Management (/server/pkg/document)
[Editor Clients] <---> [LSP Protocol Layer] <---> [C3 Language Server Core]
[Source Code] -> [Parser] -> [CST] -> [AST] -> [Symbol Table]
Important Flows to Highlight
a) Document Processing Flow:
• Document changes
• Parse operations
• Symbol indexing
• Diagnostic generation
b) Feature Request Flow:
• Completion requests
• Definition lookup
• Declaration resolution
• Hover information retrieval
Level 1: High-level architecture
• Client-Server communication
• Main system components
Level 2: Server internals
• LSP protocol handling
• Project state management
• Language processing pipeline
Level 3: Feature implementation details
• Symbol resolution
• Search system
• Document management
Implementation Details
• Tree-sitter integration for parsing
• Symbol table organization
• Document store structure
• Search system architecture
Remember to:
• Use clear, consistent naming
• Version information handling
• Error handling paths
• Configuration points
• Extension points for future features