ConstructCache() публичный статический Метод

public static ConstructCache ( Script scriptToCache ) : void
scriptToCache Script
Результат void
Пример #1
0
        public void RegisterScriptHeader(string header)
        {
            Script newHeader = new Script("__Plugin" + _editorInterface.pluginID + ".ash", header, true);

            AutoComplete.ConstructCache(newHeader);
            _scriptHeaders.Add(newHeader);
        }
Пример #2
0
 private void scintilla_OnBeforeShowingAutoComplete(object sender, EventArgs e)
 {
     if (_editorTextModifiedSinceLastCopy)
     {
         UpdateScriptObjectWithLatestTextInWindow();
     }
     AutoComplete.ConstructCache(_script);
 }
Пример #3
0
        private void GoToDefinition(string structName, string memberName)
        {
            ScriptToken   found           = null;
            Script        foundInScript   = null;
            List <Script> scriptsToSearch = new List <Script>();

            scriptsToSearch.AddRange(_agsEditor.GetAllScriptHeaders());
            scriptsToSearch.Add(_script);

            foreach (Script script in scriptsToSearch)
            {
                found         = FindTokenInScript(script, structName, memberName);
                foundInScript = script;

                if ((found != null) && (script.IsHeader))
                {
                    // Always prefer the definition in the main script to
                    // the import in the header
                    Script mainScript = _agsEditor.CurrentGame.Scripts.FindMatchingScriptOrHeader(script);
                    if (!mainScript.AutoCompleteData.Populated)
                    {
                        AutoComplete.ConstructCache(mainScript);
                    }
                    ScriptToken foundInScriptBody = FindTokenInScript(mainScript, structName, memberName);
                    if (foundInScriptBody != null)
                    {
                        found         = foundInScriptBody;
                        foundInScript = mainScript;
                    }
                }

                if (found != null)
                {
                    break;
                }
            }

            if ((found == null) && (structName == null))
            {
                found = FindTokenAsLocalVariable(memberName, false);
            }

            if (found != null)
            {
                if (foundInScript.FileName == AGSEditor.BUILT_IN_HEADER_FILE_NAME)
                {
                    Factory.GUIController.LaunchHelpForKeyword(_goToDefinition);
                }
                else if (foundInScript.FileName == Tasks.AUTO_GENERATED_HEADER_NAME)
                {
                    Factory.GUIController.ShowMessage("This variable is internally defined by AGS and probably corresponds to an in-game entity such as a Character or Inventory Item.", MessageBoxIcon.Information);
                }
                else
                {
                    Factory.GUIController.ZoomToFile(foundInScript.FileName, ZoomToFileZoomType.ZoomToCharacterPosition, found.StartsAtCharacterIndex);
                }
            }
        }
Пример #4
0
 /// <summary>
 /// Updates this script's autocomplete cache and all the controls that depend on it.
 /// </summary>
 private void UpdateAutocompleteAndControls(bool force)
 {
     if (!force && !ContainsFocus)
     {
         return; // only update for the active pane to avoid expensive combo Add operations
     }
     AutoComplete.ConstructCache(_script, _agsEditor.GetImportedScriptHeaders(_script));
     UpdateStructHighlighting();
     UpdateFunctionList();
 }
Пример #5
0
        public void SaveChanges()
        {
            if (_editorTextModifiedSinceLastCopy)
            {
                UpdateScriptObjectWithLatestTextInWindow();
            }

            if (scintilla.IsModified)
            {
                _script.SaveToDisk();
                scintilla.SetSavePoint();
                if (_script.IsHeader)
                {
                    AutoComplete.ConstructCache(_script);
                }
            }
        }
Пример #6
0
 void IAGSEditor.RebuildAutocompleteCache(Script script)
 {
     AutoComplete.ConstructCache(script);
 }
Пример #7
0
 void IAGSEditor.RebuildAutocompleteCache(Script script)
 {
     AutoComplete.ConstructCache(script, _agsEditor.GetImportedScriptHeaders(script));
 }