javalover520 / jsyntaxpane

Automatically exported from code.google.com/p/jsyntaxpane
0 stars 0 forks source link

Improvement in autocompletion #54

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
It is not possible to auto complete items with ","
For example, it's not possible to insert "add(a,b)" because the string will
be split.
I suggest to escape commas in the properties
"add(a\\,b)"

in Configuration.java:
public static final Pattern COMMA_SEPARATOR =
Pattern.compile("\\s*(?<!\\\\),\\s*");

and
public String[] getPrefixPropertyList(String prefix, String key)
{
    String v = getProperty(prefix + "." + key);
    if (v == null)
    {
        v = getProperty(key);
    }
    if (v == null)
    {
        return EMPTY_LIST;
    }
    String[] split = COMMA_SEPARATOR.split(v);
    for (int i = 0; i < split.length; i++)
    {
        String string = split[i];
        split[i] = string.replaceAll("\\\\,", ",");
    }
    return split;
} 

Original issue reported on code.google.com by fcolasuo...@gmail.com on 22 Jan 2009 at 9:56

GoogleCodeExporter commented 8 years ago
I actually do not like the current way of comma separated very long values in 
the
configuration, and that is one reason.  I mainly released completions to see if 
the
UI looks and behaves fine.
I will look for better configuration methods and hopefully this will be 
eliminated. 
But it will be in the next release.
If you still need current version, then i'll upgrade the 0.9.4 branch a bit 
later. 
I'm getting very busy now.

Original comment by ayman.al...@gmail.com on 22 Jan 2009 at 7:21

GoogleCodeExporter commented 8 years ago
I'm working on this enhancement right now.  I need to know and get some ideas 
as to
what data you'll want to display in the completions dialog.

Original comment by ayman.al...@gmail.com on 25 Jan 2009 at 1:52

GoogleCodeExporter commented 8 years ago
Right now I'd like to autocomplete c++ keywords and macros, with comma-separated
arguments. I'm using the above mentioned code right now.

Original comment by fcolasuo...@gmail.com on 26 Jan 2009 at 9:35

GoogleCodeExporter commented 8 years ago
How about key/value Property Type file with keys being the displayed text, and 
values
being what is to be inserted?  This will make it more user friendly for users 
to see
proper readable text in the combo.
Any ideas?

Original comment by ayman.al...@gmail.com on 26 Jan 2009 at 1:29

GoogleCodeExporter commented 8 years ago
See latest code and binary for Abbreviations.  This should sort out this 
requirement.

Original comment by ayman.al...@gmail.com on 5 Mar 2009 at 3:50