You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When overriding a virtual base class method, selecting one of the suggested overrides does not insert the method's parameter types or return type.
Steps To Reproduce:
Create the following TriggerHandler apex class.
public virtual without sharing class TriggerHandler
{
public virtual void BeforeInsert(List<sObject> Records)
{
}
}
Create the following LeadHandler apex class which extends TriggerHandler.
public without sharing class LeadHandler extends TriggerHandler
{
}
In class LeadHandler, attempt to override the BeforeInsert method from the base class by starting to type the following:
public override
Expected result
Selecting one of the suggested base class methods to override should insert the full signature of the method being overridden resulting in the following:
public override void BeforeInsert(List<sObject> Records)
Additionally, it would make sense to also include the method's statement block and set the insertion point inside the block.
public override void BeforeInsert(List<sObject> Records)
{
// Insertion point here
}
Actual result
The inserted method signature is missing the types for the method parameters. It will also be missing the return type unless I explicitly typed it first.
If I explicitly type the return type before selecting the suggested method signature:
public override void BeforeInsert(Records)
If I did not explicitly type the return type before selecting the suggested method signature:
Summary
When overriding a virtual base class method, selecting one of the suggested overrides does not insert the method's parameter types or return type.
Steps To Reproduce:
Expected result
Selecting one of the suggested base class methods to override should insert the full signature of the method being overridden resulting in the following:
Additionally, it would make sense to also include the method's statement block and set the insertion point inside the block.
Actual result
The inserted method signature is missing the types for the method parameters. It will also be missing the return type unless I explicitly typed it first.
If I explicitly type the return type before selecting the suggested method signature:
If I did not explicitly type the return type before selecting the suggested method signature:
Additional information
VS Code Version:
Version 1.33.1
Salesforce Extensions
Version 45.10.0
SFDX CLI Version:
sfdx-cli/7.3.0-94ecf2d5ee win32-x64 node-v10.15.3
OS and version:
Windows 10 Pro Version 1803 (OS Build 17134.706)
The text was updated successfully, but these errors were encountered: