-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
Overview
VSCode extension for gtext has been fully implemented but needs debugging before release.
What Works ✅
gtext serve command
- Fully functional HTTP server with live preview
- Auto-refresh on file changes
- Correct processing of all include blocks:
- File includes
- CLI command execution
- Live reload
Test confirmed:
cd temp
gtext serve test.md.gtext --port 8091
curl http://localhost:8091 # Shows fully processed contentAll include blocks are processed correctly:
includes/header.md→ includedincludes/features.md→ includedcli: date→ executed and output includedcli: ls -la includes/→ executed and output includedcli: python3 -c "..."→ executed and output includedincludes/footer.md→ included
What Doesn't Work ❌
VSCode Extension
The extension structure is complete but something isn't working:
Problem: When opening the preview in VSCode Extension Development Host, "non cambia nulla" (nothing shows/changes)
Symptoms:
- File opens in Extension Development Host
- Preview command available
- But no visible changes or syntax highlighting observed
File Structure Created
Extension Files (/Users/gporcari/Sviluppo/genro_ng/vscode-gtext/)
vscode-gtext/
├── package.json # Extension manifest
├── tsconfig.json # TypeScript config
├── src/
│ ├── extension.ts # Main extension logic
│ └── diagnostics.ts # Real-time error detection
├── syntaxes/
│ └── gtext.tmLanguage.json # Syntax highlighting
├── snippets/
│ └── gtext.json # Code snippets
├── images/
│ ├── icon.png # Extension icon (weaverbird, transparent)
│ └── gtext-file.png # File type icon
└── language-configuration.json # Language config
Test Files (/Users/gporcari/Sviluppo/genro_ng/gtext/temp/)
temp/
├── test.md.gtext # Main test file with include blocks
└── includes/
├── header.md # Header content
├── features.md # Features list
└── footer.md # Footer content
Extension Features Implemented
-
Commands:
gtext.preview- Open preview in current columngtext.previewToSide- Open preview to the sidegtext.stopServer- Stop preview server
-
Language Support:
- File extension:
.gtext - Syntax highlighting for include blocks
- File icon
- File extension:
-
Snippets:
inc/include- Include file blockinccli/cli- Include CLI command blockincglob/glob- Include glob pattern block
-
Diagnostics:
- Error: Unclosed include blocks
- Warning: Include block not on its own line
- Warning: Backslashes in file paths
-
Configuration:
gtext.preview.port(default: 8090)gtext.preview.autoRefresh(default: true)
-
Server Integration:
- Spawns
gtext serveas child process - Monitors stderr for errors
- Shows webview with iframe to localhost:port
- Auto-cleanup on extension deactivation
- Spawns
Testing Steps
- Open VSCode in
/Users/gporcari/Sviluppo/genro_ng/vscode-gtext/ - Press F5 to launch Extension Development Host
- In new window, open
/Users/gporcari/Sviluppo/genro_ng/gtext/temp/test.md.gtext - Click preview icon in editor title bar (or use command palette)
- Expected: Should see processed content with all includes resolved
- Actual: "non cambia nulla" (nothing visible/no change)
Possible Issues to Investigate
- TypeScript compilation: Check if
out/extension.jswas generated - Extension activation: Check if extension activates on
.gtextfiles - Webview rendering: Check if webview panel is created
- Server spawning: Check if
gtext servestarts correctly - Port conflicts: Check if port 8090 is available
- Error messages: Check Debug Console in VSCode for errors
Debug Steps
# Check TypeScript compilation
cd /Users/gporcari/Sviluppo/genro_ng/vscode-gtext
npm run compile
ls -la out/
# Verify gtext serve works standalone
cd /Users/gporcari/Sviluppo/genro_ng/gtext/temp
gtext serve test.md.gtext --port 8090
# In another terminal, test the server
curl http://localhost:8090 | head -50Configuration Files
package.json key sections
- Port default: 8090
- Activation:
onLanguage:gtext - Main:
./out/extension.js - Commands registered with icons
extension.ts (src/extension.ts:144-200)
Server spawning logic with error handling for:
- Command not found
- Port already in use
- Server startup detection
Next Steps
- Debug why extension doesn't show changes in Extension Development Host
- Check VSCode Output and Debug Console for errors
- Verify TypeScript compilation succeeded
- Test if language features (syntax highlighting, snippets) work
- Test if preview command appears and executes
- Once working, package extension:
vsce package - Publish to VSCode Marketplace or use locally
Additional Notes
- Icon created from official gtext logo (weaverbird only, transparent background)
- All file paths use forward slashes (cross-platform)
- Server uses polling-based auto-refresh (1 second interval)
- Extension properly cleans up server process on deactivation
Related Files
- gtext server:
gtext/gtext/server.py - gtext CLI:
gtext/gtext/cli.py - Test file:
gtext/temp/test.md.gtext - Extension:
vscode-gtext/src/extension.ts
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels