* adding language toolkit to some search operations
* fixed some seach related bugs in multil language workspaces
+ support of search pattern recognition for searches line a::*::alfa for Tcl.
diff --git a/plugins/org.eclipse.dltk.javascript.core/src/org/eclipse/dltk/internal/javascript/reference/resolvers/SourceBasedResolver.java b/plugins/org.eclipse.dltk.javascript.core/src/org/eclipse/dltk/internal/javascript/reference/resolvers/SourceBasedResolver.java
index e8b5346..d6b5e03 100644
--- a/plugins/org.eclipse.dltk.javascript.core/src/org/eclipse/dltk/internal/javascript/reference/resolvers/SourceBasedResolver.java
+++ b/plugins/org.eclipse.dltk.javascript.core/src/org/eclipse/dltk/internal/javascript/reference/resolvers/SourceBasedResolver.java
@@ -36,6 +36,7 @@
 import org.eclipse.dltk.internal.javascript.typeinference.IReference;
 import org.eclipse.dltk.internal.javascript.typeinference.VaribleDeclarationReference;
 import org.eclipse.dltk.javascript.core.FunctionDeclarationReference;
+import org.eclipse.dltk.javascript.core.JavaScriptLanguageToolkit;
 import org.eclipse.dltk.javascript.core.JavaScriptNature;
 import org.eclipse.dltk.javascript.internal.core.mixin.JavaScriptMixinModel;
 
@@ -161,7 +162,7 @@
 			matchRule |= SearchPattern.R_PATTERN_MATCH;
 		}
 		SearchPattern pattern = SearchPattern.createPattern(patternString,
-				searchFor, limitTo, matchRule);
+				searchFor, limitTo, matchRule, JavaScriptLanguageToolkit.getDefault());
 		new SearchEngine().search(pattern,
 				new SearchParticipant[] { SearchEngine
 						.getDefaultSearchParticipant() }, scope, requestor,
diff --git a/plugins/org.eclipse.dltk.javascript.core/src/org/eclipse/dltk/javascript/internal/core/codeassist/JavaScriptCallProcessor.java b/plugins/org.eclipse.dltk.javascript.core/src/org/eclipse/dltk/javascript/internal/core/codeassist/JavaScriptCallProcessor.java
index 4b03aa6..c158744 100644
--- a/plugins/org.eclipse.dltk.javascript.core/src/org/eclipse/dltk/javascript/internal/core/codeassist/JavaScriptCallProcessor.java
+++ b/plugins/org.eclipse.dltk.javascript.core/src/org/eclipse/dltk/javascript/internal/core/codeassist/JavaScriptCallProcessor.java
@@ -72,7 +72,8 @@
 		};
 
 		SearchPattern pattern = SearchPattern.createPattern(element,
-				IDLTKSearchConstants.REFERENCES|IDLTKSearchConstants.METHOD, GENERICS_AGNOSTIC_MATCH_RULE);
+				IDLTKSearchConstants.REFERENCES | IDLTKSearchConstants.METHOD,
+				GENERICS_AGNOSTIC_MATCH_RULE, scope.getLanguageToolkit());
 		try {
 			searchEngine
 					.search(pattern, new SearchParticipant[] { SearchEngine
diff --git a/plugins/org.eclipse.dltk.javascript.core/src/org/eclipse/dltk/javascript/internal/core/codeassist/JavaScriptCalleeProcessor.java b/plugins/org.eclipse.dltk.javascript.core/src/org/eclipse/dltk/javascript/internal/core/codeassist/JavaScriptCalleeProcessor.java
index d6c05bb..1a7cd23 100644
--- a/plugins/org.eclipse.dltk.javascript.core/src/org/eclipse/dltk/javascript/internal/core/codeassist/JavaScriptCalleeProcessor.java
+++ b/plugins/org.eclipse.dltk.javascript.core/src/org/eclipse/dltk/javascript/internal/core/codeassist/JavaScriptCalleeProcessor.java
@@ -32,46 +32,54 @@
 import org.eclipse.dltk.core.search.SearchRequestor;
 import org.eclipse.dltk.javascript.core.JavaScriptNature;
 
-
 public class JavaScriptCalleeProcessor implements ICalleeProcessor {
-	protected static int EXACT_RULE = SearchPattern.R_EXACT_MATCH | SearchPattern.R_CASE_SENSITIVE;
-	
+	protected static int EXACT_RULE = SearchPattern.R_EXACT_MATCH
+			| SearchPattern.R_CASE_SENSITIVE;
+
 	private Map fSearchResults = new HashMap();
 
 	private IMethod method;
-		
-	//private IDLTKSearchScope scope;
 
-	public JavaScriptCalleeProcessor(IMethod method, IProgressMonitor monitor, IDLTKSearchScope scope) {
+	// private IDLTKSearchScope scope;
+
+	public JavaScriptCalleeProcessor(IMethod method, IProgressMonitor monitor,
+			IDLTKSearchScope scope) {
 		this.method = method;
-		//this.scope = scope;
+		// this.scope = scope;
 	}
+
 	int index;
 
-	private class CaleeSourceElementRequestor implements ISourceElementRequestor {
+	private class CaleeSourceElementRequestor implements
+			ISourceElementRequestor {
 		public void acceptFieldReference(char[] fieldName, int sourcePosition) {
 		}
 
-		public void acceptMethodReference(char[] methodName, int argCount, int sourcePosition, int sourceEndPosition) {
+		public void acceptMethodReference(char[] methodName, int argCount,
+				int sourcePosition, int sourceEndPosition) {
 			String name = new String(methodName);
 			int off = 0;
 			try {
-				off = method.getSourceRange().getOffset()+index;
+				off = method.getSourceRange().getOffset() + index;
 			} catch (ModelException e) {
 				e.printStackTrace();
-			} 
-			//TODO RMOVE HACK
-			SimpleReference ref = new SimpleReference(off + sourcePosition, off + sourceEndPosition+1, name);
-			IMethod[] methods = findMethods(name, argCount, off + sourcePosition);
+			}
+			// TODO RMOVE HACK
+			SimpleReference ref = new SimpleReference(off + sourcePosition, off
+					+ sourceEndPosition + 1, name);
+			IMethod[] methods = findMethods(name, argCount, off
+					+ sourcePosition);
 			fSearchResults.put(ref, methods);
 		}
 
-		public void acceptPackage(int declarationStart, int declarationEnd, char[] name) {
+		public void acceptPackage(int declarationStart, int declarationEnd,
+				char[] name) {
 			// TODO Auto-generated method stub
 
 		}
 
-		public void acceptTypeReference(char[][] typeName, int sourceStart, int sourceEnd) {
+		public void acceptTypeReference(char[][] typeName, int sourceStart,
+				int sourceEnd) {
 			// TODO Auto-generated method stub
 
 		}
@@ -101,12 +109,14 @@
 
 		}
 
-		public boolean enterMethodWithParentType(MethodInfo info, String parentName, String delimiter) {
+		public boolean enterMethodWithParentType(MethodInfo info,
+				String parentName, String delimiter) {
 			// TODO Auto-generated method stub
 			return false;
 		}
-		
-		public boolean enterFieldWithParentType(FieldInfo info, String parentName, String delimiter) {
+
+		public boolean enterFieldWithParentType(FieldInfo info,
+				String parentName, String delimiter) {
 			// TODO Auto-generated method stub
 			return false;
 		}
@@ -121,7 +131,8 @@
 
 		}
 
-		public boolean enterTypeAppend(TypeInfo info, String fullName, String delimiter) {
+		public boolean enterTypeAppend(TypeInfo info, String fullName,
+				String delimiter) {
 			// TODO Auto-generated method stub
 			return false;
 		}
@@ -146,7 +157,7 @@
 
 		public void enterModuleRoot() {
 			// TODO Auto-generated method stub
-			
+
 		}
 
 		public boolean enterTypeAppend(String fullName, String delimiter) {
@@ -156,7 +167,7 @@
 
 		public void exitModuleRoot() {
 			// TODO Auto-generated method stub
-			
+
 		}
 	}
 
@@ -164,11 +175,13 @@
 		try {
 			String methodSource = method.getSource();
 			this.index = methodSource.indexOf('{');
-			methodSource=methodSource.substring(index);
+			methodSource = methodSource.substring(index);
 			CaleeSourceElementRequestor requestor = new CaleeSourceElementRequestor();
-			ISourceElementParser parser = DLTKLanguageManager.getSourceElementParser(JavaScriptNature.NATURE_ID);
+			ISourceElementParser parser = DLTKLanguageManager
+					.getSourceElementParser(JavaScriptNature.NATURE_ID);
 			parser.setRequestor(requestor);
-			parser.parseSourceModule(methodSource.toCharArray(), null, method.getSourceModule().getPath().toString().toCharArray());
+			parser.parseSourceModule(methodSource.toCharArray(), null, method
+					.getSourceModule().getPath().toString().toCharArray());
 
 			return fSearchResults;
 		} catch (ModelException e) {
@@ -180,14 +193,16 @@
 		}
 		return fSearchResults;
 	}
-	
-	public IMethod[] findMethods(final String methodName, int argCount, int sourcePosition) {
+
+	public IMethod[] findMethods(final String methodName, int argCount,
+			int sourcePosition) {
 		final List methods = new ArrayList();
 		ISourceModule module = this.method.getSourceModule();
 		try {
-			IModelElement[] elements = module.codeSelect(sourcePosition, methodName.length());
-			for( int i = 0; i < elements.length; ++i ) {
-				if( elements[i] instanceof IMethod ) {
+			IModelElement[] elements = module.codeSelect(sourcePosition,
+					methodName.length());
+			for (int i = 0; i < elements.length; ++i) {
+				if (elements[i] instanceof IMethod) {
 					methods.add(elements[i]);
 				}
 			}
@@ -195,86 +210,99 @@
 			// TODO Auto-generated catch block
 			e.printStackTrace();
 		}
-//		final String nsName;
-//		if( methodName.indexOf("::") != -1 ) {
-//			String mmName = methodName;
-//			if( mmName.startsWith("::")) {
-//				mmName = mmName.substring(2);
-//			}
-//			if( mmName.indexOf("::") != -1 ) {
-//				int posb = mmName.indexOf("::");
-//				nsName = mmName.substring(0, posb);
-//			}
-//			else {
-//				nsName = null;
-//			}
-//		}
-//		else {
-//			nsName = null;
-//		}
-//		SearchRequestor requestor = new SearchRequestor() {
-//			public void acceptSearchMatch(SearchMatch match) throws CoreException {
-//				Object element = match.getElement();
-//				if( element instanceof IMethod ) {
-//					IMethod method = (IMethod)element;
-//					String mn = method.getTypeQualifiedName('$', false).replaceAll("\\$", "::");
-//					if( mn.equals(methodName) && !isIgnoredBySearchScope(method) ) {
-//						methods.add(method);
-//					}
-//				}
-//				else {
-//					IType type = (IType) element;
-//					if( !( type.getParent() instanceof ISourceModule )) {						
-//						return;
-//					}
-//					processTypeFunctions(type);
-//				}
-//			}
-//			private void processTypeFunctions(IType type) throws ModelException {				
-//				IMethod[] tmethods = type.getMethods();
-//				for (int i = 0; i < tmethods.length; ++i) {
-//					String mn = tmethods[i].getTypeQualifiedName('$', false).replaceAll("\\$", "::");
-//					if( mn.equals(methodName) && !isIgnoredBySearchScope(tmethods[i]) ) {
-//						methods.add(tmethods[i]);
-//					}
-//				}
-//				IType[] types = type.getTypes();
-//				for( int i = 0; i < types.length; ++i ) {
-//					processTypeFunctions(types[i]);
-//				}
-//			}
-//		};
-//		
-//		try {
-//			String pattern = methodName;
-//			if( pattern.startsWith("::")) {
-//				pattern = pattern.substring(2);
-//			}
-//			if( pattern.indexOf("::")==-1) {
-//				search(pattern, IDLTKSearchConstants.METHOD, IDLTKSearchConstants.DECLARATIONS, scope, requestor);				
-//			}
-//			if( nsName != null ) {				
-//				search(nsName, IDLTKSearchConstants.TYPE, IDLTKSearchConstants.DECLARATIONS, scope, requestor);
-//			}
-//		} catch (CoreException e) {
-//			// TODO Auto-generated catch block
-//			e.printStackTrace();
-//		}
-		
-		return (IMethod[])methods.toArray(new IMethod[methods.size()]);
+		// final String nsName;
+		// if( methodName.indexOf("::") != -1 ) {
+		// String mmName = methodName;
+		// if( mmName.startsWith("::")) {
+		// mmName = mmName.substring(2);
+		// }
+		// if( mmName.indexOf("::") != -1 ) {
+		// int posb = mmName.indexOf("::");
+		// nsName = mmName.substring(0, posb);
+		// }
+		// else {
+		// nsName = null;
+		// }
+		// }
+		// else {
+		// nsName = null;
+		// }
+		// SearchRequestor requestor = new SearchRequestor() {
+		// public void acceptSearchMatch(SearchMatch match) throws CoreException
+		// {
+		// Object element = match.getElement();
+		// if( element instanceof IMethod ) {
+		// IMethod method = (IMethod)element;
+		// String mn = method.getTypeQualifiedName('$', false).replaceAll("\\$",
+		// "::");
+		// if( mn.equals(methodName) && !isIgnoredBySearchScope(method) ) {
+		// methods.add(method);
+		// }
+		// }
+		// else {
+		// IType type = (IType) element;
+		// if( !( type.getParent() instanceof ISourceModule )) {
+		// return;
+		// }
+		// processTypeFunctions(type);
+		// }
+		// }
+		// private void processTypeFunctions(IType type) throws ModelException {
+		// IMethod[] tmethods = type.getMethods();
+		// for (int i = 0; i < tmethods.length; ++i) {
+		// String mn = tmethods[i].getTypeQualifiedName('$',
+		// false).replaceAll("\\$", "::");
+		// if( mn.equals(methodName) && !isIgnoredBySearchScope(tmethods[i]) ) {
+		// methods.add(tmethods[i]);
+		// }
+		// }
+		// IType[] types = type.getTypes();
+		// for( int i = 0; i < types.length; ++i ) {
+		// processTypeFunctions(types[i]);
+		// }
+		// }
+		// };
+		//		
+		// try {
+		// String pattern = methodName;
+		// if( pattern.startsWith("::")) {
+		// pattern = pattern.substring(2);
+		// }
+		// if( pattern.indexOf("::")==-1) {
+		// search(pattern, IDLTKSearchConstants.METHOD,
+		// IDLTKSearchConstants.DECLARATIONS, scope, requestor);
+		// }
+		// if( nsName != null ) {
+		// search(nsName, IDLTKSearchConstants.TYPE,
+		// IDLTKSearchConstants.DECLARATIONS, scope, requestor);
+		// }
+		// } catch (CoreException e) {
+		// // TODO Auto-generated catch block
+		// e.printStackTrace();
+		// }
+
+		return (IMethod[]) methods.toArray(new IMethod[methods.size()]);
 	}
 
-	protected void search(String patternString, int searchFor, int limitTo, IDLTKSearchScope scope, SearchRequestor resultCollector)
+	protected void search(String patternString, int searchFor, int limitTo,
+			IDLTKSearchScope scope, SearchRequestor resultCollector)
 			throws CoreException {
-		search(patternString, searchFor, limitTo, EXACT_RULE, scope, resultCollector);
+		search(patternString, searchFor, limitTo, EXACT_RULE, scope,
+				resultCollector);
 	}
 
-	protected void search(String patternString, int searchFor, int limitTo, int matchRule, IDLTKSearchScope scope, SearchRequestor requestor)
+	protected void search(String patternString, int searchFor, int limitTo,
+			int matchRule, IDLTKSearchScope scope, SearchRequestor requestor)
 			throws CoreException {
-		if (patternString.indexOf('*') != -1 || patternString.indexOf('?') != -1) {
+		if (patternString.indexOf('*') != -1
+				|| patternString.indexOf('?') != -1) {
 			matchRule |= SearchPattern.R_PATTERN_MATCH;
 		}
-		SearchPattern pattern = SearchPattern.createPattern(patternString, searchFor, limitTo, matchRule);
-		new SearchEngine().search(pattern, new SearchParticipant[] { SearchEngine.getDefaultSearchParticipant() }, scope, requestor, null);
+		SearchPattern pattern = SearchPattern.createPattern(patternString,
+				searchFor, limitTo, matchRule, scope.getLanguageToolkit());
+		new SearchEngine().search(pattern,
+				new SearchParticipant[] { SearchEngine
+						.getDefaultSearchParticipant() }, scope, requestor,
+				null);
 	}
 }
diff --git a/plugins/org.eclipse.dltk.javascript.core/src/org/eclipse/dltk/javascript/internal/core/codeassist/selection/JavaScriptSelectionEngine.java b/plugins/org.eclipse.dltk.javascript.core/src/org/eclipse/dltk/javascript/internal/core/codeassist/selection/JavaScriptSelectionEngine.java
index 3a49671..a8cafaa 100644
--- a/plugins/org.eclipse.dltk.javascript.core/src/org/eclipse/dltk/javascript/internal/core/codeassist/selection/JavaScriptSelectionEngine.java
+++ b/plugins/org.eclipse.dltk.javascript.core/src/org/eclipse/dltk/javascript/internal/core/codeassist/selection/JavaScriptSelectionEngine.java
@@ -42,137 +42,134 @@
 
 public class JavaScriptSelectionEngine extends ScriptSelectionEngine {
 
-	public JavaScriptSelectionEngine(/*Map settings*/) {
-//		super(settings);
+	public JavaScriptSelectionEngine(/* Map settings */) {
+		// super(settings);
 	}
 
 	public IAssistParser getParser() {
 		return null;
 	}
-	
+
 	ISourceModule cu;
 
 	public IModelElement[] select(ISourceModule cu, int offset, int i) {
 		String content = cu.getSourceContents();
 		char[] fileName = cu.getFileName();
-		this.cu=cu;
-		ReferenceResolverContext buildContext2 = AssitUtils.buildContext((org.eclipse.dltk.core.ISourceModule) cu,offset ,
-				content, fileName);
+		this.cu = cu;
+		ReferenceResolverContext buildContext2 = AssitUtils.buildContext(
+				(org.eclipse.dltk.core.ISourceModule) cu, offset, content,
+				fileName);
 		HostCollection buildContext = buildContext2.getHostCollection();
 		AssitUtils.PositionCalculator calc = new AssitUtils.PositionCalculator(
 				content, offset, true);
 		// if (i==offset)i=1;
-		final List result=new ArrayList();
+		final List result = new ArrayList();
 		String selection = calc.getCompletion();
 		if (calc.isMember()) {
 			processMember(buildContext2, calc, result, selection);
 		} else {
 			processGlobals(buildContext2, buildContext, result, selection);
 		}
-		HashSet sm=new HashSet(result);
-		IModelElement[] resultA=new IModelElement[sm.size()];
+		HashSet sm = new HashSet(result);
+		IModelElement[] resultA = new IModelElement[sm.size()];
 		sm.toArray(resultA);
 		return resultA;
 	}
 
-	private void processGlobals(ReferenceResolverContext rc, HostCollection buildContext, final List result,
-			String selection) {
-		if (!(selection.length()==0))
-		{	
-		//local defenitition
-		//global member;					
-		IReference rm= buildContext.getReference(selection);
-		if (rm!=null)
-		{	
-			rm.addModelElements(result);
-		}
-		else{
-			Set resolveGlobals = rc.resolveGlobals(selection);
-			Iterator it=resolveGlobals.iterator();
-			while (it.hasNext()){
-				Object next = it.next();
-				if (it instanceof IReference)
-				{
-				IReference r=(IReference) next;
-				if (r.getName().equals(selection))
-				r.addModelElements(result);
+	private void processGlobals(ReferenceResolverContext rc,
+			HostCollection buildContext, final List result, String selection) {
+		if (!(selection.length() == 0)) {
+			// local defenitition
+			// global member;
+			IReference rm = buildContext.getReference(selection);
+			if (rm != null) {
+				rm.addModelElements(result);
+			} else {
+				Set resolveGlobals = rc.resolveGlobals(selection);
+				Iterator it = resolveGlobals.iterator();
+				while (it.hasNext()) {
+					Object next = it.next();
+					if (it instanceof IReference) {
+						IReference r = (IReference) next;
+						if (r.getName().equals(selection))
+							r.addModelElements(result);
+					}
 				}
 			}
-		}
-		
-		if (result.size()==0)
-		{
-		doCompletionOnFunction(selection, result);
-		doCompletionOnGlobalVariable(selection,result);
-		}
+
+			if (result.size() == 0) {
+				doCompletionOnFunction(selection, result);
+				doCompletionOnGlobalVariable(selection, result);
+			}
 		}
 	}
 
 	private void processMember(ReferenceResolverContext buildContext,
 			AssitUtils.PositionCalculator calc, final List result,
 			String selection) {
-		String core=calc.getCorePart();
-		IReference rm= buildContext.getHostCollection() .queryElement(selection,true);
-		if (rm!=null)
-		rm.addModelElements(result);
-		if (result.size()==0)
-		{
-		IDLTKLanguageToolkit toolkit = null;
-		toolkit = DLTKLanguageManager
-				.getLanguageToolkit(JavaScriptNature.NATURE_ID);
-		Set resolveGlobals = buildContext.resolveGlobals(selection);
-		Iterator it=resolveGlobals.iterator();
-		while (it.hasNext()){
-			IReference r=(IReference) it.next();
-			r.addModelElements(result);
-		}
-		
-		SearchRequestor requestor = new SearchRequestor() {
-
-			public void acceptSearchMatch(SearchMatch match)
-					throws CoreException {
-				FieldReferenceMatch mr = (FieldReferenceMatch) match;
-				ASTNode nm=mr.getNode();
-				if (nm instanceof VaribleDeclarationReference){
-					VaribleDeclarationReference vm=(VaribleDeclarationReference) nm;
-					IReference reference = vm.getReference();
-					if (reference!=null){
-						reference.addModelElements(result);
-					}
-				}
-				
-				
+		String core = calc.getCorePart();
+		IReference rm = buildContext.getHostCollection().queryElement(
+				selection, true);
+		if (rm != null)
+			rm.addModelElements(result);
+		if (result.size() == 0) {
+			IDLTKLanguageToolkit toolkit = null;
+			toolkit = DLTKLanguageManager
+					.getLanguageToolkit(JavaScriptNature.NATURE_ID);
+			Set resolveGlobals = buildContext.resolveGlobals(selection);
+			Iterator it = resolveGlobals.iterator();
+			while (it.hasNext()) {
+				IReference r = (IReference) it.next();
+				r.addModelElements(result);
 			}
 
-		};
-		IDLTKSearchScope scope = SearchEngine.createWorkspaceScope(toolkit);
-		try {
+			SearchRequestor requestor = new SearchRequestor() {
 
-			search(selection , IDLTKSearchConstants.FIELD,
-					IDLTKSearchConstants.REFERENCES, scope, requestor);
-		} catch (CoreException e) {
-			e.printStackTrace();
-		}
+				public void acceptSearchMatch(SearchMatch match)
+						throws CoreException {
+					FieldReferenceMatch mr = (FieldReferenceMatch) match;
+					ASTNode nm = mr.getNode();
+					if (nm instanceof VaribleDeclarationReference) {
+						VaribleDeclarationReference vm = (VaribleDeclarationReference) nm;
+						IReference reference = vm.getReference();
+						if (reference != null) {
+							reference.addModelElements(result);
+						}
+					}
+
+				}
+
+			};
+			IDLTKSearchScope scope = SearchEngine.createWorkspaceScope(toolkit);
+			try {
+
+				search(selection, IDLTKSearchConstants.FIELD,
+						IDLTKSearchConstants.REFERENCES, scope, requestor);
+			} catch (CoreException e) {
+				e.printStackTrace();
+			}
 		}
 	}
-		
-	private void doCompletionOnFunction(final String startPart,final List modelElements) {
+
+	private void doCompletionOnFunction(final String startPart,
+			final List modelElements) {
 		SearchRequestor requestor = new SearchRequestor() {
 			public void acceptSearchMatch(SearchMatch match)
 					throws CoreException {
 				Object element = match.getElement();
 				if (element instanceof IMethod) {
-					IMethod mn=(IMethod) element;
-					if (mn.getElementName().equals(startPart))
-					{
-					if (!modelElements.isEmpty())return;
-					modelElements.add(element);
+					IMethod mn = (IMethod) element;
+					if (mn.getElementName().equals(startPart)) {
+						if (!modelElements.isEmpty())
+							return;
+						modelElements.add(element);
 					}
 				}
 			}
 		};
 		IDLTKLanguageToolkit toolkit = null;
-		toolkit = DLTKLanguageManager.getLanguageToolkit(JavaScriptNature.NATURE_ID);
+		toolkit = DLTKLanguageManager
+				.getLanguageToolkit(JavaScriptNature.NATURE_ID);
 		IDLTKSearchScope scope = SearchEngine.createWorkspaceScope(toolkit);
 		try {
 			search(startPart, IDLTKSearchConstants.METHOD,
@@ -180,35 +177,36 @@
 		} catch (CoreException e) {
 			// TODO Auto-generated catch block
 			e.printStackTrace();
-		}		
+		}
 	}
-	
-	private void doCompletionOnGlobalVariable(
-			String startPart, final List methods) {
+
+	private void doCompletionOnGlobalVariable(String startPart,
+			final List methods) {
 		SearchRequestor requestor = new SearchRequestor() {
 			public void acceptSearchMatch(SearchMatch match)
 					throws CoreException {
 				Object element = match.getElement();
 				if (element instanceof IField) {
-					methods.add(element);					
+					methods.add(element);
 				}
 				if (match instanceof FieldReferenceMatch) {
 					FieldReferenceMatch mr = (FieldReferenceMatch) match;
-					
-					//String string = mr.getNode().toString();
-					//if (string.startsWith("!!!"))
-					//	return;
-					//int i = string.indexOf('.');
-					//if (i != -1)
-					//	string = string.substring(0, i);
-					//if (!completedNames.contains(string))
-					//props.add(string);
-					
+
+					// String string = mr.getNode().toString();
+					// if (string.startsWith("!!!"))
+					// return;
+					// int i = string.indexOf('.');
+					// if (i != -1)
+					// string = string.substring(0, i);
+					// if (!completedNames.contains(string))
+					// props.add(string);
+
 				}
 			}
 		};
 		IDLTKLanguageToolkit toolkit = null;
-		toolkit = DLTKLanguageManager.getLanguageToolkit(JavaScriptNature.NATURE_ID);
+		toolkit = DLTKLanguageManager
+				.getLanguageToolkit(JavaScriptNature.NATURE_ID);
 		IDLTKSearchScope scope = SearchEngine.createWorkspaceScope(toolkit);
 		try {
 			search(startPart + "*", IDLTKSearchConstants.FIELD,
@@ -218,9 +216,9 @@
 		} catch (CoreException e) {
 			// TODO Auto-generated catch block
 			e.printStackTrace();
-		}				
+		}
 	}
-	
+
 	protected void search(String patternString, int searchFor, int limitTo,
 			IDLTKSearchScope scope, SearchRequestor resultCollector)
 			throws CoreException {
@@ -236,16 +234,15 @@
 			matchRule |= SearchPattern.R_PATTERN_MATCH;
 		}
 		SearchPattern pattern = SearchPattern.createPattern(patternString,
-				searchFor, limitTo, matchRule);
-		if (pattern==null){
-			pattern = SearchPattern.createPattern(patternString,
-					searchFor, limitTo, matchRule);
+				searchFor, limitTo, matchRule, scope.getLanguageToolkit());
+		if (pattern == null) {
+			pattern = SearchPattern.createPattern(patternString, searchFor,
+					limitTo, matchRule, scope.getLanguageToolkit());
 		}
 		new SearchEngine().search(pattern,
 				new SearchParticipant[] { SearchEngine
 						.getDefaultSearchParticipant() }, scope, requestor,
 				null);
 	}
-	
 
 }