Bug 9596

Summary: [Drosera] add a function popup to the source pane
Product: WebKit Reporter: Timothy Hatcher <timothy>
Component: New BugsAssignee: Nobody <webkit-unassigned>
Status: CLOSED FIXED    
Severity: Enhancement CC: jhurshman, vladimir.olexa
Priority: P2    
Version: 420+   
Hardware: Mac   
OS: OS X 10.4   
Attachments:
Description Flags
Patch
timothy: review-
Screenshot with file popup active
none
Screenshot with file popup closed and selected function highlighted
none
Patch Revised timothy: review+

Timothy Hatcher
Reported 2006-06-26 04:32:41 PDT
Add a function popup that lists all JavaScript functions similar to Xcode's popup.
Attachments
Patch (10.40 KB, patch)
2006-10-31 19:40 PST, Vladimir Olexa (vladinecko)
timothy: review-
Screenshot with file popup active (218.95 KB, image/jpeg)
2006-10-31 19:42 PST, Vladimir Olexa (vladinecko)
no flags
Screenshot with file popup closed and selected function highlighted (184.51 KB, image/jpeg)
2006-10-31 19:43 PST, Vladimir Olexa (vladinecko)
no flags
Patch Revised (9.77 KB, patch)
2006-11-03 13:06 PST, Vladimir Olexa (vladinecko)
timothy: review+
Vladimir Olexa (vladinecko)
Comment 1 2006-10-31 19:40:44 PST
Created attachment 11317 [details] Patch This patch adds the function popup functionality in Drosera. Once we have fixed the parsing functions to get keywords properly, this will work a bit better and potentially faster as many "if" statements can be removed . Also, we'll need to handle special cases such as var foo = function() or foo: function() so that the popup is a bit more useful in those cases. Right now, the popup only gives "function()" in those instances.
Vladimir Olexa (vladinecko)
Comment 2 2006-10-31 19:42:18 PST
Created attachment 11318 [details] Screenshot with file popup active
Vladimir Olexa (vladinecko)
Comment 3 2006-10-31 19:43:25 PST
Created attachment 11319 [details] Screenshot with file popup closed and selected function highlighted
Timothy Hatcher
Comment 4 2006-11-01 11:25:27 PST
Comment on attachment 11317 [details] Patch This is looking good. There are a few things that need addressed. Many elese statments do not meet our style guidlines. + } + else Place the else on the same line as the end brace. + } else + result += "<span class=\"keyword\">" + "<a name=\"function-" These first two strings can be combined into one, eliminating a concatination. + var functionNames = new Array(); Why have a local functionNames when you just use file. functionNames? + var counter = 8; Rename that to functionKeywordOffset or something meaningful. The current name is confusing. Please use "<No selected symbol>", like Xcode. Note the missing spaces and the capital No. removeChildrenFromElement should be a prototype function on Element and just called removeChildren. There are a couple of functions we add to element for adding and removing class names. I am not big fan of the red highlight around the function name, lets just remove that. Xcode dosen't do that.
Timothy Hatcher
Comment 5 2006-11-02 15:25:23 PST
Xcode selects the function name when you pick one. We should do the same and not the red highlight. Here is how in WebKit: var selection = window.getSelection(); var element = document.getElementById("test"); selection.setBaseAndExtent(element, 0, element, 1);
Vladimir Olexa (vladinecko)
Comment 6 2006-11-03 13:06:35 PST
Created attachment 11367 [details] Patch Revised - corrected else statements - removed unnecessary variable - removed unnecessary concatenation - renamed var counter to functionKeywordOffset - prototyped Element.removeChildren - renamed placeholder text to <No selected symbol> - replaced function name highlight with selection
Timothy Hatcher
Comment 7 2006-11-03 16:08:07 PST
Comment on attachment 11367 [details] Patch Revised Looks good.
Timothy Hatcher
Comment 8 2006-11-03 16:17:40 PST
Great job. Landed in r17583.
Timothy Hatcher
Comment 9 2008-05-17 09:55:51 PDT
Closing since Drosera has been replaced by the new Web Inspector debugger. Moving to the New Bugs component so the Drosera component can be closed and removed.
Note You need to log in before you can comment on or make changes to this bug.