Detect fields accessed on queried SObjects that weren't included in the query and prompt to add them
Issue #695
new
This is a super fancy sounding idea, and seems like a ton of overhead - but: what if, when accessing a field of an SObject that has been queried for the first time, IC/IntelliJ offers to add it to the query that originated the object? Example:
List<Account> accountList = [SELECT Id FROM Account LIMIT 10];
for (Account acc : accountList) {
acc.Name = 'Acme'; // when I type this, IC/IJ offers to add "Name" to the above query since that is where it originated.
}
Comments (4)
-
-
repo owner - removed version
-
repo owner - changed title to Detect fields accessed on queried SObjects that weren't included in the query and prompt to add them
- changed component to Code Inspections and Intentions
-
repo owner Issue
#881was marked as a duplicate of this issue. - Log in to comment
Great idea.
Even better / more convoluted, add the reference to the dynamic string used to generate the query
also in cases like
string q = 'SELECT Id, CreatedBy ' + 'FROM Account LIMIT 10';