Browse Source

Merged missing SharpReport resources from Corsavy.

Fixed some bugs in code analysis-AddIn.

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@1603 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
shortcuts
Daniel Grunwald 19 years ago
parent
commit
a5ec465e77
  1. 1
      data/resources/image/BitmapResources/BitmapResources.res
  2. BIN
      data/resources/image/BitmapResources/SharpReportIcons/Icons.16x16.SharpReport.Rectangle.png
  3. BIN
      data/resources/image/BitmapResources/SharpReportIcons/Icons.16x16.SharpReport.Table.gif
  4. 4
      src/AddIns/Misc/CodeAnalysis/Src/FxCopLogger.cs
  5. 2
      src/AddIns/Misc/CodeAnalysis/Src/SuppressMessageCommand.cs
  6. 6
      src/Libraries/ICSharpCode.Build.Tasks/Project/FxCop.cs
  7. 1
      src/Libraries/NRefactory/Project/Src/Lexer/AbstractLexer.cs
  8. 51
      src/Libraries/NRefactory/Project/Src/Lexer/CSharp/Lexer.cs
  9. 4
      src/Libraries/NRefactory/Project/Src/Lexer/Special/ISpecial.cs
  10. 1
      src/Libraries/NRefactory/Project/Src/Lexer/VBNet/Lexer.cs
  11. 25
      src/Libraries/NRefactory/Project/Src/Output/CodeDOM/CodeDOMOutputVisitor.cs
  12. 8
      src/Libraries/NRefactory/Project/Src/Output/VBNet/VBNetOutputVisitor.cs
  13. 1
      src/Libraries/NRefactory/Project/Src/Parser/AbstractParser.cs
  14. 2
      src/Libraries/NRefactory/Project/Src/Parser/VBNet/Parser.cs
  15. 4
      src/Main/Base/Project/Src/Services/ParserService/DefaultProjectContent.cs
  16. BIN
      src/Main/StartUp/Project/Resources/BitmapResources.resources

1
data/resources/image/BitmapResources/BitmapResources.res

@ -489,6 +489,7 @@ Icons.16x16.SharpReport.Descending = SharpReportIcons\Icons.16x16.SharpReport.De @@ -489,6 +489,7 @@ Icons.16x16.SharpReport.Descending = SharpReportIcons\Icons.16x16.SharpReport.De
Icons.16x16.SharpReport.Function = SharpReportIcons\Icons.16x16.SharpReport.Function.ico
Icons.16.16.SharpReport.Textbox = SharpReportIcons\Icons.16.16.SharpReport.Textbox.ico
Icons.16.16.SharpReport.Line = SharpReportIcons\Icons.16.16.SharpReport.Line.ico
Icons.16x16.SharpReport.Rectangle = SharpReportIcons\Icons.16x16.SharpReport.Rectangle.png
#ViewNavigation icons
Icons.16x16.NavigateBack = NavigationIcons\Icons.16x16.NavigateBack.png

BIN
data/resources/image/BitmapResources/SharpReportIcons/Icons.16x16.SharpReport.Rectangle.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 137 B

BIN
data/resources/image/BitmapResources/SharpReportIcons/Icons.16x16.SharpReport.Table.gif

Binary file not shown.

After

Width:  |  Height:  |  Size: 871 B

4
src/AddIns/Misc/CodeAnalysis/Src/FxCopLogger.cs

@ -52,7 +52,7 @@ namespace ICSharpCode.CodeAnalysis @@ -52,7 +52,7 @@ namespace ICSharpCode.CodeAnalysis
public void Initialize(IEventSource eventSource)
{
this.eventSource = eventSource;
engine.MessageView.AppendText("Running FxCop...\r\n");
engine.MessageView.AppendText("Running FxCop on " + Path.GetFileNameWithoutExtension(engine.CurrentProjectFile) + "\r\n");
eventSource.ErrorRaised += OnError;
eventSource.WarningRaised += OnWarning;
}
@ -99,6 +99,8 @@ namespace ICSharpCode.CodeAnalysis @@ -99,6 +99,8 @@ namespace ICSharpCode.CodeAnalysis
err.FileName = pos.Cu.FileName ?? "";
err.Line = pos.Line;
err.Column = pos.Column;
} else {
err.FileName = null;
}
}

2
src/AddIns/Misc/CodeAnalysis/Src/SuppressMessageCommand.cs

@ -55,6 +55,8 @@ namespace ICSharpCode.CodeAnalysis @@ -55,6 +55,8 @@ namespace ICSharpCode.CodeAnalysis
string code = codegen.GenerateCode(CreateSuppressAttribute(p.Cu, tag), indentation.ToString());
if (!code.EndsWith("\n")) code += Environment.NewLine;
document.Insert(line.Offset, code);
provider.TextEditorControl.ActiveTextAreaControl.Caret.Line = p.Line - 1;
provider.TextEditorControl.ActiveTextAreaControl.ScrollToCaret();
TaskService.Remove(t);
ParserService.ParseViewContent(window.ViewContent);
}

6
src/Libraries/ICSharpCode.Build.Tasks/Project/FxCop.cs

@ -141,6 +141,9 @@ namespace ICSharpCode.Build.Tasks @@ -141,6 +141,9 @@ namespace ICSharpCode.Build.Tasks
{
bool isWarning = true;
string checkId = message.GetAttribute("CheckId");
if (message.HasAttribute("TypeName")) {
checkId = checkId + ":" + message.GetAttribute("TypeName");
}
string category = message.GetAttribute("Category");
foreach (XmlNode node in message.SelectNodes(".//Issue")) {
XmlElement issueEl = node as XmlElement;
@ -175,9 +178,6 @@ namespace ICSharpCode.Build.Tasks @@ -175,9 +178,6 @@ namespace ICSharpCode.Build.Tasks
issueFullFile = "positionof#" + memberName;
}
if (message.HasAttribute("TypeName")) {
checkId = checkId + ":" + message.GetAttribute("TypeName");
}
if (message.HasAttribute("Id")) {
memberName = memberName + "|" + message.GetAttribute("Id");
}

1
src/Libraries/NRefactory/Project/Src/Lexer/AbstractLexer.cs

@ -16,6 +16,7 @@ namespace ICSharpCode.NRefactory.Parser @@ -16,6 +16,7 @@ namespace ICSharpCode.NRefactory.Parser
/// <summary>
/// This is the base class for the C# and VB.NET lexer
/// </summary>
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1708:IdentifiersShouldDifferByMoreThanCase")]
public abstract class AbstractLexer : ILexer
{
TextReader reader;

51
src/Libraries/NRefactory/Project/Src/Lexer/CSharp/Lexer.cs

@ -262,25 +262,28 @@ namespace ICSharpCode.NRefactory.Parser.CSharp @@ -262,25 +262,28 @@ namespace ICSharpCode.NRefactory.Parser.CSharp
string stringValue = prefix + digit + suffix;
if (isfloat) {
try {
return new Token(Tokens.Literal, x, y, stringValue, Single.Parse(digit, CultureInfo.InvariantCulture));
} catch (Exception) {
float num;
if (float.TryParse(digit, NumberStyles.Any, CultureInfo.InvariantCulture, out num)) {
return new Token(Tokens.Literal, x, y, stringValue, num);
} else {
errors.Error(y, x, String.Format("Can't parse float {0}", digit));
return new Token(Tokens.Literal, x, y, stringValue, 0f);
}
}
if (isdecimal) {
try {
return new Token(Tokens.Literal, x, y, stringValue, Decimal.Parse(digit, NumberStyles.Any, CultureInfo.InvariantCulture));
} catch (Exception) {
decimal num;
if (decimal.TryParse(digit, NumberStyles.Any, CultureInfo.InvariantCulture, out num)) {
return new Token(Tokens.Literal, x, y, stringValue, num);
} else {
errors.Error(y, x, String.Format("Can't parse decimal {0}", digit));
return new Token(Tokens.Literal, x, y, stringValue, 0m);
}
}
if (isdouble) {
try {
return new Token(Tokens.Literal, x, y, stringValue, Double.Parse(digit, CultureInfo.InvariantCulture));
} catch (Exception) {
double num;
if (double.TryParse(digit, NumberStyles.Any, CultureInfo.InvariantCulture, out num)) {
return new Token(Tokens.Literal, x, y, stringValue, num);
} else {
errors.Error(y, x, String.Format("Can't parse double {0}", digit));
return new Token(Tokens.Literal, x, y, stringValue, 0d);
}
@ -310,32 +313,36 @@ namespace ICSharpCode.NRefactory.Parser.CSharp @@ -310,32 +313,36 @@ namespace ICSharpCode.NRefactory.Parser.CSharp
if (islong) {
if (isunsigned) {
try {
token = new Token(Tokens.Literal, x, y, stringValue, UInt64.Parse(digit, ishex ? NumberStyles.HexNumber : NumberStyles.Number));
} catch (Exception) {
ulong num;
if (ulong.TryParse(digit, ishex ? NumberStyles.HexNumber : NumberStyles.Number, CultureInfo.InvariantCulture, out num)) {
token = new Token(Tokens.Literal, x, y, stringValue, num);
} else {
errors.Error(y, x, String.Format("Can't parse unsigned long {0}", digit));
token = new Token(Tokens.Literal, x, y, stringValue, 0UL);
}
} else {
try {
token = new Token(Tokens.Literal, x, y, stringValue, Int64.Parse(digit, ishex ? NumberStyles.HexNumber : NumberStyles.Number));
} catch (Exception) {
long num;
if (long.TryParse(digit, ishex ? NumberStyles.HexNumber : NumberStyles.Number, CultureInfo.InvariantCulture, out num)) {
token = new Token(Tokens.Literal, x, y, stringValue, num);
} else {
errors.Error(y, x, String.Format("Can't parse long {0}", digit));
token = new Token(Tokens.Literal, x, y, stringValue, 0L);
}
}
} else {
if (isunsigned) {
try {
token = new Token(Tokens.Literal, x, y, stringValue, UInt32.Parse(digit, ishex ? NumberStyles.HexNumber : NumberStyles.Number));
} catch (Exception) {
uint num;
if (uint.TryParse(digit, ishex ? NumberStyles.HexNumber : NumberStyles.Number, CultureInfo.InvariantCulture, out num)) {
token = new Token(Tokens.Literal, x, y, stringValue, num);
} else {
errors.Error(y, x, String.Format("Can't parse unsigned int {0}", digit));
token = new Token(Tokens.Literal, x, y, stringValue, 0U);
token = new Token(Tokens.Literal, x, y, stringValue, (uint)0);
}
} else {
try {
token = new Token(Tokens.Literal, x, y, stringValue, Int32.Parse(digit, ishex ? NumberStyles.HexNumber : NumberStyles.Number));
} catch (Exception) {
int num;
if (int.TryParse(digit, ishex ? NumberStyles.HexNumber : NumberStyles.Number, CultureInfo.InvariantCulture, out num)) {
token = new Token(Tokens.Literal, x, y, stringValue, num);
} else {
errors.Error(y, x, String.Format("Can't parse int {0}", digit));
token = new Token(Tokens.Literal, x, y, stringValue, 0);
}

4
src/Libraries/NRefactory/Project/Src/Lexer/Special/ISpecial.cs

@ -34,13 +34,13 @@ namespace ICSharpCode.NRefactory.Parser @@ -34,13 +34,13 @@ namespace ICSharpCode.NRefactory.Parser
Location startPosition, endPosition;
public AbstractSpecial(Location position)
protected AbstractSpecial(Location position)
{
this.startPosition = position;
this.endPosition = position;
}
public AbstractSpecial(Location startPosition, Location endPosition)
protected AbstractSpecial(Location startPosition, Location endPosition)
{
this.startPosition = startPosition;
this.endPosition = endPosition;

1
src/Libraries/NRefactory/Project/Src/Lexer/VBNet/Lexer.cs

@ -250,6 +250,7 @@ namespace ICSharpCode.NRefactory.Parser.VB @@ -250,6 +250,7 @@ namespace ICSharpCode.NRefactory.Parser.VB
return Char.ToUpper((char)ReaderPeek(), CultureInfo.InvariantCulture);
}
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1818:DoNotConcatenateStringsInsideLoops")]
Token ReadDigit(char ch, int x)
{
sb.Length = 0;

25
src/Libraries/NRefactory/Project/Src/Output/CodeDOM/CodeDOMOutputVisitor.cs

@ -469,15 +469,15 @@ namespace ICSharpCode.NRefactory.Parser @@ -469,15 +469,15 @@ namespace ICSharpCode.NRefactory.Parser
}
#region Expressions
public override object Visit(PrimitiveExpression expression, object data)
public override object Visit(PrimitiveExpression primitiveExpression, object data)
{
return new CodePrimitiveExpression(expression.Value);
return new CodePrimitiveExpression(primitiveExpression.Value);
}
public override object Visit(BinaryOperatorExpression expression, object data)
public override object Visit(BinaryOperatorExpression binaryOperatorExpression, object data)
{
CodeBinaryOperatorType op = CodeBinaryOperatorType.Add;
switch (expression.Op) {
switch (binaryOperatorExpression.Op) {
case BinaryOperatorType.Add:
op = CodeBinaryOperatorType.Add;
break;
@ -544,14 +544,14 @@ namespace ICSharpCode.NRefactory.Parser @@ -544,14 +544,14 @@ namespace ICSharpCode.NRefactory.Parser
op = CodeBinaryOperatorType.BitwiseAnd;
break;
}
return new CodeBinaryOperatorExpression((CodeExpression)expression.Left.AcceptVisitor(this, data),
return new CodeBinaryOperatorExpression((CodeExpression)binaryOperatorExpression.Left.AcceptVisitor(this, data),
op,
(CodeExpression)expression.Right.AcceptVisitor(this, data));
(CodeExpression)binaryOperatorExpression.Right.AcceptVisitor(this, data));
}
public override object Visit(ParenthesizedExpression expression, object data)
public override object Visit(ParenthesizedExpression parenthesizedExpression, object data)
{
return expression.Expression.AcceptVisitor(this, data);
return parenthesizedExpression.Expression.AcceptVisitor(this, data);
}
public override object Visit(InvocationExpression invocationExpression, object data)
@ -586,12 +586,12 @@ namespace ICSharpCode.NRefactory.Parser @@ -586,12 +586,12 @@ namespace ICSharpCode.NRefactory.Parser
return new CodeMethodInvokeExpression(targetExpr, methodName, GetExpressionList(invocationExpression.Arguments));
}
public override object Visit(IdentifierExpression expression, object data)
public override object Visit(IdentifierExpression identifierExpression, object data)
{
if (!IsLocalVariable(expression.Identifier) && IsField(expression.Identifier)) {
return new CodeFieldReferenceExpression(new CodeThisReferenceExpression(), expression.Identifier);
if (!IsLocalVariable(identifierExpression.Identifier) && IsField(identifierExpression.Identifier)) {
return new CodeFieldReferenceExpression(new CodeThisReferenceExpression(), identifierExpression.Identifier);
}
return new CodeVariableReferenceExpression(expression.Identifier);
return new CodeVariableReferenceExpression(identifierExpression.Identifier);
}
public override object Visit(UnaryOperatorExpression unaryOperatorExpression, object data)
@ -860,7 +860,6 @@ namespace ICSharpCode.NRefactory.Parser @@ -860,7 +860,6 @@ namespace ICSharpCode.NRefactory.Parser
static CodeTypeReferenceExpression ConvertToTypeReference(FieldReferenceExpression fieldReferenceExpression)
{
FieldReferenceExpression primaryReferenceExpression = fieldReferenceExpression;
StringBuilder type = new StringBuilder("");
while (fieldReferenceExpression.TargetObject is FieldReferenceExpression) {

8
src/Libraries/NRefactory/Project/Src/Output/VBNet/VBNetOutputVisitor.cs

@ -171,11 +171,11 @@ namespace ICSharpCode.NRefactory.PrettyPrinter @@ -171,11 +171,11 @@ namespace ICSharpCode.NRefactory.PrettyPrinter
}
}
public object Visit(InnerClassTypeReference typeReference, object data)
public object Visit(InnerClassTypeReference innerClassTypeReference, object data)
{
nodeTracker.TrackedVisit(typeReference.BaseType, data);
nodeTracker.TrackedVisit(innerClassTypeReference.BaseType, data);
outputFormatter.PrintToken(Tokens.Dot);
return Visit((TypeReference)typeReference, data); // call Visit(TypeReference, object)
return Visit((TypeReference)innerClassTypeReference, data); // call Visit(TypeReference, object)
}
#region Global scope
@ -183,7 +183,7 @@ namespace ICSharpCode.NRefactory.PrettyPrinter @@ -183,7 +183,7 @@ namespace ICSharpCode.NRefactory.PrettyPrinter
{
outputFormatter.Indent();
outputFormatter.PrintText("<");
if (attributeSection.AttributeTarget != null && attributeSection.AttributeTarget != String.Empty) {
if (attributeSection.AttributeTarget != null && attributeSection.AttributeTarget.Length > 0) {
outputFormatter.PrintIdentifier(attributeSection.AttributeTarget);
outputFormatter.PrintToken(Tokens.Colon);
outputFormatter.Space();

1
src/Libraries/NRefactory/Project/Src/Parser/AbstractParser.cs

@ -13,6 +13,7 @@ namespace ICSharpCode.NRefactory.Parser @@ -13,6 +13,7 @@ namespace ICSharpCode.NRefactory.Parser
/// <summary>
/// Description of AbstractParser.
/// </summary>
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1708:IdentifiersShouldDifferByMoreThanCase")]
public abstract class AbstractParser : IParser
{
protected const int minErrDist = 2;

2
src/Libraries/NRefactory/Project/Src/Parser/VBNet/Parser.cs

@ -6275,4 +6275,4 @@ out blockStmt); @@ -6275,4 +6275,4 @@ out blockStmt);
};
} // end Parser
}
}

4
src/Main/Base/Project/Src/Services/ParserService/DefaultProjectContent.cs

@ -872,7 +872,9 @@ namespace ICSharpCode.Core @@ -872,7 +872,9 @@ namespace ICSharpCode.Core
firstMethod = m;
}
}
return firstMethod;
if (firstMethod != null)
return firstMethod;
return curClass.SearchMember(memberName, LanguageProperties.CSharp);
}
}
}

BIN
src/Main/StartUp/Project/Resources/BitmapResources.resources

Binary file not shown.
Loading…
Cancel
Save