|
From: <caw...@us...> - 2007-07-12 15:18:01
|
Revision: 2752
http://svn.sourceforge.net/rubyeclipse/?rev=2752&view=rev
Author: cawilliams
Date: 2007-07-12 08:17:58 -0700 (Thu, 12 Jul 2007)
Log Message:
-----------
significantly speed up searching for all type names that match prefix. Build it into search query, rather than filtering after the fact. (should have done this before, but the search didn't properly filter before).
Modified Paths:
--------------
trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/codeassist/CompletionEngine.java
Modified: trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/codeassist/CompletionEngine.java
===================================================================
--- trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/codeassist/CompletionEngine.java 2007-07-12 15:15:55 UTC (rev 2751)
+++ trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/codeassist/CompletionEngine.java 2007-07-12 15:17:58 UTC (rev 2752)
@@ -330,15 +330,13 @@
}
private void suggestTypeNames() {
- SearchPattern pattern = SearchPattern.createPattern(IRubyElement.TYPE, "*", IRubySearchConstants.DECLARATIONS, SearchPattern.R_PATTERN_MATCH);
+ SearchPattern pattern = SearchPattern.createPattern(IRubyElement.TYPE, fContext.getPartialPrefix() + "*", IRubySearchConstants.DECLARATIONS, SearchPattern.R_PATTERN_MATCH);
IRubySearchScope scope = BasicSearchEngine.createRubySearchScope(new IRubyElement[] {fContext.getScript().getRubyProject()});
List<SearchMatch> results = search(pattern, scope);
Set<String> names = new HashSet<String>();
for (SearchMatch match: results) {
IRubyElement element = (IRubyElement) match.getElement();
String name = element.getElementName();
- if (!fContext.prefixStartsWith(name))
- continue;
if (names.contains(name)) continue;
names.add(name);
CompletionProposal proposal = createProposal(fContext.getReplaceStart(), CompletionProposal.TYPE_REF, name, element);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|