public static void Show(Diagnostic diag) { var task = new ErrorTask { Text = string.Format(@"{0,4} : {1}", diag.ID, diag.Message), Category = TaskCategory.CodeSense, ErrorCategory = diag.Level == DiagnosticLevel.Warning ? TaskErrorCategory.Warning : TaskErrorCategory.Error, Column = diag.StartColumn, Line = diag.StartLine - 1, Document = diag.FilePath, HierarchyItem = (IVsHierarchy)AVRStudio.GetProjectItem(dte, diag.FilePath).Object, }; task.Navigate += (sender, args) => { task.Line++; errorListProvider.Navigate(task, Guid.Parse(EnvDTE.Constants.vsViewKindCode)); task.Line--; }; errorListProvider.Tasks.Add(task); }
private static ClangAdapter CreateClangAdapter(ITextBuffer buffer) { ITextDocument document; buffer.Properties.TryGetProperty(typeof(ITextDocument), out document); var filePath = document.FilePath; var includePaths = AVRStudio.GetIncludePaths(filePath, dte); var symbols = AVRStudio.GetPredefinedSymbols(filePath, dte); return(new ClangAdapter(filePath, new List <string>(includePaths), new List <string>(symbols))); }
private static ClangAdapter CreateClangAdapter(ITextBuffer buffer) { ITextDocument document; if (!buffer.Properties.TryGetProperty(typeof(ITextDocument), out document) || document == null) { return(null); } var filePath = document.FilePath; var includePaths = AVRStudio.GetIncludePaths(filePath, dte); var symbols = AVRStudio.GetPredefinedSymbols(filePath, dte); var isc99 = AVRStudio.IsC99Enabled(filePath, dte); return(new ClangAdapter(filePath, new List <string>(includePaths), new List <string>(symbols), isc99)); }