{"id":46099733,"url":"https://github.com/vix-4800/rector-vsc","last_synced_at":"2026-04-06T11:04:11.718Z","repository":{"id":323751649,"uuid":"1094520077","full_name":"vix-4800/rector-vsc","owner":"vix-4800","description":"Rector integration for Visual Studio Code","archived":false,"fork":false,"pushed_at":"2025-12-13T11:20:11.000Z","size":87,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-12-15T01:35:12.286Z","etag":null,"topics":["php","rector","refactoring","vscode-extension"],"latest_commit_sha":null,"homepage":"https://marketplace.visualstudio.com/items?itemName=vix.rector-vscode","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/vix-4800.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-11-11T20:21:22.000Z","updated_at":"2025-12-13T11:19:56.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/vix-4800/rector-vsc","commit_stats":null,"previous_names":["vix-4800/rector-vsc"],"tags_count":9,"template":false,"template_full_name":null,"purl":"pkg:github/vix-4800/rector-vsc","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vix-4800%2Frector-vsc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vix-4800%2Frector-vsc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vix-4800%2Frector-vsc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vix-4800%2Frector-vsc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vix-4800","download_url":"https://codeload.github.com/vix-4800/rector-vsc/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vix-4800%2Frector-vsc/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29981506,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-01T16:35:47.903Z","status":"ssl_error","status_checked_at":"2026-03-01T16:35:44.899Z","response_time":124,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["php","rector","refactoring","vscode-extension"],"created_at":"2026-03-01T19:34:44.032Z","updated_at":"2026-04-06T11:04:11.712Z","avatar_url":"https://github.com/vix-4800.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Rector for VS Code\n\n[Rector](https://github.com/rectorphp/rector) integration for Visual Studio Code. Provides automated refactoring for PHP\ncode.\n\n## Features\n\n- Apply Rector refactoring rules to current file\n- **Refactor multiple files and folders** via Explorer context menu\n- Preview changes before applying with diff view\n- Optional auto-fix on file save\n- **Lint on save** — highlights lines Rector would change without modifying the file, with quick-fix actions to apply or diff\n- **CodeLens buttons** for quick access to Rector commands directly in PHP files\n- Automatic Rector config file detection\n- Clear Rector cache\n- Output channel with detailed logging of Rector commands and results\n\n## Requirements\n\n- Rector installed globally or in project\n- Rector configuration file (`rector.php`)\n\n## Installation\n\nInstall Rector globally:\n\n```bash\ncomposer global require rector/rector\n```\n\nOr in your project:\n\n```bash\ncomposer require --dev rector/rector\n```\n\n## Usage\n\n### Commands\n\n- **Rector: Process Current File** - Apply Rector to the current file\n- **Rector: Process Current File (Show Diff)** - Preview changes before applying\n- **Rector: Refactor Selected Files/Folders** - Apply Rector to selected files or folders in Explorer\n- **Rector: Clear Cache** - Clear Rector cache\n- **Rector: Show Output** - Open the PHP Rector output channel\n\nCommands are available via:\n\n- Command Palette (`Ctrl+Shift+P` / `Cmd+Shift+P`)\n- Editor context menu (right click)\n- **Explorer context menu** (right click on files or folders)\n\n## Configuration\n\n### `rector.enabled`\n\n- Type: `boolean`\n- Default: `true`\n- Description: Enable/disable the extension\n\n### `rector.executablePath`\n\n- Type: `string`\n- Default: `\"rector\"`\n- Description: Path to Rector executable. Supports VS Code variables.\n- Examples:\n  - `\"rector\"` - global installation\n  - `\"./vendor/bin/rector\"` - project installation (relative to workspace)\n  - `\"~/bin/rector\"` - home directory expansion\n  - `\"${workspaceFolder}/vendor/bin/rector\"` - using workspace variable\n  - `\"/home/user/.config/composer/vendor/bin/rector\"` - absolute path\n\n### `rector.configPath`\n\n- Type: `string`\n- Default: `\"\"`\n- Description: Path to Rector configuration file. Supports VS Code variables.\n- Examples:\n  - `\"\"` - empty (auto-detection)\n  - `\"./rector.php\"` - relative to workspace\n  - `\"~/config/rector.php\"` - home directory expansion\n  - `\"${workspaceFolder}/rector.php\"` - using workspace variable\n  - `\"${workspaceFolder}/config/rector.php\"` - config in subdirectory\n  - `\"/absolute/path/to/rector.php\"` - absolute path\n- Note: If not specified, the extension searches for `rector.php` or `rector.php.dist` in parent directories\n\n### Supported Variables\n\nThe following VS Code variables are supported in `rector.executablePath` and `rector.configPath`:\n\n- `${workspaceFolder}` - The path of the folder opened in VS Code\n- `${workspaceFolderBasename}` - The name of the folder opened in VS Code without slashes\n- `${file}` - The current opened file (context-dependent)\n- `${fileBasename}` - The current opened file's basename\n- `${fileBasenameNoExtension}` - The current opened file's basename with no extension\n- `${fileExtname}` - The current opened file's extension\n- `${fileDirname}` - The current opened file's directory\n- `${fileDirnameBasename}` - The current opened file's directory name\n- `${userHome}` - The path of the user's home directory\n\n### `rector.enableAutofix`\n\n- Type: `boolean`\n- Default: `false`\n- Description: Automatically apply Rector changes on file save\n\n### `rector.showDiffOnSave`\n\n- Type: `boolean`\n- Default: `false`\n- Description: Show diff before applying changes on save (only works if `enableAutofix` is enabled)\n\n### `rector.clearCacheBeforeRun`\n\n- Type: `boolean`\n- Default: `false`\n- Description: Clear Rector cache before each run\n\n### `rector.enableCodeLens`\n\n- Type: `boolean`\n- Default: `true`\n- Description: Enable/disable CodeLens buttons in PHP files for quick access to Rector commands\n- Note: CodeLens buttons appear at the top of each PHP file and provide quick actions:\n  - **Run Rector** - Apply changes immediately\n  - **Run Rector (Show Diff)** - Preview changes before applying\n\n### `rector.lintOnSave` _(Experimental)_\n\n- Type: `boolean`\n- Default: `false`\n- Description: Run Rector in dry-run mode on every save and highlight lines that would be changed, without modifying the file\n- Notes:\n  - Changed lines are shown as `Information` diagnostics in the editor gutter and the Problems panel with the message **\"Rector: improvement available\"**\n  - A spinner appears in the status bar while the analysis is running\n  - A quick-fix lightbulb (`Ctrl+.`) on any highlighted line offers **Apply Rector changes** and **Show Rector diff** actions\n  - Diagnostics are cleared automatically when the file is closed or changes are applied\n  - Cannot be combined with `rector.enableAutofix` — if autofix is enabled it takes priority\n\n## Example Configuration\n\nAdd to `.vscode/settings.json`:\n\n```json\n{\n  \"rector.enabled\": true,\n  \"rector.executablePath\": \"${workspaceFolder}/vendor/bin/rector\",\n  \"rector.configPath\": \"${workspaceFolder}/rector.php\",\n  \"rector.enableAutofix\": false,\n  \"rector.showDiffOnSave\": false,\n  \"rector.enableCodeLens\": true,\n  \"rector.lintOnSave\": false\n}\n```\n\n## License\n\n[MIT License](LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvix-4800%2Frector-vsc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvix-4800%2Frector-vsc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvix-4800%2Frector-vsc/lists"}