Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 352160

Summary: [content assist] Use index to find global functions
Product: [WebTools] JSDT Reporter: Ian Tewksbury <itewksbu>
Component: GeneralAssignee: Project Inbox <jsdt.javascript-inbox>
Status: RESOLVED WONTFIX QA Contact: Nitin Dahyabhai <thatnitind>
Severity: enhancement    
Priority: P3 CC: cmjaun
Version: 3.2.5Flags: cmjaun: review-
thatnitind: review-
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard:
Attachments:
Description Flags
Fix Patch
none
Updated Testing Zip
none
Fix Patch - Update 1
none
Fix Patch - Update 2
none
Fix Patch - Update 3
none
Fix Patch - Update 4 none

Description Ian Tewksbury CLA 2011-07-14 16:17:58 EDT
Currently the index is only used to find the location of global functions but then those functions and the fiels they are in still have to be parsed, inferred, and bound.  All the information to create a content assist suggestion should be stored in the index so that these functions do not need to be parsed, inferred, and bound every time content assist is invoked.
Comment 1 Ian Tewksbury CLA 2011-07-14 16:19:49 EDT
Created attachment 199703 [details]
Fix Patch

This patch primarily updates the MethodPattern to store all the information about a function that is needed to create a content assist proposal.  The rest of the changes are to then either help get that information to the MehtodPattern, or leverage the new information now stored in the index.

Have also added a bunch of new JUnits to test all of this.
Comment 2 Ian Tewksbury CLA 2011-07-14 16:20:53 EDT
Created attachment 199704 [details]
Updated Testing Zip

This is an updated testing zip for org.eclipse.wst.jsdt.ui.tests/testresources for the updated JUnits.
Comment 3 Ian Tewksbury CLA 2011-07-14 16:58:05 EDT
Created attachment 199712 [details]
Fix Patch - Update 1

same as last patch except I have added more documentation.

I have a bit more documentation to do.
Comment 4 Ian Tewksbury CLA 2011-07-15 17:12:25 EDT
Created attachment 199775 [details]
Fix Patch - Update 2

Finished documenting.  Also had to add code to BasicSearchEngine#searchAllFunctions to deal with working copies.
Comment 5 Ian Tewksbury CLA 2011-07-18 16:18:10 EDT
Created attachment 199862 [details]
Fix Patch - Update 3

Same as last patch except I removed a piece of code I commented out.
Comment 6 Chris Jaun CLA 2011-07-19 09:30:25 EDT
I think we are good to go on this.
Comment 7 Ian Tewksbury CLA 2011-07-19 15:05:39 EDT
Created bug 352499 to put this in head as well. merged patch there.
Comment 8 Ian Tewksbury CLA 2011-07-19 15:48:12 EDT
Created attachment 199943 [details]
Fix Patch - Update 4

Same as last patch except small fix in Methodpattern#matchesDecodedKey.  One of the lines was comparing the return qualificaiton to the return simple name rather then to the return qualification of the pattern to try and match.
Comment 9 Chris Jaun CLA 2011-08-08 16:27:00 EDT
Backed out the patch that was checked in on 07/20 because it breaks search and the SelectionEngine for functions.
Comment 10 Nitin Dahyabhai CLA 2011-08-30 14:48:28 EDT
Needs a lot more study to avoid breaking other functions.