Fix Mate AI
Fix Mate AI is a VSCode extension that uses AI to suggest fixes for console error messages.
The extension currently uses OpenAI’s GPT-3.5 Turbo model to generate suggestions for fixing errors. WIP: switch between AI models.
Website
Visit our website for more information.
Setup Instructions
Step 1: Install the Extension
Install the Fix Mate AI extension from the VSCode Marketplace.
Step 2: Setting Up the OpenAI API Key
FixMateAI requires an OpenAI Project API Key.
- Go to the OpenAI dashboard and create a new API key under your project settings.
- In VSCode, go to
Settings
and search for FixMateAI
.
- Paste your Project API Key in the
fixmateai.apiKey
field.
Ensure that the key is valid and associated with your OpenAI project.
For the FixMateAI extension to properly lint JavaScript and TypeScript files, an ESLint configuration file named eslint.config.mjs
is required. This configuration file defines the rules and settings for ESLint.
Create the Configuration File: Ensure that you have an eslint.config.mjs
file in the root of your project. If it does not exist, create one using the example configuration below.
Example Configuration: Below is a sample configuration for eslint.config.mjs
:
import { defineFlatConfig } from "eslint";
export default defineFlatConfig([
{
extends: [
"eslint:recommended",
"plugin:react/recommended",
"plugin:@typescript-eslint/recommended",
"prettier",
"plugin:prettier/recommended",
],
parser: "@typescript-eslint/parser",
parserOptions: {
ecmaVersion: 2021,
sourceType: "module",
},
plugins: ["react", "@typescript-eslint"],
rules: {
"prettier/prettier": "error",
// Add other custom rules here
},
settings: {
react: {
version: "detect",
},
},
},
]);
Place the File: Save the eslint.config.mjs
file in the root directory of your project. The extension will look for this file to apply linting rules.
Step 4: Use the Extension
Once your API key and ESLint configuration are set up, open any log file or console output with errors. The extension will analyze the errors and provide suggestions in the "FixMateAI" output channel.
It supports PHP and JavaScript (including TypeScript) and integrates with the OpenAI API.
Troubleshooting
If you encounter issues while using the FixMateAI extension, check the following:
"ESLint is not installed"
- Issue: The extension may indicate that ESLint is not installed.
- Solution: Ensure that ESLint is installed globally or in your workspace. You can install it using:
npm install -g eslint
“No ESLint Configuration File”
• Issue: The extension may not work correctly if the eslint.config.mjs file is missing or not properly configured.
• Solution: Ensure that you have an eslint.config.mjs file in the root of your project, and it is correctly configured as per the example above.
WIP
• Cache Results: Cache AI suggestions to avoid redundant API calls for the same error.
• User Preferences: Allow users to switch between AI models.