index: update all.json

This commit is contained in:
hyb1996
2018-02-04 11:23:03 +08:00
parent 399cb29dd5
commit 3b398ec732
5 changed files with 108 additions and 10 deletions

View File

@@ -51,7 +51,8 @@ public class AutoCompletion {
private void buildDictionaryTree(List<Module> modules) {
for (Module module : modules) {
mGlobalPropertyTree.putWord(module.getName(), module.asGlobalProperty());
if (!module.getName().equals("globals"))
mGlobalPropertyTree.putWord(module.getName(), module.asGlobalProperty());
for (Property property : module.getProperties()) {
if (property.isGlobal())
mGlobalPropertyTree.putWord(property.getKey(), property);

View File

@@ -20,6 +20,9 @@ public class Property {
@SerializedName("global")
private boolean mGlobal;
@SerializedName("variable")
private boolean mVariable = false;
public Property() {
}
@@ -61,4 +64,12 @@ public class Property {
public void setGlobal(boolean global) {
mGlobal = global;
}
public boolean isVariable() {
return mVariable;
}
public void setVariable(boolean variable) {
mVariable = variable;
}
}

View File

@@ -428,12 +428,18 @@ public class EditorView extends FrameLayout implements CodeCompletionBar.OnHintC
@Override
public void onPropertyClick(Module m, Property property) {
if (property.isGlobal()) {
mEditor.insert(property.getKey() + "()");
} else {
mEditor.insert(m.getName() + "." + property.getKey() + "()");
String p = property.getKey();
if (!property.isVariable()) {
p = p + "()";
}
if (property.isGlobal()) {
mEditor.insert(p);
} else {
mEditor.insert(m.getName() + "." + p);
}
if (!property.isVariable()) {
mEditor.moveCursor(0, -1);
}
mEditor.moveCursor(0, -1);
mFunctionsKeyboardHelper.hideFunctionsLayout(true);
}