Beispiel #1
0
        public void textChanged(object o, TextContentChangedEventArgs e)
        {
            ThreadHelper.ThrowIfNotOnUIThread();
            ParseTree.Tree.Parse(e.After.GetText(), out bool parsed);
            results.Clear();
            var root = ParseTree.Tree.Root();

            Parse(root);
            //results.Add(new Result { span = new Span(0, e.After.Length - 1), type = NodeType.MPLCONTENT });
            var errorStack = ParseTree.Tree.GetErrorStack();

            generalPane.Clear();
            if (!parsed)
            {
                try {
                    foreach (var error in errorStack)
                    {
                        var    document = getPropertyFromBuffer <ITextDocument>(e.Before.TextBuffer);
                        string message  = document.FilePath + error.getMessage() + '\n';
                        generalPane.OutputString(message);
                        generalPane.Activate();
                    }
                } catch (InvalidOperationException er) {
                    generalPane.OutputString(er.Message);
                    generalPane.Activate();
                }
            }

            ClassificationChanged?.Invoke(this, new ClassificationChangedEventArgs(new SnapshotSpan(e.After, 0, e.After.Length)));
        }
Beispiel #2
0
        public async Task ClearAsync()
        {
            await ThreadHelper.JoinableTaskFactory.SwitchToMainThreadAsync();

            _hasOutputSinceSolutionOpened = false;
            _outputPane.Clear();
            await TaskScheduler.Default;
        }
        public OutputWindowWriter(DTE dte, IVsOutputWindowPane outputWindow)
        {
            _outputWindow = outputWindow;
            _dte = dte;

            _outputWindow.Clear();
        }
        private void CleanBinAndObj(object sender, EventArgs e)
        {
            var sw = new Stopwatch();
            var solutionProjects = GetProjects();

            _vsOutputWindowPane.Clear();
            WriteToOutput($"Starting... Projects to clean: {solutionProjects.Length}");
            uint cookie = 0;

            StatusBar.Progress(ref cookie, 1, string.Empty, 0, (uint)solutionProjects.Length);
            sw.Start();
            for (uint index = 0; index < solutionProjects.Length; index++)
            {
                var project         = solutionProjects[index];
                var projectRootPath = GetProjectRootFolder(project);
                var message         = $"Cleaning {project.UniqueName}";
                WriteToOutput(message);
                StatusBar.Progress(ref cookie, 1, string.Empty, index, (uint)solutionProjects.Length);
                StatusBar.SetText(message);
                CleanDirectory(projectRootPath);
            }

            sw.Stop();
            WriteToOutput($@"Finished. Elapsed: {sw.Elapsed:mm\:ss\.ffff}");
            // Clear the progress bar.
            StatusBar.Progress(ref cookie, 0, string.Empty, 0, 0);
            StatusBar.FreezeOutput(0);
            StatusBar.SetText("Cleaned bin and obj");
        }
Beispiel #5
0
        public void Initialize()
        {
            ThreadHelper.ThrowIfNotOnUIThread();
            try
            {
                _outputWindow = Package.GetGlobalService(typeof(SVsOutputWindow)) as IVsOutputWindow;
            }
            catch (Exception)
            {
                _outputWindow = null;
            }

            if (_outputWindow == null)
            {
                return;
            }

            var generatorOutputWindowPaneId = new Guid("D6002C1E-2DB8-4C9D-996D-A29364FB8DAC");

            ErrorHandler.ThrowOnFailure(_outputWindow.CreatePane(ref generatorOutputWindowPaneId, "Unit Test Generator", 0, 1));
            ErrorHandler.ThrowOnFailure(_outputWindow.GetPane(ref generatorOutputWindowPaneId, out _testingOutputPane));

            if (_testingOutputPane != null)
            {
                ErrorHandler.ThrowOnFailure(_testingOutputPane.Clear());
                ErrorHandler.ThrowOnFailure(_testingOutputPane.Activate());
            }
        }
Beispiel #6
0
 public static void ClearOutputWindow()
 {
     if (_pane != null)
     {
         _pane.Clear();
     }
 }
Beispiel #7
0
        public void Clear()
        {
            Start();

            _outputWindowPane.Activate();
            _outputWindowPane.Clear();
        }
        public OutputWindowWriter(DTE dte, IVsOutputWindowPane outputWindow)
        {
            _outputWindow = outputWindow;
            _dte          = dte;

            _outputWindow.Clear();
        }
Beispiel #9
0
 public static void Clear()
 {
     if (_pane != null)
     {
         _pane.Clear();
     }
 }
