A comprehensive VS Code extension for the Soar cognitive architecture, providing syntax highlighting, intelligent code validation, datamap management, and seamless VisualSoar project integration.
- Command: "Create New Soar Project"
- Guided Setup: Select directory and enter agent name
- Default Datamap: Standard Soar state structure with IO, memory systems
- File Scaffolding: Complete folder structure with source files
- VisualSoar Compatible: Generates .vsa.json project files
- Ready to Run: Includes initialization operator and elaborations
- Complete TextMate grammar for Soar productions
- Color-coded keywords, variables, attributes, and operators
- Support for comments, strings, and numeric literals
- Real-time Validation: Checks code against project datamap
- Diagnostics: Highlights errors at exact attribute locations
- Code Intelligence: Foundation for completions and navigation
- Tree View: Visual representation of working memory structure
- CRUD Operations: Add, edit, delete attributes via UI
- Type Support: SOAR_ID, ENUMERATION, INTEGER, FLOAT, STRING
- Cycle Detection: Prevents infinite expansion of recursive structures
- Multiple Views: Switch between root and substate datamaps
- Layout Tree: Hierarchical view of operators and files
- VisualSoar Compatible: Full bidirectional compatibility
- Quick Navigation: Click to open files
- CRUD Operations: Add operators, substates, files, folders
- Orphan Detection: Find and import untracked .soar files
- Validates attributes against datamap structure
- Reports errors at actual attribute locations
- Escalated to errors (breaks Soar import if invalid)
- Auto-validates on save
- VS Code 1.80.0 or higher
- Node.js 18+ (for development)
- Download the
.vsixfile from releases - Open VS Code
- Go to Extensions view (
Ctrl+Shift+X) - Click
...menu →Install from VSIX - Select the downloaded file
git clone <repository-url>
cd soar-vs-code
npm install
npm run compile
# Press F5 to launch Extension Development Host-
Create a New Project
- Open Command Palette (
Ctrl+Shift+P/Cmd+Shift+P) - Run "Soar: Create New Soar Project"
- Select a directory and enter your agent name
- Project structure is automatically generated
- Open Command Palette (
-
Open an Existing Soar Project
- Open a folder containing a
.vsa.json,.vsproj, or.soarprojfile - The extension auto-loads the project structure
- Open a folder containing a
-
View Datamap
- Open the Soar sidebar (circuit board icon in Activity Bar)
- Explore the "Datamap" tree view
- Right-click to add/edit/delete attributes
-
Navigate Project Structure
- View the "Project Structure" tree
- Click files to open them
- Right-click to add operators or substates
-
Write Soar Code
- Create a
.soarfile - Get syntax highlighting automatically
- Save to validate against datamap
- Create a
The datamap tree shows your agent's working memory structure:
- Root node shows the top-level state
- Attributes appear without the
^prefix - ENUMERATION types show possible values
- Operator attributes show operator names
- Right-click a SOAR_ID node in the datamap tree
- Select "Add Attribute"
- Enter attribute name (e.g.,
position,status) - Choose type (SOAR_ID, ENUMERATION, INTEGER, FLOAT, STRING)
- For ENUMERATION, enter comma-separated values
- Optionally add a comment
- Right-click an attribute
- Select "Edit Attribute"
- Choose what to edit:
- Rename: Change attribute name
- Edit Comment: Add/modify description
- Change Type: Convert to different type (
⚠️ may delete children)
- Right-click an attribute
- Select "Delete Attribute"
- Confirm (
⚠️ deletes all child attributes)
- Right-click a HIGH_LEVEL_OPERATOR in the project structure
- Select "View Datamap"
- The datamap view switches to that substate
- Click the home icon to return to root datamap
- Right-click a folder or operator in the project structure
- Select "Add Operator"
- Enter operator name
- A new .soar file is created
- Right-click a folder or operator
- Select "Add Substate"
- Enter substate name
- Creates folder, file, and datamap vertex
- Click the search icon in the Project Structure toolbar
- Review list of .soar files not in the project
- Select files to import
- Files are added to the project structure
Validation happens automatically on save:
sp {example
(state <s> ^io <io> # Valid - 'io' in datamap
^foo <f>) # ERROR - 'foo' not in datamap
(<io> ^input-link <in>) # Valid
-->
(<s> ^result ok)
}
Errors appear:
- In the editor (red squigglies)
- In the Problems panel (
Ctrl+Shift+M) - At the exact attribute location
Access via Command Palette (Ctrl+Shift+P):
| Command | Description |
|---|---|
Soar: Refresh Datamap |
Reload datamap from project file |
Soar: Refresh Project Structure |
Reload project structure |
Soar: View Root Datamap |
Return to root datamap view |
Soar: Validate Against Datamap |
Manually validate current file |
Soar: Validate Selected Project Against Datamap |
Validate all .soar files in the selected project |
Soar: Find Orphaned Files |
Find untracked .soar files |
Soar: Sync Project Files |
Import orphaned files |
The extension uses VisualSoar's project format (.vsa.json):
{
"version": "6",
"datamap": {
"rootId": "root-state",
"vertices": [
{
"id": "root-state",
"type": "SOAR_ID",
"outEdges": [
{
"name": "io",
"toId": "io-vertex",
"comment": "Input/output interface"
}
]
}
]
},
"layout": {
"type": "OPERATOR_ROOT",
"id": "root",
"name": "MyProject",
"folder": ".",
"children": []
}
}Compatible with VisualSoar 9.6.4 - Projects can be opened in both tools.
npm install # Install dependencies
npm run compile # Compile TypeScript
npm run watch # Watch mode for development
npm run lint # Run ESLint
npm test # Run tests- Open project in VS Code
- Press
F5to launch Extension Development Host - Set breakpoints in TypeScript files
- Test in the debug window
src/
├── extension.ts # Main entry point
├── client/ # LSP client
├── server/ # LSP server & parser
├── datamap/ # Datamap management
└── layout/ # Project structure
See doc/ARCHITECTURE.md for detailed system design.
✅ Full bidirectional compatibility with VisualSoar 9.6.4
- Open VisualSoar projects in VS Code
- Edit projects in VS Code, open in VisualSoar
- Preserves all project metadata
- Supports all node types and vertex types
{
"soar.maxNumberOfProblems": 100,
"soar.trace.server": "off" // or "messages", "verbose"
}- Large Projects: Very large projects (>10K lines) may have slow initial validation
- Foreign Datamaps: External datamap references not fully implemented yet
- Context-aware completions based on variable bindings
- Rename refactoring across project
- Visual graph editor for datamap
- Import datamap from existing code
- Semantic search for attributes
- Hover information for attributes
Contributions welcome! See doc/ARCHITECTURE.md for system design details.
- Maintain VisualSoar schema compatibility
- Test with both simple and hierarchical projects
- Follow existing code patterns
- Update documentation for new features
[Add license information]
For detailed documentation, see the doc/ directory:
- ARCHITECTURE.md - System design and implementation
- FEATURES.md - Feature implementation guide
- QUICKREF.md - Quick reference card
- DATAMAP-CRUD.md - Datamap operations guide
- VISUALSOAR-INTEGRATION.md - VisualSoar compatibility
- REFERENCES.md - External resources
- Syntax highlighting for Soar files
- LSP with validation against datamap
- Datamap tree view with CRUD operations
- Project structure tree with navigation
- VisualSoar compatibility
- Orphaned file detection and import
Made with ❤️ for the Soar community