Skip to content

Improve translation completion, navigation, and quick fixes - #439

Open
shuvroroy wants to merge 6 commits into
PHPantom-dev:mainfrom
shuvroroy:feat/laravel-translation-depth
Open

Improve translation completion, navigation, and quick fixes#439
shuvroroy wants to merge 6 commits into
PHPantom-dev:mainfrom
shuvroroy:feat/laravel-translation-depth

Conversation

@shuvroroy

Copy link
Copy Markdown
Contributor

Laravel translation support now covers both lang/ and resources/lang/ throughout the editor:

  • JSON definitions land on the key's exact range, and references connect JSON declarations with PHP and Blade call sites.
  • Locale arguments and replacement-array keys complete for translation helpers and the Lang facade, including named arguments.
  • Hover shows each locale's value with a link to its declaration.
  • Unknown keys offer an empty entry in each existing PHP group file, preserving nested keys, sibling entries, comments, and formatting.

A shared lazy catalog avoids repeated directory scans and parsing, and refreshes for buffer edits, file changes, and provider updates. The changes also correct escaped-key matching and Blade reference coordinates.

Validation:

  • Full Rust suite: 14,785 tests passed, plus doctests.
  • Added executable production Rust lines: 693/693 covered (100%), measured with cargo llvm-cov against main.
  • Required Clippy checks, formatting, PHP syntax checks, and both demo assertion suites passed.
  • Laravel analyze reports the three intentional demo errors plus the existing <x-slot:title> diagnostic covered by the separate PR; that template is unchanged.

Checklist

  • Updated the changelog.
  • Updated documentation and Laravel examples; removed the completed translation-depth backlog item.
  • Added and updated tests covering the changes.
  • Reviewed the implementation and documentation.

Retain exact key ranges when decoding JSON translations, including escaped keys and provider paths. Use the shared reference index for requests from JSON declarations and read unsaved buffers during definition lookup.

Add navigation regressions and a JSON translation example with a runtime assertion.
Decode PHP translation literals before matching JSON and PHP declarations, retain source ranges, and reject non-JSON whitespace. Read Blade reference positions in the symbol map coordinate space before translating them back to the template.

Cover stale diagnostics, removed files, invalid paths, nested calls, and unknown replacement arrays. Complete the translation-depth documentation and backlog cleanup.

Validation: 14,785 Rust tests passed; all 693 added executable production Rust lines covered. Clippy, formatting, doctests, PHP syntax checks, and demo runtime assertions passed.
@shuvroroy shuvroroy changed the title feat(laravel): deepen translation support across locales Improve translation completion, navigation, and quick fixes Sep 9, 2026
@codecov-commenter

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants