-
Notifications
You must be signed in to change notification settings - Fork 1
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
GoToDefinition occasionally does nothing on THIS{DOT}MethodName #35
Comments
Fixed bug where using GoToDef on `This.SomeMethod` would do nothing under some circumstances: (VFPX#35) - In a form (or form based class), in a method for the form itself (and thus `ThisForm.SomeMethod` would be equivalent). - AND the currently selected object (as appears in the Properties Window) is an object in the form (but not the form itself)
This issue has been address in Version 2.17 (2025-01-14). I was confounded as to how to even attack this intermittent problem until it happened to me. Please let me know here if here are any further issues with GTD. |
Ugh. It's been working well. I must have jinxed it. Just prior to using GoToDefinition, I was thinking that. Musta got it fixed, I thought. But then it happened. In a method of the form. I was using this.GetStats(). I selected GoToDefinition and nothing happened (this was for a new method I was creating, so it does not yet exist). I tried thisform.GetStats(). Nothing. And I see nothing unusual that I've done. Also, I did a check for updates and I'm current on all the Thor tools I use. I closed the form and reopened it. No change. I closed VFP and reopened it and GoToDefinition then worked properly. |
I am running out of guesses here as to what might be going on for you. However, I do have a random set of questions that might give me a hint. When you find that it is doing nothing
|
I will try all that if it happens again. As for #2, I did mention in my last communication that I tried both this and thisform, with no success. However, I think in a previous communication changing to thisform did make it work. Anyway, I'll keep you posted. Thanks for your responses. |
Ok, Jim, it just happened. For this and thisform. Even if thisform was used at the bottom of the code window. Even though the Properties window was showing the form itself as the active object and I was in a method of the form itself. However, the PEM Editor was not open. So I used Alt-F9 to open it, then tried again with GoToDefinition and it worked. |
Well, damn, I spoke too soon. The GoToDefinition window came up and I came straight here and reported the above. But then I went back to VFP and I realized the form had no method name in it. So I closed it and tried again by clicking on the code window and using the feature. No luck. Then I closed PEM Editor, reopened it, and immediately tried the feature. It came up again with nothing in the method name field. It's coming up when PEM Editor has the focus and so it's not really working with the code window. So that was a false alarm. At present, I can't get it to work with the code window. But, like before, I quit VFP, restarted it, and then it worked fine. |
You mean this is failing when PEMEditor has the focus? I wouldn't expect it to -- it works only if the code window has the focus. Or am I misinterpreting your test? Please send a screenshot just before you call GoToDef. Also, you did not answer this (from my earlier message)
|
"Also, you did not answer this (from my earlier message)" When I put the cursor on the last line of the code window (a blank line unto itself) and use GoToDefinition, I get a "blank" GoToDefinition window. The one where you do the work - confirm the name, choose if it's a property or method, etc. When I put the cursor on the last line of the Command Window (blank line), I get the same behavior as just described. When PEM Editor has the focus and I use the GoToDefinition feature, the GoToDefinition form comes up, but has no method name in the top field. It's an empty GoToDefinition form. That fooled my earlier because I just failed to pay enough attention. So when I realized that and put the focus back on the code window, highlighted the method name of this.() it still did not work. Not until I exited VFP and restarted it. Then it worked perfectly. |
So this helps, at least somewhat. I suggest this: Do not select (highlight) the method name. There is no need to; simply execute GoToDef when the cursor is anywhere within the method name -- in fact, it can also be right before the first character or right after the last character. You can actually do more than that by entering any parameters as well, and using GoToDef after the closing paren. All this, of course, if it works. And, if that doesn't change anything, can you send an image of the entire code window ? |
Alright, I'll try that. And I see that my use of less than and greater than signs did not work out like I wanted it to, so this "highlighted the method name of this.() it still did not work" was not supposed to look quite like that. But it probably does not matter now. |
I ran into the problem again. I tried not selecting the method name I was attempting to add. No dice. The only thing different was that when I put it at the end of this.GetSkipList(), after the closing parentheses, I did get the window to come up, but it was blank. I shut down VFP and restarted it and it worked fine. |
First, a question -- in the image you just sent, the pop-up form to add a method/property appeared, but the name was empty. So are you saying that some of the time this window comes up with nothing in the name field and some of the time nothing happens at all? Really, then, two different undesirable behaviors? |
In the past, nothing ever happened. But I was always highlighting the method name via a double-click, then selecting GoToDefinition from the Thor Tools menu. Now, doing what you suggested, putting the cursor at the end of the line there after the closing parentheses, the blank form comes up. But the "old" way, highlighting the method name, results in nothing at all happening. And, like I was saying, it worked perfectly after exiting VFP and restarting it. |
But I did have two occasions here recently where it failed. The second one was just now. I had typed in this.SavePayment(), double-clicked SavePayment and selected Go to definition from the menu. Nothing. So I looked back over your last communication and saw that I should try thisform. Well, that did make it work. I can't say it's always about that, because I do try to use "thisform" only when the object is not the form and I use "this" when I'm in a method of the form. So if that were the only cause, I think I'd see it a lot more. But this time, using thisform did the trick.
Reported on Thor issues page by @GTGeek88
The text was updated successfully, but these errors were encountered: