Get quick fixes and refactoring suggestions
file:///workspace/main.py)| Action | Fixes |
|---|---|
| Add import | "List" is not defined → Add from typing import List |
| Remove unused | Import "os" is not accessed → Remove import os |
| Add type hint | Missing type annotation → Add : int |
| Fix indentation | Indentation error → Correct spacing |
| Action | Transform |
|---|---|
| Extract method | Selection → New function |
| Extract variable | Expression → Named variable |
| Inline variable | Variable → Direct value |
| Convert to f-string | "Hello " + name → f"Hello {name}" |
| Action | Effect |
|---|---|
| Organize imports | Sort and group imports |
| Remove unused imports | Delete unreferenced imports |
| Add all missing imports | Import all undefined names |
| Sort imports | Alphabetically sort imports |
| Kind | Category | Examples |
|---|---|---|
quickfix | Error fixes | Add import, fix syntax |
refactor | Code transformation | Extract, inline, rename |
refactor.extract | Extract operations | Extract method/variable |
refactor.inline | Inline operations | Inline variable/function |
refactor.rewrite | Rewrite patterns | Convert to f-string |
source | Source-level | Organize/sort code |
source.organizeImports | Import management | Sort and group imports |
isPreferred: true indicates the recommended one:
| Code | Reason | Solution |
|---|---|---|
FILE_NOT_FOUND | File doesn’t exist | Verify file path |
INVALID_RANGE | Range out of bounds | Check start/end positions |
NO_ACTIONS_AVAILABLE | No actions for this range | Try different selection |
PARSE_ERROR | Cannot parse file | Fix syntax errors first |
| Tier | Requests/Hour | Requests/Day |
|---|---|---|
| Free | 20 | 100 |
| Hobby | 500 | 5,000 |
| Pro | 5,000 | 50,000 |
| Enterprise | Unlimited | Unlimited |