return true;
}
- public override Gee.ArrayList<CompletionProposal> suggestComplete(
- JsRender.JsRender file,
- JsRender.Node? node,
- JsRender.NodeProp? xxprop,
- string complete_string
- ) {
-
- var ret = new Gee.ArrayList<CompletionProposal>();
- return ret;
- /*
- // completion rules??
-
- // Roo......
-
- // this. (based on the node type)
- // this.xxx // Node and any determination...
-
- if (complete_string.index_of(".",0) < 0) {
- // string does not have a '.'
- // offer up this / Roo / javascript keywords... / look for var string = .. in the code..
- for(var i = 0; i < JsRender.Lang.match_strings.size ; i++) {
- var str = JsRender.Lang.match_strings.get(i);
- if (complete_string != str && str.index_of(complete_string,0) == 0 ) {
- // should we ignore exact matches... ???tr,str,
- var sci = new CompletionProposal(str,str, "javascript: " + str);
- ret.add(sci);
-
- }
-
-
- }
- if (complete_string != "Roo" && "Roo".index_of(complete_string,0) == 0 ) {
- // should we ignore exact matches... ???
-
- var sci = new CompletionProposal("Roo - A Roo class","Roo", "Roo Library");
- ret.add(sci);
-
- }
- if (complete_string != "_this" && "_this".index_of(complete_string,0) == 0 ) {
- // should we ignore exact matches... ???
- var sci = new CompletionProposal("_this - Reference to the global pointer to the files main class instance",
- "_this", "Reference to the global pointer to the files main class instance");
- ret.add(sci);
-
- }
- return ret;
- }
- // got at least one ".".
- var parts = complete_string.split(".");
- var curtype = "";
- var cur_instance = false;
- if (parts[0] == "this") {
- // work out from the node, what the type is...
- if (node == null) {
- print("node is empty - no return\n");
- return ret; // no idea..
- }
- curtype = node.fqn();
- cur_instance = true;
- }
- if (parts[0] == "Roo") {
- curtype = "Roo";
- cur_instance = false;
- }
-
- var prevbits = parts[0] + ".";
- for(var i =1; i < parts.length; i++) {
- print("matching %d/%d\n", i, parts.length);
- var is_last = i == parts.length -1;
-
- // look up all the properties of the type...
- var cls = this.getClass(curtype);
- if (cls == null) {
- print("could not get class of curtype %s\n", curtype);
- return ret;
- }
-
- if (!is_last) {
-
- // only exact matches from here on...
- if (cur_instance) {
- if (cls.props.has_key(parts[i])) {
- var prop = cls.props.get(parts[i]);
- if (prop.type.index_of(".",0) > -1) {
- // type is another roo object..
- curtype = prop.type;
- prevbits += parts[i] + ".";
- continue;
- }
- return ret;
- }
-
-
-
- // check methods?? - we do not export that at present..
- return ret; //no idea...
- }
-
- // not a instance..
- //look for child classes.
- var citer = this.classes.map_iterator();
- var foundit = false;
- while (citer.next()) {
- var scls = citer.get_key();
- var look = prevbits + parts[i];
- if (scls.index_of(look,0) != 0) {
- continue;
- }
- // got a starting match..
- curtype = look;
- cur_instance = false;
- foundit =true;
- break;
- }
- if (!foundit) {
- return ret;
- }
- prevbits += parts[i] + ".";
- continue;
- }
- // got to the last element..
- print("Got last element\n");
- if (curtype == "") { // should not happen.. we would have returned already..
- return ret;
- }
- print("Got last element type %s\n",curtype);
- if (!cur_instance) {
- print("matching instance");
- // it's a static reference..
- var citer = this.classes.map_iterator();
- while (citer.next()) {
- var scls = citer.get_key();
- var look = prevbits + parts[i];
- if (parts[i].length > 0 && scls.index_of(look,0) != 0) {
- continue;
- }
-
- // got a starting match..
- var sci = new CompletionProposal(scls,scls,scls);
- ret.add(sci);
- }
- return ret;
- }
- print("matching property");
-
-
-
- var citer = cls.methods.map_iterator();
- while (citer.next()) {
- var prop = citer.get_value();
- // does the name start with ...
- if (parts[i].length > 0 && prop.name.index_of(parts[i],0) != 0) {
- continue;
- }
- // got a matching property...
- // return type?
-
-
- var sci = new CompletionProposal(prop.name + prop.sig + " : ("+ prop.propertyof + ")",
- prevbits + prop.name + "(",prop.doctxt);
- ret.add(sci);
-
- }
-
- // get the properties / methods and subclasses.. of cls..
- // we have cls.. - see if the string matches any of the properties..
- citer = cls.props.map_iterator();
- while (citer.next()) {
- var prop = citer.get_value();
- // does the name start with ...
- if (parts[i].length > 0 && prop.name.index_of(parts[i],0) != 0) {
- continue;
- }
- // got a matching property..
- var sci = new CompletionProposal(prop.name + prop.type + " : ("+ prop.propertyof + ")",
- prevbits + prop.name + "(",prop.doctxt);
- ret.add(sci);
-
- }
-
-
- return ret;
-
-
-
-
-
- }
-
-
-
-
-
-
- return ret;
- */
- }
+
public override Gee.ArrayList<string> getChildList(string in_rval, bool with_prop)