|
From: <caw...@us...> - 2007-04-15 14:34:46
|
Revision: 2320
http://svn.sourceforge.net/rubyeclipse/?rev=2320&view=rev
Author: cawilliams
Date: 2007-04-15 07:34:45 -0700 (Sun, 15 Apr 2007)
Log Message:
-----------
roll back change sthat moved prefix into search pattern. for whatever reason our search pattern is being matched up against the index key (not just the type name for types, for example) - so we're not getting any matches...
Modified Paths:
--------------
branches/search_engine/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/codeassist/CompletionEngine.java
Modified: branches/search_engine/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/codeassist/CompletionEngine.java
===================================================================
--- branches/search_engine/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/codeassist/CompletionEngine.java 2007-04-15 14:33:33 UTC (rev 2319)
+++ branches/search_engine/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/codeassist/CompletionEngine.java 2007-04-15 14:34:45 UTC (rev 2320)
@@ -142,7 +142,7 @@
}
private void suggestGlobals() {
- SearchPattern pattern = SearchPattern.createPattern(IRubyElement.GLOBAL, "$*", IRubySearchConstants.DECLARATIONS, SearchPattern.R_PATTERN_MATCH);
+ SearchPattern pattern = SearchPattern.createPattern(IRubyElement.GLOBAL, "*", IRubySearchConstants.DECLARATIONS, SearchPattern.R_PATTERN_MATCH);
IRubySearchScope scope = BasicSearchEngine.createRubySearchScope(new IRubyElement[] {fContext.getScript().getRubyProject()});
List<SearchMatch> results = search(pattern, scope);
for (SearchMatch match: results) {
@@ -157,12 +157,14 @@
}
private void suggestTypeNames() {
- SearchPattern pattern = SearchPattern.createPattern(IRubyElement.TYPE, fContext.getPartialPrefix() + "*", IRubySearchConstants.DECLARATIONS, SearchPattern.R_PATTERN_MATCH);
+ SearchPattern pattern = SearchPattern.createPattern(IRubyElement.TYPE, "*", IRubySearchConstants.DECLARATIONS, SearchPattern.R_PATTERN_MATCH);
IRubySearchScope scope = BasicSearchEngine.createRubySearchScope(new IRubyElement[] {fContext.getScript().getRubyProject()});
List<SearchMatch> results = search(pattern, scope);
for (SearchMatch match: results) {
IRubyElement element = (IRubyElement) match.getElement();
String name = element.getElementName();
+ if (!fContext.prefixStartsWith(name))
+ continue;
CompletionProposal proposal = createProposal(fContext.getReplaceStart(), CompletionProposal.TYPE_REF, name);
proposal.setType(name);
fRequestor.accept(proposal);
@@ -189,12 +191,14 @@
}
private void suggestConstantNames() {
- SearchPattern pattern = SearchPattern.createPattern(IRubyElement.CONSTANT, fContext.getPartialPrefix() + "*", IRubySearchConstants.DECLARATIONS, SearchPattern.R_PATTERN_MATCH);
+ SearchPattern pattern = SearchPattern.createPattern(IRubyElement.CONSTANT, "*", IRubySearchConstants.DECLARATIONS, SearchPattern.R_PATTERN_MATCH);
IRubySearchScope scope = BasicSearchEngine.createRubySearchScope(new IRubyElement[] {fContext.getScript()});
List<SearchMatch> results = search(pattern, scope);
for (SearchMatch match: results) {
IRubyElement element = (IRubyElement) match.getElement();
String name = element.getElementName();
+ if (!fContext.prefixStartsWith(name))
+ continue;
CompletionProposal proposal = createProposal(fContext.getReplaceStart(), CompletionProposal.FIELD_REF, name);
proposal.setType(name);
fRequestor.accept(proposal);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|