Ejemplo n.º 1
0
        static public void OnCurrentFileChanged()
        {
            if (CodeMapPanel != null)
            {
                CodeMapPanel.RefreshContent();
            }

            if (Npp.IsCurrentScriptFile() && Config.Instance.UseRoslynProvider && Config.Instance.StartRoslynServerAtNppStartup)
            {
                CSScriptHelper.InitRoslyn();
            }
        }
Ejemplo n.º 2
0
 static public void Run()
 {
     if (Debugger.IsRunning)
     {
         Debugger.Go();
     }
     else if (Npp.IsCurrentScriptFile() && runningScript == null)
     {
         if (Plugin.ProjectPanel == null)
         {
             InitProjectPanel();
         }
         Plugin.RunScript();
     }
 }
Ejemplo n.º 3
0
        static IEnumerable <Keys> BindInteranalShortcuts()
        {
            var uniqueKeys = new Dictionary <Keys, int>();

            AddInternalShortcuts("Build:F7",
                                 "Build (validate)",
                                 Build, uniqueKeys);

            AddInternalShortcuts("LoadCurrentDocument:Ctrl+F7",
                                 "Load Current Document", () =>
            {
                InitProjectPanel();
                ShowProjectPanel();
                ProjectPanel.LoadCurrentDoc();
            }, uniqueKeys);

            AddInternalShortcuts("Stop:Shift+F5",
                                 "Stop running script",
                                 Stop, uniqueKeys);

            AddInternalShortcuts("_Run:F5",
                                 "Run",
                                 Run, uniqueKeys);

            AddInternalShortcuts("_Debug:Alt+F5",
                                 "Debug", () =>
            {
                if (!Debugger.IsRunning && Npp.IsCurrentScriptFile())
                {
                    DebugScript();
                }
            }, uniqueKeys);

            AddInternalShortcuts("ToggleBreakpoint:F9",
                                 "Toggle Breakpoint",
                                 () => Debugger.ToggleBreakpoint(), uniqueKeys);

            AddInternalShortcuts("QuickWatch:Shift+F9",
                                 "Show QuickWatch...",
                                 QuickWatchPanel.PopupDialog, uniqueKeys);

            AddInternalShortcuts("StepInto:F11",
                                 "Step Into",
                                 Debugger.StepIn, uniqueKeys);

            AddInternalShortcuts("StepOut:Shift+F11",
                                 "Step Out",
                                 Debugger.StepOut, uniqueKeys);

            AddInternalShortcuts("StepOver:F10",
                                 "Step Over",
                                 StepOver, uniqueKeys);

            AddInternalShortcuts("SetNextIP:Ctrl+Shift+F10",
                                 "Set Next Statement",
                                 Debugger.SetInstructionPointer, uniqueKeys);

            AddInternalShortcuts("RunToCursor:Ctrl+F10",
                                 "Run To Cursor",
                                 Debugger.RunToCursor, uniqueKeys);

            AddInternalShortcuts("RunAsExternal:Ctrl+F5",
                                 "Run As External Process", () =>
            {
                if (Npp.IsCurrentScriptFile())
                {
                    RunAsExternal();
                }
            }, uniqueKeys);

            AddInternalShortcuts("ShowNextFileLocationFromOutput:F4",
                                 "Next File Location in Output", () =>
            {
                OutputPanel.TryNavigateToFileReference(toNext: true);
            }, uniqueKeys);

            AddInternalShortcuts("ShowPrevFileLocationFromOutput:Shift+F4",
                                 "Previous File Location in Output", () =>
            {
                OutputPanel.TryNavigateToFileReference(toNext: false);
            }, uniqueKeys);

            return(uniqueKeys.Keys);
        }