Skip to content
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

Overriding a virtual base class method using auto-complete missing parameter types. #1256

Closed
D99000947 opened this issue Apr 12, 2019 · 1 comment

Comments

@D99000947
Copy link

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:

  1. Create the following TriggerHandler apex class.
public virtual without sharing class TriggerHandler
{
    public virtual void BeforeInsert(List<sObject> Records)
    {
    }
}
  1. Create the following LeadHandler apex class which extends TriggerHandler.
public without sharing class LeadHandler extends TriggerHandler
{
}
  1. 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:

public override BeforeInsert(Records)

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)

@sfsholden
Copy link
Contributor

This bug was fixed in https://git.soma.salesforce.com/apex/apex-jorje/pull/690 back in August of 2019. This change would have been bundled in with change #1567.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants