Port Debug Extension
A VS Code extension for debugging Port language files with TCP communication capabilities.
Features
- Debugging: Step-by-step execution, breakpoints, and variable inspection
- TCP Communication: Real-time connection to external Port debugger (
port.exe
)
- Syntax Highlighting: Full support for Port language syntax
- Autocomplete: Smart suggestions for SECS/GEM messages and data types
Installation
- Install the Port Debuger extension from VS Code Marketplace
- Ensure
port.exe
is available in your system PATH or project directory
Usage
Basic Debugging
- Open a Port file (
.port
) in VS Code
- Switch to the Debug viewlet (Ctrl+Shift+D)
- Select "Port Debug" from the debug configuration dropdown
- Press F5 to start debugging
Execution Control
- Continue (F5): Execute through all Port statements
- Step Over (F10): Execute next Port statement
- Step Into (F11): Detailed character-by-character execution
- Step Out (Shift+F11): Return to previous execution level
Debug Console Output
All communication is logged in a structured format:
--- SEND ---
COM12.9600.N.8.1->
{A[11]
HelloWorld\n
}
--- END SEND ---
--- RESPONSE ---
SUCCESS: [SEND][72 101 108 108 111 87 111 114 108 100 10](https://github.com/portdic/portdic-secs-autocomplete/blob/HEAD/11)
--- END RESPONSE ---
Sample Files
SECS Protocol Example (sample/secs.port
)
S7F1->
{L[4]
{A[15]
Hello.World
}
{U2
42
}
{I8
987654321
}
{B[3]
1 2 3
}
}
<-S7F1
{L[4]
{A[15]
Hello.World
}
{U2
42
}
{I8
987654321
}
{B[3]
1 2 3
}
}
Serial Communication Example (sample/serial.port
)
COM12.9600.N.8.1->
{A[11]
HelloWorld\n
}
<-COM12.9600.N.8.1
{A[11]
HelloWorld\n
}
Configuration
Extension Settings
{
"portlang.enableAutocomplete": true,
"portlang.enableSecsAutocomplete": true,
"portlang.enableDataTypeAutocomplete": true,
"portlang.enableParameterAutocomplete": true
}
Debug Configurations
Port Debug (Launch)
{
"type": "port",
"request": "launch",
"name": "Debug Port File",
"program": "${file}",
"stopOnEntry": true
}
Port Debug (External)
{
"type": "port-debug",
"request": "launch",
"name": "Port Debug",
"port": "8080",
"command": "debug"
}
Troubleshooting
Common Issues
TCP Connection Failed
- Ensure
port.exe
is running and accessible
- Check firewall settings for port 8080
Syntax Highlighting Not Working
- Ensure file has
.port
extension
- Check language mode is set to "Port"
Autocomplete Not Showing
- Enable autocomplete in settings
- Check file syntax is valid
Port Debug - Making Port language development simple and efficient.