The Rename Identifier Extension for Visual Studio Code helps you easily rename identifiers in JavaScript files with the assistance of Artificial Intelligence. It works seamlessly with the LLM Plugin Extension, leveraging Gemini AI to suggest better identifier names.
- Identify and Highlight Identifiers: Identifies all the variables, functions, and identifiers in your JavaScript code.
- AI-powered Suggestions: Receives suggestions for better identifier names using the Gemini AI model.
- Double-click to Rename: Allows you to double-click on a suggestion to update all occurrences of the identifier in your code.
- Scope Awareness: The extension maintains scope awareness to avoid renaming identifiers outside the selected context.
- LLM-Plugin: Connects Visual Studio Code with Gemini AI via API.
- @types/chai: TypeScript definitions for Chai.
- @types/mocha: TypeScript definitions for Mocha.
- @types/node: TypeScript definitions for Node.js.
- @types/sinon: TypeScript definitions for Sinon.
- @types/vscode: TypeScript definitions for the Visual Studio Code API.
- @typescript-eslint/eslint-plugin: ESLint rules for TypeScript.
- @typescript-eslint/parser: ESLint parser for TypeScript.
- eslint: JavaScript linter for ensuring code quality.
- typescript: Superset of JavaScript with static typing support.
- ts-node: TypeScript execution environment for Node.js.
- acorn: A fast, small JavaScript parser.
- sinon: Test spies, stubs, and mocks for JavaScript.
- Clone the project.
- Navigate to
LLMConsumerFrontend/rename-identifier. - Run
npm ito install dependencies. - Run
npm run compileto compile the extension.
Press F5 to run the extension in debug mode within Visual Studio Code.
- Install VSCE by running:
npm install -g @vscode/vsce. - Package the extension by running:
vsce package.
- Install the LLM-Plugin extension.
- Install the Rename Identifier extension.
- Click on the search icon in the top bar to highlight the identifiers in your code.
- Double-click on any identifier to get AI suggestions for better names.
- Double-click on any name from the suggestions to replace it with the existing identifier.
The LLM Plugin Extension enables communication between Visual Studio Code and the Gemini AI model via API calls. It allows you to send input prompts to the AI and retrieve intelligent suggestions directly within your coding environment.
- Send Input to Gemini AI: Allows users to send prompts and retrieve intelligent suggestions from the Gemini AI model.
- Retry Mechanism: Ensures reliable communication with the AI service using a retry mechanism in case of network or server issues.
- API Key Management: Encrypts and securely manages your API key locally.
- Custom Storage Path for API Key: Allows users to specify the storage path for their API key.
- axios: Handles HTTP requests to interact with the Gemini AI API.
- esbuild: Fast bundler for building the extension.
- npm-run-all: Allows parallel and sequential running of scripts.
- typescript: TypeScript support for the extension.
- eslint: Linter for TypeScript codebase.
- @typescript-eslint/eslint-plugin: TypeScript-specific ESLint rules.
- @types/vscode: Provides type definitions for the VS Code API.
- @types/node: Provides type definitions for Node.js.
- jest: Testing framework for running tests.
- ts-jest: Jest plugin for TypeScript.
- @vscode/test-cli: CLI for running VS Code extension tests.
- @vscode/test-electron: Framework for testing extensions in the VS Code Electron environment.
- Clone the repository.
- Navigate to the
llm-pluginfolder. - Run
npm ito install dependencies. - Run
npm run compileto compile the extension.
Press F5 to run the extension in debug mode within Visual Studio Code.
- Install VSCE by running:
npm install -g @vscode/vsce. - Package the extension by running:
vsce package.
- Install the LLM-Plugin extension.
- The extension communicates directly with Gemini AI, sending input and retrieving suggestions based on your prompt.
-
Install both extensions:
- Install LLM-Plugin Extension for communication with Gemini AI.
- Install Rename Identifier Extension to help you rename variables using AI suggestions.
-
Rename Identifiers:
- Open your JavaScript code and click on the search icon in the top bar to highlight the identifiers.
- Double-click on any identifier to get suggestions from Gemini AI.
- Use the suggestions to update all occurrences of the identifier within the current scope.
This README consolidates the key information about both extensions into one place for ease of use. You can now use the Rename Identifier Extension to rename identifiers in JavaScript and the LLM Plugin Extension to interact with Gemini AI.