- Add while, for, and do-while loops with break/continue - Implement assignment statements (prevents if(x=10) bugs) - Keep assignment expressions only for for-loop clauses - Fix critical memory management bug (dangling pointers in cleanup) - Add automatic memory cleanup with conservative reference counting - Consolidate documentation into single reference file - Add comprehensive test coverage for all loop types and edge cases - VSCode extension for bob highlighting and snippets
2.7 KiB
2.7 KiB
Bob Language Extension Installation Guide
Quick Installation
Option 1: Automatic Installation (Recommended)
cd bob-language-extension
./install.sh
Option 2: Manual Installation
-
Copy the extension files to your VS Code extensions directory:
- macOS:
~/.vscode/extensions/bob-language-0.1.0/ - Linux:
~/.vscode/extensions/bob-language-0.1.0/ - Windows:
%APPDATA%\Code\User\extensions\bob-language-0.1.0\
- macOS:
-
Restart VS Code/Cursor
Option 3: VSIX Package
cd bob-language-extension
./package-vsix.sh
Then install the generated .vsix file in VS Code/Cursor.
Features Included
✅ Syntax Highlighting
- Keywords:
if,else,while,for,break,continue,return,var,func - Built-in functions:
print,assert,input,type,toString,toNumber,time - Data types: numbers, strings, booleans,
none - Operators: arithmetic, comparison, logical, bitwise, compound assignment
✅ Code Snippets
Type these prefixes and press Tab:
func- Function definitionif- If statementwhile- While loopfor- For loopvar- Variable declarationprint- Print statementassert- Assert statementanon- Anonymous functiontest- Test function
✅ Language Features
- Auto-closing brackets and quotes
- Smart indentation
- Comment support (
//and/* */) - Code folding
- Hover information for built-in functions
- IntelliSense completion
✅ Color Theme
- "Bob Dark" theme included
- Optimized colors for Bob syntax
Testing the Extension
- Open VS Code/Cursor
- Open the
example.bobfile in the extension directory - You should see syntax highlighting, code completion, and snippets working
File Association
Files with .bob extension will automatically be recognized as Bob language files.
Troubleshooting
Extension not working?
- Check that the extension is installed in the correct directory
- Restart VS Code/Cursor completely
- Check the Extensions panel (Ctrl+Shift+X) to see if the extension is listed
Syntax highlighting not working?
- Make sure your file has a
.bobextension - Check the language mode in the bottom-right corner of VS Code
- Manually select "Bob" as the language mode if needed
Snippets not working?
- Type the snippet prefix (e.g.,
func) - Press
Ctrl+Spaceto trigger suggestions - Select the snippet and press
Tab
Development
To modify the extension:
- Edit the files in the extension directory
- Run
npm run compileto rebuild TypeScript - Reload VS Code/Cursor to see changes
Support
For issues or questions:
- Check the README.md file
- Look at the example.bob file for syntax examples
- Review the TextMate grammar in
syntaxes/bob.tmLanguage.json