internal static void DoPlugStart() { if (OnPlugReady != null) { OnPlugReady(); } // subscribe to static events ProEnvironment.OnEnvironmentChange += FileExplorer.RebuildFileList; ProEnvironment.OnEnvironmentChange += DataBase.UpdateDatabaseInfo; DataBase.OnDatabaseInfoUpdated += AutoComplete.RefreshStaticItems; ParserHandler.OnParseStarted += () => { CodeExplorer.Refreshing = true; }; ParserHandler.OnParseEnded += AutoComplete.RefreshDynamicItems; ParserHandler.OnParseEnded += CodeExplorer.UpdateCodeExplorer; AutoComplete.OnUpdatedStaticItems += Parser.UpdateKnownStaticItems; Keywords.Import(); Snippets.Init(); FileTag.Import(); // initialize the list of objects of the autocompletion form AutoComplete.RefreshStaticItems(); // Simulates a OnDocumentSwitched when we start this dll IsCurrentFileProgress = Abl.IsCurrentProgressFile; // to correctly init isPreviousProgress DoNppBufferActivated(true); // triggers OnEnvironmentChange via ProEnvironment.Current.ReComputeProPath(); // Make sure to give the focus to scintilla on startup WinApi.SetForegroundWindow(Npp.HandleNpp); }
internal static void DoPlugStart() { if (OnPlugReady != null) { OnPlugReady(); } // subscribe to static events ProEnvironment.OnEnvironmentChange += FileExplorer.Instance.RebuildFileList; ProEnvironment.OnEnvironmentChange += DataBase.Instance.UpdateDatabaseInfo; ProEnvironment.OnEnvironmentChange += ParserHandler.ClearStaticData; Keywords.Instance.OnImport += AutoCompletion.SetStaticItems; DataBase.Instance.OnDatabaseUpdate += AutoCompletion.SetStaticItems; AutoCompletion.OnUpdateStaticItems += ParserHandler.UpdateKnownStaticItems; ParserHandler.OnEndSendCompletionItems += AutoCompletion.SetDynamicItems; ParserHandler.OnStart += CodeExplorer.Instance.OnStart; ParserHandler.OnEndSendParserItems += CodeExplorer.Instance.OnParseEndParserItems; ParserHandler.OnEndSendCodeExplorerItems += CodeExplorer.Instance.OnParseEndCodeExplorerItems; ParserHandler.OnEnd += CodeExplorer.Instance.OnParseEnd; ProExecutionHandleCompilation.OnEachCompilationOk += FilesInfo.ProExecutionHandleCompilationOnEachCompilationOk; // Clear the %temp% directory if we didn't do it properly last time Utils.DeleteDirectory(Config.FolderTemp, true); //Snippets.Init(); FileTag.Import(); // ask to disable the default autocompletion DelayedAction.StartNew(100, () => { if (!Npp.ConfXml.AskToDisableAutocompletionAndRestart()) { // check if an update was done UpdateHandler.CheckForUpdateDone(); } }); // start checking for new updates UpdateHandler.StartCheckingForUpdate(); // async // Try to update the configuration from the distant shared folder ShareExportConf.StartCheckingForUpdates(); // ReSharper disable once ObjectCreationAsStatement RecurentAction.StartNew(User.Ping, 1000 * 60 * 120); // Make sure to give the focus to scintilla on startup Sci.GrabFocus(); }