public Commands(IVsExtensionRepository repo, IVsExtensionManager manager, OleMenuCommandService mcs, IVsOutputWindowPane outputPane)
 {
     _repository = repo;
     _manager = manager;
     _mcs = mcs;
     _outputPane = outputPane;
 }
        public OutputWindowWriter(DTE dte, IVsOutputWindowPane outputWindow)
        {
            _outputWindow = outputWindow;
            _dte = dte;

            _outputWindow.Clear();
        }
Beispiel #3
0
 /// <summary>
 /// Prints messages to the package manager output window
 /// </summary>
 /// <param name="message">Message to print</param>
 /// <param name="pane">Pane object</param>
 public static void PrintOutput(string message, IVsOutputWindowPane pane)
 {
     if(pane != null)
     {
         ErrorHandler.ThrowOnFailure(pane.OutputString(message + "\n"));
     }
 }
 public int GetPane(ref Guid rguidPane, out IVsOutputWindowPane ppPane)
 {
     GetPaneCalled = true;
     GetPaneArgumentGuidPane = rguidPane;
     ppPane = GetPaneReturnValue;
     return VSConstants.S_OK;
 }
Beispiel #5
0
 public MSBuildRunner(IServiceProvider host, string msbuild, string projectName, string buildFullFileName, IVsOutputWindowPane buildWnd)
 {
     Host = host;
     BuildFullFileName = buildFullFileName;
     MSBUILD = msbuild;
     ProjectName = projectName;
     BuildWindow = buildWnd; // host.GetOutputPane(VSConstants.BuildOutput, "Build");
 }
Beispiel #6
0
 /// <summary>
 /// Make sure the output pane is loaded.
 /// </summary>
 public void Load()
 {
     if (outputPane == null)
     {
         outputPane = VSUtilities.ServiceProvider().GetOutputPane(new Guid(GuidList.Strings.guidDot42OutputPane), "dot42", true, false);
         outputPane.Activate();
     }
 }
Beispiel #7
0
 public Compiler(EnvDTE.Project proj, string file, IVsOutputWindowPane pane)
 {
     taskTimer = new TaskTimer("Compile " + file);
     project = proj;
     clTool = new VCCompilerHelper(project);
     filename = file;
     buildPane = pane;
 }
 /// <summary>
 /// Creates a new node provider
 /// </summary>
 /// <param name="parser"></param>
 /// <param name="buffer">buffer to watch</param>
 public NodeProvider(IVsOutputWindowPane djangoDiagnostics, IParser parser, ITextBuffer buffer)
 {
     this.djangoDiagnostics = djangoDiagnostics;
     this.parser = parser;
     this.buffer = buffer;
     filePath = ((ITextDocument)buffer.Properties[typeof(ITextDocument)]).FilePath;
     rebuildNodes(buffer.CurrentSnapshot);
     buffer.Changed += new EventHandler<TextContentChangedEventArgs>(buffer_Changed);
 }
        public override MSBuildResult Build(uint vsopts, string config, IVsOutputWindowPane output, string target)
        {
            if (output != null)
            {
                output.OutputString("Build for node.js project is not required.\n");
            }

            return MSBuildResult.Successful;
        }
Beispiel #10
0
        private static bool EnsurePane()
        {
            if (_pane == null)
                lock (SyncRoot)
                    if (_pane == null)
                        _pane = HlslToolsPackage.Instance.GetOutputPane(HlslToolsOutputWindowGuid, "HLSL Tools");

            return _pane != null;
        }
 public int GetPane(ref Guid rguidPane, out IVsOutputWindowPane ppPane) {
     MockOutputWindowPane pane;
     if (_panes.TryGetValue(rguidPane, out pane)) {
         ppPane = pane;
         return VSConstants.S_OK;
     }
     ppPane = null;
     return VSConstants.E_FAIL;
 }
 private void btnProgram_Click(object sender, EventArgs e)
 {
     var info = GetProcessInfo();
     AVRDudeProcessWrapper programmer = new AVRDudeProcessWrapper(info);
     outputPane = CreateOrGetOutputWindowPane();
     outputPane.Activate();
     programmer.MessageReceived += Programmer_MessageReceived;
     programmer.Program(txtProgramPath.Text);
 }
Beispiel #13
0
 public static void Instantiate(IVsOutputWindowPane outputLog, IVsStatusbar statusBar)
 {
     lock (_locker)
     {
         if (_instance != null)
             throw new InvalidOperationException(string.Format("{0} of Resurrect is already instantiated.", _instance.GetType().Name));
         _instance = new Log(outputLog, statusBar);
     }
 }
 public void OutputString(string message)
 {
     string title = Resource.ToolWindowTitle;
     if (_outputPane == null)
     {
     _outputPane = (IVsOutputWindowPane)Package.GetGlobalService(typeof(SVsGeneralOutputWindowPane));
     }
     _outputPane.SetName(title);
     _outputPane.OutputStringThreadSafe(message + "\n");
 }
        public void UpdatePackage(string projPath, IVsOutputWindowPane pane, string platform)
        {
            Dictionary<string, string> patchMap = new Dictionary<string, string>();

            patchMap.Add(string.Format(CultureInfo.CurrentCulture, "\\uwp\\{0}\\serialport.node", platform),
                "\\node_modules\\serialport\\build\\serialport.node");

            NpmPatcher npmPatcher = new NpmPatcher();
            npmPatcher.UpdatePackage(new Uri(PatchUri), projPath, pane, Name, patchMap);
        }
Beispiel #16
0
        public MSBuildRunner(IServiceProvider host, string msbuild, string projectName, string buildFullFileName, IVsOutputWindowPane buildWnd)
        {
            Host = host;
            BuildFullFileName = buildFullFileName;
            MSBUILD = msbuild;
            ProjectName = projectName;
            BuildWindow = buildWnd;

            _pipename = string.Format(@"_sharponly_{0}", buildFullFileName.GetHashCode().ToString());
        }
		public int GetPane(ref Guid rguidPane, out IVsOutputWindowPane ppPane)
		{
			// First make sure the pane was created (we may need to add standard ones in the constructor)
			if (!paneList.ContainsKey(rguidPane))
				throw new ArgumentException("Could not find the requested pane, make sure you call CreatePane first");

			// Create a pane with the correct name
			ppPane = new OutputWindowPane(paneList[rguidPane]);
			return VSConstants.S_OK;
		}
        int IVsOutputWindow.GetPane(ref Guid rguidPane, out IVsOutputWindowPane ppPane)
        {
            if (this.panes.ContainsKey(rguidPane))
            {
                ppPane = this.panes[rguidPane];
                return VSConstants.S_OK;
            }

            ppPane = null;
            return VSConstants.E_FAIL;
        }
Beispiel #19
0
 public BuildProfiler(EnvDTE.Project proj, int stackMaxSize, IVsOutputWindowPane bpane, IVsOutputWindowPane ppane, Action onFinished, string singleFile = null)
 {
     if (singleFile != null)
         onlyFile = singleFile;
     project = proj;
     clTool = new VCCompilerHelper(project);
     profilePane = ppane;
     buildPane = bpane;
     profiler = new ActiveObject(stackMaxSize);
     signalFinished = onFinished;
     Initialize();
     profiler.Signal();
 }
Beispiel #20
0
        /// <summary>
        /// Creates a new node provider
        /// </summary>
        /// <param name="parser"></param>
        /// <param name="buffer">buffer to watch</param>
        public NodeProvider(IVsOutputWindowPane djangoDiagnostics, IParser parser, ITextBuffer buffer)
        {
            this.djangoDiagnostics = djangoDiagnostics;
            this.parser = parser;
            this.buffer = buffer;
            filePath = ((ITextDocument)buffer.Properties[typeof(ITextDocument)]).FilePath;

            buffer.Changed += new EventHandler<TextContentChangedEventArgs>(buffer_Changed);
            // we need to run rebuildNodes on a separate thread. Using timer
            // for this seems to be an overkill, but we need the timer anyway so - why not
            parserTimer =
                new Timer(rebuildNodes, buffer.CurrentSnapshot, 0, Timeout.Infinite);
        }
Beispiel #21
0
        /// <summary>
        /// Constructor.  Inititialize member data.
        /// </summary>
        public IDEBuildLogger(IVsOutputWindowPane output, TaskProvider taskProvider, IVsHierarchy hierarchy)
        {
            if (taskProvider == null)
                throw new ArgumentNullException("taskProvider");
            if (hierarchy == null)
                throw new ArgumentNullException("hierarchy");

            this.taskProvider = taskProvider;
            this.outputWindowPane = output;
            this.hierarchy = hierarchy;
            IOleServiceProvider site;
            Microsoft.VisualStudio.ErrorHandler.ThrowOnFailure(hierarchy.GetSite(out site));
            this.serviceProvider = new ServiceProvider(site);
        }
Beispiel #22
0
        private static bool EnsurePane()
        {
            if (pane == null)
            {
                lock (_syncRoot)
                {
                    if (pane == null)
                    {
                        pane = EditorExtensionsPackage.Instance.GetOutputPane(new Guid("f1536ef8-92ec-443c-9ed7-fdadf150da44"), "Web Essentials");
                    }
                }
            }

            return pane != null;
        }
Beispiel #23
0
        static Output()
        {
            const string customTitle = "EventStore";
            var outWindow = (IVsOutputWindow) Package.GetGlobalService(typeof (SVsOutputWindow));

            // Use e.g. Tools -> Create GUID to make a stable, but unique GUID for your pane.
            // Also, in a real project, this should probably be a static constant, and not a local variable
            var customGuid = new Guid(EventStoreOutputWindowGuid);
            outWindow.CreatePane(ref customGuid, customTitle, 1, 1);

            IVsOutputWindowPane customPane;
            outWindow.GetPane(ref customGuid, out customPane);

            Pane = customPane;
        }
Beispiel #24
0
        private static bool EnsurePane()
        {
            if (pane == null)
            {
                lock (_syncRoot)
                {
                    if (pane == null)
                    {
                        pane = EditorExtensionsPackage.Instance.GetOutputPane(VSConstants.OutputWindowPaneGuid.BuildOutputPane_guid, "Web Essentials");
                    }
                }
            }

            return pane != null;
        }
Beispiel #25
0
        private static bool EnsurePane()
        {
            if (pane == null)
            {
                lock (_syncRoot)
                {
                    if (pane == null)
                    {
                        pane = ImageOptimizerPackage.Instance.GetOutputPane(VSConstants.OutputWindowPaneGuid.BuildOutputPane_guid, "Image Optimizer");
                    }
                }
            }

            return pane != null;
        }
        private static bool EnsurePane()
        {
            if (pane == null)
            {
                lock (_syncRoot)
                {
                    if (pane == null)
                    {
                        pane = Globals.Package.GetOutputPane(Guids.OutputWindowPane, "Publishing");
                    }
                }
            }

            return pane != null;
        }
        public void UpdatePackage(string projPath, IVsOutputWindowPane pane)
        {
            Dictionary<string, string> patchMap = new Dictionary<string, string>();

            patchMap.Add("\\uwp\\serialport.js", "\\node_modules\\serialport\\serialport.js");
            foreach (Platform platform in Enum.GetValues(typeof(Platform)))
            {
                string platformStr = platform.ToString();
                patchMap.Add(string.Format(CultureInfo.CurrentCulture, "\\uwp\\{0}\\serialport.node", platformStr), string.Format(CultureInfo.CurrentCulture,
                    "\\node_modules\\serialport\\build\\Release\\node-{0}-win32-{1}\\serialport.node", NODE_MODULE_VERSION, (platform == Platform.x86) ? "ia32" : platformStr));      
            }

            NpmPatcher npmPatcher = new NpmPatcher();
            npmPatcher.UpdatePackage(new Uri(PatchUri), projPath, pane, Name, patchMap);
        }
Beispiel #28
0
        private static bool EnsurePane()
        {
            if (pane == null)
            {
                lock (_syncRoot)
                {
                    if (pane == null)
                    {
                        pane = TsWspPackage.Instance.GetOutputPane(VSConstants.OutputWindowPaneGuid.BuildOutputPane_guid, TsWspConstants.PANE_CAPTION);
                    }
                }
            }

            return pane != null;
        }
Beispiel #29
0
        public static IProgressEvents StartAsync(IServiceProvider sp, IProgressControlHost host, Func <IProgressController, ProgressStepDefinition[]> stepFactory)
        {
            if (sp == null)
            {
                throw new ArgumentNullException(nameof(sp));
            }

            if (host == null)
            {
                throw new ArgumentNullException(nameof(host));
            }

            if (stepFactory == null)
            {
                throw new ArgumentNullException(nameof(stepFactory));
            }

            Debug.Assert(ThreadHelper.CheckAccess(), "Expected to be called on the UI thread");

            // Initialize a controller and an observer
            var controller = new SequentialProgressController(sp);

            controller.Initialize(stepFactory(controller));

            IVsOutputWindowPane sonarLintPane = VsShellUtils.GetOrCreateSonarLintOutputPane(sp);

            bool logFullMessage;

#if DEBUG
            logFullMessage = true;
#else
            logFullMessage = false;
#endif
            var notifier = new VsOutputWindowPaneNotifier(sp,
                                                          sonarLintPane,
                                                          ensureOutputVisible: true,
                                                          messageFormat: Strings.UnexpectedWorkflowError,
                                                          logFullException: logFullMessage);
            controller.ErrorNotificationManager.AddNotifier(notifier);

            Observe(controller, host);
            controller.RunOnFinished(r => observedControllersMap.Remove(controller));
#pragma warning disable 4014 // We do want to start and forget. All the errors will be forwarded via the error notification manager
            controller.StartAsync();
#pragma warning restore 4014

            return(controller);
        }
Beispiel #30
0
 /// <summary>
 /// Make sure the output pane is loaded.
 /// </summary>
 public void Load()
 {
     if (outputPane == null)
     {
         Guid guid = _guid;
         if (_guid == default(Guid))
         {
             outputPane = VSUtilities.ServiceProvider().GetOutputPane(new Guid(GuidList.Strings.guidDot42OutputPane), _title, true, false);
             outputPane.Activate();
         }
         else
         {
             outputPane = VSUtilities.ServiceProvider().GetOutputPane(_guid, _title, true, false);
         }
     }
 }
 public void Write(string msg)
 {
     Debug.Write(msg);
     if (m_Package == null)
     {
         return;
     }
     PackageGlobals.InvokeOnUIThread(delegate()
     {
         IVsOutputWindowPane output_pane = m_Package.GetOutputPane(GuidList.guidVSWindowTitleChangerCmdSet, "VSWindowTitleChanger");
         if (output_pane != null)
         {
             output_pane.OutputString(msg);
         }
     });
 }
        /// <summary>
        ///     Write a line of text to the output pane.
        /// </summary>
        /// <param name="outputPane">
        ///     The output window pane.
        /// </param>
        /// <param name="messageOrFormat">
        ///     The message or message-format specifier to write.
        /// </param>
        /// <param name="formatArguments">
        ///     Optional message-format arguments.
        /// </param>
        public static void WriteLine(this IVsOutputWindowPane outputPane, string messageOrFormat, params object[] formatArguments)
        {
            if (outputPane == null)
            {
                throw new ArgumentNullException(nameof(outputPane));
            }

            if (String.IsNullOrWhiteSpace(messageOrFormat))
            {
                throw new ArgumentException($"Argument cannot be null, empty, or entirely composed of whitespace: {nameof(messageOrFormat)}.", nameof(messageOrFormat));
            }

            outputPane.WriteLine(
                String.Format(messageOrFormat, formatArguments)
                );
        }
Beispiel #33
0
 public static void DeletePane()
 {
     if (_pane != null)
     {
         try
         {
             IVsOutputWindow output = (IVsOutputWindow)_provider.GetService(typeof(SVsOutputWindow));
             output.DeletePane(ref _guid);
             _pane = null;
         }
         catch (Exception ex)
         {
             System.Diagnostics.Debug.Write(ex);
         }
     }
 }
Beispiel #34
0
        /// <summary>
        /// Constructor.  Inititialize member data.
        /// </summary>
        public IDEBuildLogger(IVsOutputWindowPane output, TaskProvider taskProvider, IVsHierarchy hierarchy)
        {
            Utilities.ArgumentNotNull(nameof(taskProvider), taskProvider);
            Utilities.ArgumentNotNull(nameof(hierarchy), hierarchy);

            Trace.WriteLineIf(Thread.CurrentThread.GetApartmentState() != ApartmentState.STA, "WARNING: IDEBuildLogger constructor running on the wrong thread.");

            Microsoft.VisualStudio.ErrorHandler.ThrowOnFailure(hierarchy.GetSite(out var site));

            this.taskProvider     = taskProvider;
            this.outputWindowPane = output;
            this.hierarchy        = hierarchy;
            this.serviceProvider  = new ServiceProvider(site);
            this.serviceProvider.GetUIThread().MustBeCalledFromUIThread();
            this.dispatcher = Dispatcher.CurrentDispatcher;
        }
        public void InitializeOnMainThread(IServiceProvider serviceProvider)
        {
            var dte = (DTE)serviceProvider.GetService(typeof(DTE));

            window = dte.Windows.Item(EnvDTE.Constants.vsWindowKindOutput);

            var outputWindow = (IVsOutputWindow)serviceProvider.GetService(typeof(SVsOutputWindow));

            pane = CreatePane(outputWindow, OutputPaneGuid, "Dogfood", true, false);

            progress = new Progress <string>(line =>
            {
                ThreadHelper.ThrowIfNotOnUIThread();
                pane.OutputString(line + Environment.NewLine);
            });
        }
Beispiel #36
0
        private NonReferencedProjectsCommand(Package package)
        {
            outputPane   = OutputWindow.Pane;
            this.package = package ?? throw new ArgumentNullException(nameof(package));
            var commandService = ServiceProvider.GetService(typeof(IMenuCommandService)) as OleMenuCommandService;

            if (commandService == null)
            {
                return;
            }

            var menuCommandID = new CommandID(CommandSet, CommandId);
            var menuItem      = new MenuCommand(MenuItemCallback, menuCommandID);

            commandService.AddCommand(menuItem);
        }
Beispiel #37
0
 /// <summary>
 /// Deletes the Output Window pane.
 /// </summary>
 public static void DeletePane()
 {
     if (pane != null)
     {
         try
         {
             var output = (IVsOutputWindow)_provider.GetService(typeof(SVsOutputWindow));
             output?.DeletePane(ref _guid);
             pane = null;
         }
         catch (Exception ex)
         {
             Debug.Write(ex);
         }
     }
 }
Beispiel #38
0
        public void UpdatePackage(string projPath, IVsOutputWindowPane pane)
        {
            Dictionary <string, string> patchMap = new Dictionary <string, string>();

            patchMap.Add("\\uwp\\serialport.js", "\\node_modules\\serialport\\serialport.js");
            foreach (Platform platform in Enum.GetValues(typeof(Platform)))
            {
                string platformStr = platform.ToString();
                patchMap.Add(string.Format(CultureInfo.CurrentCulture, "\\uwp\\{0}\\serialport.node", platformStr), string.Format(CultureInfo.CurrentCulture,
                                                                                                                                  "\\node_modules\\serialport\\build\\Release\\node-{0}-win32-{1}\\serialport.node", NODE_MODULE_VERSION, (platform == Platform.x86) ? "ia32" : platformStr));
            }

            NpmPatcher npmPatcher = new NpmPatcher();

            npmPatcher.UpdatePackage(new Uri(PatchUri), projPath, pane, Name, patchMap);
        }
        private void NotifyEndDeploy(int success)
        {
            try {
                foreach (IVsDeployStatusCallback callback in GetSinkCollection())
                {
                    callback.OnEndDeploy(success);
                }
            } finally {
                lock (syncObject) {
                    this.appContainerBootstrapperOperation = null;
                    this.deployOp = null;
                }
            }

            outputWindow = null;
        }
Beispiel #40
0
        /// <summary>
        /// Constructor.  Inititialize member data.
        /// </summary>
        public IDEBuildLogger(IVsOutputWindowPane output, TaskProvider taskProvider, IVsHierarchy hierarchy)
        {
            Utilities.ArgumentNotNull("taskProvider", taskProvider);
            Utilities.ArgumentNotNull("hierarchy", hierarchy);

            Trace.WriteLineIf(Thread.CurrentThread.GetApartmentState() != ApartmentState.STA, "WARNING: IDEBuildLogger constructor running on the wrong thread.");

            IOleServiceProvider site;

            Microsoft.VisualStudio.ErrorHandler.ThrowOnFailure(hierarchy.GetSite(out site));

            this.taskProvider     = taskProvider;
            this.outputWindowPane = output;
            this.hierarchy        = hierarchy;
            this.serviceProvider  = new ServiceProvider(site);
        }
Beispiel #41
0
 /// <summary>
 /// Make sure the output pane is loaded.
 /// </summary>
 public void Load()
 {
     if (outputPane == null)
     {
         Guid guid = _guid;
         if (_guid == default(Guid))
         {
             outputPane = VSUtilities.ServiceProvider().GetOutputPane(new Guid(GuidList.Strings.guidDot42OutputPane), _title, true, false);
             outputPane.Activate();
         }
         else
         {
             outputPane = VSUtilities.ServiceProvider().GetOutputPane(_guid, _title, true, false);
         }
     }
 }
Beispiel #42
0
        internal static IVsOutputWindowPane GetOrCreateOutputPane(string /*!*/ name, Guid guid, bool clearWithSolution = false)
        {
            IVsOutputWindowPane outputPane = null;
            IVsOutputWindow     output     = (IVsOutputWindow)Package.GetGlobalService(typeof(SVsOutputWindow));

            if (ErrorHandler.Failed(output.GetPane(ref guid, out outputPane)))
            {
                if (!ErrorHandler.Failed(output.CreatePane(ref guid, name, Convert.ToInt32(true), Convert.ToInt32(clearWithSolution))))
                {
                    output.GetPane(ref guid, out outputPane);
                }
            }

            Debug.Assert(outputPane != null);
            return(outputPane);
        }
Beispiel #43
0
        private void RealWriteToOutputPane(string data)
        {
            ThreadHelper.ThrowIfNotOnUIThread();

            if (this.windowPane == null)
            {
                this.windowPane = this.package.GetOutputPane(VSConstants.OutputWindowPaneGuid.GeneralPane_guid, ProjectApiWindowPaneCaption);
            }

            int?hr = this.windowPane?.Activate();

            if (hr.HasValue && ErrorHandler.Succeeded(hr.Value))
            {
                this.windowPane?.OutputStringThreadSafe(data + System.Environment.NewLine);
            }
        }
Beispiel #44
0
        private static void OutputString(Package package, DTE dte, string message)
        {
            IVsOutputWindowPane output = package.GetOutputPane(Guids.MeneesVsToolsOutputPane, MainPackage.Title);

            if (output != null)
            {
                // ErrorHandler.ThrowOnFailure(output.Clear());
                ErrorHandler.ThrowOnFailure(output.Activate());

                // Make sure the output window is open/visible.
                Window outputWindow = dte.Windows.Item(EnvDTE.Constants.vsWindowKindOutput);
                outputWindow.Visible = true;
                outputWindow.Activate();

                ErrorHandler.ThrowOnFailure(output.OutputString(message));
            }
        }
Beispiel #45
0
        public void OutputString(string text)
        {
            IVsOutputWindowPane outputWindowPane = GetOutputWindowPane(guidPane);

            if (outputWindowPane != null)
            {
                try
                {
                    outputWindowPane.Activate();
                    outputWindowPane.OutputString(Environment.NewLine + text);
                }
                catch (Exception ex)
                {
                    ShowMessageBox("OutputString()", ex.Message);
                }
            }
        }
        /// <summary>
        ///     Prints text to the output window avoiding pushing a message pump, if possible.
        /// </summary>
        /// <exception cref="ArgumentNullException">
        ///     <paramref name="pane"/> is <see langword="null"/>.
        /// </exception>
        public static void OutputStringNoPump(this IVsOutputWindowPane pane, string pszOutputString)
        {
            Requires.NotNull(pane, nameof(pane));

            if (pane is IVsOutputWindowPaneNoPump noPumpPane)
            {
                noPumpPane.OutputStringNoPump(pszOutputString);
            }
            else
            {
                HResult hr = pane.OutputStringThreadSafe(pszOutputString);
                if (hr.Failed)
                {
                    throw hr.Exception;
                }
            }
        }
Beispiel #47
0
        /// <summary>
        /// Main (and only) method called by patcher classes.
        /// </summary>
        /// <param name="uri">Uri of zip file with patch</param>
        /// <param name="destPath">Patch download destination</param>
        /// <param name="pane">Visual Studio output pane to display messages</param>
        /// <param name="packageName">Name of the npm package</param>
        /// <param name="patchMap">Maps the files in in patch to their destinations</param>
        internal void UpdatePackage(Uri uri, string destPath, IVsOutputWindowPane pane, string packageName, Dictionary <string, string> patchMap)
        {
            ProjectPath = string.Format(CultureInfo.CurrentCulture, "{0}\\", destPath);

            // Check if package is already installed
            if (!Directory.Exists(string.Format(CultureInfo.CurrentCulture, "{0}node_modules\\{1}", ProjectPath, packageName)))
            {
                return;
            }

            NpmOutputPane = pane;
            PackageName   = packageName;
            PatchMap      = patchMap;
            PatchUri      = uri;

            DownloadPatch();
        }
Beispiel #48
0
        public TypescriptWatcher(VSPackage package, IVsOutputWindowPane pane)
        {
            if (package == null)
            {
                throw new ArgumentNullException(nameof(package));
            }
            _vsOutWindow = pane ?? throw new ArgumentNullException(nameof(pane));

            _runningDocumentTable = new RunningDocumentTable(package);
            _runningDocumentTable.Advise(this);

            _errorList = new ErrorListProvider(package)
            {
                ProviderName = $"{Symbol.Name} Error List",
                ProviderGuid = new Guid("e18abe6a-7968-4bd6-9266-0684b1d50e7a")
            };
        }
Beispiel #49
0
        public WindowStatus(IVsOutputWindowPane outputWindowPane, IVsWindowFrame frame)
        {
            outputPane = outputWindowPane;
            this.frame = frame;

            if (frame != null)
            {
                VSSETFRAMEPOS[] pos = new VSSETFRAMEPOS[1];
                int             x;
                int             y;
                int             width;
                int             height;
                Guid            unused;
                frame.GetFramePos(pos, out unused, out x, out y, out width, out height);
                this.dockable = (pos[0] & VSSETFRAMEPOS.SFP_fFloat) != VSSETFRAMEPOS.SFP_fFloat;
            }
        }
Beispiel #50
0
        public SassWatcher(VSPackage package, IVsOutputWindowPane pane)
        {
            if (package == null)
            {
                throw new ArgumentNullException(nameof(package));
            }
            _vsOutWindow = pane ?? throw new ArgumentNullException(nameof(pane));

            _runningDocumentTable = new RunningDocumentTable(package);
            _runningDocumentTable.Advise(this);

            _errorList = new ErrorListProvider(package)
            {
                ProviderName = $"{Metadata.ProductName} Error List",
                ProviderGuid = new Guid("6e63fa03-9f4e-47da-9cf9-5efd22799c28")
            };
        }
Beispiel #51
0
 private void OutputData(string data, bool isStdErr)
 {
     try
     {
         OnTargetOutput(isStdErr, data + Environment.NewLine);
         _ = Task.Run(async() =>
         {
             await GodotPackage.Instance.JoinableTaskFactory.SwitchToMainThreadAsync();
             IVsOutputWindowPane outputPane = GodotPackage.Instance.GetOutputPane(VSConstants.OutputWindowPaneGuid.DebugPane_guid, "Output");
             outputPane.OutputStringThreadSafe(data + Environment.NewLine);
         });
     }
     catch (Exception e)
     {
         Console.Error.WriteLine(e);
     }
 }
        /// <summary>
        /// Initializes a new instance of the <see cref="GitCommands"/> class.
        /// Adds our command handlers for menu (commands must exist in the command table file)
        /// </summary>
        /// <param name="package">Owner package, not null.</param>
        /// <param name="commandService">Command service to add command to, not null.</param>
        private GitOriginDevelopment(AsyncPackage package,
                                     OleMenuCommandService commandService,
                                     IGitExt gitService,
                                     IVsOutputWindowPane vsOutputWindow,
                                     DTE dteVsCoreAutomation)
        {
            this.package         = package ?? throw new ArgumentNullException(nameof(package));
            commandService       = commandService ?? throw new ArgumentNullException(nameof(commandService));
            _gitService          = gitService ?? throw new ArgumentNullException(nameof(gitService));
            _vsOutputWindowPane  = vsOutputWindow ?? throw new ArgumentNullException(nameof(vsOutputWindow));
            _dteVsCoreAutomation = dteVsCoreAutomation ?? throw new ArgumentNullException(nameof(dteVsCoreAutomation));

            var menuCommandID = new CommandID(CommandSet, CommandId);
            var menuItem      = new MenuCommand(this.Execute, menuCommandID);

            commandService.AddCommand(menuItem);
        }
        public static void Write(string message)
        {
            ThreadHelper.ThrowIfNotOnUIThread();
            IVsOutputWindow     outWindow       = Package.GetGlobalService(typeof(SVsOutputWindow)) as IVsOutputWindow;
            Guid                generalPaneGuid = VSConstants.GUID_OutWindowDebugPane; // P.S. There's also the GUID_OutWindowDebugPane available.
            IVsOutputWindowPane generalPane     = null;

            outWindow?.GetPane(ref generalPaneGuid, out generalPane);
            generalPane?.OutputString(Environment.NewLine);
            generalPane?.OutputString(message);
            generalPane?.OutputString(Environment.NewLine);
            if (_isFirstTime)
            {
                _isFirstTime = false;
                generalPane?.Activate();
            }
        }
Beispiel #54
0
        private static bool EnsurePane()
        {
            if (pane == null)
            {
                lock (_syncRoot)
                {
                    if (pane == null)
                    {
                        pane = NuspecPackagerPackage.Instance.GetOutputPane(VSConstants.OutputWindowPaneGuid.GeneralPane_guid, "NuspecPackager");
                    }
                }
            }

            pane.Activate();

            return(pane != null);
        }
