-
Notifications
You must be signed in to change notification settings - Fork 405
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
"Go to Definition" and "Peek Definition" not working #653
Comments
@maruchymurphy79 - Are you able to open a case with support? I would like to request for login-as so that I can get your apex code and try it out. |
@vazexqi - Will do it today. Keep in mind we don't use DX, that is why we are taking advantage of the new extension version. |
@maruchymurphy79 When you say you aren't using "DX", what do you mean by that? If you mean that you aren't using the new source format, then that is the problem. To use VS Code you are required to convert your metadata to the new source format. See: https://github.com/forcedotcom/salesforcedx-vscode/wiki/Migrate-From-Forcecom-IDE-to-Visual-Studio-Code |
@ntotten That is exactly what I meant. We don't use DX but we are using the new source format. So far is working good except for the issue I mentioned here. Thanks. |
@vazexqi I have opened the support case (Case# 20359687). Thanks for your help and support. |
Perfect, we’ll take a look. Thanks for clarifying! |
Hi @maruchymurphy79, I am currently looking into this issue and was wondering, are you still seeing this problem in your VS Code extensions? I saw that the case that you opened with support has been closed, but it was unclear to me whether or not it was closed because you are no longer experiencing the problem. Thanks! |
I'm experiencing this same issue and curious what the result of this was. @maruchymurphy79 ? |
@allileong @JJtorrent The ticket was closed as "Known Issue". It hasn't fixed yet. It works for some methods and classes but it continue failing sometimes. |
@JJtorrent @maruchymurphy79 Can you please try enabling the apex semantic error in settings and let us know if the member or type or the file in which you are invoking Go-to-Def has any semantic errors are not? You need to set the following in your VS Code settings: This would help us to debug the issue further. Sometimes, semantic errors present in the code may result in type or member not binding to the definition. |
@praksb, I added the setting you mentioned into settings.json file of my project:
I'm still not getting any semantic warnings or errors in the Apex Language Service console messages after restarting VS Code and opening/editing/saving/deploying a Lightning component's JS controller. If it matters, this particular project is a manifest type. ALS log:
Now that the semantic errors flag it set, I'm getting weird warnings in other classes for totally standard stuff... for instance it says that CaseShare is an invalid type, and I'm getting Variable does not exist warnings about standard fields dereferenced on an object... ?? |
@JJtorrent When you enable this setting "salesforcedx-vscode-apex.enable-semantic-errors": true you would start seeing errors in the "Problems" pane. Squigglies will also start showing up in your editor under the parts of code where there is a semantic error and the error will show up when you hover over the squigglied text. You will NOT see these errors show up in the console messages. These errors are not enabled by default because they are not always accurate since they work based on the types you have locally on your machine and not all types may be available for the compiler to successfully bind. This is the reason you are seeing CaseShare show up as an invalid type. You could fix this by downloading the SObject types by running the "SFDX: Refresh SObject Definitions" command from the "Command Palette" in VS Code. Doing the above mentioned SObject refresh would fix some of the problems you are seeing with respect to "Go to definition" not working since now the compiler should be able to bind successfully many of symbols that is necessary for the feature to work successfully. |
@praksb
Perhaps I am missing some other settings? I'm curious if this is a problem localized to Manifest-type projects (which I am working in presently). |
@JJtorrent Did the operation to refresh SObject definitions succeed? A successful refresh should have something log lines which look like these in the output window: 10:23:00.464 sfdx sobject definitions refresh Also, can you clarify what manifest-type project means? Are you following the "Org based development model"? If so, did you authorize an org? |
@praksb
|
@JJtorrent I am out of ideas to debug on this thread. I would love to understand more on why it is not working for you. Do you mind if I setup a meeting over google hangout where you can share your screen? That would help me understand your project setup and try out a few things. Do let me know if that works for you and your availability for the meeting and I can send a meeting invite over email with the link to google hangout. Thanks! |
@praksb, my apologies for the delay. I will have time next week in the mid-mornings, if you'd still like to look at the project setup. |
@JJtorrent Great. Let me send you an email. |
How's this coming along? |
This issue has been automatically closed because there has been no response to our request for more information from the original author. Currently, there is not enough information provided for us to take action. Please reply and reopen this issue if you need additional assistance. |
Summary
"Go to Definition" and "Peek Definition" not working when the method is in a different class or if it is not a static method. I'm opening the issue again due #557 was closed due it was classified as duplicate and related to a null exception issue I'm not getting.
Steps To Reproduce:
Expected result
New class opened with the corresponding method we would like to see the definition.
Actual result
A message is displayed "No definition found for 'Method name'".
Also, I have recently changed to the new manifest structure and still "Go to Definition" and "Peek Definition" are not working.
VS Code Version: 1.27.2
salesforce.salesforcedx-vscode Version: 43.17.0
OS and version: W10
Internal Work Item: W-5501966
The text was updated successfully, but these errors were encountered: