Skip to content
This repository
Browse code

Fix autocompletion when there are upper letters in the name (hopefuly…

… with no bugs this time!).
  • Loading branch information...
commit c245dfe99d5ee087208f3b3564dc7a0209c776b8 1 parent 623a2ee
Benjamin Cabé authored February 27, 2012
2  ...eclipse.koneki.ldt.editor/src/org/eclipse/koneki/ldt/editor/internal/completion/LuaCompletionEngine.java
@@ -54,7 +54,7 @@ public void complete(IModuleSource module, int position, int k) {
54 54
 		ISourceModule sourceModule = (ISourceModule) modelElement;
55 55
 
56 56
 		// Retrieve start position of word current user is typing
57  
-		String start = getWordStarting(module.getSourceContents(), position).toLowerCase();
  57
+		String start = getWordStarting(module.getSourceContents(), position);
58 58
 
59 59
 		this.requestor.beginReporting();
60 60
 		if (start.contains(".") || start.contains(":")) { //$NON-NLS-1$//$NON-NLS-2$
5  plugins/org.eclipse.koneki.ldt.parser/src/org/eclipse/koneki/ldt/parser/LuaASTUtils.java
@@ -284,7 +284,8 @@ public boolean endvisit(ASTNode node) throws Exception {
284 284
 					List<LocalVar> localVars = ((Block) node).getLocalVars();
285 285
 					for (LocalVar localVar : localVars) {
286 286
 						Item item = localVar.getVar();
287  
-						if (!collectedLocalVars.containsKey(item.getName()) && (start == null || item.getName().startsWith(start))) {
  287
+						if (!collectedLocalVars.containsKey(item.getName())
  288
+								&& (start == null || item.getName().toLowerCase().startsWith(start.toLowerCase()))) {
288 289
 							collectedLocalVars.put(item.getName(), item);
289 290
 						}
290 291
 					}
@@ -394,7 +395,7 @@ public static Definition getDefinition(ISourceModule sourceModule, LuaExpression
394 395
 		// get a global var with this name
395 396
 		final List<Definition> definitions = new ArrayList<Definition>();
396 397
 		for (Item globalvar : luaSourceRoot.getFileapi().getGlobalvars().values()) {
397  
-			if (start == null || start.isEmpty() || globalvar.getName().startsWith(start))
  398
+			if (start == null || start.isEmpty() || globalvar.getName().toLowerCase().startsWith(start.toLowerCase()))
398 399
 				definitions.add(new Definition(preloadedSourceModule, globalvar));
399 400
 		}
400 401
 

0 notes on commit c245dfe

Please sign in to comment.
Something went wrong with that request. Please try again.