Beispiel #55
0
        private static bool ExecutePortForwardCommmand(IVsOutputWindowPane outputPane)
        {
            ThreadHelper.ThrowIfNotOnUIThread();

            var adbCommandLine = "\"" + Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), "Android", "sdk", "platform-tools", "adb" + (IsWindows ? ".exe" : "")) + "\" "
                                 + "forward tcp:45820 tcp:45820";

            var process = new System.Diagnostics.Process();

            process.StartInfo.CreateNoWindow         = true;
            process.StartInfo.RedirectStandardOutput = true;
            process.StartInfo.RedirectStandardInput  = true;
            process.StartInfo.RedirectStandardError  = true;
            process.StartInfo.UseShellExecute        = false;
            if (IsWindows)
            {
                process.StartInfo.Arguments = adbCommandLine;
                process.StartInfo.FileName  = "powershell";
            }
            else
            {
                process.StartInfo.Arguments = string.Format("-c \"{0}\"", adbCommandLine);
                process.StartInfo.FileName  = "/bin/sh";
            }

            try
            {
                process.Start();

                var adb_output = process.StandardOutput.ReadToEnd();

                if (adb_output.Length > 0 && adb_output != "45820" + Environment.NewLine)
                {
                    throw new InvalidOperationException($"Unable to forward tcp port from emulator, is emulator running? (adb tool returned '{adb_output}')");
                }
            }
            catch (Exception ex)
            {
                outputPane.OutputString($"{process.StandardOutput.ReadToEnd()}{Environment.NewLine}");
                outputPane.OutputString($"{process.StandardError.ReadToEnd()}{Environment.NewLine}");
                outputPane.OutputString($"{ex}{Environment.NewLine}");
                return(false);
            }

            return(true);
        }
        public WindowStatus(IVsOutputWindowPane outputWindowPane, IVsWindowFrame frame)
        {
            outputPane = outputWindowPane;
            this.frame = frame;

            if (frame != null)
            {
                VSSETFRAMEPOS[] pos = new VSSETFRAMEPOS[1];
                int x;
                int y;
                int width;
                int height;
                Guid unused;
                frame.GetFramePos(pos, out unused, out x, out y, out width, out height);
                dockable = (pos[0] & VSSETFRAMEPOS.SFP_fFloat) != VSSETFRAMEPOS.SFP_fFloat;
            }
        }
        private TransformProjectFilesCommand(
            Package package, ErrorListProvider errorListProvider,
            IVsOutputWindowPane outputWindowPane, IVsStatusbar statusbar, IOptions options)
        {
            m_package           = package ?? throw new ArgumentNullException(nameof(package));
            m_errorListProvider = errorListProvider ?? throw new ArgumentNullException(nameof(errorListProvider));
            m_outputWindowPane  = outputWindowPane ?? throw new ArgumentNullException(nameof(outputWindowPane));
            m_statusbar         = statusbar ?? throw new ArgumentNullException(nameof(statusbar));
            m_options           = options ?? throw new ArgumentNullException(nameof(options));

            if (ServiceProvider.GetService(typeof(IMenuCommandService)) is OleMenuCommandService commandService)
            {
                var menuCommandID = new CommandID(CommandSet, CommandId);
                var menuItem      = new MenuCommand(async(s, e) => await InvokeRefactoring(s, e), menuCommandID);
                commandService.AddCommand(menuItem);
            }
        }
Beispiel #58
0
        private int Deploy()
        {
            try {
                foreach (IVsDeployStatusCallback callback in deployCallbackCollection)
                {
                    callback.OnEndDeploy(1);
                }
            } finally {
                lock (syncObject) {
                    appContainerBootstrapperOperation = null;
                    deployOp = null;
                }
            }

            this.outputWindow = null;

            return(VSConstants.S_OK);
        }
Beispiel #59
0
        public PackageHandler(EnvDTE.Project project, IVsPackageInstallerServices packageServices, IVsPackageInstaller installer,
                              IVsPackageUninstaller uninstaller, IVsPackageInstallerEvents events, IVsOutputWindowPane outputWindowPane)
        {
            m_project          = project ?? throw new ArgumentNullException(nameof(project));
            m_packageServices  = packageServices ?? throw new ArgumentNullException(nameof(packageServices));
            m_installer        = installer ?? throw new ArgumentNullException(nameof(installer));
            m_uninstaller      = uninstaller ?? throw new ArgumentNullException(nameof(uninstaller));
            m_events           = events;
            m_outputWindowPane = outputWindowPane;

            if (m_outputWindowPane != null && m_events != null)
            {
                m_events.PackageInstalling   += OnEventsOnPackageInstalling;
                m_events.PackageInstalled    += OnEventsOnPackageInstalled;
                m_events.PackageUninstalling += OnEventsOnPackageUninstalling;
                m_events.PackageUninstalled  += OnEventsOnPackageUninstalled;
            }
        }
        public GitStashPage([Import(typeof(SVsServiceProvider))] IServiceProvider serviceProvider)
        {
            Title        = "Git Stash";
            gitService   = (IGitExt)serviceProvider.GetService(typeof(IGitExt));
            teamExplorer = (ITeamExplorer)serviceProvider.GetService(typeof(ITeamExplorer));
            gitService.PropertyChanged += OnGitServicePropertyChanged;

            var outWindow  = Package.GetGlobalService(typeof(SVsOutputWindow)) as IVsOutputWindow;
            var customGuid = new Guid("B602D8ED-2A92-4EB6-AE2C-A04F19386BAF");

            outWindow.CreatePane(ref customGuid, "Git stash", 1, 1);
            outWindow.GetPane(ref customGuid, out outputWindow);

            hiddenOutput = new Service.HiddenGitOutput();

            ui          = new GitStashPageUI();
            PageContent = ui;
        }