forcedotcom / salesforcedx-vscode

Salesforce Extensions for VS Code
https://developer.salesforce.com/tools/vscode
BSD 3-Clause "New" or "Revised" License
953 stars 406 forks source link

Apex Language Server should support methods in anon-apex #5312 #5325

Closed przemekrcloudity closed 3 weeks ago

przemekrcloudity commented 9 months ago

Is your feature request related to a problem? Please describe.

In anonymous apex scripts, defined functions aren't auto-completed. For example in code

String key(Integer x, Integer y) {
    return x + '  ' + y;
}

System.debug(key(10, 10));

method key is not autocompleted.

Whats more, parameters are not visible inside function, which means that autocompletion for both these parameters and theirs methods and properties is not working. Variables defined inside method are visible though.

Parameters autocompletion Variables autocompletion
issue_with_anon_apex_1 issue_with_anon_apex_2

Describe the solution you'd like A clear and concise description of what you want to happen.

In annonymous apex scripts, I would like to have methods that were defined to be inculded in autocompletion. In anonymous apex script, I would also like to have parameters included in autocompletion inside method.

Describe alternatives you've considered A clear and concise description of any alternative solutions or features you've considered.

Writing apex scripts inside function in apex class. THis solution is prone to error as it can be deployed by mistake

Additional context Add any other context or screenshots about the feature request here.

Under #5312 it was suggested to convert ticket from issue to feature request

mingxuanzhangsfdx commented 9 months ago

Hi @przemekrcloudity thanks for creating the feature request. We will keep you and the community informed about the progress and any decisions made regarding this feature. Please feel free to reach out if you have any more ideas, questions, or feedback.

git2gus[bot] commented 8 months ago

This issue has been linked to a new work item: W-14837332