New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Table name completion in strings? #57

Closed
NamelessCoder opened this Issue Sep 26, 2017 · 1 comment

Comments

Projects
None yet
2 participants
@NamelessCoder

NamelessCoder commented Sep 26, 2017

I don't even know if this is possible, but I came up with this idea while working on a TCA-heavy project:

Would it be possible to auto-complete table names that are added to TCA, when writing strings?

This could be really helpful, even if it is for example limited to only happen in certain files, e.g. TCA files.

It could also make sense to target any argument named $table or $tableName and/or simply targeting the table-specific arguments on Doctrine QueryBuilder, e.g. all the select(), getConnectionForTable(), getQueryBuilderForTable(), and any alias-argument for field selection methods.

This could perhaps also be combined with inspections to report bad values in known table arguments in functions such as the ExtensionManagementUtility::addTCAcolumns function.

Something universal which triggers on argument name could be opt-in, but for people who write consistent variable names it would be very useful.

@cedricziel

This comment has been minimized.

Owner

cedricziel commented Sep 26, 2017

Thx for your suggestion!

I don't think matching the argument-name is a good idea, but I'll think about it (I don't like the magic and I'm pretty sure we wouldnt match all of those arguments :) ). Could you help compiling a list of methods where we need completion for starters?

cedricziel added a commit that referenced this issue Nov 30, 2017

Refactor table name completion to use PsiReferences
All matches for common table name places are now PsiReferences.
One side effect is faster completion through variants and
automatic go-to-definition handling.

Fixes: #58,#57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment