QBasic Nexus ⚙️
Enhances QBasic development in VS Code with syntax highlighting, code snippets, and robust support for your externally installed QB64 compiler. Features include auto-detection of your QB64 installation or manual path configuration.
✨ Features
- Flexible QB64 Integration:
- Auto-Detection: Attempts to automatically find your existing QB64 installation on startup.
- Manual Configuration: Allows you to specify the exact path to your QB64 executable via VS Code settings.
- Compile & Run 🚀: Compile your QBasic code and run it in the integrated terminal with a single command.
- Compile Only 🌀: Compile your code to create a standalone executable file (
.exe on Windows, or a plain executable on macOS/Linux).
- Cross-Platform Support: Works seamlessly on Windows, macOS, and Linux.
- Status Bar Integration: Easily access the Compile & Run command from an icon in the status bar whenever a
.bas or .bi file is open.
- Detailed Output Panel: View detailed logs, progress, and errors from the compilation process in a dedicated "QBasic Nexus Compiler" output channel.
- Integrated Terminal Execution: Runs the compiled program directly in the VS Code integrated terminal.
- Customizable Compiler Arguments: Pass additional arguments to the QB64 compiler via settings.
- Syntax Highlighting & Snippets: Rich language support for QBasic and QB64.
⚙️ Prerequisites
For QBasic Nexus to compile your code, your QB64 installation must be correctly set up.
🚀 Getting Started
- Install & Set Up QB64:
- a. Obtain and extract the QB64 build of your choice. We recommend the Legacy release from qb64.com, though you’re free to use the QB64 Phoenix Edition from qb64phoenix.com as well.
- b. (Crucial for macOS/Linux) Open a terminal, navigate into the unzipped QB64 directory, and run the required setup script:
- On macOS:
sh ./setup_osx.command
- On Linux:
sh ./setup_lnx.sh
- This step is essential as it configures the compiler. The extension will not work without it.
- Install this Extension: Find "QBasic Nexus" in the VS Code Marketplace and install it.
- Compiler Path Configuration (If Needed):
- On first activation (or if the path is not set), the extension will try to auto-detect your QB64 installation.
- If successful, and you confirm by clicking "Yes, use this path" in the notification, the path will be saved in your global settings.
- If auto-detection fails, or you prefer to set it manually:
- Open VS Code Settings (
Ctrl+, or Cmd+, ).
- Search for
QBasic Nexus Compiler Path .
- Enter the full, absolute path to your
qb64.exe (Windows) or qb64 (macOS/Linux) executable.
- Example Windows:
C:\QB64\qb64.exe
- Example macOS:
/Applications/qb64/qb64
- Example Linux:
/home/youruser/qb64/qb64
- Open a QBasic File: Open a file with a
.bas or .bi extension.
- Using the Extension:
- When a
.bas or .bi file is active and the compiler path is set, you'll see a 🔥 Compile .BAS icon in the Status Bar. Clicking this icon will compile and run the file.
- If the path is not set, the Status Bar will show
⚠️ Set QB64 Path . Clicking it will open the settings.
📦 Available Commands
📄 Understanding the Output
- Output Panel ("QBasic Nexus Compiler" channel):
- Shows auto-detection attempts, compiler path information, the exact command being executed, and detailed compilation logs (COMPILE SUCCESSFUL ✅ or COMPILE FAILED ❌, error messages from QB64).
- Terminal Panel ("QBasic Nexus: Run Output" tab):
- Displays the output of your running QBasic program (e.g., from
PRINT statements) when using "Compile & Run".
- Executable File:
- Created in the same directory as your source
.bas or .bi file.
🛠️ Configuration
You can configure the extension via VS Code Settings:
Search for "QBasic Nexus" in VS Code Settings to find these options.
🆘 Troubleshooting
If you encounter issues while compiling, try these steps:
Check the "QBasic Nexus Compiler" Output Panel:
- This is the first place to look! It provides detailed logs from the compilation process and often contains error messages that point to the root cause.
- Press
Ctrl+Shift+U (or Cmd+Shift+U on Mac) to open the Output panel, then select "QBasic Nexus Compiler" from the dropdown.
Issue: "ERROR: C++ compilation failed. Check ./internal/temp/compilelog.txt for details." (Common on Linux/macOS)
- Cause: QB64 successfully translated your QBasic code to C++, but it failed to compile that C++ code into an executable. This usually means:
- QB64 Not Set Up Correctly: You may have missed running the
setup_lnx.sh or setup_osx.command script after unzipping QB64. See the Prerequisites section.
- C++ Compiler Not Installed/Configured:
- Linux: Ensure
build-essential (which includes g++ ) is installed: sudo apt-get install build-essential .
- macOS: Ensure
Xcode Command Line Tools are installed: xcode-select --install .
- Solution:
- Examine
compilelog.txt : This log file is located within your QB64 installation directory, inside the internal/temp/ subfolder (e.g., if QB64 is at /home/user/qb64/ , the log is at /home/user/qb64/internal/temp/compilelog.txt ).
- Open this log file and look for specific error messages from
g++ or clang .
- If unsure, search for these error messages online or ask in QB64 communities.
Issue: "QB64 compiler path is not set." or "QB64 compiler not found at the specified path."
- Cause: The extension cannot find your QB64 executable, or it hasn't been made executable by the setup script on Linux/macOS.
- Solution:
- Ensure you have installed and correctly set up QB64 by running its setup script (see Prerequisites).
- Go to VS Code Settings (search for "QBasic Nexus Compiler Path") and enter the correct, full path to your
qb64.exe (Windows) or qb64 (Linux/macOS) file.
- Double-check the path for typos and ensure the file exists at that location.
Issue: "Failed to set execute permission on QB64" (Common on Linux/macOS)
Other Issues:
- Ensure your QBasic code itself has no syntax errors.
- Try compiling your
.bas file directly from the QB64 IDE (if available) to see if it compiles there normally. This can help isolate whether the issue is with the code, QB64, or the extension's interaction.
If you still face issues, please open an issue on the GitHub Repository Issuse and include the full logs from the "QBasic Nexus Compiler" Output Panel and the compilelog.txt file (if applicable).
📄 License
MIT License
Copyright (c) 2025 Thirawat Sinlapasomsak
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
| |