index: update all.json
This commit is contained in:
@@ -1,4 +1,83 @@
|
||||
[
|
||||
{
|
||||
"name": "globals",
|
||||
"url": "globals.html",
|
||||
"summary": "全局函数",
|
||||
"properties": [
|
||||
{
|
||||
"key": "sleep",
|
||||
"url": "globals.html#globals_sleep_n",
|
||||
"summary": "暂停运行",
|
||||
"global": true
|
||||
},
|
||||
{
|
||||
"key": "currentPackage",
|
||||
"url": "globals.html#globals_currentpackage",
|
||||
"summary": "当前包名",
|
||||
"global": true
|
||||
},
|
||||
{
|
||||
"key": "currentActivity",
|
||||
"url": "globals.html#globals_currentactivity",
|
||||
"summary": "当前活动",
|
||||
"global": true
|
||||
},
|
||||
{
|
||||
"key": "setClip",
|
||||
"url": "globals.html#globals_setclip_text",
|
||||
"summary": "设置剪贴板",
|
||||
"global": true
|
||||
},
|
||||
{
|
||||
"key": "getClip",
|
||||
"url": "globals.html#globals_getclip",
|
||||
"summary": "获取剪贴板",
|
||||
"global": true
|
||||
},
|
||||
{
|
||||
"key": "toast",
|
||||
"url": "globals.html#globals_toast_message",
|
||||
"summary": "气泡提示",
|
||||
"global": true
|
||||
},
|
||||
{
|
||||
"key": "toastLog",
|
||||
"url": "globals.html#globals_toastlog_messagep",
|
||||
"summary": "提示&打印",
|
||||
"global": true
|
||||
},
|
||||
{
|
||||
"key": "waitForActivity",
|
||||
"url": "globals.html#globals_waitforactivity_activity_period_200",
|
||||
"summary": "等待活动",
|
||||
"global": true
|
||||
},
|
||||
{
|
||||
"key": "waitForPackage",
|
||||
"url": "globals.html#globals_waitforpackage_package_period_200",
|
||||
"summary": "等待包名",
|
||||
"global": true
|
||||
},{
|
||||
"key": "exit",
|
||||
"url": "globals.html#globals_exit",
|
||||
"summary": "退出",
|
||||
"global": true
|
||||
},
|
||||
{
|
||||
"key": "random",
|
||||
"url": "globals.html#globals_random_min_max",
|
||||
"summary": "随机数",
|
||||
"global": true
|
||||
},
|
||||
{
|
||||
"key": "context",
|
||||
"url": "globals.html#globals_context",
|
||||
"summary": "",
|
||||
"global": true,
|
||||
"variable": true
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "app",
|
||||
"url": "app.html",
|
||||
@@ -190,7 +269,8 @@
|
||||
{
|
||||
"key": "log",
|
||||
"url": "console.html#console_console_log_data_args",
|
||||
"summary": "打印日志"
|
||||
"summary": "打印日志",
|
||||
"global": true
|
||||
},
|
||||
{
|
||||
"key": "warn",
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user