Beispiel #1
0
        public static async System.Threading.Tasks.Task Initialize(AsyncPackage package)
        {
            if (Instance == null)
            {
                var commandService = await package.GetServiceAsync(typeof(IMenuCommandService)) as OleMenuCommandService;

                var dte = await package.GetServiceAsync(typeof(DTE)) as DTE2;

                Instance = new ReportMissingLanguage(commandService, dte);
            }
        }
Beispiel #2
0
        public void TextViewCreated(IWpfTextView textView)
        {
            if (!TextmateBundlerInstallerPackage.IsInitialized)
            {
                return;
            }

            ITextDocument doc = null;

            if (!DocumentService.TryGetTextDocument(textView.TextBuffer, out doc) || !IsFileSupported(doc.FilePath))
            {
                return;
            }

            if (ReportMissingLanguage.Instance == null && textView.TextBuffer.ContentType.TypeName == _contentType)
            {
                ShowMessageBox(doc);

                ThreadHelper.JoinableTaskFactory.Run(async() =>
                {
                    await ReportMissingLanguage.Initialize(TextmateBundlerInstallerPackage.Instance);
                });
            }
        }