andy-blum / drupal-smart-snippets

This extension adds rich language support for Drupal Hooks, Services, and Render Elements to VS Code.
https://marketplace.visualstudio.com/items?itemName=andrewdavidblum.drupal-smart-snippets
MIT License
21 stars 4 forks source link

Add support for entity_autocomplete form element in autocomplete #27

Open ultimike opened 1 year ago

ultimike commented 1 year ago

When using @FormElement to autocomplete form elements, the entity_autocomplete element is missing.

The scraper needs to add /core/lib/Drupal/Core/Entity/Element/ to include it.

thanks, -mike

andy-blum commented 1 year ago

Seems our scraper is not scanning the directory where the entity_autocomplete element is defined:

export async function getElementFiles(version) {
    return new Promise((res) => {
        find.file(`tmp/drupal-${version}/core/lib/Drupal/Core/Render/Element/`, (file) => {
            const filtered = file.filter((filename) => filename.endsWith('.php'));
            res(filtered);
        });
    });
}

Might be worth scanning /core/lib/Drupal/Core/*/Element/

ultimike commented 1 day ago

Nudge (pretty please.)

andy-blum commented 1 day ago

So impatient

ultimike commented 1 day ago

Heh - indeed.

I have no idea if the pull request will work (no idea if wildcards are allowed.) In fact, I did it during a module development class I was teaching. 🤞🏼

thanks, -mike

andy-blum commented 1 day ago

I'll take a look - updating to include 10.3 and 11.0 first