PDA

View Full Version : [OPEN] Created wrong name for Event in Controller



blomasky
21 Aug 2015, 10:25 AM
I have a form field (called state) and entered the following for the listener:



listener: {
blur: 'upperCaseState'
}

When the IDE generated the event handler, it was named "upperCase" (forgot the word state)


Bruce

Chris.OBrien
24 Aug 2015, 5:54 AM
I've tried a few times to recreate this on my end, and think I figured out why you're seeing this.

I think it is a timing issue. If I have the following code:

controller: 'main',
listeners: {
blur: 'upperCase'
}

I can do the quick fix to "Create method upperCase in..."

However, if I append "State" into the blur: 'upperCase' and try to do the quick fix real quick, it still presents the "Create method upperCase in..." It also generates it with the old name.

If I type in 'State' and let WebStorm think for a second before doing the quick fix, it shows the appropriate name in the quick fix menu, and generates the method with the proper name.

You could try it again, but wait a little bit before the quick fix kicks in? I know this isn't ideal, telling a developer to slow down is never appropriate :)

I'll open a ticket to see if there's anything we can do in the future, but it might be how JetBrain's quick fixes behave. I've definitely noticed that just getting the quick fix to 'trigger' in the first place sometimes takes a second. Might have something to do with how the file is being analyzed/indexed.