# microptyhon_vscode **Repository Path**: guluguluchui/microptyhon_vscode ## Basic Information - **Project Name**: microptyhon_vscode - **Description**: No description available - **Primary Language**: Unknown - **License**: MIT - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2025-11-10 - **Last Updated**: 2025-11-10 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # MicroPython Extension for VS Code A comprehensive VS Code extension for MicroPython development that enables seamless connection to MicroPython devices, code upload/download, and provides integrated development tools. ## ๐Ÿš€ Features ### Device Connection - **Serial (USB) Connection**: Connect to MicroPython devices via USB serial ports - **WebREPL Connection**: Connect wirelessly to MicroPython devices supporting WebREPL - **Auto-detection**: Automatically detect connected MicroPython devices - **Port Discovery**: Browse and select from available serial ports ### File Management - **Device File Explorer**: Browse files and directories on your MicroPython device - **Upload Files**: Upload Python files from your local workspace to the device - **Download Files**: Download files from the device to your local workspace - **Run Files**: Execute Python files directly on the connected device ### REPL Integration - **Interactive Terminal**: Built-in REPL terminal for direct interaction with your device - **Real-time Communication**: Send commands and receive responses in real-time - **Special Commands**: Support for Ctrl+C (interrupt) and Ctrl+D (soft reset) ### IntelliSense Support (๐Ÿ†• Built-in) - **Auto-Completion**: Intelligent code completion for MicroPython APIs - **Type Hints**: Full type information for all MicroPython modules - **Go to Definition**: Jump to MicroPython API definitions - **Parameter Info**: See function signatures and documentation - **Device-Specific APIs**: Automatic support for ESP32 and Raspberry Pi Pico - **Built-in Stubs**: No manual configuration needed! ## ๐Ÿ“‹ Requirements - VS Code 1.105.0 or higher - Node.js (for development) - MicroPython device (ESP32, ESP8266, Raspberry Pi Pico, etc.) ## ๐Ÿ”ง Installation 1. Clone or download this repository 2. Open the project in VS Code 3. Run `npm install` to install dependencies 4. Press `F5` to run the extension in development mode ## ๐Ÿ“š Documentation - **[IntelliSense Guide](INTELLISENSE_GUIDE.md)** - ๐Ÿ†• ๅ†…็ฝฎ IntelliSense ๅŠŸ่ƒฝ่ฏดๆ˜Žๅ’Œไฝฟ็”จ็คบไพ‹ - **[Commands Reference](COMMANDS_REFERENCE.md)** - ่ฏฆ็ป†็š„ๅ‘ฝไปค่ฏดๆ˜Žๅ’Œๅฎž็ŽฐๅŽŸ็† - **[Visual Guide](VISUAL_GUIDE.md)** - ๅฏ่ง†ๅŒ–ไฝฟ็”จๆŒ‡ๅ—๏ผŒๅŒ…ๅซๅ›พๆ ‡ๆŒ‰้’ฎไฝ็ฝฎ - **[Quick Start](QUICKSTART.md)** - ๅฟซ้€Ÿๅผ€ๅง‹ๆŒ‡ๅ— - **[Debug Guide](DEBUG_GUIDE.md)** - ่ฐƒ่ฏ•ๅ’Œๆต‹่ฏ•ๆŒ‡ๅ— - **[Installation Guide](INSTALLATION.md)** - ๅฎ‰่ฃ…่ฏดๆ˜Ž - **[Troubleshooting](TROUBLESHOOT.md)** - ๆ•…้šœๆŽ’้™คๆŒ‡ๅ— ## โš™๏ธ Configuration The extension contributes the following settings: ### Device Connection - `micropython.autoConnect`: Automatically connect to MicroPython device on startup (default: false) - `micropython.port`: Serial port for MicroPython device connection - `micropython.baudRate`: Baud rate for serial communication (default: 115200) - `micropython.webReplUrl`: WebREPL URL for wireless connection (default: "ws://192.168.4.1:8266/") - `micropython.webReplPassword`: WebREPL password for wireless connection ### IntelliSense (๐Ÿ†•) - `micropython.enableIntelliSense`: Enable IntelliSense support for MicroPython (default: true) - `micropython.customStubsPath`: Custom path to additional MicroPython stubs (optional) ## ๐ŸŽฏ Usage ### Connecting to a Device 1. **Via Command Palette**: - Press `Ctrl+Shift+P` (Windows/Linux) or `Cmd+Shift+P` (macOS) - Type "MicroPython: Connect Device" - Choose Serial (USB) or WebREPL (WiFi) connection 2. **Via Device Explorer**: - Open the MicroPython Device view in the Explorer panel - Click the "Connect" button ### Managing Files - **Upload**: Right-click a Python file and select "MicroPython: Upload File to Device" - **Download**: In the Device Explorer, right-click a file and select "Download File from Device" - **Run**: Click the "Run" button next to Python files in the Device Explorer ### Using REPL - Use command "MicroPython: Open REPL Terminal" to open an interactive terminal - Type Python commands directly to interact with your device - Use `Ctrl+C` to interrupt running code and `Ctrl+D` for soft reset ## ๐Ÿ—๏ธ Development ### Project Structure ``` src/ โ”œโ”€โ”€ extension.ts # Main extension entry point โ”œโ”€โ”€ deviceConnectionManager.ts # Device connection handling โ”œโ”€โ”€ deviceFileManager.ts # File operations โ”œโ”€โ”€ deviceExplorer.ts # Device file tree view โ”œโ”€โ”€ replTerminal.ts # REPL terminal implementation โ””โ”€โ”€ serialPortDiscovery.ts # Serial port detection ``` ### Building ```bash npm run compile # Compile TypeScript npm run watch # Watch mode for development npm run package # Build for production ``` ### Testing ```bash npm run test # Run tests npm run lint # Lint code ``` ## ๐Ÿ› Known Issues - WebSocket warnings during compilation (can be safely ignored) - Binary file transfers are not yet supported - Large file uploads may timeout ## ๐Ÿ“ Release Notes ### 0.0.1 - Initial release - Serial and WebREPL connection support - Device file explorer - File upload/download functionality - Integrated REPL terminal - Auto-detection of MicroPython devices ## ๐Ÿค Contributing Contributions are welcome! Please feel free to submit a Pull Request. ## ๐Ÿ“„ License This project is licensed under the MIT License. ## ๐Ÿ”— Resources - [MicroPython Documentation](https://docs.micropython.org/) - [VS Code Extension API](https://code.visualstudio.com/api) - [Serial Port Communication](https://github.com/serialport/node-serialport)