package com.redhat.ceylon.eclipse.core.debug;

import java.util.ArrayList;
import java.util.List;

import org.eclipse.debug.core.DebugException;
import org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext;
import org.eclipse.jdt.debug.core.IJavaVariable;

public class CeylonContentProviderFilter {
    public static Object[] filterVariables(Object[] variables, IPresentationContext context) throws DebugException {
        List<Object> keep = new ArrayList<Object>(variables.length);
        for (int i = 0; i < variables.length; i++) {
            boolean filter = false;
            if (variables[i] instanceof IJavaVariable){
                IJavaVariable var = (IJavaVariable)variables[i];
                if (var.getName().contains("$")){
                    filter = true;
                }
            }
            if (!filter){
                keep.add(variables[i]);
            }
        }
        return keep.toArray(new Object[keep.size()]);
    }

}

@@ -273,16 +273,72 @@
 iable;%0A%0A
+import com.redhat.ceylon.compiler.java.codegen.Naming;%0A%0A
 public c
@@ -723,28 +723,23 @@
     
-IJavaVariable var
+String name
  = 
+(
 (IJa
@@ -761,16 +761,27 @@
 ables%5Bi%5D
+).getName()
 ;%0A      
@@ -798,21 +798,219 @@
 if (
-var.getName()
+name.charAt(0) == '$') %7B%0A                    if (Naming.isJavaKeyword(name, 1, name.length())) %7B%0A                        name = name.substring(1);%0A                    %7D%0A                %7D%0A                if (name
 .con

Manage quoted variables (because having the name of a Java keyword)