コード例 #1
0
        public void VsTextViewCreated(IVsTextView textViewAdapter)
        {
            IWpfTextView view = AdaptersFactory.GetWpfTextView(textViewAdapter);

            view.TextBuffer.Properties.GetOrCreateSingletonProperty(() => view);
            _errorList = view.TextBuffer.Properties.GetOrCreateSingletonProperty(() => new ErrorListProvider(ServiceProvider));

            if (_errorList == null)
                return;

            if (ExtensibilityToolsPackage.Options.PkgdefShowIntellisense)
            {

                PkgdefCompletionController completion = new PkgdefCompletionController(view, CompletionBroker);
                IOleCommandTarget completionNext;
                textViewAdapter.AddCommandFilter(completion, out completionNext);
                completion.Next = completionNext;
            }

            PkgdefFormatter formatter = new PkgdefFormatter(view);
            IOleCommandTarget formatterNext;
            textViewAdapter.AddCommandFilter(formatter, out formatterNext);
            formatter.Next = formatterNext;

            view.Closed += OnViewClosed;
        }
        public SubSonicTemplatingService(SubSonicCoreVisualStudioAsyncPackage package)
        {
            Trace.WriteLine($"Constructing a new instance of {nameof(SubSonicTemplatingService)}.");

            VsShell.ThreadHelper.ThrowIfNotOnUIThread();

            this.package           = package ?? throw new ArgumentNullException(nameof(package));
            this.errorListProvider = new VsShell.ErrorListProvider(package)
            {
                MaintainInitialTaskOrder = true
            };
            this.subSonicOutput = new SubSonicOutputWriter(package);

            this.Engine             = new TemplatingEngine();
            this.transformationHost = new RemoteTransformationHost();

            this.transformationHost.GetHostOptionEventHandler            += TransformationHost_GetHostOptionEventHandler;
            this.transformationHost.ResolveAssemblyReferenceEventHandler += TransformationHost_ResolveAssemblyReferenceEventHandler;
            this.transformationHost.ExpandAllVariablesEventHandler       += TransformationHost_ExpandAllVariablesEventHandler;
            this.transformationHost.ResolveParameterValueEventHandler    += TransformationHost_ResolveParameterValueEventHandler;

            singleton = this;

            package.DTE.Events.SolutionEvents.AfterClosing += SolutionEvents_AfterClosing;
        }
コード例 #3
0
ファイル: ErrorList.cs プロジェクト: QuinntyneBrown/WebLinter
        private static ErrorTask CreateTask(LintingError error, ErrorListProvider provider)
        {
            ErrorTask task = new ErrorTask()
            {
                Line = error.LineNumber - 1,
                Column = error.ColumnNumber,
                ErrorCategory = error.IsWarning ? TaskErrorCategory.Warning : TaskErrorCategory.Error,
                Category = TaskCategory.Html,
                Document = error.FileName,
                Priority = TaskPriority.Normal,
                Text = $"({error.Provider}) {error.Message}",
            };

            EnvDTE.ProjectItem item = VSPackage.Dte.Solution.FindProjectItem(error.FileName);

            if (item != null && item.ContainingProject != null)
                AddHierarchyItem(task, item.ContainingProject);

            task.Navigate += (s, e) =>
            {
                provider.Navigate(task, new Guid(EnvDTE.Constants.vsViewKindPrimary));

                if (task.Column > 0)
                {
                    var doc = (EnvDTE.TextDocument)VSPackage.Dte.ActiveDocument.Object("textdocument");
                    doc.Selection.MoveToLineAndOffset(task.Line + 1, task.Column, false);
                }
            };

            return task;
        }
コード例 #4
0
        protected override void Initialize()
        {
            Debug.WriteLine ("Entering Initialize() of: {0}", this);
            base.Initialize();

            _dte = (DTE)GetService(typeof(DTE));
            _events = _dte.Events;
            _documentEvents = _events.DocumentEvents;
            _documentEvents.DocumentSaved += DocumentEvents_DocumentSaved;

            var window = _dte.Windows.Item(EnvDTE.Constants.vsWindowKindOutput);

            var outputWindow = (OutputWindow)window.Object;

            _outputPane = outputWindow.OutputWindowPanes
                                      .Cast<OutputWindowPane>()
                                      .FirstOrDefault(p => p.Name == "AutoRunCustomTool")
                          ?? outputWindow.OutputWindowPanes.Add("AutoRunCustomTool");
            _errorListProvider = new ErrorListProvider(this)
                                 {
                                      ProviderName = "AutoRunCustomTool",
                                      ProviderGuid = Guid.NewGuid()
                                 };
            RegisterExtenderProvider();
        }
 public ErrorListProvider(
     Microsoft.VisualStudio.Shell.ErrorListProvider errorList,
     IFileSystem fileSystem)
 {
     _fileSystem = fileSystem;
     _errorList  = errorList;
 }
コード例 #6
0
 private void CreateErrorListProvider()
 {
     IServiceProvider serviceProvider = new ServiceProvider((Microsoft.VisualStudio.OLE.Interop.IServiceProvider)mApplication);
       mErrorListProvider = new ErrorListProvider(serviceProvider);
       mErrorListProvider.ProviderName = "CppCheck Errors";
       mErrorListProvider.ProviderGuid = new Guid("5A10E43F-8D1D-4026-98C0-E6B502058901");
 }
    protected override void Initialize()
    {
        base.Initialize();

        var exceptionDialog = new ExceptionDialog("http://code.google.com/p/notifypropertyweaver/issues/list", "NotifyPropertyWeaver");
        try
        {
            using (var catalog = new AssemblyCatalog(GetType().Assembly))
            using (var container = new CompositionContainer(catalog))
            {
                var menuCommandService = (IMenuCommandService) GetService(typeof (IMenuCommandService));
                var errorListProvider = new ErrorListProvider(ServiceProvider.GlobalProvider);

                container.ComposeExportedValue(exceptionDialog);
                container.ComposeExportedValue(menuCommandService);
                container.ComposeExportedValue(errorListProvider);

                container.GetExportedValue<MenuConfigure>().RegisterMenus();
                container.GetExportedValue<SolutionEvents>().RegisterSolutionEvents();
                container.GetExportedValue<TaskFileReplacer>().CheckForFilesToUpdate();
            }
        }
        catch (Exception exception)
        {
            exceptionDialog.HandleException(exception);
        }
    }
コード例 #8
0
    protected override void Initialize()
    {
        base.Initialize();
        var exceptionDialog = new ExceptionDialog();
        try
        {
            var menuCommandService = (IMenuCommandService) GetService(typeof (IMenuCommandService));
            var errorListProvider = new ErrorListProvider(ServiceProvider.GlobalProvider);

            var currentProjectFinder = new CurrentProjectFinder();
            var contentsFinder = new ContentsFinder();
            var configureMenuCallback = new ConfigureMenuCallback(currentProjectFinder, contentsFinder, exceptionDialog);
            var messageDisplayer = new MessageDisplayer(errorListProvider);
            var disableMenuConfigure = new DisableMenuConfigure(currentProjectFinder, messageDisplayer, exceptionDialog);
            var containsFodyChecker = new ContainsFodyChecker();
            var menuStatusChecker = new MenuStatusChecker(currentProjectFinder, exceptionDialog, containsFodyChecker);
            new MenuConfigure(configureMenuCallback, disableMenuConfigure, menuCommandService, menuStatusChecker).RegisterMenus();
            var taskFileReplacer = new TaskFileReplacer(messageDisplayer, contentsFinder);
            var taskFileProcessor = new TaskFileProcessor(taskFileReplacer, messageDisplayer);
            var msBuildKiller = new MSBuildKiller();
            new SolutionEvents(taskFileProcessor, exceptionDialog, msBuildKiller).RegisterSolutionEvents();
            new TaskFileReplacer(messageDisplayer, contentsFinder).CheckForFilesToUpdate();
        }
        catch (Exception exception)
        {
            exceptionDialog.HandleException(exception);
        }
    }
