forcedotcom / salesforcedx-vscode

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

APEX Language Server: Schema.SObjectType.xxxxxx won't resolve #2028

Open Pierre-Felber opened 4 years ago

Pierre-Felber commented 4 years ago

Summary

Code completion on Schema.SObject is not working . Probably related to #2020 No members of Schema.SObject are resolved. No standard objects and no custom objects.

Steps To Reproduce:

  1. Create Class

    public with sharing class test {
    
    public void blo(){
    
        Schema.SObjectType.Account.getDescribe();
    
    }
    }

    Expected result

Not marking as error.

Actual result

Marked as error. image

Additional information

image

VS Code Version:

Version: 1.42.1 (user setup) Commit: c47d83b293181d9be64f27ff093689e8e7aed054 Date: 2020-02-11T14:45:59.656Z Electron: 6.1.6 Chrome: 76.0.3809.146 Node.js: 12.4.0 V8: 7.6.303.31-electron.0

SFDX CLI Version: sfdx-cli/7.47.0-0e5d18732f win32-x64 node-v10.15.3

OS and version: Windows_NT x64 10.0.18363

lcampos commented 4 years ago

Hi @Pierre-Felber , thanks for opening this issue. It is similar to the issue you link and a current limitation/gap in the autocompletions provided by the Apex Language Server.

cc @smaddox-sf

Pierre-Felber commented 4 years ago

tx for the feedback, is it planned, to fill the gap?

git2gus[bot] commented 4 years ago

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

smaddox-sf commented 4 years ago

Hi @Pierre-Felber - We've added it to our backlog

samuel-reyes commented 4 years ago

If I am not mistaken, Illuminated Cloud solves this by using the Symbol Table class, and creating an offline copy of it. https://developer.salesforce.com/docs/atlas.en-us.api_tooling.meta/api_tooling/tooling_api_objects_symboltable.htm

http://www.illuminatedcloud.com/home/offlinesymboltable

Could the salesforcedx-vscode plugins do something similar to handle this behavior?

git2gus[bot] commented 2 weeks ago

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