I use VS Code with Salesforce Extension Pack.
I have this line in my class code:
string cId = ApexPages.currentPage().getParameters().get('cId');
It gets a squiggle line under getParameters() and a message "Method does not exist or incorrect signature: void getParameters() from the type System.Pagereference"
Apex reference clearly says here: https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_System_PageReference_methods.htm
getParameters(): Returns a map of the query string parameters for the PageReference; both POST and GET parameters are included. The key string contains the name of the parameter, while the value string contains the value of the parameter.
In another language I would think I'm missing a library reference or something but there is no such thing in VS Code with Salesforce Extension Pack! (or is there?)
Why is the error and how can I fix it?
Thank you Very Much!