コード例 #1
0
        public void Update(Diagnostic[] diagnostics, FileName fileName, IDocument document)
        {
            WorkbenchSingleton.SafeThreadCall(() => {
                ClearTasksForFileName(fileName);

                List <TypeScriptTask> tasks = diagnostics
                                              .Select(diagnostic => TypeScriptTask.Create(fileName, diagnostic, document))
                                              .ToList();

                TaskService.AddRange(tasks);
            });
        }
コード例 #2
0
        public void Update(Diagnostic[] diagnostics, FileName fileName)
        {
            SD.MainThread.InvokeIfRequired(() => {
                ClearTasksForFileName(fileName);

                IViewContent view = FileService.GetOpenFile(fileName);
                if (view == null)
                {
                    return;
                }

                ITextEditor textEditor = view.GetService <ITextEditor>();
                if (textEditor == null)
                {
                    return;
                }

                List <TypeScriptTask> tasks = diagnostics
                                              .Select(diagnostic => TypeScriptTask.Create(fileName, diagnostic, textEditor.Document))
                                              .ToList();

                TaskService.AddRange(tasks);
            });
        }