From 46fe506585b7a81fe5b1cdfaf8b3187af4b573c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jose=20Luis=20Monta=C3=B1es=20Ojados?= Date: Sat, 17 Jan 2026 01:48:20 +0100 Subject: [PATCH] docs: add VS Code development guide to readme --- readme.md | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/readme.md b/readme.md index aaab55f..8119452 100644 --- a/readme.md +++ b/readme.md @@ -49,3 +49,27 @@ go run ./cmd/tui --server your-ip:9987 --debug - `Enter`: Join channel. - `1`: Poke user (in User View). - `m`: Mute/Unmute audio. +## 💻 Development with VS Code + +This project uses Go **build tags** to support multiple platforms from the same codebase. This can sometimes cause "redeclared" errors or "undefined" symbols in VS Code if not configured correctly. + +### Recommended Setup + +1. **Windows + MSYS2**: If you are developing on Windows and have Opus/PortAudio installed via MSYS2, your `.vscode/settings.json` should include the paths to your MinGW64 environment: + ```json + { + "go.toolsEnvVars": { + "CGO_ENABLED": "1", + "PATH": "C:\\msys64\\mingw64\\bin;${env:PATH}", + "PKG_CONFIG_PATH": "C:\\msys64\\mingw64\\lib\\pkgconfig" + } + } + ``` +2. **Build Tags**: Do **not** force both tags simultaneously (e.g., `-tags=linux,windows`) as this will cause "redeclared" errors for types defined in both systems (like `Player` or `Capturer`). +3. **Switching OS Analysis**: If you are on Windows but want to check for errors in the Linux files, update your settings to: + ```json + "go.toolsEnvVars": { "GOOS": "linux" } + ``` + +### Pro Tip: VS Code Remote - WSL +For the best experience when working on Linux features from Windows, use the **WSL extension**. Open VS Code inside your WSL environment (`code .` from the WSL terminal). This allows `gopls` to run directly in Linux, where all system headers and libraries are natively available.