コード例 #9
0
ファイル: StatusController.cs プロジェクト: BenHall/lonestar
 public ErrorListProvider GetErrorListProvider()
 {
     ErrorListProvider provider = new ErrorListProvider(this);
     provider.ProviderName = "Lonestar";
     provider.ProviderGuid = new Guid("1b956816-8bbd-4ef2-ae4b-fb94a2b9adfb");
     return provider;
 }
        /////////////////////////////////////////////////////////////////////////////
        // Overridden Package Implementation
        #region Package Members

        /// <summary>
        /// Initialization of the package; this method is called right after the package is sited, so this is the place
        /// where you can put all the initialization code that rely on services provided by VisualStudio.
        /// </summary>
        protected override void Initialize()
        {
            base.Initialize();

            //create the menu service
            OleMenuCommandService _menuService = this.GetService(typeof(IMenuCommandService)) as OleMenuCommandService;

            //get the menu item command based on the GUID/ID
            CommandID _cleanHiveCmd = new CommandID(Guid.Parse("{1467AD39-B4C7-47EC-8075-09AB259EB847}"), int.Parse("7A121",System.Globalization.NumberStyles.HexNumber));

            MenuCommand _clientHiveMenuItem = new MenuCommand(ExecuteCleanHiveAndDebug, _cleanHiveCmd);
            _menuService.AddCommand(_clientHiveMenuItem);

            CommandID _enableVSIPLoggingCmd = new CommandID(Guid.Parse("{1467AD39-B4C7-47EC-8075-09AB259EB847}"), int.Parse("7A122", System.Globalization.NumberStyles.HexNumber));
            MenuCommand _enableVSIPMenuItem = new MenuCommand(ExecuteEnableVSIPLogging,_enableVSIPLoggingCmd);
            _menuService.AddCommand(_enableVSIPMenuItem);

            CommandID _disbleVSIPLoggingCmd = new CommandID(Guid.Parse("{1467AD39-B4C7-47EC-8075-09AB259EB847}"), int.Parse("7A123", System.Globalization.NumberStyles.HexNumber));
            MenuCommand _disableVSIPMenuItem = new MenuCommand(ExecuteDisableVSIPLogging, _disbleVSIPLoggingCmd);
            _menuService.AddCommand(_disableVSIPMenuItem);

            //create the errorlist provider
            _errProvider = new ErrorListProvider(this);

           
        }
コード例 #11
0
 public ErrorList(DTE _dte)
 {
     dte = _dte;
       _errorListProvider = new ErrorListProvider(this);
       _errorListProvider.ProviderName = "SPSF Generator";
       _errorListProvider.ProviderGuid = new Guid("{051F078C-B363-4d08-B351-206E9E62BBEF}");
       _errorListProvider.Show();
 }
コード例 #12
0
 public ErrorListHelper(object dte2)
 {
     _serviceProvider = new ServiceProvider(dte2 as Microsoft.VisualStudio.OLE.Interop.IServiceProvider);
     _errorProvider = new ErrorListProvider(_serviceProvider);//this implementing IServiceProvider
     _errorProvider.ProviderName = "JS Lint";
     _errorProvider.ProviderGuid = new Guid(); // should be package guid
     _errorProvider.Show();
 }
コード例 #13
0
 static ErrorList()
 {
     ErrorListProvider = new ErrorListProvider(EditorExtensionsPackage.Instance)
     {
         ProviderName = "Unused CSS Browser Link Extension",
         ProviderGuid = new Guid("5BA8BB0D-D518-45ae-966C-864C536454F2")
     };
 }
コード例 #14
0
        internal SettingsManager(IWpfTextView view, ITextDocument document, ErrorListProvider messageList)
        {
            _view = view;
            _messageList = messageList;
            _message = null;

            LoadSettings(document.FilePath);
        }
コード例 #15
0
        private ErrorPresenter()
        {
            previousErrors = new List <ErrorTask>();
            var             DTEObj = Microsoft.VisualStudio.Shell.ServiceProvider.GlobalProvider.GetService(typeof(EnvDTE.DTE)) as EnvDTE.DTE;
            ServiceProvider sp     = new ServiceProvider((Microsoft.VisualStudio.OLE.Interop.IServiceProvider)DTEObj);

            errorList = new Microsoft.VisualStudio.Shell.ErrorListProvider(sp);
        }
