Adding a New IDE Parser
swAItch is designed to make adding new IDE support straightforward. You only need to:- Add an enum value
- Add data paths
- Implement one class
- Register it
Step 1: Add the IDE Type
Inmodels.py, add a new value to the IDEType enum:
Step 2: Add Data Paths
Inconfig.py, add the IDE’s data paths to IDEPaths:
Step 3: Implement the Parser
Create a new file inparsers/ that extends BaseParser:
Step 4: Register It
Inserver.py, add one line to _build_registry():
Tips
Use caching
Use caching
Implement
invalidate_cache() if your parser caches data. The file watcher calls this when files change.Handle missing data gracefully
Handle missing data gracefully
Return
SourceStatus.NOT_FOUND from detect() if the IDE isn’t installed. Never raise exceptions from detection.Sort by recency
Sort by recency
list_conversation_ids() should ideally return results sorted by recency if the underlying storage supports it easily.Include metadata
Include metadata
Use the
metadata dict on Conversation and ChatMessage to pass IDE-specific info that doesn’t fit the standard model.
