A VS Code extension that runs PythonTA on demand and displays its diagnostics as squiggles and Problems panel entries.
Pressing Ctrl+Shift+T (or running Run PythonTA from the Command Palette) spawns python -m python_ta --output-format pyta-lsp on the active file. The extension reads the JSON output from stdout and populates a named DiagnosticCollection, so PythonTA's annotations appear in the editor.
- Node.js (v18+)
- pnpm (
npm install -g pnpm) - VS Code (v1.100+)
- A Python environment with PythonTA installed (
pip install python-ta)
# Install dependencies
pnpm install
# Compile TypeScript once
pnpm run compile
# Or watch for changes (recompiles on save)
pnpm run watchPress F5 to open an Extension Development Host window with the extension loaded. In that window, open any .py file and press Ctrl+Shift+T to trigger a check.
After editing src/extension.ts, press Ctrl+Shift+F5 in the Extension Development Host window to reload the extension without restarting.
| Setting | Default | Description |
|---|---|---|
pythonta.pythonPath |
(ms-python interpreter) | Path to the Python executable that has PythonTA installed. Falls back to python if neither this nor the ms-python extension is available. |
pythonta.configPath |
(none) | Path to a PythonTA config file (.pylintrc). Passed to the subprocess via --config. |
src/
└── extension.ts # activate(), runPythonTA(), getPythonPath()
.vscode/
├── launch.json # F5 debug configuration
└── tasks.json # compile / watch build tasks
package.json # extension manifest (commands, keybindings, configuration)
tsconfig.json
# Install the vsce tool if you don't have it
pnpm add -g @vscode/vsce
# Build a .vsix for local installation
vsce package --no-dependenciesInstall the resulting .vsix via Extensions: Install from VSIX… in the Command Palette.