コード例 #16
0
ファイル: PackageRestorer.cs プロジェクト: Newtopian/nuget
 public PackageRestorer(DTE dte, IServiceProvider serviceProvider)
 {
     _dte = dte;
     _errorListProvider = new ErrorListProvider(serviceProvider);
     _buildEvents = dte.Events.BuildEvents;
     _buildEvents.OnBuildBegin += BuildEvents_OnBuildBegin;
     _solutionEvents = dte.Events.SolutionEvents;
     _solutionEvents.AfterClosing += SolutionEvents_AfterClosing;            
 }
コード例 #17
0
        public Logger(IServiceProvider serviceProvider)
        {
            sp = serviceProvider;
            tasksDictionary = new Dictionary<string, List<ErrorTask>>();

            elp = new ErrorListProvider(sp);
            elp.ProviderName = "Factory Guide Errors";
            elp.ProviderGuid = new Guid("5A10E43F-8D1D-4026-98C0-E6B502058901");
        }
コード例 #18
0
        public JsHintRunner(string fileName)
        {
            _fileName = fileName;

            if (!_providers.TryGetValue(fileName, out _provider))
            {
                _provider = new ErrorListProvider(EditorExtensionsPackage.Instance);
                _providers.Add(fileName, _provider);
            }
        }
コード例 #19
0
        public ErrorList(EventBus eventBus)
        {
            _EventBus = eventBus;

            // Setup the error list controller, which will update the IDE error list with
            // error coming back from the closure compiler.
            _ErrorListProvider = new Microsoft.VisualStudio.Shell.ErrorListProvider(_EventBus.Package);
            _ErrorListProvider.ProviderGuid = SoftGPL.vs10.GuidList.guidvs10Pkg;
            _ErrorListProvider.ProviderName = "SoftGPL.gcVS10";
        }
コード例 #20
0
        public void Dispose()
        {
            this.document.TextBuffer.Properties.RemoveProperty(typeof(TemplateErrorReporter));

            if (this.errorListProvider != null)
            {
                this.errorListProvider.Dispose();
                this.errorListProvider = null;
            }
        }
コード例 #21
0
ファイル: ErrorListPresenter.cs プロジェクト: derigel23/Nitra
    public ErrorListPresenter(ITextBuffer textBuffer, IErrorProviderFactory squiggleProviderFactory, IServiceProvider serviceProvider)
    {
      _textBuffer = textBuffer;
      _textBuffer.Changed += OnTextBufferChanged;

      _serviceProvider = serviceProvider;
      _squiggleTagger = squiggleProviderFactory.GetErrorTagger(_textBuffer);
      _errorListProvider = new Microsoft.VisualStudio.Shell.ErrorListProvider(serviceProvider);
      _previousErrors = new List<ErrorTask>();
      _previousSquiggles = new List<TrackingTagSpan<IErrorTag>>();
    }
コード例 #22
0
        public LintReporter(ILintCompiler compiler, ILinterSettings settings, string fileName)
        {
            Settings = settings;
            FileName = fileName;
            _compiler = compiler;

            if (!_providers.TryGetValue(fileName, out _provider))
            {
                _provider = new ErrorListProvider(WebEssentialsPackage.Instance);
                _providers.Add(fileName, _provider);
            }
        }
コード例 #23
0
        public Plugin(IWpfTextView view, ITextDocument document, DTE dte, ErrorListProvider messageList)
        {
            this.view = view;
            this.dte = dte;
            this.messageList = messageList;
            this.message = null;

            document.FileActionOccurred += FileActionOccurred;
            view.GotAggregateFocus += GotAggregateFocus;
            view.Closed += Closed;

            LoadSettings(document.FilePath);
        }
コード例 #24
0
ファイル: ErrorList.cs プロジェクト: saaadhu/naggy
        public static void Initialize(IServiceProvider provider, DTE _dte)
        {
            dte = _dte;
            if (errorListProvider != null)
                return;

            errorListProvider = new ErrorListProvider(provider);
            errorListProvider.ProviderGuid = Guid.Parse("7C2C89EC-D368-4B15-B93A-E506EEA449E4");
            errorListProvider.ProviderName = "Naggy.DiagnosticsProvider";

            documentEvents = dte.Events.DocumentEvents;
            documentEvents.DocumentClosing += new _dispDocumentEvents_DocumentClosingEventHandler(documentEvents_DocumentClosing);
        }
コード例 #25
0
ファイル: ErrorListPresenter.cs プロジェクト: Strongc/VSLua
        public ErrorListPresenter(IWpfTextView textView, ISingletons singletons)
        {
            Validate.IsNotNull(textView, nameof(textView));
            Validate.IsNotNull(singletons, nameof(singletons));

            this.textView = textView;
            this.singletons = singletons;
            this.errorListProvider = new ErrorListProvider(singletons.ServiceProvider);
            this.errorListProvider.ProviderGuid = Guid.NewGuid();
            this.errorListProvider.ProviderName = Constants.Language.Name;

            this.textView.TextBuffer.Changed += this.OnBufferChanged;
        }
コード例 #26
0
ファイル: ErrorList.cs プロジェクト: QuinntyneBrown/WebLinter
        public static void AddErrors(string file, IEnumerable<LintingError> errors)
        {
            CleanErrors(file);
            var provider = new ErrorListProvider(VSPackage.Package);

            foreach (var error in errors)
            {
                var task = CreateTask(error, provider);
                provider.Tasks.Add(task);
            }

            _providers.Add(file, provider);
        }
コード例 #27
0
        public JsHintRunner(string fileName)
        {
            _fileName = fileName;

            if (_providers.ContainsKey(fileName))
            {
                _provider = _providers[fileName];
            }
            else
            {
                _provider = new ErrorListProvider(EditorExtensionsPackage.Instance);
                _providers.Add(fileName, _provider);
            }
        }
コード例 #28
0
        /// <summary>
        /// Constructs and Registers ("Advises") for Project retargeting events if the IVsTrackProjectRetargeting service is available
        /// Otherwise, it simply exits
        /// </summary>
        /// <param name="dte"></param>
        public ProjectRetargetingHandler(DTE dte, IServiceProvider serviceProvider)
        {
            if (dte == null)
            {
                throw new ArgumentNullException("dte");
            }

            if (serviceProvider == null)
            {
                throw new ArgumentNullException("serviceProvider");
            }

            IVsTrackProjectRetargeting vsTrackProjectRetargeting = serviceProvider.GetService(typeof(SVsTrackProjectRetargeting)) as IVsTrackProjectRetargeting;
            if (vsTrackProjectRetargeting != null)
            {
                _vsMonitorSelection = (IVsMonitorSelection)serviceProvider.GetService(typeof(IVsMonitorSelection));
                Debug.Assert(_vsMonitorSelection != null);
                _errorListProvider = new ErrorListProvider(serviceProvider);
                _dte = dte;
                _vsTrackProjectRetargeting = vsTrackProjectRetargeting;

                // Register for ProjectRetargetingEvents
                if (_vsTrackProjectRetargeting.AdviseTrackProjectRetargetingEvents(this, out _cookieProjectRetargeting) == VSConstants.S_OK)
                {
                    Debug.Assert(_cookieProjectRetargeting != 0);
                    _dte.Events.BuildEvents.OnBuildBegin += BuildEvents_OnBuildBegin;
                    _dte.Events.SolutionEvents.AfterClosing += SolutionEvents_AfterClosing;
                }
                else
                {
                    _cookieProjectRetargeting = 0;
                }

                // Register for BatchRetargetingEvents. Using BatchRetargetingEvents, we need to detect platform retargeting
                if (_vsTrackProjectRetargeting.AdviseTrackBatchRetargetingEvents(this, out _cookieBatchRetargeting) == VSConstants.S_OK)
                {
                    Debug.Assert(_cookieBatchRetargeting != 0);
                    if (_cookieProjectRetargeting == 0)
                    {
                        // Register for dte Events only if they are not already registered for
                        _dte.Events.BuildEvents.OnBuildBegin += BuildEvents_OnBuildBegin;
                        _dte.Events.SolutionEvents.AfterClosing += SolutionEvents_AfterClosing;
                    }
                }
                else
                {
                    _cookieBatchRetargeting = 0;
                }
            }
        }
コード例 #29
0
ファイル: ErrorList.cs プロジェクト: ChinaJason/Typewriter
 public static void Initialize(IServiceProvider serviceProvider)
 {
     try
     {
         _ivsSolution = (IVsSolution)Package.GetGlobalService(typeof (IVsSolution));
         _ivsErrorList = (IVsErrorList)Package.GetGlobalService(typeof (SVsErrorList));
         _errorListProvider = new ErrorListProvider(serviceProvider);
         _initialized = true;
     }
     catch (Exception exception)
     {
         Log.Error($"Failed to initialize Error List. {exception.Message}");
     }
 }
コード例 #30
0
        public static void AddErrors(string file, IEnumerable<MinificationError> errors)
        {
            CleanErrors(file);

            ErrorListProvider provider = new ErrorListProvider(BundlerMinifierPackage.Package);

            foreach (var error in errors)
            {
                var task = CreateTask(error, provider);
                provider.Tasks.Add(task);
            }

            _providers.Add(file, provider);
        }
コード例 #31
0
ファイル: TaskList.cs プロジェクト: cbilson/chirpy
        public TaskList(object application)
        {
            instance = this;

            this.app = application as DTE2;
            var app = application as Microsoft.VisualStudio.OLE.Interop.IServiceProvider;
            if (app != null)
            {
                this.serviceProvider = new ServiceProvider(app);
                this.listProvider = new ErrorListProvider(this.serviceProvider);
                this.listProvider.ProviderName = this.GetType().Assembly.FullName;
                this.listProvider.ProviderGuid = new Guid("F1415C4C-5D67-401F-A81C-71F0721BB6F0");
                this.listProvider.Show();
            }
        }
コード例 #32
0
ファイル: ErrorListPresenter.cs プロジェクト: Strongc/VSLua
        protected override void DisposeManagedResources()
        {
            if (this.textView.TextBuffer != null)
            {
                this.textView.TextBuffer.Changed -= this.OnBufferChanged;
            }

            this.ClearErrors();

            Validate.IsNotNull(this.errorListProvider, nameof(this.errorListProvider));

            this.errorListProvider.Dispose();
            this.errorListProvider = null;

            base.DisposeManagedResources();
        }
コード例 #33
0
        public VisualStudioWriter(DTE dte, System.IServiceProvider serviceProvider)
        {
            if (dte == null)
            {
                Debug.Write("Visual Studio Writer was passed a null DTE");

                if(System.Diagnostics.Debugger.IsAttached)
                    System.Diagnostics.Debugger.Break();

                return;
            }

            _outputWindowPane = LoadOutputWindowPane(dte);
            _errorListProvider = LoadErrorListPane(serviceProvider);
            _statusbar = serviceProvider.GetService(typeof (SVsStatusbar)) as IVsStatusbar;
        }
コード例 #34
0
        public ErrorListPresenter(IWpfTextView textView, IErrorProviderFactory squiggleProviderFactory, IServiceProvider serviceProvider)
        {
            this.textView = textView;
            this.textView.TextBuffer.Changed += OnTextBufferChanged;
            this.textView.Closed             += new EventHandler(OnTextViewClosed);

            this.errorListProvider = new PyErrorListProvider();
            this.squiggleTagger    = squiggleProviderFactory.GetErrorTagger(textView.TextBuffer);

            errorList = new Microsoft.VisualStudio.Shell.ErrorListProvider(serviceProvider);

            previousErrors    = new List <ErrorTask>();
            previousSquiggles = new List <TrackingTagSpan <IErrorTag> >();

            CreateErrors();
        }