Skip to content

Drupal configuration schema read again one file at a time - #543

Merged
AJenbo merged 1 commit into
PHPantom-dev:mainfrom
giuseppe-esposito-87:drupal-config-schema-cache
Nov 6, 2026
Merged

AJenbo merged 1 commit into
PHPantom-dev:mainfrom
giuseppe-esposito-87:drupal-config-schema-cache

Conversation

@giuseppe-esposito-87

Copy link
Copy Markdown
Contributor

🤖 This was written by an AI agent on behalf of @giuseppe-esposito-87 (claude-code/claude-opus-5-5).

Editing a Drupal configuration schema file now reads only that file again. Before, every keystroke in a config/schema/*.schema.yml buffer made the next request re-read every schema file of the site. Opening, saving or closing a schema file without changing its text costs nothing. Completion, hover and go-to-definition return the same results.

Two small fixes on the same path:

  • A schema file changed on disk keeps its place in the list, so the first file to declare a key still wins.
  • Closing an unsaved new configuration file of a test module removes its names.

Follow-up to #540.

How to test: run composer install in examples/drupal, then open examples/drupal with this branch's build. In web/modules/custom/acme/:

  • In config/schema/acme.schema.yml, add these lines at the top:

    acme.extra:
      type: config_object

    In src/Form/SettingsForm.php, empty ['acme.settings'] in getEditableConfigNames() and complete: acme.extra is offered.

  • In the schema, rename notify_email: to notify_mail:. In SettingsForm.php, complete after '#config_target' => 'acme.settings:: notify_mail is offered.

  • Undo both edits: the old names come back.

Checklist

If applicable:

  • I have updated CHANGELOG.md. Not applicable: this fixes the still unreleased configuration names entry.
  • I have updated the documentation (README.md, docs/, examples/). Not applicable: no visible behaviour to document.
  • I have updated the config schema (config-schema.json). Not applicable: this PR adds or changes no setting.
  • I have added/updated tests to cover my changes
  • If I used AI tools, I have reviewed what they produced and can explain
    the changes and why they are needed.
  • I have read through any AI-generated text, especially documentation,
    the changelog, and other user-facing content, and removed or corrected
    anything inaccurate, unclear, or unnecessary.

@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

❌ Patch coverage is 99.03101% with 5 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/drupal/config.rs 98.97% 5 Missing ⚠️

📢 Thoughts on this report? Let us know!

Editing a configuration schema file, in a buffer or on disk, reads only that file again. The other files keep their parsed entries and trees, and an event whose text did not change reads nothing. A schema file changed on disk keeps its place in the list, so the first declaration of a key still wins, and closing an unsaved new configuration file of a test module drops its names.

Assisted-by: claude-code/claude-opus-5-5
@AJenbo
AJenbo force-pushed the drupal-config-schema-cache branch from bd52b8b to 90b175c Compare November 6, 2026 21:36
@AJenbo
AJenbo merged commit 1da0683 into PHPantom-dev:main Nov 6, 2026
13 of 15 checks passed
@AJenbo

AJenbo commented Nov 6, 2026

Copy link
Copy Markdown
Contributor

Thanks for fixing that

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.

3 participants