Files
nand2tetris-zed/CHANGELOG.md
Sean O'Connor c231dbfd27 Fix HDL and Hack Assembly syntax highlighting and queries
- Fixed HDL highlights query syntax error with #match? predicate
- Replaced #match? with #any-of? for exact string matching
- Fixed Hack Assembly outline query invalid field name
- Improved HDL syntax highlighting with comprehensive patterns
- Added HDL bracket matching for all syntax types
- Fixed XML scope mismatch from text.xml to source.xml
- Enhanced outline queries for better code navigation
2025-09-11 11:24:24 -04:00

5.6 KiB

Changelog

All notable changes to the Nand2Tetris Zed Extension will be documented in this file.

The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.

[2.0.0] - 2025-01-26

Added

  • Complete Hack Assembly Language Support (.asm files)

    • Full tree-sitter grammar with syntax highlighting
    • Support for A-instructions (@value, @symbol)
    • Support for C-instructions (dest=comp;jump)
    • Label declarations ((LABEL))
    • All predefined symbols (R0-R15, SP, LCL, ARG, THIS, THAT, SCREEN, KBD)
    • User-defined symbols and variables
    • Comment highlighting and toggling
    • Code outline showing labels and sections
  • VM Language Support (.vm files)

    • Complete tree-sitter grammar for VM commands
    • Stack arithmetic operations (add, sub, neg, eq, gt, lt, and, or, not)
    • Memory access commands (push, pop) with all memory segments
    • Program flow commands (label, goto, if-goto)
    • Function commands (function, call, return)
    • Memory segment highlighting (argument, local, static, constant, this, that, pointer, temp)
    • Function and label outline navigation
  • Test Script Language Support (.tst files)

    • Tree-sitter grammar for nand2tetris test scripts
    • Test commands (load, output-file, compare-to, set, eval, output)
    • Simulation control (tick, tock, ticktock)
    • Control flow structures (repeat, while)
    • Variable references (RAM[n], register names, pin names)
    • Binary value highlighting (%B1010101)
    • Format specification highlighting
    • Bracket matching for control blocks
  • Compare/Output File Support (.cmp, .out files)

    • Tree-sitter grammar for tabular test result files
    • Header row highlighting with column names
    • Binary and decimal value highlighting
    • Register and pin reference recognition
    • Table structure visualization
  • Custom Tree-sitter Grammars

    • Built from scratch for Assembly, VM, Test Script, and Compare/Output languages
    • Full Rust bindings for all custom grammars
    • Comprehensive test suites for each grammar
    • Complete Node.js package configurations
  • Enhanced Documentation

    • Comprehensive README with examples for all languages
    • Development guide for contributors
    • Troubleshooting section with common issues
    • Grammar development guidelines

Enhanced

  • Extended Language Coverage

    • Now supports all major nand2tetris file types
    • Complete course workflow coverage from hardware to software
    • Consistent syntax highlighting across all languages
  • Improved Editor Integration

    • Code outline support for all languages
    • Bracket matching where applicable
    • Smart indentation rules
    • Comment toggling support (Cmd+/ or Ctrl+/)
  • Better Error Handling

    • Robust grammar parsing with error recovery
    • Clear error messages for common issues
    • Comprehensive troubleshooting documentation

Technical

  • Grammar Architecture

    • Four new custom Tree-sitter grammars
    • Proper semantic token classification
    • Efficient parsing with minimal conflicts
    • Full compatibility with Zed's Tree-sitter integration
  • Build System

    • Complete Rust build configuration for all grammars
    • Node.js bindings for development tools
    • Automated testing and validation
    • Cross-platform compatibility

[1.1.0] - Previous Release

Added

  • HDL (Hardware Description Language) support
  • Jack programming language support
  • Basic syntax highlighting and bracket matching
  • Code outline for HDL chips and Jack classes

Technical

  • Integration with external tree-sitter grammars
  • Basic Zed extension configuration

[1.0.0] - Initial Release

Added

  • Initial extension structure
  • Basic HDL support
  • Extension manifest and configuration

Development Notes

Version 2.0.0 Represents a Major Milestone

This release transforms the extension from basic HDL/Jack support to comprehensive coverage of the entire nand2tetris ecosystem. The addition of four custom Tree-sitter grammars makes this the most complete nand2tetris editor integration available.

Custom Grammar Development

The custom grammars were developed specifically for this extension to ensure:

  • Accurate parsing of nand2tetris language specifications
  • Optimal performance in the Zed editor
  • Comprehensive syntax highlighting
  • Proper semantic token classification
  • Future extensibility and maintenance

Breaking Changes

  • Extension ID and configuration may have changed
  • New file type associations require extension reinstallation
  • Grammar compilation requires Rust toolchain

Compatibility

  • Requires Zed editor with Tree-sitter support
  • Requires Rust installed via rustup for grammar compilation
  • Compatible with all nand2tetris course materials
  • Supports both individual files and complete project structures

Performance

  • All grammars optimized for fast parsing
  • Minimal memory footprint
  • Efficient syntax highlighting queries
  • Responsive editor integration

Future Roadmap

Potential Future Enhancements

  • Language server integration for advanced IDE features
  • Code formatting support
  • Integration with nand2tetris simulation tools
  • Snippet support for common patterns
  • Debugging integration
  • Project template support

Community Contributions

We welcome contributions for:

  • Grammar improvements and bug fixes
  • Additional language features
  • Documentation enhancements
  • Test case additions
  • Performance optimizations

For detailed technical information, see DEVELOPMENT.md. For usage instructions, see README.md.