Browse Source

Small bug fixes.

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@266 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
shortcuts
Daniel Grunwald 21 years ago
parent
commit
c27ee76994
  1. 18
      src/Libraries/ICSharpCode.TextEditor/Project/Src/Gui/TextView.cs
  2. 2
      src/Main/Base/Project/ICSharpCode.SharpDevelop.csproj
  3. 125
      src/Main/Base/Project/Src/Gui/Pads/CompilerMessageView/CompilerMessageView.cs
  4. 0
      src/Main/Base/Project/Src/Gui/Pads/CompilerMessageView/CompilerMessageViewToolbarCommands.cs
  5. 61
      src/Main/Base/Project/Src/Gui/Pads/CompilerMessageView/OutputTextLineParser.cs
  6. 5
      src/Main/Base/Project/Src/Project/MSBuildEngine.cs
  7. 5
      src/Main/Base/Project/Src/Services/Debugger/DebuggerService.cs
  8. 19
      src/Main/Base/Project/Src/Services/Tasks/Task.cs
  9. 9
      src/Main/Base/Project/Src/TextEditor/Gui/Editor/ErrorDrawer.cs
  10. 71
      src/Tools/CheckFileHeaders/Main.cs

18
src/Libraries/ICSharpCode.TextEditor/Project/Src/Gui/TextView.cs

@ -414,7 +414,9 @@ namespace ICSharpCode.TextEditor @@ -414,7 +414,9 @@ namespace ICSharpCode.TextEditor
DrawSpaceMarker(g, spaceMarkerForeColor, physicalXPos, lineRectangle.Y);
}
foreach (TextMarker marker in markers) {
DrawMarker(g, marker, spaceRectangle);
if (marker.TextMarkerType != TextMarkerType.SolidBlock) {
DrawMarker(g, marker, spaceRectangle);
}
}
physicalXPos += spaceWidth;
@ -451,7 +453,9 @@ namespace ICSharpCode.TextEditor @@ -451,7 +453,9 @@ namespace ICSharpCode.TextEditor
}
foreach (TextMarker marker in markers) {
DrawMarker(g, marker, tabRectangle);
if (marker.TextMarkerType != TextMarkerType.SolidBlock) {
DrawMarker(g, marker, tabRectangle);
}
}
physicalXPos += tabWidth;
@ -545,12 +549,12 @@ namespace ICSharpCode.TextEditor @@ -545,12 +549,12 @@ namespace ICSharpCode.TextEditor
// bgColorBrush.Dispose();
// bgColorBrush = null;
// }
//
//
// if (selectionBackgroundBrush != null) {
// selectionBackgroundBrush.Dispose();
// selectionBackgroundBrush = null;
// }
//
//
// if (unselectedBackgroundBrush != null) {
// unselectedBackgroundBrush.Dispose();
// unselectedBackgroundBrush = null;
@ -568,16 +572,16 @@ namespace ICSharpCode.TextEditor @@ -568,16 +572,16 @@ namespace ICSharpCode.TextEditor
// TextFormatFlags flags = TextFormatFlags.NoOverhangPadding |
// TextFormatFlags.NoPrefix |
// TextFormatFlags.NoFullWidthCharacterBreak |
// TextFormatFlags.NoClipping |
// TextFormatFlags.NoClipping |
// TextFormatFlags.PreserveGraphicsClipping |
// TextFormatFlags.PrefixOnly |
// TextFormatFlags.SingleLine;
// Size wordSize = TextRenderer.MeasureText(word, font, Size.Empty, flags);
//
//
// if (DrawingPosition.Left < position.X + DrawingPosition.X) {
// TextRenderer.DrawText(g,
// word,
// font,
// font,
// position,
// foreColor,
// ((SolidBrush)backBrush).Color,

2
src/Main/Base/Project/ICSharpCode.SharpDevelop.csproj

@ -423,7 +423,7 @@ @@ -423,7 +423,7 @@
<Compile Include="Src\Project\UnknownProject.cs" />
<Compile Include="Src\Gui\Pads\ErrorList\ErrorList.cs" />
<Compile Include="Src\Gui\Pads\ErrorList\ErrorListToolbarCommands.cs" />
<Compile Include="Src\Gui\Pads\CompilerMessageView\CompulerMessageViewToolbarCommands.cs" />
<Compile Include="Src\Gui\Pads\CompilerMessageView\CompilerMessageViewToolbarCommands.cs" />
<Compile Include="Src\Services\ParserService\DefaultProjectContent.cs" />
<Compile Include="Src\Services\ParserService\IProjectContent.cs" />
<Compile Include="Src\Gui\Pads\ClassBrowser\ClassBrowser.cs" />

125
src/Main/Base/Project/Src/Gui/Pads/CompilerMessageView/CompilerMessageView.cs

@ -19,12 +19,13 @@ using ICSharpCode.Core; @@ -19,12 +19,13 @@ using ICSharpCode.Core;
using ICSharpCode.SharpDevelop.Gui.OptionPanels;
using ICSharpCode.SharpDevelop.Project;
using ICSharpCode.TextEditor;
using ICSharpCode.TextEditor.Document;
namespace ICSharpCode.SharpDevelop.Gui
{
/// <summary>
/// This class displays the errors and warnings which the compiler outputs and
/// allows the user to jump to the source of the warnig / error
/// allows the user to jump to the source of the warning / error
/// </summary>
public class CompilerMessageView : AbstractPadContent, IClipboardHandler
{
@ -36,8 +37,6 @@ namespace ICSharpCode.SharpDevelop.Gui @@ -36,8 +37,6 @@ namespace ICSharpCode.SharpDevelop.Gui
}
}
// RichTextBox textEditorControl = new RichTextBox();
TextEditorControl textEditorControl = new TextEditorControl();
Panel myPanel = new Panel();
@ -115,8 +114,7 @@ namespace ICSharpCode.SharpDevelop.Gui @@ -115,8 +114,7 @@ namespace ICSharpCode.SharpDevelop.Gui
textEditorControl.Font = FontSelectionPanel.ParseFont(properties.Get("DefaultFont", new Font("Courier New", 10).ToString()).ToString());
properties.PropertyChanged += new PropertyChangedEventHandler(PropertyChanged);
textEditorControl.MouseDown += new MouseEventHandler(TextEditorControlMouseDown);
textEditorControl.BackColor = SystemColors.Window;
textEditorControl.ActiveTextAreaControl.TextArea.DoubleClick += TextEditorControlDoubleClick;
ToolStrip toolStrip = ToolbarService.CreateToolStrip(this, "/SharpDevelop/Pads/CompilerMessageView/Toolbar");
toolStrip.Stretch = true;
@ -126,7 +124,7 @@ namespace ICSharpCode.SharpDevelop.Gui @@ -126,7 +124,7 @@ namespace ICSharpCode.SharpDevelop.Gui
SetWordWrap();
myPanel.ResumeLayout(false);
SetText(StringParser.Parse(messageCategories[selectedCategory].Text));
SetText(messageCategories[selectedCategory]);
}
void SetWordWrap()
@ -161,37 +159,33 @@ namespace ICSharpCode.SharpDevelop.Gui @@ -161,37 +159,33 @@ namespace ICSharpCode.SharpDevelop.Gui
void CategoryTextCleared(object sender, EventArgs e)
{
MessageViewCategory category = (MessageViewCategory)sender;
SelectCategory(category.Category);
WorkbenchSingleton.SafeThreadCall(this, "ClearText");
WorkbenchSingleton.SafeThreadAsyncCall(this, "ClearText", sender);
}
void ClearText()
void ClearText(MessageViewCategory category)
{
SelectCategory(category.Category);
textEditorControl.Text = "";
textEditorControl.Refresh();
}
void CategoryTextSet(object sender, TextEventArgs e)
{
MessageViewCategory category = (MessageViewCategory)sender;
SelectCategory(category.Category);
WorkbenchSingleton.SafeThreadCall(this, "SetText", StringParser.Parse(messageCategories[selectedCategory].Text));
WorkbenchSingleton.SafeThreadAsyncCall(this, "SetText", (MessageViewCategory)sender);
}
void CategoryTextAppended(object sender, TextEventArgs e)
{
MessageViewCategory category = (MessageViewCategory)sender;
int oldCategory = SelectedCategoryIndex;
SelectCategory(category.Category);
if (oldCategory != SelectedCategoryIndex)
WorkbenchSingleton.SafeThreadCall(this, "SetText", StringParser.Parse(messageCategories[selectedCategory].Text));
else
WorkbenchSingleton.SafeThreadCall(this, "AppendText", StringParser.Parse(e.Text));
WorkbenchSingleton.SafeThreadAsyncCall(this, "AppendText", (MessageViewCategory)sender, e.Text);
}
void AppendText(string text)
void AppendText(MessageViewCategory category, string text)
{
if (messageCategories[SelectedCategoryIndex] != category) {
SetText(category);
return;
}
if (text != null) {
text = StringParser.Parse(text);
textEditorControl.Document.ReadOnly = false;
textEditorControl.Document.Insert(textEditorControl.Document.TextLength, text);
textEditorControl.Document.ReadOnly = true;
@ -200,8 +194,9 @@ namespace ICSharpCode.SharpDevelop.Gui @@ -200,8 +194,9 @@ namespace ICSharpCode.SharpDevelop.Gui
}
}
void SetText(string text)
void SetText(MessageViewCategory category)
{
string text = StringParser.Parse(category.Text);
if (text == null) {
text = String.Empty;
}
@ -248,91 +243,23 @@ namespace ICSharpCode.SharpDevelop.Gui @@ -248,91 +243,23 @@ namespace ICSharpCode.SharpDevelop.Gui
WorkbenchSingleton.Workbench.WorkbenchLayout.ActivatePad(this.GetType().FullName);
}
void MessageCategorySelectedIndexChanged(object sender, EventArgs e)
{
WorkbenchSingleton.SafeThreadCall(this, "SetText", StringParser.Parse(messageCategories[selectedCategory].Text));
}
/// <summary>
/// Occurs when the mouse pointer is over the control and a
/// mouse button is pressed.
/// </summary>
void TextEditorControlMouseDown(object sender, MouseEventArgs e)
void TextEditorControlDoubleClick(object sender, EventArgs e)
{
// // Double click?
// if (e.Clicks == 2) {
// // Any text?
// if (textEditorControl.Text.Length > 0) {
//
// // Parse text line double clicked.
// Point point = new Point(e.X, e.Y);
//
// int charIndex = textEditorControl.GetCharIndexFromPosition(point);
// string textLine = GetTextLine(charIndex, textEditorControl.Text);
//
// FileLineReference lineReference = OutputTextLineParser.GetFileLineReference(textLine);
// if (lineReference != null) {
// // Open matching file.
// JumpToFilePosition(Path.GetFullPath(lineReference.FileName),
// lineReference.Line,
// lineReference.Column);
// }
// }
// }
}
/// <summary>
/// Gets the line of text that includes the specified
/// character index.
/// </summary>
/// <remarks>
/// This is used instead of using the <see cref="RichTextBox.Lines"/>
/// array since we have to take into account word wrapping.
/// </remarks>
string GetTextLine(int charIndex, string textLines)
{
Debug.Assert(charIndex < textLines.Length, String.Concat("CharIndex out of range. charIndex=", charIndex, ", textLines.Length=", textLines.Length));
string textLine = String.Empty;
int lineStartIndex = 0;
int lineLength = 0;
bool wasFound = false;
for (int i = 0; i < textLines.Length; ++i) {
char ch = textLines[i];
// Any text?
if (textEditorControl.Text.Length > 0) {
int line = textEditorControl.ActiveTextAreaControl.Caret.Line;
string textLine = TextUtilities.GetLineAsString(textEditorControl.Document, line);
if (ch == '\r' || ch == '\n') {
// End of line.
if (i >= charIndex) {
// Found line.
textLine = textLines.Substring(lineStartIndex, lineLength);
wasFound = true;
break;
} else {
lineStartIndex = i + 1;
lineLength = 0;
}
} else {
++lineLength;
FileLineReference lineReference = OutputTextLineParser.GetFileLineReference(textLine);
if (lineReference != null) {
// Open matching file.
FileService.JumpToFilePosition(Path.GetFullPath(lineReference.FileName), lineReference.Line, lineReference.Column);
}
}
if (!wasFound && (lineLength > 0)) {
textLine = textLines.Substring(lineStartIndex, lineLength);
}
return textLine;
}
/// <summary>
/// Jumps to the specified file line number and position.
/// </summary>
/// <param name="filename">The filename.</param>
/// <param name="line">The line number.</param>
/// <param name="column">The line column</param>
private void JumpToFilePosition(string filename, int line, int column)
{
FileService.JumpToFilePosition(filename, line, column);
}
/// <summary>

0
src/Main/Base/Project/Src/Gui/Pads/CompilerMessageView/CompulerMessageViewToolbarCommands.cs → src/Main/Base/Project/Src/Gui/Pads/CompilerMessageView/CompilerMessageViewToolbarCommands.cs

61
src/Main/Base/Project/Src/Gui/Pads/CompilerMessageView/OutputTextLineParser.cs

@ -14,32 +14,25 @@ namespace ICSharpCode.SharpDevelop.Gui @@ -14,32 +14,25 @@ namespace ICSharpCode.SharpDevelop.Gui
/// Parses output text in the Output Build pad window and extracts source code
/// file references.
/// </summary>
public class OutputTextLineParser
public static class OutputTextLineParser
{
/// <summary>
/// Creates a new instance of the <see cref="OutputTextlineParser"/> class.
/// </summary>
OutputTextLineParser()
{
}
/// <summary>
/// Extracts source code file reference from the compiler output.
/// Extracts source code file reference from the c# compiler output.
/// </summary>
/// <param name="line">The text line to parse.</param>
/// <returns>A <see cref="lineReference"/> if the line of text contains a
/// <returns>A <see cref="LineReference"/> if the line of text contains a
/// file reference otherwise <see langword="null"/></returns>
public static FileLineReference GetCompilerOutputFileLineReference(string lineText)
public static FileLineReference GetCSharpCompilerFileLineReference(string lineText)
{
if (lineText != null) {
Match match = Regex.Match(lineText, @"^(.*?)\(([\d]*),([\d]*)\)");
Match match = Regex.Match(lineText, @"^.*?(\w+:[/\\].*?)\(([\d]*),([\d]*)\)");
if (match.Success) {
try {
// Take off 1 for line/pos since SharpDevelop is zero index based.
// Take off 1 for line/col since SharpDevelop is zero index based.
int line = Convert.ToInt32(match.Groups[2].Value) - 1;
int pos = Convert.ToInt32(match.Groups[3].Value) - 1;
int col = Convert.ToInt32(match.Groups[3].Value) - 1;
return new FileLineReference(match.Groups[1].Value, line, pos);
return new FileLineReference(match.Groups[1].Value, line, col);
} catch (Exception) {
// Ignore.
}
@ -57,12 +50,17 @@ namespace ICSharpCode.SharpDevelop.Gui @@ -57,12 +50,17 @@ namespace ICSharpCode.SharpDevelop.Gui
/// file reference otherwise <see langword="null"/></returns>
public static FileLineReference GetFileLineReference(string lineText)
{
FileLineReference lineReference = GetCompilerOutputFileLineReference(lineText);
FileLineReference lineReference = GetCSharpCompilerFileLineReference(lineText);
if (lineReference == null) {
lineReference = GetNUnitOutputFileLineReference(lineText, false);
}
if (lineReference == null) {
// Also works for VB compiler output.
lineReference = GetCppCompilerFileLineReference(lineText);
}
return lineReference;
}
@ -85,12 +83,39 @@ namespace ICSharpCode.SharpDevelop.Gui @@ -85,12 +83,39 @@ namespace ICSharpCode.SharpDevelop.Gui
int line = Convert.ToInt32(match.Groups[2].Value) - 1;
return new FileLineReference(match.Groups[1].Value, line);
} catch (Exception) {
// Ignore.i
// Ignore.
}
}
}
return null;
}
}
/// <summary>
/// Extracts source code file reference from the c++ or VB.Net compiler output.
/// </summary>
/// <param name="line">The text line to parse.</param>
/// <returns>A <see cref="LineReference"/> if the line of text contains a
/// file reference otherwise <see langword="null"/></returns>
public static FileLineReference GetCppCompilerFileLineReference(string lineText)
{
if (lineText != null ) {
Match match = Regex.Match(lineText, @"^.*?(\w+:[/\\].*?)\(([\d]*)\) :");
if (match.Success) {
try {
// Take off 1 for line/pos since SharpDevelop is zero index based.
int line = Convert.ToInt32(match.Groups[2].Value) - 1;
return new FileLineReference(match.Groups[1].Value.Trim(), line);
} catch (Exception) {
// Ignore.
}
}
}
return null;
}
}
}

5
src/Main/Base/Project/Src/Project/MSBuildEngine.cs

@ -159,11 +159,12 @@ namespace ICSharpCode.SharpDevelop.Project @@ -159,11 +159,12 @@ namespace ICSharpCode.SharpDevelop.Project
void AppendError(string file, int lineNumber, int columnNumber, string code, string message, bool isWarning)
{
if (projectFiles.Count > 0) {
file = Path.Combine(Path.GetDirectoryName(projectFiles.Peek()), file);
}
CompilerError error = new CompilerError(file, lineNumber, columnNumber, code, message);
error.IsWarning = isWarning;
AppendText(error.ToString());
if (projectFiles.Count > 0)
error.FileName = Path.Combine(Path.GetDirectoryName(projectFiles.Peek()), file);
results.Errors.Add(error);
}

5
src/Main/Base/Project/Src/Services/Debugger/DebuggerService.cs

@ -262,7 +262,10 @@ namespace ICSharpCode.Core @@ -262,7 +262,10 @@ namespace ICSharpCode.Core
if (textArea.ToolTipVisible) return;
if (!CodeCompletionOptions.TooltipsEnabled) return;
// TODO: if (CodeCompletionOptions.TooltipsOnlyWhenDebugging && !isDebugging) return;
if (CodeCompletionOptions.TooltipsOnlyWhenDebugging) {
if (currentDebugger == null) return;
if (!currentDebugger.IsDebugging) return;
}
Point mousepos = textArea.PointToClient(Control.MousePosition);
Rectangle viewRect = textArea.TextView.DrawingPosition;

19
src/Main/Base/Project/Src/Services/Tasks/Task.cs

@ -99,8 +99,8 @@ namespace ICSharpCode.Core @@ -99,8 +99,8 @@ namespace ICSharpCode.Core
public Task(CompilerError error)
{
type = error.IsWarning ? TaskType.Warning : TaskType.Error;
column = error.Column - 1;
line = error.Line - 1;
column = Math.Max(error.Column - 1, 0);
line = Math.Max(error.Line - 1, 0);
description = error.ErrorText + "(" + error.ErrorNumber + ")";
fileName = error.FileName;
}
@ -108,21 +108,6 @@ namespace ICSharpCode.Core @@ -108,21 +108,6 @@ namespace ICSharpCode.Core
public void JumpToPosition()
{
FileService.JumpToFilePosition(fileName, line, column);
// CompilerResultListItem li = (CompilerResultListItem)OpenTaskView.FocusedItem;
//
// string filename = li.FileName;
//
// if (filename == null || filename.Equals(""))
// return;
//
// if (File.Exists(filename)) {
// string directory = Path.GetDirectoryName(filename);
// if (directory[directory.Length - 1] != Path.DirectorySeparatorChar) {
// directory += Path.DirectorySeparatorChar;
// }
//
// ContentWindow window = OpenWindow(filename);
// }
}
}
}

