AI Editor Extension
VS Code extension for incremental text analysis in Markdown, plaintext, and optionally code comments.
What It Does
- Checks changed text on
onDidChangeTextDocument with debounce
- Runs full-document analysis on command and optionally on save
- Publishes issues through the VS Code
Diagnostics API
- Shows hover messages for detected problems
- Adds
Quick Fix actions:
Apply suggestion: ...
Ask AI to rewrite this
Игнорировать
- Can analyze through local regex rules and an optional server API
- Opens an optional AI chat webview
Commands
| Command |
Description |
aiEditor.checkDocument |
Analyze the entire active document |
aiEditor.openAIChat |
Open the AI chat panel |
Settings
{
"aiEditor.enabledMarkdown": true,
"aiEditor.enabledPlaintext": true,
"aiEditor.enabledComments": true,
"aiEditor.ignoreWords": [],
"aiEditor.analyzeOnSave": true,
"aiEditor.analysisDebounceMs": 700,
"aiEditor.diagnosticLevel": "Warning",
"aiEditor.serverUrl": "https://www.cleartext.ru:9080"
}
| Setting |
Description |
aiEditor.enabledMarkdown |
Enable analysis for Markdown files |
aiEditor.enabledPlaintext |
Enable analysis for plaintext files |
aiEditor.enabledComments |
Enable comment-only analysis inside code files |
aiEditor.ignoreWords |
Terms that should not be flagged |
aiEditor.analyzeOnSave |
Run an additional full-document pass on save |
aiEditor.analysisDebounceMs |
Debounce delay for incremental analysis |
aiEditor.diagnosticLevel |
Base diagnostics level in the editor |
aiEditor.serverUrl |
REST API base URL for /analyze and /rewrite |
Analysis Model
- Markdown and plaintext: analyzes the changed sentence or nearby fragment
- Code files: when
enabledComments is on, analyzes only comment blocks
- Manual command and save hook: analyze the whole document
API Contract
POST /analyze
Request:
{
"text": "В данный момент осуществляется проверка текста.",
"max_issues": 100
}
Response:
{
"issues": [
{
"start": 0,
"end": 26,
"type": "style",
"message": "Канцеляризм",
"suggestion": "Сейчас проверяем текст.",
"severity": "warning"
}
]
}
POST /rewrite
Request:
{
"text": "В данный момент осуществляется проверка текста.",
"aggressive": false
}
Response:
{
"rewritten": "Сейчас проверяем текст."
}
Development
npm run compile