Beispiel #10
0
        internal static void LogStartRunning()
        {
            IVsOutputWindowPane buildPane = BuildPane;

            buildPane.Clear();
            buildPane.OutputString(String.Format(CultureInfo.InvariantCulture, "------ Roslyn script started: {0} ------{1}", DateTime.Now, Environment.NewLine));
        }
Beispiel #11
0
        private async Task OutputMessageAsync(string message, bool clear = false)
        {
            await ThreadHelper.JoinableTaskFactory.SwitchToMainThreadAsync();

            IVsOutputWindowPane outputPane  = null;
            IVsWindowFrame      windowFrame = null;
            var outputWindow = ServiceProvider.GlobalProvider.GetService(typeof(SVsOutputWindow)) as IVsOutputWindow;

            if (outputWindow != null && ErrorHandler.Failed(outputWindow.GetPane(windowGuid, out outputPane)))
            {
                outputWindow.CreatePane(windowGuid, "Meadow Device Explorer", 1, 1);
                outputWindow.GetPane(windowGuid, out outputPane);
            }

            var  vsUiShell = ServiceProvider.GlobalProvider.GetService(typeof(SVsUIShell)) as IVsUIShell;
            uint flags     = (uint)__VSFINDTOOLWIN.FTW_fForceCreate;

            vsUiShell?.FindToolWindow(flags, VSConstants.StandardToolWindows.Output, out windowFrame);

            if (clear)
            {
                outputPane?.Clear();
            }

            windowFrame?.Show();
            outputPane?.Activate();
            outputPane?.OutputString($"[{DateTime.Now.ToLocalTime()}] {message}" + Environment.NewLine);
        }
Beispiel #12
0
 public void ClearOutput()
 {
     if (_outputWindowPane != null)
     {
         ErrorHandler.ThrowOnFailure(_outputWindowPane.Clear());
     }
 }
            public async Task ClearAsync()
            {
                await ThreadHelper.JoinableTaskFactory.SwitchToMainThreadAsync();

                _cachedOutput.Clear();
                _outputPane.Clear();
            }
Beispiel #14
0
 /// <summary>
 /// Removes all text from the Output Window pane.
 /// </summary>
 public static void Clear()
 {
     if (pane != null)
     {
         pane?.Clear();
     }
 }
 private void OnBuildStarted(object sender)
 {
     if (buildDemangledPane != null)
     {
         buildDemangledPane.Clear();
     }
 }
        /// <summary>
        /// Clears all text from pane.
        /// </summary>
        public void Clear()
        {
#if VSSDK_15_AND_NEW
            ThreadHelper.ThrowIfNotOnUIThread(); //TODO: upgrade to 15
#endif

            pane.Clear();
        }
Beispiel #17
0
 /// <summary>
 /// Clears the content of the output window pane.
 /// </summary>
 public void Clear()
 {
     if (IsVirtual)
     {
         return;
     }
     _pane.Clear();
 }
Beispiel #18
0
        public OutputWindowWriter(DTE dte, IVsOutputWindowPane outputWindow)
            : base(CultureInfo.CurrentCulture)
        {
            _outputWindow = outputWindow;
            _dte          = dte;

            _outputWindow.Clear();
        }
Beispiel #19
0
        public OutputWindowWriter(DTE dte, IVsOutputWindowPane outputWindow)
            : base(CultureInfo.CurrentCulture)
        {
            _outputWindow = outputWindow ?? throw new ArgumentNullException(nameof(outputWindow));
            _dte          = dte;

            _outputWindow.Clear();
        }
Beispiel #20
0
 public static void ClearDeploymentMessages()
 {
     ThreadHelper.JoinableTaskFactory.RunAsync(async() =>
     {
         await ThreadHelper.JoinableTaskFactory.SwitchToMainThreadAsync();
         _nanoFrameworkMessagesPane.Clear();
     });
 }
Beispiel #21
0
        /// <summary>
        /// Clears all of the content from the GCP window pane.
        /// </summary>
        public async Task ClearAsync()
        {
            IVsOutputWindowPane outputWindowPane = await _outputWindowPane.GetValueAsync();

            await JoinableTaskFactory.SwitchToMainThreadAsync();

            outputWindowPane.Clear();
        }
Beispiel #22
0
    /// <summary>
    /// Removes all text from the Output Window pane.
    /// </summary>
    public static void Clear()
    {
        ThreadHelper.ThrowIfNotOnUIThread();

        if (pane != null)
        {
            pane.Clear();
        }
    }
