A versatile VSCode extension designed to instantly correct typos across all text files, streamlining your coding workflow with seamless LLM-powered typo correction.
You can use OpenAI chat completion API and also OpenAI compatible chat completion API like groq.
- Quickly fix typos in your line.
- Highlights the fixed typos for a short period of time.
-
Visual Studio Code >= 1.87.0
-
- Note that you can use the API key for an OpenAI compatible chat completion API like groq.
You can install this extension in two ways:
-
Download the
.vsix
file from https://github.com/hmasdev/QuickTypoFix/releases -
Install the extension with
install from VSIX...
in VS Code.
-
Clone the repository:
git clone https://github.com/hmasdev/QuickTypoFix
-
Change to the directory:
cd QuickTypoFix
-
Install the dependencies:
npm install
-
Build the extension:
vsce package
-
Install the extension with
install from VSIX...
in VS Code in the same way as the above.
Open the setting page with Ctrl+,
and search quicktypofix
.
Then you can customize this extension as follows:
- REQUIRED
quicktypofix.apiKey
: The API key for typo corrections. Default is an empty string;
- Optional
quicktypofix.apiEndpoint
: The OpenAI-compatible chat completion API endpoint for typo corrections. Default is https://api.openai.com/v1/chat/completions;quicktypofix.modelName
: The LLM model name for typo corrections. Default isgpt-4o-mini
;quicktypofix.systemPrompt
: The system prompt for typo corrections. Default is 'Excellent Typo Fixer. Output the only fixed sentence without any header or any footer.';quicktypofix.highlightTimeout
: The timeout for the highlight in milliseconds. Default is 3000;quicktypofix.addedHighlightColor
: The highlight color for added characters likergba(0, 255, 0, 0.5)
or#00FF00
. Default isrgba(0, 255, 0, 0.5)
;quicktypofix.removedHighlightColor
: The highlight color for removed characters likergba(255, 0, 0, 0.5)
or#FF0000
. Default isrgba(255, 0, 0, 0.5)
;
During writing codes or texts in VS Code, you can use the QuickTypoFix command to fix typos in the following two ways.
Ctrl+Shift+P
to open the command palette, then typeFix typo in this line
and select the command.
or
-
Crtl+K Ctrl+N
to execute the command directly.- NOTE: You can remeber the shortcut by
Ctrl+K
followed byCtrl+N
as "これ直して(Kore Naoshite)".
- NOTE: You can remeber the shortcut by
After fixed, the typo will be highlighted for a short period of time. Check them.
- Node.js >= v20.11.1
- npm
- Dependencies (See the package.json for the details)
- vsce >= 2.24.0
- diff >= 5.2.0
- [node-fetch](https://www.npmjs.com/package/ node-fetch) >= 2.6.7
- Dependencies (See the package.json for the details)
-
Fork the repository: https://github.com/hmasdev/QuickTypoFix/fork
-
Clone the forked repository:
git clone https://github.com/{YOUR_ACCOUT_HERE}/QuickTypoFix
-
Change to the directory:
cd QuickTypoFix
-
Git checkout to the branch for development:
git checkout -b {YOUR_BRANCH_NAME_HERE}
-
Install the dependencies:
npm install
-
Edit the source code. Some notes as follows:
- Implement tests as follows:
- Unit Test: attach 'Unit Test' to the title in
describe
- Integration Test: attach 'Integration Test' to the title in
describe
- Note that "Integration Test" means the tests which require an external services like the OpenAI API.
- Unit Test: attach 'Unit Test' to the title in
- Implement tests as follows:
-
Test the extension:
-
Unit Test
npm run test
-
Integration Test
npm run test-integration
Note that you need to add your OpenAI API key to the
.env
file before running integration tests. The.env
file should be like this:OPENAI_API_KEY={YOUR_OPENAI_API_KEY}
-
-
Git commit and push the changes:
git add . git commit -m "Add xxxx feature" git push origin add_xxxx_feature
-
Create a pull request from the following link:
https://github.com/hmasdev/QuickTypoFix/compare/master...{YOUR_ACCOUT_HERE}:QuickTypoFix:{YOUR_BRANCH_NAME_HERE}
Release the extension is automated by GitHub Actions. The following steps are for the maintainers:
npm version {HERE_IS_THE_VERSION}
git push origin {HERE_IS_THE_VERSION}
where the tag format must be %d.%d.%d
like 0.0.1
.
After that, the maintainers should check the release page: https://github.com/hmasdev/QuickTypoFix/releases
-
Specify the versions of requirements - Implement the customizable dictionaries
-
Add the tests for ./temporalHighlight.js