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);
            });
        }
Ejemplo n.º 2
0
        public TypeScriptTask(
			FileName fileName,
			Diagnostic diagnostic,
			int column,
			int line)
            : base(fileName,
				diagnostic.ToString(),
				column,
				line,
				GetTaskType(diagnostic.category))
        {
        }
		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);
			});
		}
Ejemplo n.º 4
0
		public static TypeScriptTask Create(FileName fileName, Diagnostic diagnostic, IDocument document)
		{
			TextLocation location = document.GetLocation(diagnostic.start);
			return new TypeScriptTask(fileName, diagnostic, location.Column, location.Line);
		}