Enhance refactor commands with controller-aware Route() updates and fix code quality violations

Add semantic token highlighting for 'that' variable and comment file references in VS Code extension
Add Phone_Text_Input and Currency_Input components with formatting utilities
Implement client widgets, form standardization, and soft delete functionality
Add modal scroll lock and update documentation
Implement comprehensive modal system with form integration and validation
Fix modal component instantiation using jQuery plugin API
Implement modal system with responsive sizing, queuing, and validation support
Implement form submission with validation, error handling, and loading states
Implement country/state selectors with dynamic data loading and Bootstrap styling
Revert Rsx::Route() highlighting in Blade/PHP files
Target specific PHP scopes for Rsx::Route() highlighting in Blade
Expand injection selector for Rsx::Route() highlighting
Add custom syntax highlighting for Rsx::Route() and Rsx.Route() calls
Update jqhtml packages to v2.2.165
Add bundle path validation for common mistakes (development mode only)
Create Ajax_Select_Input widget and Rsx_Reference_Data controller
Create Country_Select_Input widget with default country support
Initialize Tom Select on Select_Input widgets
Add Tom Select bundle for enhanced select dropdowns
Implement ISO 3166 geographic data system for country/region selection
Implement widget-based form system with disabled state support

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
root
2025-10-30 06:21:56 +00:00
parent e678b987c2
commit f6ac36c632
5683 changed files with 5854736 additions and 22329 deletions

View File

@@ -107,6 +107,10 @@ class RouteExists_CodeQualityRule extends CodeQualityRule_Abstract
return;
}
// Get original file content for extracting actual controller/method names
// (The $contents parameter may be sanitized with strings replaced by spaces)
$original_contents = file_get_contents($file_path);
// Pattern to match Rsx::Route and Rsx.Route calls (NOT plain Route())
// Matches both single and double parameter versions:
// - Rsx::Route('Controller') // PHP, defaults to 'index'
@@ -122,11 +126,15 @@ class RouteExists_CodeQualityRule extends CodeQualityRule_Abstract
// First check two-parameter calls
if (preg_match_all($pattern_two_params, $contents, $matches, PREG_OFFSET_CAPTURE)) {
// Also match against original content to get real controller/method names
preg_match_all($pattern_two_params, $original_contents, $original_matches, PREG_OFFSET_CAPTURE);
foreach ($matches[0] as $index => $match) {
$full_match = $match[0];
$offset = $match[1];
$controller = $matches[1][$index][0];
$method = $matches[2][$index][0];
// Extract controller and method from ORIGINAL content, not sanitized
$controller = $original_matches[1][$index][0] ?? $matches[1][$index][0];
$method = $original_matches[2][$index][0] ?? $matches[2][$index][0];
// Skip if contains template variables like {$variable}
if (str_contains($controller, '{$') || str_contains($controller, '${') ||
@@ -147,9 +155,9 @@ class RouteExists_CodeQualityRule extends CodeQualityRule_Abstract
// Calculate line number
$line_number = substr_count(substr($contents, 0, $offset), "\n") + 1;
// Extract the line for snippet
$lines = explode("\n", $contents);
$code_snippet = isset($lines[$line_number - 1]) ? trim($lines[$line_number - 1]) : $full_match;
// Extract the line for snippet - use ORIGINAL file content, not sanitized
$original_lines = explode("\n", $original_contents);
$code_snippet = isset($original_lines[$line_number - 1]) ? trim($original_lines[$line_number - 1]) : $full_match;
// Build suggestion
$suggestion = $this->build_suggestion($controller, $method);
@@ -167,6 +175,9 @@ class RouteExists_CodeQualityRule extends CodeQualityRule_Abstract
// Then check single-parameter calls (avoiding overlap with two-parameter calls)
if (preg_match_all($pattern_one_param, $contents, $matches, PREG_OFFSET_CAPTURE)) {
// Also match against original content to get real controller names
preg_match_all($pattern_one_param, $original_contents, $original_matches, PREG_OFFSET_CAPTURE);
foreach ($matches[0] as $index => $match) {
$full_match = $match[0];
$offset = $match[1];
@@ -178,7 +189,8 @@ class RouteExists_CodeQualityRule extends CodeQualityRule_Abstract
continue; // This is a two-parameter call, already handled above
}
$controller = $matches[1][$index][0];
// Extract controller from ORIGINAL content, not sanitized
$controller = $original_matches[1][$index][0] ?? $matches[1][$index][0];
$method = 'index'; // Default to 'index'
// Skip if contains template variables like {$variable}
@@ -194,9 +206,9 @@ class RouteExists_CodeQualityRule extends CodeQualityRule_Abstract
// Calculate line number
$line_number = substr_count(substr($contents, 0, $offset), "\n") + 1;
// Extract the line for snippet
$lines = explode("\n", $contents);
$code_snippet = isset($lines[$line_number - 1]) ? trim($lines[$line_number - 1]) : $full_match;
// Extract the line for snippet - use ORIGINAL file content, not sanitized
$original_lines = explode("\n", $original_contents);
$code_snippet = isset($original_lines[$line_number - 1]) ? trim($original_lines[$line_number - 1]) : $full_match;
// Build suggestion
$suggestion = $this->build_suggestion($controller, $method);