9
src/Main/Base/Project/Src/TextEditor/Gui/Editor/ErrorDrawer.cs

@ -128,8 +128,8 @@ namespace ICSharpCode.SharpDevelop.DefaultEditor.Gui.Editor @@ -128,8 +128,8 @@ namespace ICSharpCode.SharpDevelop.DefaultEditor.Gui.Editor
if (!CheckTask(task)) return;
if (task.Line >= 0 && task.Line < textEditor.Document.TotalNumberOfLines) {
LineSegment line = textEditor.Document.GetLineSegment(task.Line);
int offset = line.Offset + task.Column;
if (line.Words != null) {
int offset = line.Offset + task.Column;
foreach (TextWord tw in line.Words) {
if (task.Column >= tw.Offset && task.Column < (tw.Offset + tw.Length)) {
textEditor.Document.MarkerStrategy.AddMarker(new VisualError(offset, tw.Length, task));
@ -140,10 +140,9 @@ namespace ICSharpCode.SharpDevelop.DefaultEditor.Gui.Editor @@ -140,10 +140,9 @@ namespace ICSharpCode.SharpDevelop.DefaultEditor.Gui.Editor
}
}
}
/*
int startOffset = offset;//Math.Min(textEditor.Document.TextLength, TextUtilities.FindWordStart(textEditor.Document, offset));
int endOffset = Math.Max(1, TextUtilities.FindWordEnd(textEditor.Document, offset));
textEditor.Document.MarkerStrategy.TextMarker.Add(new VisualError(startOffset, endOffset - startOffset + 1, task.Description, task.TaskType == TaskType.Error));*/
int startOffset = offset;//Math.Min(textEditor.Document.TextLength, TextUtilities.FindWordStart(textEditor.Document, offset));
int endOffset = Math.Max(1, TextUtilities.FindWordEnd(textEditor.Document, offset));
textEditor.Document.MarkerStrategy.AddMarker(new VisualError(startOffset, endOffset - startOffset + 1, task));
}
}

71
src/Tools/CheckFileHeaders/Main.cs

