mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-01-19 00:37:25 +01:00
[apps/code] Load varbox before returning it in console
This commit is contained in:
@@ -159,9 +159,7 @@ int VariableBoxController::typeAtLocation(int i, int j) {
|
||||
|
||||
void VariableBoxController::loadFunctionsAndVariables(int scriptIndex, const char * textToAutocomplete, int textToAutocompleteLength) {
|
||||
// Reset the node counts
|
||||
m_currentScriptNodesCount = 0;
|
||||
m_builtinNodesCount = 0;
|
||||
m_importedNodesCount = 0;
|
||||
empty();
|
||||
|
||||
if (scriptIndex < 0) {
|
||||
/* If not script index is given, the variable box is loaded from console. We
|
||||
@@ -241,6 +239,16 @@ const char * VariableBoxController::autocompletionAlternativeAtIndex(int textToA
|
||||
return currentName + textToAutocompleteLength;
|
||||
}
|
||||
|
||||
void VariableBoxController::loadVariablesImportedFromScripts() {
|
||||
const int scriptsCount = m_scriptStore->numberOfScripts();
|
||||
for (int i = 0; i < scriptsCount; i++) {
|
||||
Script script = m_scriptStore->scriptAtIndex(i);
|
||||
if (script.contentFetchedFromConsole()) {
|
||||
loadGlobalAndImportedVariablesInScriptAsImported(script.fullName(), script.scriptContent(), nullptr, -1, false); // TODO optimize number of script fetches
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void VariableBoxController::empty() {
|
||||
m_builtinNodesCount = 0;
|
||||
m_currentScriptNodesCount = 0;
|
||||
@@ -382,16 +390,6 @@ void VariableBoxController::insertTextInCaller(const char * text, int textLength
|
||||
sender()->handleEventWithText(commandBuffer);
|
||||
}
|
||||
|
||||
void VariableBoxController::loadVariablesImportedFromScripts() {
|
||||
const int scriptsCount = m_scriptStore->numberOfScripts();
|
||||
for (int i = 0; i < scriptsCount; i++) {
|
||||
Script script = m_scriptStore->scriptAtIndex(i);
|
||||
if (script.contentFetchedFromConsole()) {
|
||||
loadGlobalAndImportedVariablesInScriptAsImported(script.fullName(), script.scriptContent(), nullptr, -1, false); // TODO optimize number of script fetches
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void VariableBoxController::loadBuiltinNodes(const char * textToAutocomplete, int textToAutocompleteLength) {
|
||||
//TODO LEA could be great to use strings defined in STATIC const char *const tok_kw[] from python/lexer.c
|
||||
//TODO LEA Prune these (check all are usable in our Python, but just comment those which aren't -> there might become usable later)
|
||||
|
||||
Reference in New Issue
Block a user