-
Open the extension folder in VS Code:
c:\Users\Joseph Ridder\Documents\SWG-Source\swg-stf-editor-extension -
Press
F5to launch the Extension Development Host window -
A new VS Code window will open with the extension loaded
You have STF files in your workspace! They're located in:
c:\Users\Joseph Ridder\Documents\SWG-Source\client-assets-master\string\en\
Example STF files you can test with:
- Any
.stffiles in thestring/en/directory - Common ones include UI strings, creature names, etc.
Method 1: File Explorer
- In the Extension Development Host window, open your SWG-Source folder
- Navigate to
client-assets-master\string\en\ - Right-click any
.stffile - Select "Open With..." > "SWG String File Editor"
Method 2: Command Palette
- Press
Ctrl+Shift+P - Type "Open SWG String File"
- Browse to
client-assets-master\string\en\ - Select any
.stffile
-
The file should open in a custom editor showing text format like:
[string_name] id=0 crc=123456 text=Some localized text -
Make a change to one of the
text=lines -
Press
Ctrl+Sto save -
Close and reopen the file to verify your changes were saved
To verify the extension is correctly writing binary files:
- Open an STF file with the extension
- Make a simple change
- Save the file
- Check the file size - it should still be reasonable (not massively larger)
- Try opening with the original LocalizationTool (if available) to verify compatibility
- Action: Open any STF file
- Expected: File content displays as readable text
- Verify: Check that all sections appear with [name], id=, crc=, text=
- Action: Edit a text field and save
- Expected: File saves without errors
- Verify: Reopen file and see your changes
- Action: Add text with newlines:
text=Line 1\\nLine 2 - Expected: Saves correctly
- Verify: Reopen shows the escaped newline
- Action: Add a new section at the end:
[test_string] id=9999 crc=0 text=Test text - Expected: Saves successfully
- Verify: Reopen shows the new entry
- Action: Open multiple STF files simultaneously
- Expected: Each file works independently
- Verify: Changes in one don't affect the other
- Check the Output panel: View > Output > Select "Extension Host"
- Look for any error messages
- Check that the file has
.stfextension - Try reloading:
Ctrl+Shift+P> "Developer: Reload Window"
- Check file permissions
- Verify the file is a valid STF file (starts with 0xDEADBEEF magic number)
- Look at the developer console: Help > Toggle Developer Tools
- Keep backups of original files
- Check the text format for syntax errors
- Verify IDs are unique integers
- Check that section headers use
[name]format correctly
Run this command to find all STF files:
Get-ChildItem -Path "c:\Users\Joseph Ridder\Documents\SWG-Source" -Filter "*.stf" -Recurse | Select-Object FullNameCommon locations:
client-assets-master\string\en\*.stf- Look for subdirectories with localization data
To verify the binary format is correct:
# View first 20 bytes of an STF file in hex
Format-Hex -Path "path\to\file.stf" -Count 20Expected output should start with:
EF BE AD DE(magic number in little-endian)- Followed by version byte (00 or 01)
The extension is working correctly if:
- ✅ STF files open and display readable text
- ✅ Text edits save successfully
- ✅ Reopened files show the saved changes
- ✅ File sizes remain reasonable
- ✅ No errors appear in the output panel
- ✅ Multiple files can be edited simultaneously
- Package the extension:
vsce package - Install locally: Test the .vsix file
- Share with testers: Get feedback from other SWG developers
- Publish: Follow BUILD.md instructions for marketplace publication
If you find bugs:
- Note the exact steps to reproduce
- Check the Output panel for error messages
- Save the problematic STF file (if safe to share)
- Document the expected vs. actual behavior
For large files:
- Find the largest STF file in your workspace
- Open it and measure load time
- Make an edit and measure save time
- Verify memory usage (Task Manager or Activity Monitor)
Target performance:
- Load: <2 seconds for files under 1MB
- Save: <1 second for typical files
- Memory: <100MB total
Happy Testing! 🧪
Once you've verified everything works, you're ready to publish to the VS Code Marketplace!