@ -21,10 +21,10 @@ namespace CheckFileHeaders @@ -21,10 +21,10 @@ namespace CheckFileHeaders
try {
MainClass m = new MainClass();
if (args.Length == 0) {
Console.WriteLine("Checking files in working directory...");
count = m.Run(@"D:\Corsavy\SharpDevelop\src");
Console.WriteLine("Checking files in {0} ...", Path.GetFullPath(@"..\..\..\..\"));
count = m.Run(@"..\..\..\..\");
} else {
Console.WriteLine("Checking files in {0}...", args[0]);
Console.WriteLine("Checking files in {0} ...", Path.GetFullPath(args[0]));
count = m.Run(args[0]);
}
Console.WriteLine("Finished! (checked {0} files, changed {1} files, ignored {2} files)", count, m.changeCount, m.ignoreCount);
@ -36,7 +36,6 @@ namespace CheckFileHeaders @@ -36,7 +36,6 @@ namespace CheckFileHeaders
return 0;
}
int Run(string dir)
{
int count = 0;
foreach (string file in Directory.GetFiles(dir, "*.cs")) {
@ -73,7 +72,7 @@ namespace CheckFileHeaders @@ -73,7 +72,7 @@ namespace CheckFileHeaders
}
// must be splitted because this file is under version control, too
Regex resetVersionRegex = new Regex(@"^// <version>\$Revi" + @"sion: \d+ \$</version>$");
Regex resetVersionRegex = new Regex(@"// <version>\$Revi" + @"sion: \d+ \$</version>", RegexOptions.Compiled);
int changeCount, ignoreCount;
@ -90,39 +89,34 @@ namespace CheckFileHeaders @@ -90,39 +89,34 @@ namespace CheckFileHeaders
if (author == null)
author = "";
if (author == "") {
if (file.IndexOf("Main\\Core\\") >= 0) {
Console.Write(file);
char ch;
do {
Console.WriteLine();
Console.Write(" Mike/Daniel/Other/None/Ignore (M/D/O/N/I): ");
}
while ((ch = char.ToUpper(Console.ReadKey().KeyChar)) != 'M'
&& ch != 'N' && ch != 'I' && ch != 'O' && ch != 'D');
Console.WriteLine();
if (ch == 'M') {
author = "Omnibrain";
} else {
Console.Write(file);
char ch;
} else if (ch == 'D') {
author = "Daniel Grunwald";
} else if (ch == 'O') {
bool ok;
do {
Console.WriteLine();
Console.Write(" Mike/Daniel/Other/None/Ignore (M/D/O/N/I): ");
}
while ((ch = char.ToUpper(Console.ReadKey().KeyChar)) != 'M'
&& ch != 'N' && ch != 'I' && ch != 'O' && ch != 'D');
if (ch == 'M') {
author = "Omnibrain";
} else if (ch == 'D') {
author = "Daniel Grunwald";
} else if (ch == 'O') {
Console.WriteLine();
bool ok;
do {
Console.Write("Enter author name: ");
author = Console.ReadLine();
if (author == "David") author = "David Srbecky";
if (author == "Markus") author = "Markus Palme";
email = CheckAuthor(ref author);
ok = author != null;
} while (!ok);
} else if (ch == 'I') {
ignoreCount++;
return;
} else {
author = "none";
}
Console.WriteLine();
Console.Write("Enter author name: ");
author = Console.ReadLine();
if (author == "David") author = "David Srbecky";
if (author == "Markus") author = "Markus Palme";
email = CheckAuthor(ref author);
ok = author != null;
} while (!ok);
} else if (ch == 'I') {
ignoreCount++;
return;
} else {
author = "none";
}
}
string oldAuthor = author;
@ -151,7 +145,8 @@ namespace CheckFileHeaders @@ -151,7 +145,8 @@ namespace CheckFileHeaders
builder.Append(content.Substring(offset).Trim());
builder.AppendLine();
string newContent = builder.ToString();
if (newContent != resetVersionRegex.Replace(content, versionLine)) {
string resettedVersion = resetVersionRegex.Replace(content, versionLine);
if (newContent != resettedVersion) {
using (StreamWriter w = new StreamWriter(file, false, GetOptimalEncoding(newContent))) {
changeCount++;
w.Write(newContent);
@ -174,7 +169,7 @@ namespace CheckFileHeaders @@ -174,7 +169,7 @@ namespace CheckFileHeaders
case "David Srbecky":
case "David Srbeck":
author = "David Srbecký";
return "dsrbecky@post.cz";
return "dsrbecky@gmail.com";
case "Andrea Paatz":
//case "Andrea":
author = "Andrea Paatz";

Loading…
Cancel
Save