Overview Version History Q & A Rating & Review
Flex Language Extension for VS Code
This extension provides support for the Flex programming language in Visual Studio Code, including syntax highlighting, code completion, and execution of Flex programs.
Features
Syntax highlighting for Flex files (.lx, .flex, .fx)
Run Flex programs directly from VS Code
Optional AI-assisted coding and error handling
Support for multiple AI models (Qwen, OpenAI, LMStudio)
Cross-platform support (Windows, macOS, Linux)
Installation
Prerequisites
Install Visual Studio Code
Install the Flex Interpreter for your operating system
Install Node.js (required for running Flex scripts)
Installing the Extension
Open VS Code
Go to Extensions (Ctrl+Shift+X or Cmd+Shift+X)
Search for "Flex Language"
Click "Install"
Post-Installation Setup
After installing the extension, you'll need to configure it:
Open VS Code settings (File > Preferences > Settings)
Search for "flex" to find all Flex-related settings
Set flex.flexPath
to the directory containing your Flex interpreter's main.py
file
Optional: Configure AI settings if you want to use AI-assisted features
Common Installation Issues and Solutions
Windows Users
Windows users may experience issues with script permissions or path resolution. If you encounter any issues:
Run the Windows Fix Script:
Download windows-fix.js
Open a command prompt and navigate to the download directory
Run node windows-fix.js
Manual Fix (if the script doesn't work):
macOS and Linux Users
If you experience permission issues on macOS or Linux:
Make the script executable:
chmod +x ~/.vscode/extensions/flex-language-*/run-flex.sh
If the extension can't find the Flex interpreter, set the path manually in VS Code settings:
Go to Settings
Find flex.flexPath
Set it to the full path of your Flex interpreter directory
Usage
Running Flex Programs
Open a Flex file (with extension .lx, .flex, or .fx)
Use one of the following methods to run:
Press F5 to run without AI
Press Shift+F5 to run with AI assistance
Use the Command Palette (Ctrl+Shift+P or Cmd+Shift+P) and select "Flex: Run File" or "Flex: Run File with AI"
Stopping Execution
Press Shift+F6 or use the Command Palette and select "Flex: Stop Running"
AI Configuration
To use AI features with the extension:
Enable AI in settings: Set flex.ai.enable
to true
Choose an AI model:
Qwen : Default model, no additional setup required
OpenAI : Requires an API key set in flex.ai.apiKey
LMStudio : Requires LMStudio to be running locally, with the API URL set in flex.ai.lmstudioUrl
Configuration Options
Setting
Description
Default Value
flex.path
Path to the Flex runner script
run-flex.js
flex.flexPath
Path to the Flex interpreter directory
""
flex.ai.enable
Enable AI features
false
flex.ai.model
AI model to use (qwen, openai, lmstudio)
qwen
flex.ai.apiKey
API key for OpenAI
""
flex.ai.lmstudioUrl
URL for LMStudio API
http://localhost:1234/v1
Known Issues
The extension requires the Flex interpreter to be installed separately
AI features require specific model availability based on configuration
Terminal-based execution may behave differently across operating systems
Some special character escape sequences may not work correctly in all shells
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
License
This extension is licensed under the MIT License. See the LICENSE file for details.