feat: complete template paths in setLayout/render/extends/include#20
Open
jingu wants to merge 1 commit into
Open
feat: complete template paths in setLayout/render/extends/include#20jingu wants to merge 1 commit into
jingu wants to merge 1 commit into
Conversation
Add a PHP CompletionContributor that, inside a Qiq template, completes the first string argument of setLayout()/render()/extends()/include() with the template files found under the resolved template roots (QiqSettingsService.resolveTemplateRoots), listed as root-relative paths with the Qiq extension stripped (layout/base.qiq.php -> layout/base). Pairs with the existing Go to Declaration on the same arguments. The extension-stripping logic is a pure companion function (stripTemplateExtension) with unit tests; the VFS walk and completion firing are left to manual / HeavyPlatformTestCase verification. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
ad99a52 to
4f3884a
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Completes template paths in the first string argument of Qiq's template-referencing calls —
setLayout('...'),render('...'),extends('...'),include('...')— inside Qiq templates. Pairs with the existing Go to Declaration on those same arguments.QiqTemplatePathCompletionContributor(PHPcompletion.contributor): when the caret is in the first string arg of one of those calls in a Qiq file, offers the template files found underQiqSettingsService.resolveTemplateRoots(contextFile)as root-relative paths with the Qiq extension stripped (layout/base.qiq.php→layout/base).layout/bamatch/replace correctly.ProgressManager.checkCanceled().Test plan
./gradlew test— incl. newQiqTemplatePathCompletionContributorTest(purestripTemplateExtensioncases: longest-suffix-first,.qiq/.php, non-templates, case-insensitivity, configured order)./gradlew buildPlugin{{ setLayout('') }}/render('')→ available template paths offeredNotes
feat/helper-completion); base will be retargeted todeveloponce feat: complete custom Qiq helper names in templates #19 merges. The diff here is the single template-path commit.CodeInsightTestFixture(heavy test) and is deferred to the planned HeavyPlatformTestCase integration suite; the pure path logic is unit-tested here.🤖 Generated with Claude Code