Beispiel #23
0
 public static void ClearOutputWindow()
 {
     // Don't access _outputWindowPane through the property here so that we don't force creation
     ThreadHelper.JoinableTaskFactory.RunAsync(async() =>
     {
         await ThreadHelper.JoinableTaskFactory.SwitchToMainThreadAsync();
         OutputWindowPaneValue?.Clear();
     });
 }
Beispiel #24
0
        public void Clear()
        {
            ThreadHelper.JoinableTaskFactory.RunAsync(async() =>
            {
                await ThreadHelper.JoinableTaskFactory.SwitchToMainThreadAsync();

                _pane.Clear();
            });
        }
Beispiel #25
0
        public void Clear()
        {
            Start();

            var f = _outputWindow as IVsWindowFrame;

            _outputWindowPane.Activate();
            _outputWindowPane.Clear();
        }
Beispiel #26
0
        public void ClearRefactorPane()
        {
            IVsOutputWindowPane pane = GetPane();

            if (pane != null)
            {
                pane.Clear();
            }
        }
Beispiel #27
0
        /// <summary>
        /// Initializes a new instance of the <see cref="IDEHelper"/> class.
        /// </summary>
        /// <param name="package">The package.</param>
        internal IDEHelper(ModelingPackage package)
        {
            this.package = package;

            Dte       = (DTE)ModelingPackage.GetGlobalService(typeof(DTE));
            errorList = new ErrorListProvider(package);

            // Fenetre de sortie
            IVsOutputWindow outputWindowService = GetService <IVsOutputWindow>(typeof(SVsOutputWindow));

            if (outputWindowService != null)
            {
                Guid guid = Guid.NewGuid();
                outputWindowService.CreatePane(ref guid, "Candle", 1, 1);
                outputWindowService.GetPane(ref guid, out outputPane);
                outputPane.Clear();
            }
        }
Beispiel #28
0
        /// <summary>
        /// Clear pane content
        /// </summary>
        public void Clear()
        {
            if (pane == null)
            {
                return;
            }
            int hr = pane.Clear();

            Marshal.ThrowExceptionForHR(hr);
        }
Beispiel #29
0
        private static void PrepareOutputWindow()
        {
            OutputWindowPane.Clear();
            OutputWindowPane.Activate();

            // Force output window to front
            var dte = Package.GetGlobalService(typeof(SDTE)) as DTE;

            dte.ExecuteCommand("View.Output");
        }
Beispiel #30
0
        public int Clear()
        {
            var result = target.Clear();

            if (ErrorHandler.Failed(result))
            {
                throw new Win32Exception(result);
            }

            return(result);
        }
Beispiel #31
0
        protected bool DoBuild(KuinProjectNodeProperties kuinProperties, bool isReleaseMode)
        {
            IVsOutputWindowPane outPane = GetOutputWindowPane();
            string commandLineArgs      = kuinProperties?.CreateCommandLineArg(isReleaseMode);

            if (!Utilities.SaveDirtyFiles() ||
                kuinProperties == null ||
                outPane == null ||
                string.IsNullOrEmpty(commandLineArgs))
            {
                return(false);
            }

            if (!File.Exists(KuinclPath))
            {
                MessageBox.Show(
                    "Kuin compiler (kuincl.exe) path was not found: please set in 'Tool > Options > KuinStudio > Compiler Path'",
                    "Kuin Studio",
                    MessageBoxButton.OK,
                    MessageBoxImage.Exclamation);
                return(false);
            }

            //ビルド
            using (var compileProcess = new Process()
            {
                StartInfo = new ProcessStartInfo()
                {
                    UseShellExecute = false,
                    CreateNoWindow = true,
                    RedirectStandardOutput = true,
                    StandardOutputEncoding = Encoding.Unicode,
                    WorkingDirectory = kuinProperties.ActualWorkingDirectory,
                    FileName = KuinclPath,
                    Arguments = commandLineArgs,
                }
            })
            {
                compileProcess.Start();
                compileProcess.WaitForExit();
                string res = string.Join("\n",
                                         "Start " + (isReleaseMode ? "Release" : "Debug") + " Build",
                                         "Command: " + KuinclPath + " " + commandLineArgs,
                                         compileProcess.StandardOutput.ReadToEnd());
                outPane.Clear();
                outPane.OutputString(res);
                outPane.Activate();

                //kunncl output specification
                //0: success
                //non-0 (1): failure
                return(compileProcess.ExitCode == 0);
            }
        }