Browse Source

Merge branch '4.0'

pull/15/head
Daniel Grunwald 15 years ago
parent
commit
78aa6429bc
  1. 8
      src/AddIns/BackendBindings/Python/PythonBinding/Project/Src/PythonMemberResolver.cs
  2. 2
      src/AddIns/BackendBindings/Python/PythonBinding/Test/PythonBinding.Tests.csproj
  3. 40
      src/AddIns/BackendBindings/Python/PythonBinding/Test/Resolver/ResolveMemberWhenFieldHasNoReturnTypeTests.cs
  4. 38
      src/AddIns/BackendBindings/Python/PythonBinding/Test/Resolver/ResolveRandomRandintTests.cs
  5. 4
      src/AddIns/BackendBindings/XamlBinding/XamlBinding/XamlCodeCompletionBinding.cs
  6. 25
      src/AddIns/BackendBindings/XamlBinding/XamlBinding/XamlParser.cs
  7. 2
      src/AddIns/Debugger/Debugger.AddIn/Pads/CallStackPad.xaml.cs
  8. 7
      src/AddIns/Debugger/Debugger.AddIn/Service/AttachToProcessForm.cs
  9. 2
      src/AddIns/Debugger/Debugger.AddIn/Service/WindowsDebugger.cs
  10. 2
      src/AddIns/Debugger/Debugger.AddIn/TreeModel/ExpressionNode.cs
  11. 4
      src/AddIns/Debugger/Debugger.AddIn/Visualizers/Utils/DebuggerHelpers.cs
  12. 4
      src/AddIns/Debugger/Debugger.Core/Exception.cs
  13. 2
      src/AddIns/Debugger/Debugger.Core/Thread.cs
  14. 37
      src/AddIns/Debugger/Debugger.Core/Value.cs
  15. 2
      src/AddIns/Debugger/Debugger.Tests/Tests/AppDomain_Tests.cs
  16. 4
      src/AddIns/Debugger/Debugger.Tests/Tests/ExpressionEvaluator_Tests.cs
  17. 20
      src/AddIns/Debugger/Debugger.Tests/Tests/StackFrame_VariablesLifetime.cs
  18. 4
      src/AddIns/Debugger/Debugger.Tests/Tests/Value_Tests.cs
  19. 32
      src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/BracketHighlightRenderer.cs
  20. 20
      src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/CaretReferencesRenderer.cs
  21. 8
      src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/CodeEditor.cs
  22. 20
      src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/CodeEditorView.cs
  23. 44
      src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/ContextActionsRenderer.cs
  24. 27
      src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/CustomizableHighlightingColorizer.cs
  25. 64
      src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/Options/HighlightingOptions.xaml.cs
  26. 39
      src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/Controls/GridAdorner.cs
  27. 10
      src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/PropertyGrid/Editors/BrushEditor/SolidBrushEditor.xaml
  28. 9
      src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/WpfDesign.Designer.csproj
  29. 31
      src/AddIns/DisplayBindings/WpfDesign/WpfDesign.XamlDom/Project/XamlDocument.cs
  30. 2
      src/AddIns/Misc/SearchAndReplace/Project/Engine/SearchReplaceManager.cs
  31. 14
      src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/CodeCompletion/CompletionList.cs
  32. 6
      src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/CodeCompletion/CompletionWindow.cs
  33. 10
      src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/CodeCompletion/CompletionWindowBase.cs
  34. 12
      src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Document/TextDocument.cs
  35. 13
      src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Editing/DottedLineMargin.cs
  36. 25
      src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Highlighting/Resources/ASPX.xshd
  37. 427
      src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Highlighting/Resources/CPP-Mode.xshd
  38. 165
      src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Highlighting/Resources/Coco-Mode.xshd
  39. 763
      src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Highlighting/Resources/HTML-Mode.xshd
  40. 326
      src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Highlighting/Resources/Java-Mode.xshd
  41. 253
      src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Highlighting/Resources/JavaScript-Mode.xshd
  42. 350
      src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Highlighting/Resources/PHP-Mode.xshd
  43. 2
      src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Rendering/NewLineElementGenerator.cs
  44. 4
      src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Rendering/SingleCharacterElementGenerator.cs
  45. 74
      src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Rendering/TextView.cs
  46. 18
      src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Rendering/TextViewCachedElements.cs
  47. 40
      src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/TextEditor.cs
  48. 2
      src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Utils/Deque.cs
  49. 32
      src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Xml/AXmlParser.cs
  50. 1
      src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/themes/generic.xaml
  51. 9
      src/Libraries/NRefactory/Project/Src/PrettyPrinter/CSharp/CSharpOutputVisitor.cs
  52. 5
      src/Main/Base/Project/Src/Bookmarks/Commands/MenuCommands.cs
  53. 6
      src/Main/Base/Project/Src/Editor/Search/ProvidedDocumentInformation.cs
  54. 29
      src/Main/Base/Project/Src/Gui/Components/ColorPicker.xaml.cs
  55. 22
      src/Main/Base/Project/Src/Gui/Dialogs/NewFileDialog.cs
  56. 6
      src/Main/Base/Project/Src/Gui/IProgressMonitor.cs
  57. 1
      src/Main/Base/Project/Src/Gui/Pads/TaskList/TaskView.cs
  58. 14
      src/Main/Base/Project/Src/Services/File/FileService.cs
  59. 20
      src/Main/Base/Project/Src/Services/RefactoringService/RefactoringService.cs
  60. 27
      src/Main/Core/Project/Src/Services/MessageService/MessageService.cs
  61. 2
      src/Main/ICSharpCode.SharpDevelop.Widgets/Project/ColorHelper.cs
  62. 20
      src/Main/ICSharpCode.SharpDevelop.Widgets/Project/ColorPicker.xaml
  63. 2
      src/Main/ICSharpCode.SharpDevelop.Widgets/Project/ColorPicker.xaml.cs
  64. 9
      src/Main/ICSharpCode.SharpDevelop.Widgets/Project/ICSharpCode.SharpDevelop.Widgets.csproj
  65. 2
      src/Main/ICSharpCode.SharpDevelop.Widgets/Project/Picker.cs

8
src/AddIns/BackendBindings/Python/PythonBinding/Project/Src/PythonMemberResolver.cs

@ -119,8 +119,12 @@ namespace ICSharpCode.PythonBinding @@ -119,8 +119,12 @@ namespace ICSharpCode.PythonBinding
IMember FindMemberInParent(IMember parentMember, string memberName)
{
IClass parentMemberClass = parentMember.ReturnType.GetUnderlyingClass();
return FindMemberInClass(parentMemberClass, memberName);
IReturnType returnType = parentMember.ReturnType;
if (returnType != null) {
IClass parentMemberClass = returnType.GetUnderlyingClass();
return FindMemberInClass(parentMemberClass, memberName);
}
return null;
}
}
}

2
src/AddIns/BackendBindings/Python/PythonBinding/Test/PythonBinding.Tests.csproj

@ -369,11 +369,13 @@ @@ -369,11 +369,13 @@
<Compile Include="Resolver\ResolveImportsTestFixture.cs" />
<Compile Include="Resolver\ResolveLocalClassInstanceTests.cs" />
<Compile Include="Resolver\ResolveLocalVariableMethodTests.cs" />
<Compile Include="Resolver\ResolveMemberWhenFieldHasNoReturnTypeTests.cs" />
<Compile Include="Resolver\ResolveMethodFromUnknownImportAllTests.cs" />
<Compile Include="Resolver\ResolveMethodReturnValueTests.cs" />
<Compile Include="Resolver\ResolveMethodWhenFromImportIsUnknownTests.cs" />
<Compile Include="Resolver\ResolveMethodWhenImportIsUnknownTests.cs" />
<Compile Include="Resolver\ResolveNullCtrlSpaceParseInfoTestFixture.cs" />
<Compile Include="Resolver\ResolveRandomRandintTests.cs" />
<Compile Include="Resolver\ResolverContextDottedImportedNameMatchTests.cs" />
<Compile Include="Resolver\ResolverContextGetModulesThatImportEverythingTests.cs" />
<Compile Include="Resolver\ResolverContextGetModuleForNameImportedAsDifferentNameTestFixture.cs" />

40
src/AddIns/BackendBindings/Python/PythonBinding/Test/Resolver/ResolveMemberWhenFieldHasNoReturnTypeTests.cs

@ -0,0 +1,40 @@ @@ -0,0 +1,40 @@
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
using System;
using System.Collections;
using System.Collections.Generic;
using ICSharpCode.PythonBinding;
using ICSharpCode.Scripting.Tests.Utils;
using ICSharpCode.SharpDevelop.Dom;
using ICSharpCode.SharpDevelop.Dom.CSharp;
using NUnit.Framework;
using PythonBinding.Tests.Utils;
using UnitTestingUtils = UnitTesting.Tests.Utils;
namespace PythonBinding.Tests.Resolver
{
[TestFixture]
public class ResolveMemberWhenFieldHasNoReturnTypeTests
{
[Test]
public void Resolve_FieldHasNoReturnType_DoesNotThrowNullReferenceException()
{
MockProjectContent projectContent = new MockProjectContent();
UnitTestingUtils.MockClass c = new UnitTestingUtils.MockClass(projectContent, "Test");
projectContent.SetClassToReturnFromGetClass("self", c);
DefaultField field = c.AddField("randomNumber");
field.ReturnType = null;
ParseInformation parseInfo = new ParseInformation(c.CompilationUnit);
ExpressionResult expression = new ExpressionResult("self.randomNumber.randint", ExpressionContext.Default);
PythonClassResolver classResolver = new PythonClassResolver();
PythonLocalVariableResolver localVariableResolver = new PythonLocalVariableResolver(classResolver);
PythonMemberResolver resolver = new PythonMemberResolver(classResolver, localVariableResolver);
PythonResolverContext context = new PythonResolverContext(parseInfo, expression, "class Test:\r\npass");
Assert.DoesNotThrow(delegate { resolver.Resolve(context); });
}
}
}

38
src/AddIns/BackendBindings/Python/PythonBinding/Test/Resolver/ResolveRandomRandintTests.cs

@ -0,0 +1,38 @@ @@ -0,0 +1,38 @@
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
using System;
using ICSharpCode.PythonBinding;
using ICSharpCode.SharpDevelop.Dom;
using NUnit.Framework;
using PythonBinding.Tests.Utils;
namespace PythonBinding.Tests.Resolver
{
[TestFixture]
public class ResolveRandomRandintTests : ResolveTestsBase
{
protected override ExpressionResult GetExpressionResult()
{
return new ExpressionResult("self.randomNumber.randint", ExpressionContext.Default);
}
protected override string GetPythonScript()
{
return
"import random\r\n" +
"\r\n" +
"class Test:\r\n" +
" def __init__(self):\r\n" +
" self.randomNumber = random.random()\r\n" +
" self.randomNumber.randint\r\n" +
"\r\n";
}
[Test]
public void Resolve_RandomModuleCannotBeFound_NoNullRefererenceExceptionThrown()
{
Assert.IsNotNull(resolveResult as PythonMethodGroupResolveResult);
}
}
}

4
src/AddIns/BackendBindings/XamlBinding/XamlBinding/XamlCodeCompletionBinding.cs

@ -220,9 +220,9 @@ namespace ICSharpCode.XamlBinding @@ -220,9 +220,9 @@ namespace ICSharpCode.XamlBinding
start = "";
completionList.PreselectionLength = start.Length;
} else if (mrr.ResolvedType.FullyQualifiedName == "System.Windows.Media.FontFamily") {
string text = context.ValueStartOffset > -1 ? context.RawAttributeValue.Substring(0, Math.Min(context.ValueStartOffset + 1, context.RawAttributeValue.Length)) : "";
string text = context.ValueStartOffset > -1 ? context.RawAttributeValue.Substring(0, Math.Min(context.ValueStartOffset, context.RawAttributeValue.Length)) : "";
int lastComma = text.LastIndexOf(',');
completionList.PreselectionLength = lastComma == -1 ? context.ValueStartOffset + 1 : context.ValueStartOffset - lastComma;
completionList.PreselectionLength = lastComma == -1 ? context.ValueStartOffset : context.ValueStartOffset - lastComma - 1;
}
}
}

25
src/AddIns/BackendBindings/XamlBinding/XamlBinding/XamlParser.cs

@ -91,8 +91,8 @@ namespace ICSharpCode.XamlBinding @@ -91,8 +91,8 @@ namespace ICSharpCode.XamlBinding
public ICompilationUnit Parse(IProjectContent projectContent, string fileName, ITextBuffer fileContent)
{
//using (new DebugTimerObject("background parser")) {
// Core.LoggingService.Info("file: " + fileName);
ICompilationUnit compilationUnit;
using (ParseAndLock(fileContent)) {
var document = parser.LastDocument;
@ -101,9 +101,26 @@ namespace ICSharpCode.XamlBinding @@ -101,9 +101,26 @@ namespace ICSharpCode.XamlBinding
document.AcceptVisitor(visitor);
return visitor.CompilationUnit;
compilationUnit = visitor.CompilationUnit;
}
// During project load all XAML files are parsed
// most of them are not opened, thus fileContent.Version is null.
// We can clear the parser data, because the file will be reparsed
// as soon as it is opened by the user.
// This will save us some memory, because we only use the
// compilation unit created by the visitor above for code completion.
if (fileContent.Version == null) {
parser.Lock.EnterWriteLock();
// double-checked locking (other threads might parse the document in the meantime)
if (lastParsedVersion == null) {
parser.Clear();
}
parser.Lock.ExitWriteLock();
}
//}
return compilationUnit;
}
/// <summary>

2
src/AddIns/Debugger/Debugger.AddIn/Pads/CallStackPad.xaml.cs

@ -232,7 +232,7 @@ namespace ICSharpCode.SharpDevelop.Gui.Pads @@ -232,7 +232,7 @@ namespace ICSharpCode.SharpDevelop.Gui.Pads
}
if (showArgumentValues) {
try {
argValue = frame.GetArgumentValue(i).AsString;
argValue = frame.GetArgumentValue(i).AsString(100);
} catch { }
}
if (parameterName != null && argValue != null) {

7
src/AddIns/Debugger/Debugger.AddIn/Service/AttachToProcessForm.cs

@ -5,7 +5,9 @@ using System; @@ -5,7 +5,9 @@ using System;
using System.ComponentModel;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Windows.Forms;
using ICSharpCode.Core;
using ICSharpCode.SharpDevelop.Debugging;
using ICSharpCode.SharpDevelop.Gui;
@ -23,7 +25,10 @@ namespace ICSharpCode.SharpDevelop.Services @@ -23,7 +25,10 @@ namespace ICSharpCode.SharpDevelop.Services
{
this.process = process;
try {
managed = debugger.IsManaged(process.Id);
var modules = process.Modules.Cast<ProcessModule>().Where(
m => m.ModuleName.StartsWith("mscor", StringComparison.InvariantCultureIgnoreCase));
managed = modules.Count() > 0;
} catch { }
string fileName = Path.GetFileName(process.MainModule.FileName);

2
src/AddIns/Debugger/Debugger.AddIn/Service/WindowsDebugger.cs

@ -382,7 +382,7 @@ namespace ICSharpCode.SharpDevelop.Services @@ -382,7 +382,7 @@ namespace ICSharpCode.SharpDevelop.Services
try {
Value val = GetValueFromName(variableName);
if (val == null) return null;
return val.AsString;
return val.AsString();
} catch (GetValueException) {
return null;
}

2
src/AddIns/Debugger/Debugger.AddIn/TreeModel/ExpressionNode.cs

@ -215,7 +215,7 @@ namespace Debugger.AddIn.TreeModel @@ -215,7 +215,7 @@ namespace Debugger.AddIn.TreeModel
return;
}
} else {
fullText = val.AsString;
fullText = val.AsString();
}
this.Text = (fullText.Length > 256) ? fullText.Substring(0, 256) + "..." : fullText;

4
src/AddIns/Debugger/Debugger.AddIn/Visualizers/Utils/DebuggerHelpers.cs

@ -88,11 +88,11 @@ namespace Debugger.AddIn.Visualizers.Utils @@ -88,11 +88,11 @@ namespace Debugger.AddIn.Visualizers.Utils
// value.InvokeMethod is nice for instance methods.
// what about MethodInfo.Invoke() ?
// also, there could be an overload that takes 1 parameter instead of array
string defaultHashCode = Eval.InvokeMethod(DebuggerHelpers.hashCodeMethod, null, new Value[]{value}).AsString;
Value defaultHashCode = Eval.InvokeMethod(DebuggerHelpers.hashCodeMethod, null, new Value[]{value});
//MethodInfo method = value.Type.GetMember("GetHashCode", BindingFlags.Method | BindingFlags.IncludeSuperType) as MethodInfo;
//string hashCode = value.InvokeMethod(method, null).AsString;
return int.Parse(defaultHashCode);
return (int)defaultHashCode.PrimitiveValue;
}
public static Value EvalPermanentReference(this Expression expr)

4
src/AddIns/Debugger/Debugger.Core/Exception.cs

@ -33,7 +33,7 @@ namespace Debugger @@ -33,7 +33,7 @@ namespace Debugger
public string Message {
get {
Value message = exception.GetMemberValue("_message");
return message.IsNull ? string.Empty : message.AsString;
return message.IsNull ? string.Empty : message.AsString();
}
}
@ -86,7 +86,7 @@ namespace Debugger @@ -86,7 +86,7 @@ namespace Debugger
// Note that evaluation is not possible after a stackoverflow exception
Value stackTrace = exception.GetMemberValue("StackTrace");
if (!stackTrace.IsNull) {
sb.Append(stackTrace.AsString);
sb.Append(stackTrace.AsString());
sb.AppendLine();
}
return sb.ToString();

2
src/AddIns/Debugger/Debugger.Core/Thread.cs

@ -156,7 +156,7 @@ namespace Debugger @@ -156,7 +156,7 @@ namespace Debugger
if (runtimeValue.IsNull) return string.Empty;
Value runtimeName = runtimeValue.GetMemberValue("m_Name");
if (runtimeName.IsNull) return string.Empty;
return runtimeName.AsString.ToString();
return runtimeName.AsString(100);
}
}

37
src/AddIns/Debugger/Debugger.Core/Value.cs

@ -114,7 +114,7 @@ namespace Debugger @@ -114,7 +114,7 @@ namespace Debugger
public bool IsInvalid {
get {
return corValue_pauseSession != this.Process.PauseSession &&
!(corValue is ICorDebugHandleValue);
!(corValue is ICorDebugHandleValue);
}
}
@ -149,12 +149,23 @@ namespace Debugger @@ -149,12 +149,23 @@ namespace Debugger
}
/// <summary> Gets a string representation of the value </summary>
public string AsString {
get {
if (this.IsNull) return "null";
if (this.Type.IsPrimitive) return PrimitiveValue.ToString();
if (this.Type.FullName == typeof(string).FullName) return PrimitiveValue.ToString();
return "{" + this.Type.FullName + "}";
/// <param name="maxLength">
/// The maximum length of the result string.
/// </param>
public string AsString(int maxLength = int.MaxValue)
{
if (this.IsNull) return "null";
if (this.Type.IsPrimitive || this.Type.FullName == typeof(string).FullName) {
string text = PrimitiveValue.ToString();
if (text != null && text.Length > maxLength)
text = text.Substring(0, Math.Max(0, maxLength - 3)) + "...";
return text;
} else {
string name = this.Type.FullName;
if (name != null && name.Length > maxLength)
return "{" + name.Substring(0, Math.Max(0, maxLength - 5)) + "...}";
else
return "{" + name + "}";
}
}
@ -600,14 +611,14 @@ namespace Debugger @@ -600,14 +611,14 @@ namespace Debugger
}
/// <summary> Invoke the ToString() method </summary>
public string InvokeToString()
public string InvokeToString(int maxLength = int.MaxValue)
{
if (this.Type.IsPrimitive) return AsString;
if (this.Type.FullName == typeof(string).FullName) return AsString;
if (this.Type.IsPrimitive) return AsString(maxLength);
if (this.Type.FullName == typeof(string).FullName) return AsString(maxLength);
if (this.Type.IsPointer) return "0x" + this.PointerAddress.ToString("X");
// if (!IsObject) // Can invoke on primitives
DebugMethodInfo methodInfo = (DebugMethodInfo)this.AppDomain.ObjectType.GetMethod("ToString", new DebugType[] {});
return Eval.InvokeMethod(methodInfo, this, new Value[] {}).AsString;
return Eval.InvokeMethod(methodInfo, this, new Value[] {}).AsString(maxLength);
}
#region Convenience overload methods
@ -636,9 +647,7 @@ namespace Debugger @@ -636,9 +647,7 @@ namespace Debugger
public override string ToString()
{
return this.AsString;
return this.AsString();
}
}
}

2
src/AddIns/Debugger/Debugger.Tests/Tests/AppDomain_Tests.cs

@ -43,7 +43,7 @@ namespace Debugger.Tests { @@ -43,7 +43,7 @@ namespace Debugger.Tests {
DebugType type1b = process.SelectedStackFrame.GetLocalVariableValue("one").Type;
ObjectDump("SameDomainEqual", type1 == type1b);
process.Continue();
ObjectDump("AppDomainName", process.SelectedStackFrame.GetLocalVariableValue("appDomainName").AsString);
ObjectDump("AppDomainName", process.SelectedStackFrame.GetLocalVariableValue("appDomainName").AsString());
DebugType type2 = process.SelectedStackFrame.GetLocalVariableValue("two").Type;
ObjectDump("OtherDomainEqual", type1 == type2);
ObjectDump("AppDomainsEqual", type1.AppDomain == type2.AppDomain);

4
src/AddIns/Debugger/Debugger.Tests/Tests/ExpressionEvaluator_Tests.cs

@ -264,9 +264,9 @@ namespace Debugger.Tests { @@ -264,9 +264,9 @@ namespace Debugger.Tests {
ObjectDump("TypesIdentitcal", object.ReferenceEquals(locType, valType));
ObjectDump("TypesEqual", locType == valType);
ObjectDump("WorkerThreadMoved", process.SelectedStackFrame.GetThisValue().GetMemberValue("WorkerThreadMoved").AsString);
ObjectDump("WorkerThreadMoved", process.SelectedStackFrame.GetThisValue().GetMemberValue("WorkerThreadMoved").AsString());
process.Continue();
ObjectDump("WorkerThreadMoved", process.SelectedStackFrame.GetThisValue().GetMemberValue("WorkerThreadMoved").AsString);
ObjectDump("WorkerThreadMoved", process.SelectedStackFrame.GetThisValue().GetMemberValue("WorkerThreadMoved").AsString());
EndTest();
}

20
src/AddIns/Debugger/Debugger.Tests/Tests/StackFrame_VariablesLifetime.cs

@ -97,26 +97,22 @@ namespace Debugger.Tests { @@ -97,26 +97,22 @@ namespace Debugger.Tests {
<DebuggingPaused>Break StackFrame_VariablesLifetime.cs:21,4-21,40</DebuggingPaused>
<argument>
<Value
AsString="1"
PrimitiveValue="1"
Type="System.Int32" />
</argument>
<local>
<Value
AsString="2"
PrimitiveValue="2"
Type="System.Int32" />
</local>
<_x0040_class>
<Value
AsString="3"
PrimitiveValue="3"
Type="System.Int32" />
</_x0040_class>
<DebuggingPaused>Break StackFrame_VariablesLifetime.cs:30,4-30,40</DebuggingPaused>
<argument>
<Value
AsString="{Exception: Value is no longer valid}"
IsInvalid="True"
IsReference="{Exception: Value is no longer valid}"
PrimitiveValue="{Exception: Value is no longer valid}"
@ -124,7 +120,6 @@ namespace Debugger.Tests { @@ -124,7 +120,6 @@ namespace Debugger.Tests {
</argument>
<local>
<Value
AsString="{Exception: Value is no longer valid}"
IsInvalid="True"
IsReference="{Exception: Value is no longer valid}"
PrimitiveValue="{Exception: Value is no longer valid}"
@ -132,7 +127,6 @@ namespace Debugger.Tests { @@ -132,7 +127,6 @@ namespace Debugger.Tests {
</local>
<_x0040_class>
<Value
AsString="{Exception: Value is no longer valid}"
IsInvalid="True"
IsReference="{Exception: Value is no longer valid}"
PrimitiveValue="{Exception: Value is no longer valid}"
@ -140,14 +134,12 @@ namespace Debugger.Tests { @@ -140,14 +134,12 @@ namespace Debugger.Tests {
</_x0040_class>
<localInSubFunction>
<Value
AsString="4"
PrimitiveValue="4"
Type="System.Int32" />
</localInSubFunction>
<DebuggingPaused>Break StackFrame_VariablesLifetime.cs:23,4-23,40</DebuggingPaused>
<argument>
<Value
AsString="{Exception: Value is no longer valid}"
IsInvalid="True"
IsReference="{Exception: Value is no longer valid}"
PrimitiveValue="{Exception: Value is no longer valid}"
@ -155,7 +147,6 @@ namespace Debugger.Tests { @@ -155,7 +147,6 @@ namespace Debugger.Tests {
</argument>
<local>
<Value
AsString="{Exception: Value is no longer valid}"
IsInvalid="True"
IsReference="{Exception: Value is no longer valid}"
PrimitiveValue="{Exception: Value is no longer valid}"
@ -163,7 +154,6 @@ namespace Debugger.Tests { @@ -163,7 +154,6 @@ namespace Debugger.Tests {
</local>
<_x0040_class>
<Value
AsString="{Exception: Value is no longer valid}"
IsInvalid="True"
IsReference="{Exception: Value is no longer valid}"
PrimitiveValue="{Exception: Value is no longer valid}"
@ -171,7 +161,6 @@ namespace Debugger.Tests { @@ -171,7 +161,6 @@ namespace Debugger.Tests {
</_x0040_class>
<localInSubFunction>
<Value
AsString="{Exception: Value is no longer valid}"
IsInvalid="True"
IsReference="{Exception: Value is no longer valid}"
PrimitiveValue="{Exception: Value is no longer valid}"
@ -180,7 +169,6 @@ namespace Debugger.Tests { @@ -180,7 +169,6 @@ namespace Debugger.Tests {
<DebuggingPaused>Break StackFrame_VariablesLifetime.cs:30,4-30,40</DebuggingPaused>
<argument>
<Value
AsString="{Exception: Value is no longer valid}"
IsInvalid="True"
IsReference="{Exception: Value is no longer valid}"
PrimitiveValue="{Exception: Value is no longer valid}"
@ -188,7 +176,6 @@ namespace Debugger.Tests { @@ -188,7 +176,6 @@ namespace Debugger.Tests {
</argument>
<local>
<Value
AsString="{Exception: Value is no longer valid}"
IsInvalid="True"
IsReference="{Exception: Value is no longer valid}"
PrimitiveValue="{Exception: Value is no longer valid}"
@ -196,7 +183,6 @@ namespace Debugger.Tests { @@ -196,7 +183,6 @@ namespace Debugger.Tests {
</local>
<_x0040_class>
<Value
AsString="{Exception: Value is no longer valid}"
IsInvalid="True"
IsReference="{Exception: Value is no longer valid}"
PrimitiveValue="{Exception: Value is no longer valid}"
@ -204,7 +190,6 @@ namespace Debugger.Tests { @@ -204,7 +190,6 @@ namespace Debugger.Tests {
</_x0040_class>
<localInSubFunction>
<Value
AsString="{Exception: Value is no longer valid}"
IsInvalid="True"
IsReference="{Exception: Value is no longer valid}"
PrimitiveValue="{Exception: Value is no longer valid}"
@ -212,14 +197,12 @@ namespace Debugger.Tests { @@ -212,14 +197,12 @@ namespace Debugger.Tests {
</localInSubFunction>
<localInSubFunction_x0028_new_x0029_>
<Value
AsString="4"
PrimitiveValue="4"
Type="System.Int32" />
</localInSubFunction_x0028_new_x0029_>
<DebuggingPaused>Break StackFrame_VariablesLifetime.cs:15,4-15,40</DebuggingPaused>
<argument>
<Value
AsString="{Exception: Value is no longer valid}"
IsInvalid="True"
IsReference="{Exception: Value is no longer valid}"
PrimitiveValue="{Exception: Value is no longer valid}"
@ -227,7 +210,6 @@ namespace Debugger.Tests { @@ -227,7 +210,6 @@ namespace Debugger.Tests {
</argument>
<local>
<Value
AsString="{Exception: Value is no longer valid}"
IsInvalid="True"
IsReference="{Exception: Value is no longer valid}"
PrimitiveValue="{Exception: Value is no longer valid}"
@ -235,7 +217,6 @@ namespace Debugger.Tests { @@ -235,7 +217,6 @@ namespace Debugger.Tests {
</local>
<_x0040_class>
<Value
AsString="{Exception: Value is no longer valid}"
IsInvalid="True"
IsReference="{Exception: Value is no longer valid}"
PrimitiveValue="{Exception: Value is no longer valid}"
@ -243,7 +224,6 @@ namespace Debugger.Tests { @@ -243,7 +224,6 @@ namespace Debugger.Tests {
</_x0040_class>
<localInSubFunction>
<Value
AsString="{Exception: Value is no longer valid}"
IsInvalid="True"
IsReference="{Exception: Value is no longer valid}"
PrimitiveValue="{Exception: Value is no longer valid}"

4
src/AddIns/Debugger/Debugger.Tests/Tests/Value_Tests.cs

@ -103,7 +103,6 @@ namespace Debugger.Tests { @@ -103,7 +103,6 @@ namespace Debugger.Tests {
</LocalVariables>
<array.Length>
<Value
AsString="4"
PrimitiveValue="4"
Type="System.Int32" />
</array.Length>
@ -112,7 +111,6 @@ namespace Debugger.Tests { @@ -112,7 +111,6 @@ namespace Debugger.Tests {
ArrayDimensions="{2, 2}"
ArrayLength="4"
ArrayRank="2"
AsString="{System.Int32[,]}"
GetArrayElements="{0, 1, 2, 3}"
IsReference="True"
PrimitiveValue="{Exception: Value is not a primitive type}"
@ -123,7 +121,6 @@ namespace Debugger.Tests { @@ -123,7 +121,6 @@ namespace Debugger.Tests {
ArrayDimensions="{10..11, 20..21}"
ArrayLength="4"
ArrayRank="2"
AsString="{System.Char[,]}"
GetArrayElements="{a, b, c, d}"
IsReference="True"
PrimitiveValue="{Exception: Value is not a primitive type}"
@ -131,7 +128,6 @@ namespace Debugger.Tests { @@ -131,7 +128,6 @@ namespace Debugger.Tests {
</lbArray>
<lbArray-10-20>
<Value
AsString="a"
PrimitiveValue="a"
Type="System.Char" />
</lbArray-10-20>

32
src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/BracketHighlightRenderer.cs

@ -2,8 +2,10 @@ @@ -2,8 +2,10 @@
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Windows.Media;
using ICSharpCode.AvalonEdit.Document;
using ICSharpCode.AvalonEdit.Rendering;
using ICSharpCode.SharpDevelop.Editor;
@ -17,6 +19,11 @@ namespace ICSharpCode.AvalonEdit.AddIn @@ -17,6 +19,11 @@ namespace ICSharpCode.AvalonEdit.AddIn
Brush backgroundBrush;
TextView textView;
public static readonly Color DefaultBackground = Color.FromArgb(22, 0, 0, 255);
public static readonly Color DefaultBorder = Color.FromArgb(52, 0, 0, 255);
public const string BracketHighlight = "Bracket highlight";
public void SetHighlight(BracketSearchResult result)
{
if (this.result != result) {
@ -30,17 +37,20 @@ namespace ICSharpCode.AvalonEdit.AddIn @@ -30,17 +37,20 @@ namespace ICSharpCode.AvalonEdit.AddIn
if (textView == null)
throw new ArgumentNullException("textView");
this.borderPen = new Pen(new SolidColorBrush(Color.FromArgb(52, 0, 0, 255)), 1);
this.borderPen.Freeze();
this.backgroundBrush = new SolidColorBrush(Color.FromArgb(22, 0, 0, 255));
this.backgroundBrush.Freeze();
this.textView = textView;
this.textView.BackgroundRenderers.Add(this);
}
void UpdateColors(Color background, Color foreground)
{
this.borderPen = new Pen(new SolidColorBrush(foreground), 1);
this.borderPen.Freeze();
this.backgroundBrush = new SolidColorBrush(background);
this.backgroundBrush.Freeze();
}
public KnownLayer Layer {
get {
return KnownLayer.Selection;
@ -66,5 +76,15 @@ namespace ICSharpCode.AvalonEdit.AddIn @@ -66,5 +76,15 @@ namespace ICSharpCode.AvalonEdit.AddIn
drawingContext.DrawGeometry(backgroundBrush, borderPen, geometry);
}
}
public static void ApplyCustomizationsToRendering(BracketHighlightRenderer renderer, IEnumerable<CustomizedHighlightingColor> customizations)
{
renderer.UpdateColors(DefaultBackground, DefaultBorder);
foreach (CustomizedHighlightingColor color in customizations) {
if (color.Name == BracketHighlight) {
renderer.UpdateColors(color.Background ?? Colors.Blue, color.Foreground ?? Colors.Blue);
}
}
}
}
}

20
src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/CaretReferencesRenderer.cs

@ -3,6 +3,7 @@ @@ -3,6 +3,7 @@
using System;
using System.Collections.Generic;
using System.Threading;
using System.Windows.Threading;
using ICSharpCode.AvalonEdit.AddIn.Options;
@ -10,6 +11,7 @@ using ICSharpCode.Core; @@ -10,6 +11,7 @@ using ICSharpCode.Core;
using ICSharpCode.SharpDevelop;
using ICSharpCode.SharpDevelop.Dom;
using ICSharpCode.SharpDevelop.Editor;
using ICSharpCode.SharpDevelop.Gui;
using ICSharpCode.SharpDevelop.Refactoring;
namespace ICSharpCode.AvalonEdit.AddIn
@ -127,10 +129,20 @@ namespace ICSharpCode.AvalonEdit.AddIn @@ -127,10 +129,20 @@ namespace ICSharpCode.AvalonEdit.AddIn
/// </summary>
List<Reference> GetReferencesInCurrentFile(ResolveResult resolveResult)
{
var references = RefactoringService.FindReferencesLocal(resolveResult, Editor.FileName, null);
if (references == null || references.Count == 0)
return null;
return references;
var cancellationTokenSource = new CancellationTokenSource();
using (new Timer(
delegate {
LoggingService.Debug("Aborting GetReferencesInCurrentFile due to timeout");
cancellationTokenSource.Cancel();
}, null, 200, Timeout.Infinite))
{
var progressMonitor = new DummyProgressMonitor();
progressMonitor.CancellationToken = cancellationTokenSource.Token;
var references = RefactoringService.FindReferencesLocal(resolveResult, Editor.FileName, progressMonitor);
if (references == null || references.Count == 0)
return null;
return references;
}
}
/// <summary>

8
src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/CodeEditor.cs

@ -217,10 +217,11 @@ namespace ICSharpCode.AvalonEdit.AddIn @@ -217,10 +217,11 @@ namespace ICSharpCode.AvalonEdit.AddIn
TextCopied(this, e);
}
protected virtual void DisposeTextEditor(TextEditor textEditor)
protected virtual void DisposeTextEditor(CodeEditorView textEditor)
{
// detach IconBarMargin from IconBarManager
textEditor.TextArea.LeftMargins.OfType<IconBarMargin>().Single().TextView = null;
textEditor.Dispose();
}
void textEditor_GotFocus(object sender, RoutedEventArgs e)
@ -332,9 +333,9 @@ namespace ICSharpCode.AvalonEdit.AddIn @@ -332,9 +333,9 @@ namespace ICSharpCode.AvalonEdit.AddIn
// remove secondary editor
this.Children.Remove(secondaryTextEditor);
this.Children.Remove(gridSplitter);
secondaryTextEditorAdapter.Language.Detach();
DisposeTextEditor(secondaryTextEditor);
secondaryTextEditor = null;
secondaryTextEditorAdapter.Language.Detach();
secondaryTextEditorAdapter = null;
gridSplitter = null;
this.RowDefinitions.RemoveAt(this.RowDefinitions.Count - 1);
@ -574,6 +575,9 @@ namespace ICSharpCode.AvalonEdit.AddIn @@ -574,6 +575,9 @@ namespace ICSharpCode.AvalonEdit.AddIn
if (errorPainter != null)
errorPainter.Dispose();
this.Document = null;
DisposeTextEditor(primaryTextEditor);
if (secondaryTextEditor != null)
DisposeTextEditor(secondaryTextEditor);
}
}
}

20
src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/CodeEditorView.cs

@ -36,7 +36,7 @@ namespace ICSharpCode.AvalonEdit.AddIn @@ -36,7 +36,7 @@ namespace ICSharpCode.AvalonEdit.AddIn
/// There can be two CodeEditorView instances in a single CodeEditor if split-view
/// is enabled.
/// </summary>
public class CodeEditorView : SharpDevelopTextEditor
public class CodeEditorView : SharpDevelopTextEditor, IDisposable
{
public ITextEditor Adapter { get; set; }
@ -48,21 +48,34 @@ namespace ICSharpCode.AvalonEdit.AddIn @@ -48,21 +48,34 @@ namespace ICSharpCode.AvalonEdit.AddIn
{
this.CommandBindings.Add(new CommandBinding(ApplicationCommands.Help, OnHelpExecuted));
UpdateCustomizedHighlighting();
this.bracketRenderer = new BracketHighlightRenderer(this.TextArea.TextView);
this.caretReferencesRenderer = new CaretReferencesRenderer(this);
this.contextActionsRenderer = new ContextActionsRenderer(this);
UpdateCustomizedHighlighting();
this.MouseHover += TextEditorMouseHover;
this.MouseHoverStopped += TextEditorMouseHoverStopped;
this.MouseLeave += TextEditorMouseLeave;
this.TextArea.TextView.MouseDown += TextViewMouseDown;
this.TextArea.Caret.PositionChanged += HighlightBrackets;
this.TextArea.TextView.VisualLinesChanged += CodeEditorView_VisualLinesChanged;
SetupTabSnippetHandler();
}
void CodeEditorView_VisualLinesChanged(object sender, EventArgs e)
{
// hide tooltip
if (this.toolTip != null)
this.toolTip.IsOpen = false;
}
public virtual void Dispose()
{
contextActionsRenderer.Dispose();
}
protected override string FileName {
get { return this.Adapter.FileName; }
}
@ -491,6 +504,7 @@ namespace ICSharpCode.AvalonEdit.AddIn @@ -491,6 +504,7 @@ namespace ICSharpCode.AvalonEdit.AddIn
{
string language = this.SyntaxHighlighting != null ? this.SyntaxHighlighting.Name : null;
CustomizableHighlightingColorizer.ApplyCustomizationsToDefaultElements(this, FetchCustomizations(language));
BracketHighlightRenderer.ApplyCustomizationsToRendering(this.bracketRenderer, FetchCustomizations(language));
this.TextArea.TextView.Redraw(); // manually redraw if default elements didn't change but customized highlightings did
}

44
src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/ContextActionsRenderer.cs

@ -18,7 +18,7 @@ namespace ICSharpCode.AvalonEdit.AddIn @@ -18,7 +18,7 @@ namespace ICSharpCode.AvalonEdit.AddIn
/// <summary>
/// Renders Popup with context actions on the left side of the current line in the editor.
/// </summary>
public class ContextActionsRenderer
public sealed class ContextActionsRenderer : IDisposable
{
readonly CodeEditorView editorView;
ITextEditor Editor { get { return this.editorView.Adapter; } }
@ -36,12 +36,11 @@ namespace ICSharpCode.AvalonEdit.AddIn @@ -36,12 +36,11 @@ namespace ICSharpCode.AvalonEdit.AddIn
public bool IsEnabled
{
get {
try {
string fileName = this.Editor.FileName;
return fileName.EndsWith(".cs") || fileName.EndsWith(".vb");
} catch {
string fileName = this.Editor.FileName;
if (String.IsNullOrEmpty(fileName))
return false;
}
return fileName.EndsWith(".cs", StringComparison.OrdinalIgnoreCase)
|| fileName.EndsWith(".vb", StringComparison.OrdinalIgnoreCase);
}
}
@ -59,10 +58,16 @@ namespace ICSharpCode.AvalonEdit.AddIn @@ -59,10 +58,16 @@ namespace ICSharpCode.AvalonEdit.AddIn
this.delayMoveTimer = new DispatcherTimer() { Interval = TimeSpan.FromMilliseconds(delayMoveMilliseconds) };
this.delayMoveTimer.Stop();
this.delayMoveTimer.Tick += TimerMoveTick;
WorkbenchSingleton.Workbench.ViewClosed += WorkbenchSingleton_Workbench_ViewClosed;
WorkbenchSingleton.Workbench.ActiveViewContentChanged += WorkbenchSingleton_Workbench_ActiveViewContentChanged;
}
public void Dispose()
{
ClosePopup();
WorkbenchSingleton.Workbench.ActiveViewContentChanged -= WorkbenchSingleton_Workbench_ActiveViewContentChanged;
delayMoveTimer.Stop();
}
void ContextActionsRenderer_KeyDown(object sender, KeyEventArgs e)
{
if (this.popup == null)
@ -139,27 +144,14 @@ namespace ICSharpCode.AvalonEdit.AddIn @@ -139,27 +144,14 @@ namespace ICSharpCode.AvalonEdit.AddIn
this.lastActions = null;
}
}
void WorkbenchSingleton_Workbench_ViewClosed(object sender, ViewContentEventArgs e)
{
try {
// prevent memory leaks
if (e.Content.PrimaryFileName == this.Editor.FileName) {
WorkbenchSingleton.Workbench.ViewClosed -= WorkbenchSingleton_Workbench_ViewClosed;
WorkbenchSingleton.Workbench.ActiveViewContentChanged -= WorkbenchSingleton_Workbench_ActiveViewContentChanged;
ClosePopup();
}
} catch {}
}
void WorkbenchSingleton_Workbench_ActiveViewContentChanged(object sender, EventArgs e)
{
ClosePopup();
try {
// open the popup again if in current file
if (((IViewContent)WorkbenchSingleton.Workbench.ActiveContent).PrimaryFileName == this.Editor.FileName)
CaretPositionChanged(this, EventArgs.Empty);
} catch {}
// open the popup again if in current file
IViewContent activeViewContent = WorkbenchSingleton.Workbench.ActiveViewContent;
if (activeViewContent != null && activeViewContent.PrimaryFileName == this.Editor.FileName)
CaretPositionChanged(this, EventArgs.Empty);
else // otherwise close popup
ClosePopup();
}
}
}

27
src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/CustomizableHighlightingColorizer.cs

@ -6,8 +6,8 @@ using System.Collections.Generic; @@ -6,8 +6,8 @@ using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Media;
using ICSharpCode.AvalonEdit.Document;
using ICSharpCode.AvalonEdit.Editing;
using ICSharpCode.AvalonEdit.Highlighting;
@ -22,16 +22,23 @@ namespace ICSharpCode.AvalonEdit.AddIn @@ -22,16 +22,23 @@ namespace ICSharpCode.AvalonEdit.AddIn
{
public const string DefaultTextAndBackground = "Default text/background";
public const string SelectedText = "Selected text";
public const string NonPrintableCharacters = "Non-printable characters";
public const string LineNumbers = "Line numbers";
public static void ApplyCustomizationsToDefaultElements(TextEditor textEditor, IEnumerable<CustomizedHighlightingColor> customizations)
{
textEditor.ClearValue(TextEditor.BackgroundProperty);
textEditor.ClearValue(TextEditor.ForegroundProperty);
textEditor.ClearValue(TextEditor.LineNumbersForegroundProperty);
textEditor.TextArea.ClearValue(TextArea.SelectionBorderProperty);
textEditor.TextArea.ClearValue(TextArea.SelectionBrushProperty);
textEditor.TextArea.ClearValue(TextArea.SelectionForegroundProperty);
textEditor.TextArea.TextView.ClearValue(TextView.NonPrintableCharacterBrushProperty);
bool assignedDefaultText = false;
bool assignedSelectedText = false;
bool assignedNonPrintableCharacter = false;
bool assignedLineNumbers = false;
foreach (CustomizedHighlightingColor color in customizations) {
switch (color.Name) {
case DefaultTextAndBackground:
@ -54,7 +61,7 @@ namespace ICSharpCode.AvalonEdit.AddIn @@ -54,7 +61,7 @@ namespace ICSharpCode.AvalonEdit.AddIn
pen.Freeze();
textEditor.TextArea.SelectionBorder = pen;
SolidColorBrush back = new SolidColorBrush(color.Background.Value);
back.Opacity = 0.7;
back.Opacity = 0.7; // TODO : remove this constant, let the use choose the opacity.
back.Freeze();
textEditor.TextArea.SelectionBrush = back;
}
@ -62,6 +69,22 @@ namespace ICSharpCode.AvalonEdit.AddIn @@ -62,6 +69,22 @@ namespace ICSharpCode.AvalonEdit.AddIn
textEditor.TextArea.SelectionForeground = CreateFrozenBrush(color.Foreground.Value);
}
break;
case NonPrintableCharacters:
if (assignedNonPrintableCharacter)
continue;
assignedNonPrintableCharacter = true;
if (color.Foreground != null)
textEditor.TextArea.TextView.NonPrintableCharacterBrush = CreateFrozenBrush(color.Foreground.Value);
break;
case LineNumbers:
if (assignedLineNumbers)
continue;
assignedLineNumbers = true;
if (color.Foreground != null)
textEditor.LineNumbersForeground = CreateFrozenBrush(color.Foreground.Value);
break;
}
}
}

64
src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/Options/HighlightingOptions.xaml.cs

@ -10,11 +10,13 @@ using System.Windows; @@ -10,11 +10,13 @@ using System.Windows;
using System.Windows.Controls;
using System.Windows.Media;
using System.Xml;
using ICSharpCode.AvalonEdit.Editing;
using ICSharpCode.AvalonEdit.Highlighting;
using ICSharpCode.AvalonEdit.Highlighting.Xshd;
using ICSharpCode.AvalonEdit.Rendering;
using ICSharpCode.SharpDevelop.Bookmarks;
using ICSharpCode.SharpDevelop.Editor;
using ICSharpCode.SharpDevelop.Editor.AvalonEdit;
using ICSharpCode.SharpDevelop.Gui;
namespace ICSharpCode.AvalonEdit.AddIn.Options
@ -29,9 +31,13 @@ namespace ICSharpCode.AvalonEdit.AddIn.Options @@ -29,9 +31,13 @@ namespace ICSharpCode.AvalonEdit.AddIn.Options
InitializeComponent();
textEditor.Document.UndoStack.SizeLimit = 0;
textEditor.Options = CodeEditorOptions.Instance;
bracketHighlighter = new BracketHighlightRenderer(textEditor.TextArea.TextView);
CodeEditorOptions.Instance.BindToTextEditor(textEditor);
}
BracketHighlightRenderer bracketHighlighter;
List<CustomizedHighlightingColor> customizationList;
XshdSyntaxDefinition LoadBuiltinXshd(string name)
@ -132,6 +138,61 @@ namespace ICSharpCode.AvalonEdit.AddIn.Options @@ -132,6 +138,61 @@ namespace ICSharpCode.AvalonEdit.AddIn.Options
selectedText = new CustomizedHighlightingItem(customizationList, selectedText, language, canSetFont: false);
selectedText.PropertyChanged += item_PropertyChanged;
listBox.Items.Add(selectedText);
// Create entry for "Non-printable characters"
IHighlightingItem nonPrintChars = new SimpleHighlightingItem(
CustomizableHighlightingColorizer.NonPrintableCharacters,
ta => {
ta.Document.Text = " \r \r\n \n";
})
{
Foreground = Colors.LightGray
};
nonPrintChars = new CustomizedHighlightingItem(customizationList, nonPrintChars, null, canSetFont: false, canSetBackground: false);
if (language != null)
nonPrintChars = new CustomizedHighlightingItem(customizationList, nonPrintChars, language, canSetFont: false);
nonPrintChars.PropertyChanged += item_PropertyChanged;
listBox.Items.Add(nonPrintChars);
// Create entry for "Line numbers"
IHighlightingItem lineNumbers = new SimpleHighlightingItem(
CustomizableHighlightingColorizer.LineNumbers,
ta => {
ta.Document.Text = "These are just" + Environment.NewLine +
"multiple" + Environment.NewLine +
"lines of" + Environment.NewLine +
"text";
})
{
Foreground = Colors.Gray
};
lineNumbers = new CustomizedHighlightingItem(customizationList, lineNumbers, null, canSetFont: false, canSetBackground: false);
if (language != null)
lineNumbers = new CustomizedHighlightingItem(customizationList, lineNumbers, language, canSetFont: false);
lineNumbers.PropertyChanged += item_PropertyChanged;
listBox.Items.Add(lineNumbers);
// Create entry for "Bracket highlight"
IHighlightingItem bracketHighlight = new SimpleHighlightingItem(
BracketHighlightRenderer.BracketHighlight,
ta => {
ta.Document.Text = "(simple) example";
XshdSyntaxDefinition xshd = (XshdSyntaxDefinition)languageComboBox.SelectedItem;
if (xshd == null)
return;
var customizationsForCurrentLanguage = customizationList.Where(c => c.Language == null || c.Language == xshd.Name);
BracketHighlightRenderer.ApplyCustomizationsToRendering(bracketHighlighter, customizationsForCurrentLanguage);
bracketHighlighter.SetHighlight(new BracketSearchResult(0, 1, 7, 1));
})
{
Foreground = BracketHighlightRenderer.DefaultBorder,
Background = BracketHighlightRenderer.DefaultBackground
};
bracketHighlight = new CustomizedHighlightingItem(customizationList, bracketHighlight, null, canSetFont: false);
if (language != null)
bracketHighlight = new CustomizedHighlightingItem(customizationList, bracketHighlight, language, canSetFont: false);
bracketHighlight.PropertyChanged += item_PropertyChanged;
listBox.Items.Add(bracketHighlight);
}
void item_PropertyChanged(object sender, PropertyChangedEventArgs e)
@ -175,6 +236,7 @@ namespace ICSharpCode.AvalonEdit.AddIn.Options @@ -175,6 +236,7 @@ namespace ICSharpCode.AvalonEdit.AddIn.Options
textView.LineTransformers.Add(colorizer);
}
textEditor.Select(0, 0);
bracketHighlighter.SetHighlight(null);
item.ShowExample(textEditor.TextArea);
}
}

39
src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/Controls/GridAdorner.cs

@ -433,34 +433,37 @@ namespace ICSharpCode.WpfDesign.Designer.Controls @@ -433,34 +433,37 @@ namespace ICSharpCode.WpfDesign.Designer.Controls
public void SetGridLengthUnit(GridUnitType unit)
{
DesignItem item = unitSelector.SelectedItem;
GridLength value;
grid.UpdateLayout();
Debug.Assert(item != null);
if (orientation == Orientation.Vertical) {
value = (GridLength)item.Properties[RowDefinition.HeightProperty].ValueOnInstance;
if (unit == GridUnitType.Auto)
value = GridLength.Auto;
else
value = new GridLength(value.Value, unit);
item.Properties[RowDefinition.HeightProperty].SetValue(value);
SetGridLengthUnit(unit, item, RowDefinition.HeightProperty);
} else {
value = (GridLength)item.Properties[ColumnDefinition.WidthProperty].ValueOnInstance;
if (unit == GridUnitType.Auto)
value = GridLength.Auto;
else
value = new GridLength(value.Value, unit);
item.Properties[ColumnDefinition.WidthProperty].SetValue(value);
SetGridLengthUnit(unit, item, ColumnDefinition.WidthProperty);
}
grid.UpdateLayout();
InvalidateVisual();
}
void SetGridLengthUnit(GridUnitType unit, DesignItem item, DependencyProperty property)
{
DesignItemProperty itemProperty = item.Properties[property];
GridLength oldValue = (GridLength)itemProperty.ValueOnInstance;
GridLength value = GetNewGridLength(unit, oldValue);
if (value != oldValue) {
itemProperty.SetValue(value);
}
}
GridLength GetNewGridLength(GridUnitType unit, GridLength oldValue)
{
if (unit == GridUnitType.Auto) {
return GridLength.Auto;
}
return new GridLength(oldValue.Value, unit);
}
}
public abstract class GridSplitterAdorner : Control

10
src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/PropertyGrid/Editors/BrushEditor/SolidBrushEditor.xaml

@ -1,14 +1,12 @@ @@ -1,14 +1,12 @@
<UserControl
x:Class="ICSharpCode.WpfDesign.Designer.PropertyGrid.Editors.BrushEditor.SolidBrushEditor"
<UserControl x:Class="ICSharpCode.WpfDesign.Designer.PropertyGrid.Editors.BrushEditor.SolidBrushEditor"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:BrushEditor="clr-namespace:ICSharpCode.WpfDesign.Designer.PropertyGrid.Editors.BrushEditor"
xmlns:widgets="http://icsharpcode.net/sharpdevelop/widgets"
x:Name="this"
Height="284"
>
Height="284">
<TabControl>
<TabItem Header="Color Picker">
<BrushEditor:ColorPicker Color="{Binding Color, ElementName=this}" />
<widgets:ColorPicker Color="{Binding Color, ElementName=this}" />
</TabItem>
<TabItem Header="Color List">
<ListBox ItemsSource="{Binding AvailableColors}"

9
src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/WpfDesign.Designer.csproj

@ -165,10 +165,6 @@ @@ -165,10 +165,6 @@
<Compile Include="PropertyGrid\Editors\BrushEditor\BrushTypeEditor.xaml.cs">
<DependentUpon>BrushTypeEditor.xaml</DependentUpon>
</Compile>
<Compile Include="PropertyGrid\Editors\BrushEditor\ColorHelper.cs" />
<Compile Include="PropertyGrid\Editors\BrushEditor\ColorPicker.xaml.cs">
<DependentUpon>ColorPicker.xaml</DependentUpon>
</Compile>
<Compile Include="PropertyGrid\Editors\BrushEditor\GradientBrushEditor.xaml.cs">
<DependentUpon>GradientBrushEditor.xaml</DependentUpon>
</Compile>
@ -176,7 +172,6 @@ @@ -176,7 +172,6 @@
<DependentUpon>GradientSlider.xaml</DependentUpon>
</Compile>
<Compile Include="PropertyGrid\Editors\BrushEditor\NormalizedPanel.cs" />
<Compile Include="PropertyGrid\Editors\BrushEditor\Picker.cs" />
<Compile Include="PropertyGrid\Editors\BrushEditor\SolidBrushEditor.xaml.cs">
<DependentUpon>SolidBrushEditor.xaml</DependentUpon>
</Compile>
@ -279,10 +274,6 @@ @@ -279,10 +274,6 @@
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="PropertyGrid\Editors\BrushEditor\ColorPicker.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="PropertyGrid\Editors\BrushEditor\GradientBrushEditor.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>

31
src/AddIns/DisplayBindings/WpfDesign/WpfDesign.XamlDom/Project/XamlDocument.cs

@ -44,22 +44,24 @@ namespace ICSharpCode.WpfDesign.XamlDom @@ -44,22 +44,24 @@ namespace ICSharpCode.WpfDesign.XamlDom
/// type descriptor context needs to resolve an XML namespace.</param>
internal ITypeDescriptorContext GetTypeDescriptorContext(XamlObject containingObject)
{
return new DummyTypeDescriptorContext(this, containingObject);
IServiceProvider serviceProvider;
if (containingObject != null) {
if (containingObject.OwnerDocument != this)
throw new ArgumentException("Containing object must belong to the document!");
serviceProvider = containingObject.ServiceProvider;
} else {
serviceProvider = this.ServiceProvider;
}
return new DummyTypeDescriptorContext(serviceProvider);
}
sealed class DummyTypeDescriptorContext : ITypeDescriptorContext
{
IServiceProvider baseServiceProvider;
readonly IServiceProvider baseServiceProvider;
public DummyTypeDescriptorContext(XamlDocument document, XamlObject containingObject)
public DummyTypeDescriptorContext(IServiceProvider serviceProvider)
{
if (containingObject != null) {
if (containingObject.OwnerDocument != document)
throw new ArgumentException("Containing object must belong to the document!");
baseServiceProvider = containingObject.ServiceProvider;
} else {
baseServiceProvider = document.ServiceProvider;
}
this.baseServiceProvider = serviceProvider;
}
public IContainer Container {
@ -67,7 +69,7 @@ namespace ICSharpCode.WpfDesign.XamlDom @@ -67,7 +69,7 @@ namespace ICSharpCode.WpfDesign.XamlDom
}
public object Instance {
get { return null; }
get; set;
}
public PropertyDescriptor PropertyDescriptor {
@ -157,10 +159,11 @@ namespace ICSharpCode.WpfDesign.XamlDom @@ -157,10 +159,11 @@ namespace ICSharpCode.WpfDesign.XamlDom
Type elementType = instance.GetType();
TypeConverter c = TypeDescriptor.GetConverter(instance);
bool hasStringConverter = c.CanConvertTo(typeof(string)) && c.CanConvertFrom(typeof(string));
var ctx = new DummyTypeDescriptorContext(this.ServiceProvider);
ctx.Instance = instance;
bool hasStringConverter = c.CanConvertTo(ctx, typeof(string)) && c.CanConvertFrom(typeof(string));
if (forProperty != null && hasStringConverter) {
return new XamlTextValue(this, c.ConvertToInvariantString(instance));
return new XamlTextValue(this, c.ConvertToInvariantString(ctx, instance));
}

2
src/AddIns/Misc/SearchAndReplace/Project/Engine/SearchReplaceManager.cs

@ -215,7 +215,7 @@ namespace SearchAndReplace @@ -215,7 +215,7 @@ namespace SearchAndReplace
if (textArea != null) {
string transformedPattern = result.TransformReplacePattern(SearchOptions.ReplacePattern);
find.Replace(result.Offset, result.Length, transformedPattern);
if (!find.CurrentDocumentInformation.IsDocumentCreated) {
if (find.CurrentDocumentInformation.IsDocumentCreatedFromTextBuffer) {
textArea.Document.Replace(result.Offset, result.Length, transformedPattern);
}
} else {

14
src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/CodeCompletion/CompletionList.cs

@ -326,31 +326,31 @@ namespace ICSharpCode.AvalonEdit.CodeCompletion @@ -326,31 +326,31 @@ namespace ICSharpCode.AvalonEdit.CodeCompletion
// -1 = no match
if (query == itemText)
return 8;
if (string.Equals(itemText, query, StringComparison.OrdinalIgnoreCase))
if (string.Equals(itemText, query, StringComparison.InvariantCultureIgnoreCase))
return 7;
if (itemText.StartsWith(query, StringComparison.Ordinal))
if (itemText.StartsWith(query, StringComparison.InvariantCulture))
return 6;
if (itemText.StartsWith(query, StringComparison.OrdinalIgnoreCase))
if (itemText.StartsWith(query, StringComparison.InvariantCultureIgnoreCase))
return 5;
bool? camelCaseMatch = null;
if (query.Length <= 2) {
camelCaseMatch = CamelCaseMatch(itemText, query);
if (camelCaseMatch.GetValueOrDefault(false)) return 4;
if (camelCaseMatch == true) return 4;
}
// search by substring, if filtering (i.e. new behavior) turned on
if (IsFiltering) {
if (itemText.Contains(query))
if (itemText.IndexOf(query, StringComparison.InvariantCulture) >= 0)
return 3;
if (itemText.IndexOf(query, StringComparison.OrdinalIgnoreCase) >= 0)
if (itemText.IndexOf(query, StringComparison.InvariantCultureIgnoreCase) >= 0)
return 2;
}
if (!camelCaseMatch.HasValue)
camelCaseMatch = CamelCaseMatch(itemText, query);
if (camelCaseMatch.GetValueOrDefault(false))
if (camelCaseMatch == true)
return 1;
return -1;

6
src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/CodeCompletion/CompletionWindow.cs

@ -48,8 +48,6 @@ namespace ICSharpCode.AvalonEdit.CodeCompletion @@ -48,8 +48,6 @@ namespace ICSharpCode.AvalonEdit.CodeCompletion
toolTip.Placement = PlacementMode.Right;
toolTip.Closed += toolTip_Closed;
completionList.InsertionRequested += completionList_InsertionRequested;
completionList.SelectionChanged += completionList_SelectionChanged;
AttachEvents();
}
@ -98,6 +96,8 @@ namespace ICSharpCode.AvalonEdit.CodeCompletion @@ -98,6 +96,8 @@ namespace ICSharpCode.AvalonEdit.CodeCompletion
void AttachEvents()
{
this.completionList.InsertionRequested += completionList_InsertionRequested;
this.completionList.SelectionChanged += completionList_SelectionChanged;
this.TextArea.Caret.PositionChanged += CaretPositionChanged;
this.TextArea.MouseWheel += textArea_MouseWheel;
this.TextArea.PreviewTextInput += textArea_PreviewTextInput;
@ -106,6 +106,8 @@ namespace ICSharpCode.AvalonEdit.CodeCompletion @@ -106,6 +106,8 @@ namespace ICSharpCode.AvalonEdit.CodeCompletion
/// <inheritdoc/>
protected override void DetachEvents()
{
this.completionList.InsertionRequested -= completionList_InsertionRequested;
this.completionList.SelectionChanged -= completionList_SelectionChanged;
this.TextArea.Caret.PositionChanged -= CaretPositionChanged;
this.TextArea.MouseWheel -= textArea_MouseWheel;
this.TextArea.PreviewTextInput -= textArea_PreviewTextInput;

10
src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/CodeCompletion/CompletionWindowBase.cs

@ -5,9 +5,9 @@ using System; @@ -5,9 +5,9 @@ using System;
using System.Linq;
using System.Diagnostics;
using System.Windows;
using System.Windows.Controls.Primitives;
using System.Windows.Input;
using System.Windows.Threading;
using ICSharpCode.AvalonEdit.Document;
using ICSharpCode.AvalonEdit.Editing;
using ICSharpCode.AvalonEdit.Rendering;
@ -159,7 +159,13 @@ namespace ICSharpCode.AvalonEdit.CodeCompletion @@ -159,7 +159,13 @@ namespace ICSharpCode.AvalonEdit.CodeCompletion
void TextViewScrollOffsetChanged(object sender, EventArgs e)
{
UpdatePosition();
IScrollInfo scrollInfo = this.TextArea.TextView;
Rect visibleRect = new Rect(scrollInfo.HorizontalOffset, scrollInfo.VerticalOffset, scrollInfo.ViewportWidth, scrollInfo.ViewportHeight);
// close completion window when the user scrolls so far that the anchor position is leaving the visible area
if (visibleRect.Contains(visualLocation) || visibleRect.Contains(visualLocationTop))
UpdatePosition();
else
Close();
}
void TextAreaDocumentChanged(object sender, EventArgs e)

12
src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Document/TextDocument.cs

@ -722,13 +722,23 @@ namespace ICSharpCode.AvalonEdit.Document @@ -722,13 +722,23 @@ namespace ICSharpCode.AvalonEdit.Document
}
}
readonly UndoStack undoStack;
UndoStack undoStack;
/// <summary>
/// Gets the <see cref="UndoStack"/> of the document.
/// </summary>
/// <remarks>This property can also be used to set the undo stack, e.g. for sharing a common undo stack between multiple documents.</remarks>
public UndoStack UndoStack {
get { return undoStack; }
set {
if (value == null)
throw new ArgumentNullException();
if (value != undoStack) {
undoStack.ClearAll(); // first clear old undo stack, so that it can't be used to perform unexpected changes on this document
// ClearAll() will also throw an exception when it's not safe to replace the undo stack (e.g. update is currently in progress)
undoStack = value;
}
}
}
/// <summary>

13
src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Editing/DottedLineMargin.cs

@ -3,6 +3,7 @@ @@ -3,6 +3,7 @@
using System;
using System.Windows;
using System.Windows.Data;
using System.Windows.Media;
using System.Windows.Shapes;
@ -19,18 +20,24 @@ namespace ICSharpCode.AvalonEdit.Editing @@ -19,18 +20,24 @@ namespace ICSharpCode.AvalonEdit.Editing
/// <summary>
/// Creates a vertical dotted line to separate the line numbers from the text view.
/// </summary>
public static UIElement Create()
public static UIElement Create(TextEditor editor)
{
return new Line {
Line line = new Line {
X1 = 0, Y1 = 0, X2 = 0, Y2 = 1,
StrokeDashArray = { 0, 2 },
Stretch = Stretch.Fill,
Stroke = Brushes.Gray,
StrokeThickness = 1,
StrokeDashCap = PenLineCap.Round,
Margin = new Thickness(2, 0, 2, 0),
Tag = tag
};
line.SetBinding(
Line.StrokeProperty,
new Binding("LineNumbersForeground") { Source = editor }
);
return line;
}
/// <summary>

25
src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Highlighting/Resources/ASPX.xshd

@ -1,13 +1,16 @@ @@ -1,13 +1,16 @@
<?xml version="1.0"?>
<SyntaxDefinition name = "ASP/XHTML" extensions = ".asp;.aspx;.asax;.asmx" extends = "HTML">
<RuleSets>
<RuleSet ignorecase = "true">
<Span name = "ASPCode" rule = "ASP" bold = "false" italic = "false" color = "Black" bgcolor = "#F7F2E3" stopateol = "false">
<Begin color="Black" bgcolor="Yellow">&lt;%</Begin>
<End color="Black" bgcolor="Yellow">%&gt;</End>
</Span>
</RuleSet>
<RuleSet name="ASP" reference="C#" />
</RuleSets>
<!-- converted to AvalonEdit format by Siegfried Pammer in 2010 -->
<SyntaxDefinition name="ASP/XHTML" extensions=".asp;.aspx;.asax;.asmx" xmlns="http://icsharpcode.net/sharpdevelop/syntaxdefinition/2008">
<Color name="ASPSectionStartEndTags" foreground="Black" background="Yellow" exampleText="&lt;% System.Console.WriteLine(&quot;Hello World!&quot;); %&gt;" />
<Color name="ASPSection" foreground="Black" background="#FFF7F2E3" exampleText="&lt;% System.Console.WriteLine(&quot;Hello World!&quot;); %&gt;" />
<RuleSet ignoreCase="true">
<Span color="ASPSection" ruleSet="ASP" multiline="true">
<Begin color="ASPSectionStartEndTags">&lt;%</Begin>
<End color="ASPSectionStartEndTags">%&gt;</End>
</Span>
<Import ruleSet="HTML/" />
</RuleSet>
<RuleSet name="ASP">
<Import ruleSet="C#/" />
</RuleSet>
</SyntaxDefinition>

427
src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Highlighting/Resources/CPP-Mode.xshd

@ -1,236 +1,195 @@ @@ -1,236 +1,195 @@
<?xml version="1.0"?>
<!-- syntaxdefinition for C/C++ 2001 by Andrea Paatz and Mike Krueger
this should be rewritten to xshd v2.0 syntax to handle c++/cli keywords with whitespaces properly -->
<SyntaxDefinition name = "C++" extensions = ".c;.h;.cc;.cpp;.hpp">
<Properties>
<Property name="LineComment" value="//"/>
</Properties>
<Digits name = "Digits" bold = "false" italic = "false" color = "DarkBlue"/>
<RuleSets>
<RuleSet ignorecase = "false">
<Delimiters>~!%^*()-+=|\#/{}[]:;"'&lt;&gt; , .?</Delimiters>
<Span name = "PreprocessorDirectives" bold="false" italic="false" color="Green" stopateol = "true">
<Begin>#</Begin>
</Span>
<Span name = "LineComment" bold = "false" italic = "false" color = "Green" stopateol = "true">
<Begin>//</Begin>
</Span>
<Span name = "BlockComment" bold = "false" italic = "false" color = "Green" stopateol = "false">
<Begin>/*</Begin>
<End>*/</End>
</Span>
<Span name = "String" bold = "false" italic = "false" color = "Magenta" stopateol = "true" escapecharacter="\">
<Begin>"</Begin>
<End>"</End>
</Span>
<Span name = "Char" bold = "false" italic = "false" color = "Magenta" stopateol = "true" escapecharacter="\">
<Begin>&apos;</Begin>
<End>&apos;</End>
</Span>
<MarkPrevious bold = "true" italic = "false" color = "MidnightBlue">(</MarkPrevious>
<KeyWords name = "Punctuation" bold = "false" italic = "false" color = "DarkGreen">
<Key word = "?" />
<Key word = "," />
<Key word = "." />
<Key word = ";" />
<Key word = "(" />
<Key word = ")" />
<Key word = "[" />
<Key word = "]" />
<Key word = "{" />
<Key word = "}" />
<Key word = "+" />
<Key word = "-" />
<Key word = "/" />
<Key word = "%" />
<Key word = "*" />
<Key word = "&lt;" />
<Key word = "&gt;" />
<Key word = "^" />
<Key word = "=" />
<Key word = "~" />
<Key word = "!" />
<Key word = "|" />
<Key word = "&amp;" />
</KeyWords>
<KeyWords name = "ManagedKeyWords" bold="true" italic="false" color="Black">
<Key word = "__abstract" />
<Key word = "__box" />
<Key word = "__delegate" />
<Key word = "__gc" />
<Key word = "__identifier" />
<Key word = "__nogc" />
<Key word = "__pin" />
<Key word = "__property" />
<Key word = "__sealed" />
<Key word = "__try_cast" />
<Key word = "__typeof" />
<Key word = "__value" />
<Key word = "__event" />
<Key word = "__hook" />
<Key word = "__raise" />
<Key word = "__unhook" />
<Key word = "__interface" />
<!-- c++/cli new syntax managed keywords //-->
<Key word = "ref class" />
<Key word = "ref struct" />
<Key word = "value class" />
<Key word = "value struct" />
<Key word = "interface class" />
<Key word = "interface struct" />
<Key word = "enum class" />
<Key word = "enum struct" />
<Key word = "delegate" />
<Key word = "event" />
<Key word = "property" />
<Key word = "abstract" />
<Key word = "override" />
<Key word = "sealed" />
<Key word = "generic" />
<Key word = "where" />
<Key word = "finally" />
<Key word = "for each" />
<Key word = "gcnew" />
<Key word = "in" />
<Key word = "initonly" />
<Key word = "literal" />
<Key word = "nullptr" />
</KeyWords>
<KeyWords name = "AccessKeywords" bold="true" italic="false" color="Black">
<Key word = "this" />
</KeyWords>
<KeyWords name = "OperatorKeywords" bold="true" italic="false" color="DarkCyan">
<Key word = "and" />
<Key word = "and_eq" />
<Key word = "bitand" />
<Key word = "bitor" />
<Key word = "new" />
<Key word = "not" />
<Key word = "not_eq" />
<Key word = "or" />
<Key word = "or_eq" />
<Key word = "xor" />
<Key word = "xor_eq" />
</KeyWords>
<KeyWords name = "NameSpaces" bold="true" italic="false" color="Green">
<Key word = "using" />
<Key word = "namespace" />
</KeyWords>
<KeyWords name = "Friends" bold="false" italic="false" color="Brown">
<Key word = "friend" />
</KeyWords>
<KeyWords name = "AccessModifiers" bold="true" italic="false" color="Blue">
<Key word = "private" />
<Key word = "protected" />
<Key word = "public" />
<Key word = "const" />
<Key word = "volatile" />
<Key word = "static" />
</KeyWords>
<KeyWords name = "Types" bold="false" italic="false" color="Red">
<Key word = "bool" />
<Key word = "char" />
<Key word = "unsigned" />
<Key word = "union" />
<Key word = "virtual" />
<Key word = "double" />
<Key word = "float" />
<Key word = "short" />
<Key word = "signed" />
<Key word = "void" />
<Key word = "class" />
<Key word = "enum" />
<Key word = "struct" />
</KeyWords>
<KeyWords name = "Literals" bold="true" italic="false" color="Black">
<Key word = "false" />
<Key word = "true" />
</KeyWords>
<KeyWords name = "IterationStatements" bold="true" italic="false" color="Blue">
<Key word = "do" />
<Key word = "for" />
<Key word = "while" />
</KeyWords>
<KeyWords name = "JumpStatements" bold="false" italic="false" color="Navy">
<Key word = "break" />
<Key word = "continue" />
<Key word = "goto" />
<Key word = "return" />
</KeyWords>
<KeyWords name = "ExceptionHandlingStatements" bold="true" italic="false" color="Teal">
<Key word = "catch" />
<Key word = "throw" />
<Key word = "try" />
</KeyWords>
<KeyWords name = "SelectionStatements" bold="true" italic="false" color="Blue">
<Key word = "case" />
<Key word = "else" />
<Key word = "if" />
<Key word = "switch" />
<Key word = "default" />
</KeyWords>
<KeyWords name = "KEYWORD1" bold="true" italic="false" color="Blue">
<Key word = "asm" />
<Key word = "auto" />
<Key word = "compl" />
<Key word = "mutable" />
<Key word = "const_cast" />
<Key word = "delete" />
<Key word = "dynamic_cast" />
<Key word = "explicit" />
<Key word = "export" />
<Key word = "extern" />
<Key word = "inline" />
<Key word = "int" />
<Key word = "long" />
<Key word = "operator" />
<Key word = "register" />
<Key word = "reinterpret_cast" />
<Key word = "sizeof" />
<Key word = "static_cast" />
<Key word = "template" />
<Key word = "typedef" />
<Key word = "typeid" />
<Key word = "typename" />
</KeyWords>
</RuleSet>
</RuleSets>
<!-- syntaxdefinition for C/C++ 2001 by Andrea Paatz and Mike Krueger -->
<!-- converted to AvalonEdit format by Siegfried Pammer in 2010 -->
<SyntaxDefinition name="C++" extensions=".c;.h;.cc;.cpp;.hpp" xmlns="http://icsharpcode.net/sharpdevelop/syntaxdefinition/2008">
<Color name="Comment" foreground="Green" />
<Color name="Character" foreground="Fuchsia" />
<Color name="String" foreground="Fuchsia" />
<Color name="Preprocessor" foreground="Green" />
<Color name="Punctuation" foreground="DarkGreen" />
<Color name="MethodName" foreground="MidnightBlue" fontWeight="bold" />
<Color name="Digits" foreground="DarkBlue" />
<Color name="CompoundKeywords" foreground="Black" fontWeight="bold" />
<Color name="This" foreground="Black" fontWeight="bold" />
<Color name="Operators" foreground="#FF008B8B" fontWeight="bold" />
<Color name="Namespace" foreground="#FF008000" fontWeight="bold" />
<Color name="Friend" foreground="#FFA52A2A" />
<Color name="Modifiers" foreground="#FF0000FF" fontWeight="bold" />
<Color name="TypeKeywords" foreground="#FFFF0000" />
<Color name="BooleanConstants" foreground="#FF000000" fontWeight="bold" />
<Color name="Keywords" foreground="#FF0000FF" fontWeight="bold" />
<Color name="LoopKeywords" foreground="#FF0000FF" fontWeight="bold" />
<Color name="JumpKeywords" foreground="#FF000080" />
<Color name="ExceptionHandling" foreground="#FF008080" fontWeight="bold" />
<Color name="ControlFlow" foreground="#FF0000FF" fontWeight="bold" />
<RuleSet ignoreCase="false">
<Rule color="Punctuation">
[?,.;()\[\]{}+\-/%*&lt;&gt;^=~!&amp;]+
</Rule>
<Keywords color="CompoundKeywords">
<Word>__abstract</Word>
<Word>__box</Word>
<Word>__delegate</Word>
<Word>__gc</Word>
<Word>__identifier</Word>
<Word>__nogc</Word>
<Word>__pin</Word>
<Word>__property</Word>
<Word>__sealed</Word>
<Word>__try_cast</Word>
<Word>__typeof</Word>
<Word>__value</Word>
<Word>__event</Word>
<Word>__hook</Word>
<Word>__raise</Word>
<Word>__unhook</Word>
<Word>__interface</Word>
<Word>ref class</Word>
<Word>ref struct</Word>
<Word>value class</Word>
<Word>value struct</Word>
<Word>interface class</Word>
<Word>interface struct</Word>
<Word>enum class</Word>
<Word>enum struct</Word>
<Word>delegate</Word>
<Word>event</Word>
<Word>property</Word>
<Word>abstract</Word>
<Word>override</Word>
<Word>sealed</Word>
<Word>generic</Word>
<Word>where</Word>
<Word>finally</Word>
<Word>for each</Word>
<Word>gcnew</Word>
<Word>in</Word>
<Word>initonly</Word>
<Word>literal</Word>
<Word>nullptr</Word>
</Keywords>
<Keywords color="This">
<Word>this</Word>
</Keywords>
<Keywords color="Operators">
<Word>and</Word>
<Word>and_eq</Word>
<Word>bitand</Word>
<Word>bitor</Word>
<Word>new</Word>
<Word>not</Word>
<Word>not_eq</Word>
<Word>or</Word>
<Word>or_eq</Word>
<Word>xor</Word>
<Word>xor_eq</Word>
</Keywords>
<Keywords color="Namespace">
<Word>using</Word>
<Word>namespace</Word>
</Keywords>
<Keywords color="Friend">
<Word>friend</Word>
</Keywords>
<Keywords color="Modifiers">
<Word>private</Word>
<Word>protected</Word>
<Word>public</Word>
<Word>const</Word>
<Word>volatile</Word>
<Word>static</Word>
</Keywords>
<Keywords color="TypeKeywords">
<Word>bool</Word>
<Word>char</Word>
<Word>unsigned</Word>
<Word>union</Word>
<Word>virtual</Word>
<Word>double</Word>
<Word>float</Word>
<Word>short</Word>
<Word>signed</Word>
<Word>void</Word>
<Word>class</Word>
<Word>enum</Word>
<Word>struct</Word>
</Keywords>
<Keywords color="BooleanConstants">
<Word>false</Word>
<Word>true</Word>
</Keywords>
<Keywords color="LoopKeywords">
<Word>do</Word>
<Word>for</Word>
<Word>while</Word>
</Keywords>
<Keywords color="JumpKeywords">
<Word>break</Word>
<Word>continue</Word>
<Word>goto</Word>
<Word>return</Word>
</Keywords>
<Keywords color="ExceptionHandling">
<Word>catch</Word>
<Word>throw</Word>
<Word>try</Word>
</Keywords>
<Keywords color="ControlFlow">
<Word>case</Word>
<Word>else</Word>
<Word>if</Word>
<Word>switch</Word>
<Word>default</Word>
</Keywords>
<Keywords color="Keywords">
<Word>asm</Word>
<Word>auto</Word>
<Word>compl</Word>
<Word>mutable</Word>
<Word>const_cast</Word>
<Word>delete</Word>
<Word>dynamic_cast</Word>
<Word>explicit</Word>
<Word>export</Word>
<Word>extern</Word>
<Word>inline</Word>
<Word>int</Word>
<Word>long</Word>
<Word>operator</Word>
<Word>register</Word>
<Word>reinterpret_cast</Word>
<Word>sizeof</Word>
<Word>static_cast</Word>
<Word>template</Word>
<Word>typedef</Word>
<Word>typeid</Word>
<Word>typename</Word>
</Keywords>
<Span color="Preprocessor">
<Begin>\#</Begin>
</Span>
<Span color="Comment">
<Begin>//</Begin>
</Span>
<Span color="Comment" multiline="true">
<Begin>/\*</Begin>
<End>\*/</End>
</Span>
<Span color="String">
<Begin>"</Begin>
<End>"</End>
<RuleSet>
<Span begin="\\" end="." />
</RuleSet>
</Span>
<Span color="Character">
<Begin>'</Begin>
<End>'</End>
<RuleSet>
<Span begin="\\" end="." />
</RuleSet>
</Span>
<Rule color="MethodName">[\d\w_]+(?=(\s*\())</Rule>
<Rule color="Digits">\b0[xX][0-9a-fA-F]+|(\b\d+(\.[0-9]+)?|\.[0-9]+)([eE][+-]?[0-9]+)?</Rule>
</RuleSet>
</SyntaxDefinition>

165
src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Highlighting/Resources/Coco-Mode.xshd

@ -1,97 +1,74 @@ @@ -1,97 +1,74 @@
<?xml version="1.0" ?>
<!-- syntaxdefinition for Coco/R 2003 by Mike Krueger -->
<SyntaxDefinition name="Coco" extensions=".atg">
<Digits name="Digits" bold="false" italic="false" color="DarkBlue" />
<RuleSets>
<RuleSet ignorecase="false">
<Delimiters>&amp;&lt;&gt;~!@%^*()-+=|\#/{}[]:;"' , .?</Delimiters>
<Span name = "LINECOMMENT" bold = "false" italic = "true" color = "Gray" stopateol = "true">
<Begin>//</Begin>
</Span>
<Span name = "BLOCKCOMMENT" bold = "false" italic = "true" color = "Gray" stopateol = "false">
<Begin>/*</Begin>
<End>*/</End>
</Span>
<Span name="CSharpCode2" rule="CSharp" bold="false" italic="false" color="Black" stopateol="false">
<Begin bold = "true" color = "Blue">COMPILER</Begin>
<End bold = "true" color = "Blue">TOKENNAMES</End>
</Span>
<Span name = "STRING" bold = "false" italic = "false" color = "DarkGreen" stopateol = "true">
<Begin>"</Begin>
<End>"</End>
</Span>
<Span name = "CHAR" bold = "false" italic = "false" color = "DarkGreen" stopateol = "true">
<Begin>'</Begin>
<End>'</End>
</Span>
<Span name = "paramlist" rule="ParamList" bold = "false" italic = "false" color = "Black" stopateol = "true">
<Begin bold="true" color = "Black" >&lt;</Begin>
<End bold="true" color = "Black" >&gt;</End>
</Span>
<Span name="CSharpCode" rule="CSharp" bold="false" italic="false" color="DarkSlateGray" stopateol="false">
<Begin bold = "true" italic="true" color = "Green">(.</Begin>
<End bold = "true" italic="true" color = "Green">.)</End>
</Span>
<KeyWords name = "Punctuation" bold = "true" italic = "false" color = "Black">
<Key word = "{"/>
<Key word = "}"/>
<Key word = "("/>
<Key word = ")"/>
<Key word = "["/>
<Key word = "]"/>
<Key word = "|"/>
<Key word = "+"/>
<Key word = "-"/>
<Key word = "="/>
<Key word = "."/>
</KeyWords>
<KeyWords name = "KeyWords" bold = "true" italic = "false" color = "Blue">
<Key word = "ANY"/>
<Key word = "CHARACTERS"/>
<Key word = "COMMENTS"/>
<Key word = "COMPILER"/>
<Key word = "CONTEXT"/>
<Key word = "END"/>
<Key word = "FROM"/>
<Key word = "IF"/>
<Key word = "IGNORE"/>
<Key word = "NAMESPACE"/>
<Key word = "NESTED"/>
<Key word = "PRAGMAS"/>
<Key word = "PRODUCTIONS"/>
<Key word = "SYNC"/>
<Key word = "TO"/>
<Key word = "TOKENS"/>
<Key word = "TOKENNAMES"/>
<Key word = "WEAK"/>
<Key word = "using"/>
</KeyWords>
</RuleSet>
<RuleSet name="CSharp" reference = "C#" ignorecase="false">
</RuleSet>
<RuleSet name="ParamList" reference = "C#" ignorecase="false">
</RuleSet>
<RuleSet name="RuleDefinition" ignorecase="false">
</RuleSet>
</RuleSets>
<!-- converted to AvalonEdit format by Siegfried Pammer in 2010 -->
<SyntaxDefinition name="Coco" extensions=".atg" xmlns="http://icsharpcode.net/sharpdevelop/syntaxdefinition/2008">
<Color name="Comment" foreground="#FF808080" fontStyle="italic" />
<Color name="Punctuation" foreground="#FF000000" fontWeight="bold" />
<Color name="Keywords" foreground="#FF0000FF" fontWeight="bold" />
<Color name="String" foreground="#FF006400" />
<RuleSet ignoreCase="false">
<Rule color="Punctuation">
[{}\(\)\[\]|+\-=\.]+
</Rule>
<Keywords color="Keywords">
<Word>ANY</Word>
<Word>CHARACTERS</Word>
<Word>COMMENTS</Word>
<Word>COMPILER</Word>
<Word>CONTEXT</Word>
<Word>END</Word>
<Word>FROM</Word>
<Word>IF</Word>
<Word>IGNORE</Word>
<Word>NAMESPACE</Word>
<Word>NESTED</Word>
<Word>PRAGMAS</Word>
<Word>PRODUCTIONS</Word>
<Word>SYNC</Word>
<Word>TO</Word>
<Word>TOKENS</Word>
<Word>TOKENNAMES</Word>
<Word>WEAK</Word>
<Word>using</Word>
</Keywords>
<Span color="Comment">
<Begin>//</Begin>
</Span>
<Span color="Comment" multiline="true">
<Begin>/\*</Begin>
<End>\*/</End>
</Span>
<Span foreground="Black" ruleSet="CSharp" multiline="true">
<Begin color="Keywords">COMPILER</Begin>
<End color="Keywords">TOKENNAMES</End>
</Span>
<Span color="String">
<Begin>"</Begin>
<End>"</End>
</Span>
<Span color="String">
<Begin>'</Begin>
<End>'</End>
</Span>
<Span foreground="#FF000000" ruleSet="ParamList">
<Begin foreground="#FF000000" fontWeight="bold">&lt;</Begin>
<End foreground="#FF000000" fontWeight="bold">&gt;</End>
</Span>
<Span foreground="#FF2F4F4F" fontWeight="normal" fontStyle="normal" ruleSet="CSharp" multiline="true">
<Begin foreground="#FF008000" fontWeight="bold" fontStyle="italic">\(\.</Begin>
<End foreground="#FF008000" fontWeight="bold" fontStyle="italic">\.\)</End>
</Span>
<Rule foreground="#FF00008B" fontWeight="normal" fontStyle="normal">\b0[xX][0-9a-fA-F]+|(\b\d+(\.[0-9]+)?|\.[0-9]+)([eE][+-]?[0-9]+)?</Rule>
</RuleSet>
<RuleSet name="CSharp" ignoreCase="false">
<Import ruleSet="C#/" />
<Rule foreground="#FF00008B" fontWeight="normal" fontStyle="normal">\b0[xX][0-9a-fA-F]+|(\b\d+(\.[0-9]+)?|\.[0-9]+)([eE][+-]?[0-9]+)?</Rule>
</RuleSet>
<RuleSet name="ParamList" ignoreCase="false">
<Import ruleSet="C#/" />
<Rule foreground="#FF00008B" fontWeight="normal" fontStyle="normal">\b0[xX][0-9a-fA-F]+|(\b\d+(\.[0-9]+)?|\.[0-9]+)([eE][+-]?[0-9]+)?</Rule>
</RuleSet>
<RuleSet name="RuleDefinition" ignoreCase="false">
<Rule foreground="#FF00008B" fontWeight="normal" fontStyle="normal">\b0[xX][0-9a-fA-F]+|(\b\d+(\.[0-9]+)?|\.[0-9]+)([eE][+-]?[0-9]+)?</Rule>
</RuleSet>
</SyntaxDefinition>

763
src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Highlighting/Resources/HTML-Mode.xshd

@ -1,385 +1,384 @@ @@ -1,385 +1,384 @@
<?xml version="1.0"?>
<!-- syntaxdefinition for HTML 2000 by Mike Krueger -->
<SyntaxDefinition name = "HTML" extensions = ".htm;.html">
<Digits name = "Digits" bold = "false" italic = "false" color = "DarkBlue"/>
<RuleSets>
<RuleSet ignorecase = "true">
<!-- It is not necessary to define span-delimiting characters as delimiters -->
<Delimiters></Delimiters>
<Span name="Comment" bold="false" italic="false" color="DarkSlateGray" stopateol="false">
<Begin>&lt;!--</Begin>
<End>--&gt;</End>
</Span>
<Span name="ScriptTag" rule="JavaScriptSet" bold="false" italic="false" color="SpringGreen" stopateol="false">
<Begin>&lt;script&gt;</Begin>
<End>&lt;/script&gt;</End>
</Span>
<Span name="JavaScriptTag" rule="JavaScriptSet" bold="false" italic="false" color="SpringGreen" stopateol="false">
<Begin>&lt;script lang="JavaScript"&gt;</Begin>
<End>&lt;/script&gt;</End>
</Span>
<Span name="JScriptTag" bold="false" italic="false" color="SpringGreen" stopateol="false">
<Begin>&lt;script lang="JScript"&gt;</Begin>
<End>&lt;/script&gt;</End>
</Span>
<Span name="VBScriptTag" bold="false" italic="false" color="SpringGreen" stopateol="false">
<Begin>&lt;script lang="VBScript"&gt;</Begin>
<End>&lt;/script&gt;</End>
</Span>
<Span name="UnknownScriptTag" bold="false" italic="false" color="SpringGreen" stopateol="false">
<Begin>&lt;script@C</Begin>
<End>&lt;/script&gt;</End>
</Span>
<Span name="HtmlTag" rule="HtmlTagSet" bold="false" italic="false" color="DarkMagenta" stopateol="false">
<Begin>&lt;</Begin>
<End>&gt;</End>
</Span>
<Span name="EntityReference" rule="EntityReferenceSet" bold="false" italic="false" color="Blue" stopateol="true">
<Begin>&amp;</Begin>
<End>;</End>
</Span>
</RuleSet>
<RuleSet name="JavaScriptSet" reference="JavaScript" />
<RuleSet name="EntityReferenceSet" ignorecase="false">
<KeyWords name = "Entities" bold="false" italic="false" color="Green">
<Key word = "aacute" />
<Key word = "agrave" />
<Key word = "acirc" />
<Key word = "amp" />
<Key word = "atilde" />
<Key word = "aring" />
<Key word = "auml" />
<Key word = "aelig" />
<Key word = "ccedil" />
<Key word = "copy" />
<Key word = "eacute" />
<Key word = "egrave" />
<Key word = "ecirc" />
<Key word = "euml" />
<Key word = "iacute" />
<Key word = "igrave" />
<Key word = "icirc" />
<Key word = "iuml" />
<Key word = "eth" />
<Key word = "gt" />
<Key word = "lt" />
<Key word = "nbsp" />
<Key word = "ntilde" />
<Key word = "oacute" />
<Key word = "ograve" />
<Key word = "ocirc" />
<Key word = "otilde" />
<Key word = "ouml" />
<Key word = "oslash" />
<Key word = "quot" />
<Key word = "reg" />
<Key word = "szlig" />
<Key word = "uacute" />
<Key word = "ugrave" />
<Key word = "ucirc" />
<Key word = "uuml" />
<Key word = "yacute" />
<Key word = "thorn" />
<Key word = "trade" />
<Key word = "yuml" />
</KeyWords>
</RuleSet>
<RuleSet name="HtmlTagSet" ignorecase="false">
<Delimiters>/=</Delimiters>
<Span name="String" bold="false" italic="false" color="Blue" stopateol="true">
<Begin>&quot;</Begin>
<End>&quot;</End>
</Span>
<Span name="Char" bold="false" italic="false" color="Blue" stopateol="true">
<Begin>&apos;</Begin>
<End>&apos;</End>
</Span>
<MarkPrevious bold="false" italic="false" color="Red">=</MarkPrevious>
<KeyWords name="Slash" bold="false" italic="false" color="DarkMagenta">
<Key word="/" />
</KeyWords>
<KeyWords name="Assignment" bold="false" italic="false" color="Blue">
<Key word="=" />
</KeyWords>
<KeyWords name = "Tags" bold="false" italic="false" color="DarkMagenta">
<Key word = "!DOCTYPE" />
<Key word = "A" />
<Key word = "ABBR" />
<Key word = "ACRONYM" />
<Key word = "ADDRESS" />
<Key word = "APPLET" />
<Key word = "AREA" />
<Key word = "B" />
<Key word = "BASE" />
<Key word = "BASEFONT" />
<Key word = "BGSOUND" />
<Key word = "BDO" />
<Key word = "BIG" />
<Key word = "BLINK" />
<Key word = "BLOCKQUOTE" />
<Key word = "BODY" />
<Key word = "BR" />
<Key word = "BUTTON" />
<Key word = "CAPTION" />
<Key word = "CENTER" />
<Key word = "CITE" />
<Key word = "CODE" />
<Key word = "COL" />
<Key word = "COLGROUP" />
<Key word = "COMMENT" />
<Key word = "DD" />
<Key word = "DEL" />
<Key word = "DFN" />
<Key word = "DIR" />
<Key word = "DIV" />
<Key word = "DL" />
<Key word = "DT" />
<Key word = "EM" />
<Key word = "EMBED" />
<Key word = "FIELDSET" />
<Key word = "FONT" />
<Key word = "FORM" />
<Key word = "FRAME" />
<Key word = "FRAMESET" />
<Key word = "H" />
<Key word = "H1" />
<Key word = "H2" />
<Key word = "H3" />
<Key word = "H4" />
<Key word = "H5" />
<Key word = "H6" />
<Key word = "HEAD" />
<Key word = "HR" />
<Key word = "HTA:APPLICATION" />
<Key word = "HTML" />
<Key word = "I" />
<Key word = "IFRAME" />
<Key word = "IMG" />
<Key word = "INPUT" />
<Key word = "INS" />
<Key word = "ISINDEX" />
<Key word = "KBD" />
<Key word = "LABEL" />
<Key word = "LEGEnd" />
<Key word = "LI" />
<Key word = "LINK" />
<Key word = "LISTING" />
<Key word = "MAP" />
<Key word = "MARQUEE" />
<Key word = "MENU" />
<Key word = "META" />
<Key word = "MULTICOL" />
<Key word = "NEXTID" />
<Key word = "NOBR" />
<Key word = "NOFRAMES" />
<Key word = "NOSCRIPT" />
<Key word = "OBJECT" />
<Key word = "OL" />
<Key word = "OPTGROUP" />
<Key word = "OPTION" />
<Key word = "P" />
<Key word = "PARAM" />
<Key word = "PLAINTEXT" />
<Key word = "PRE" />
<Key word = "Q" />
<Key word = "S" />
<Key word = "SAMP" />
<Key word = "SCRIPT" />
<Key word = "SELECT" />
<Key word = "SERVER" />
<Key word = "SMALL" />
<Key word = "SOUND" />
<Key word = "SPACER" />
<Key word = "Span" />
<Key word = "STRONG" />
<Key word = "STYLE" />
<Key word = "SUB" />
<Key word = "SUP" />
<Key word = "TABLE" />
<Key word = "TBODY" />
<Key word = "TD" />
<Key word = "TEXTAREA" />
<Key word = "TEXTFLOW" />
<Key word = "TFOOT" />
<Key word = "TH" />
<Key word = "THEAD" />
<Key word = "TITLE" />
<Key word = "TR" />
<Key word = "TT" />
<Key word = "U" />
<Key word = "VAR" />
<Key word = "WBR" />
<Key word = "XMP" />
</KeyWords>
<KeyWords name = "Attributes" bold="false" italic="false" color="Red">
<Key word = "abbr" />
<Key word = "accept-charset" />
<Key word = "accept" />
<Key word = "accesskey" />
<Key word = "action" />
<Key word = "align" />
<Key word = "alink" />
<Key word = "alt" />
<Key word = "applicationname" />
<Key word = "archive" />
<Key word = "axis" />
<Key word = "background" />
<Key word = "behavior" />
<Key word = "bgcolor" />
<Key word = "bgproperties" />
<Key word = "border" />
<Key word = "bordercolor" />
<Key word = "bordercolordark" />
<Key word = "bordercolorligh" />
<Key word = "borderstyle" />
<Key word = "caption" />
<Key word = "cellpadding" />
<Key word = "cellspacing" />
<Key word = "char" />
<Key word = "charoff" />
<Key word = "charset" />
<Key word = "checked" />
<Key word = "cite" />
<Key word = "class" />
<Key word = "classid" />
<Key word = "clear" />
<Key word = "code" />
<Key word = "codetype" />
<Key word = "color" />
<Key word = "cols" />
<Key word = "colspan" />
<Key word = "compact" />
<Key word = "content" />
<Key word = "coords" />
<Key word = "data" />
<Key word = "datetime" />
<Key word = "declare" />
<Key word = "defer" />
<Key word = "dir" />
<Key word = "direction" />
<Key word = "disabled" />
<Key word = "dynsrc" />
<Key word = "enctype" />
<Key word = "face" />
<Key word = "for" />
<Key word = "frame" />
<Key word = "frameborder" />
<Key word = "framespacing" />
<Key word = "gutter" />
<Key word = "headers" />
<Key word = "height" />
<Key word = "href" />
<Key word = "hreflang" />
<Key word = "hspace" />
<Key word = "http-equiv" />
<Key word = "icon" />
<Key word = "id" />
<Key word = "ismap" />
<Key word = "label" />
<Key word = "language" />
<Key word = "leftmargin" />
<Key word = "link" />
<Key word = "longdesc" />
<Key word = "loop" />
<Key word = "lowsrc" />
<Key word = "marginheight" />
<Key word = "marginwidth" />
<Key word = "maximizebutton" />
<Key word = "maxlength" />
<Key word = "media" />
<Key word = "method" />
<Key word = "methods" />
<Key word = "minimizebutton" />
<Key word = "multiple" />
<Key word = "name" />
<Key word = "nohref" />
<Key word = "noresize" />
<Key word = "noshade" />
<Key word = "nowrap" />
<Key word = "object" />
<Key word = "onabort" />
<Key word = "onblur" />
<Key word = "onchange" />
<Key word = "onclick" />
<Key word = "ondblclick" />
<Key word = "onerror" />
<Key word = "onfocus" />
<Key word = "onkeydown" />
<Key word = "onkeypress" />
<Key word = "onkeyup" />
<Key word = "onload" />
<Key word = "onmousedown" />
<Key word = "onmousemove" />
<Key word = "onmouseout" />
<Key word = "onmouseover" />
<Key word = "onmouseup" />
<Key word = "onreset" />
<Key word = "onselect" />
<Key word = "onsubmit" />
<Key word = "onunload" />
<Key word = "profile" />
<Key word = "prompt" />
<Key word = "readonly" />
<Key word = "rel" />
<Key word = "rev" />
<Key word = "rows" />
<Key word = "rowspan" />
<Key word = "rules" />
<Key word = "runat" />
<Key word = "scheme" />
<Key word = "scope" />
<Key word = "scrollamount" />
<Key word = "scrolldelay" />
<Key word = "scrolling" />
<Key word = "selected" />
<Key word = "shape" />
<Key word = "showintaskbar" />
<Key word = "singleinstance" />
<Key word = "size" />
<Key word = "span" />
<Key word = "src" />
<Key word = "standby" />
<Key word = "start" />
<Key word = "style" />
<Key word = "summary" />
<Key word = "sysmenu" />
<Key word = "tabindex" />
<Key word = "target" />
<Key word = "text" />
<Key word = "title" />
<Key word = "topmargin" />
<Key word = "type" />
<Key word = "urn" />
<Key word = "usemap" />
<Key word = "valign" />
<Key word = "value" />
<Key word = "valuetype" />
<Key word = "version" />
<Key word = "vlink" />
<Key word = "vrml" />
<Key word = "vspace" />
<Key word = "width" />
<Key word = "windowstate" />
<Key word = "wrap" />
</KeyWords>
</RuleSet>
</RuleSets>
<!-- converted to AvalonEdit format by Siegfried Pammer in 2010 -->
<SyntaxDefinition name="HTML" extensions=".htm;.html" xmlns="http://icsharpcode.net/sharpdevelop/syntaxdefinition/2008">
<Color name="Comment" foreground="DarkSlateGray" />
<Color name="Digits" foreground="DarkBlue" />
<Color name="ScriptTag" foreground="#FF00FF7F" />
<Color name="JavaScriptTag" foreground="#FF00FF7F" />
<Color name="JScriptTag" foreground="#FF00FF7F" />
<Color name="VBScriptTag" foreground="#FF00FF7F" />
<Color name="UnknownScriptTag" foreground="#FF00FF7F" />
<Color name="HtmlTag" foreground="#FF8B008B" />
<Color name="Tags" foreground="#FF8B008B" />
<Color name="Attributes" foreground="Red" />
<Color name="Slash" foreground="DarkMagenta" />
<Color name="Assignment" foreground="Blue" />
<Color name="String" foreground="Blue" />
<Color name="EntityReference" foreground="Blue" />
<Color name="Entities" foreground="#FF008000" />
<Color name="UnknownAttribute" foreground="Blue" />
<RuleSet ignoreCase="true">
<Span color="Comment" multiline="true">
<Begin>&lt;!--</Begin>
<End>--&gt;</End>
</Span>
<Span color="ScriptTag" ruleSet="JavaScriptSet" multiline="true">
<Begin>&lt;script&gt;</Begin>
<End>&lt;/script&gt;</End>
</Span>
<Span color="JavaScriptTag" ruleSet="JavaScriptSet" multiline="true">
<Begin>&lt;script\ lang="JavaScript"&gt;</Begin>
<End>&lt;/script&gt;</End>
</Span>
<Span color="JScriptTag" multiline="true">
<Begin>&lt;script\ lang="JScript"&gt;</Begin>
<End>&lt;/script&gt;</End>
</Span>
<Span color="VBScriptTag" multiline="true">
<Begin>&lt;script\ lang="VBScript"&gt;</Begin>
<End>&lt;/script&gt;</End>
</Span>
<Span color="UnknownScriptTag" multiline="true">
<Begin>&lt;script[^\w\d_]</Begin>
<End>&lt;/script&gt;</End>
</Span>
<Span color="HtmlTag" ruleSet="HtmlTagSet" multiline="true">
<Begin>&lt;</Begin>
<End>&gt;</End>
</Span>
<Span color="EntityReference" ruleSet="EntityReferenceSet">
<Begin>&amp;</Begin>
<End>;</End>
</Span>
<Rule color="Digits">\b0[xX][0-9a-fA-F]+|(\b\d+(\.[0-9]+)?|\.[0-9]+)([eE][+-]?[0-9]+)?</Rule>
</RuleSet>
<RuleSet name="JavaScriptSet">
<Import ruleSet="JavaScript/" />
<Rule color="Digits">\b0[xX][0-9a-fA-F]+|(\b\d+(\.[0-9]+)?|\.[0-9]+)([eE][+-]?[0-9]+)?</Rule>
</RuleSet>
<RuleSet name="EntityReferenceSet" ignoreCase="false">
<Keywords color="Entities">
<Word>aacute</Word>
<Word>agrave</Word>
<Word>acirc</Word>
<Word>amp</Word>
<Word>atilde</Word>
<Word>aring</Word>
<Word>auml</Word>
<Word>aelig</Word>
<Word>ccedil</Word>
<Word>copy</Word>
<Word>eacute</Word>
<Word>egrave</Word>
<Word>ecirc</Word>
<Word>euml</Word>
<Word>iacute</Word>
<Word>igrave</Word>
<Word>icirc</Word>
<Word>iuml</Word>
<Word>eth</Word>
<Word>gt</Word>
<Word>lt</Word>
<Word>nbsp</Word>
<Word>ntilde</Word>
<Word>oacute</Word>
<Word>ograve</Word>
<Word>ocirc</Word>
<Word>otilde</Word>
<Word>ouml</Word>
<Word>oslash</Word>
<Word>quot</Word>
<Word>reg</Word>
<Word>szlig</Word>
<Word>uacute</Word>
<Word>ugrave</Word>
<Word>ucirc</Word>
<Word>uuml</Word>
<Word>yacute</Word>
<Word>thorn</Word>
<Word>trade</Word>
<Word>yuml</Word>
</Keywords>
<Rule color="Digits">\b0[xX][0-9a-fA-F]+|(\b\d+(\.[0-9]+)?|\.[0-9]+)([eE][+-]?[0-9]+)?</Rule>
</RuleSet>
<RuleSet name="HtmlTagSet" ignoreCase="false">
<Keywords color="Slash">
<Word>/</Word>
</Keywords>
<Keywords color="Assignment">
<Word>=</Word>
</Keywords>
<Keywords color="Tags">
<Word>!DOCTYPE</Word>
<Word>A</Word>
<Word>ABBR</Word>
<Word>ACRONYM</Word>
<Word>ADDRESS</Word>
<Word>APPLET</Word>
<Word>AREA</Word>
<Word>B</Word>
<Word>BASE</Word>
<Word>BASEFONT</Word>
<Word>BGSOUND</Word>
<Word>BDO</Word>
<Word>BIG</Word>
<Word>BLINK</Word>
<Word>BLOCKQUOTE</Word>
<Word>BODY</Word>
<Word>BR</Word>
<Word>BUTTON</Word>
<Word>CAPTION</Word>
<Word>CENTER</Word>
<Word>CITE</Word>
<Word>CODE</Word>
<Word>COL</Word>
<Word>COLGROUP</Word>
<Word>COMMENT</Word>
<Word>DD</Word>
<Word>DEL</Word>
<Word>DFN</Word>
<Word>DIR</Word>
<Word>DIV</Word>
<Word>DL</Word>
<Word>DT</Word>
<Word>EM</Word>
<Word>EMBED</Word>
<Word>FIELDSET</Word>
<Word>FONT</Word>
<Word>FORM</Word>
<Word>FRAME</Word>
<Word>FRAMESET</Word>
<Word>H</Word>
<Word>H1</Word>
<Word>H2</Word>
<Word>H3</Word>
<Word>H4</Word>
<Word>H5</Word>
<Word>H6</Word>
<Word>HEAD</Word>
<Word>HR</Word>
<Word>HTA:APPLICATION</Word>
<Word>HTML</Word>
<Word>I</Word>
<Word>IFRAME</Word>
<Word>IMG</Word>
<Word>INPUT</Word>
<Word>INS</Word>
<Word>ISINDEX</Word>
<Word>KBD</Word>
<Word>LABEL</Word>
<Word>LEGEnd</Word>
<Word>LI</Word>
<Word>LINK</Word>
<Word>LISTING</Word>
<Word>MAP</Word>
<Word>MARQUEE</Word>
<Word>MENU</Word>
<Word>META</Word>
<Word>MULTICOL</Word>
<Word>NEXTID</Word>
<Word>NOBR</Word>
<Word>NOFRAMES</Word>
<Word>NOSCRIPT</Word>
<Word>OBJECT</Word>
<Word>OL</Word>
<Word>OPTGROUP</Word>
<Word>OPTION</Word>
<Word>P</Word>
<Word>PARAM</Word>
<Word>PLAINTEXT</Word>
<Word>PRE</Word>
<Word>Q</Word>
<Word>S</Word>
<Word>SAMP</Word>
<Word>SCRIPT</Word>
<Word>SELECT</Word>
<Word>SERVER</Word>
<Word>SMALL</Word>
<Word>SOUND</Word>
<Word>SPACER</Word>
<Word>Span</Word>
<Word>STRONG</Word>
<Word>STYLE</Word>
<Word>SUB</Word>
<Word>SUP</Word>
<Word>TABLE</Word>
<Word>TBODY</Word>
<Word>TD</Word>
<Word>TEXTAREA</Word>
<Word>TEXTFLOW</Word>
<Word>TFOOT</Word>
<Word>TH</Word>
<Word>THEAD</Word>
<Word>TITLE</Word>
<Word>TR</Word>
<Word>TT</Word>
<Word>U</Word>
<Word>VAR</Word>
<Word>WBR</Word>
<Word>XMP</Word>
</Keywords>
<Keywords color="Attributes">
<Word>abbr</Word>
<Word>accept-charset</Word>
<Word>accept</Word>
<Word>accesskey</Word>
<Word>action</Word>
<Word>align</Word>
<Word>alink</Word>
<Word>alt</Word>
<Word>applicationname</Word>
<Word>archive</Word>
<Word>axis</Word>
<Word>background</Word>
<Word>behavior</Word>
<Word>bgcolor</Word>
<Word>bgproperties</Word>
<Word>border</Word>
<Word>bordercolor</Word>
<Word>bordercolordark</Word>
<Word>bordercolorligh</Word>
<Word>borderstyle</Word>
<Word>caption</Word>
<Word>cellpadding</Word>
<Word>cellspacing</Word>
<Word>char</Word>
<Word>charoff</Word>
<Word>charset</Word>
<Word>checked</Word>
<Word>cite</Word>
<Word>class</Word>
<Word>classid</Word>
<Word>clear</Word>
<Word>code</Word>
<Word>codetype</Word>
<Word>color</Word>
<Word>cols</Word>
<Word>colspan</Word>
<Word>compact</Word>
<Word>content</Word>
<Word>coords</Word>
<Word>data</Word>
<Word>datetime</Word>
<Word>declare</Word>
<Word>defer</Word>
<Word>dir</Word>
<Word>direction</Word>
<Word>disabled</Word>
<Word>dynsrc</Word>
<Word>enctype</Word>
<Word>face</Word>
<Word>for</Word>
<Word>frame</Word>
<Word>frameborder</Word>
<Word>framespacing</Word>
<Word>gutter</Word>
<Word>headers</Word>
<Word>height</Word>
<Word>href</Word>
<Word>hreflang</Word>
<Word>hspace</Word>
<Word>http-equiv</Word>
<Word>icon</Word>
<Word>id</Word>
<Word>ismap</Word>
<Word>label</Word>
<Word>language</Word>
<Word>leftmargin</Word>
<Word>link</Word>
<Word>longdesc</Word>
<Word>loop</Word>
<Word>lowsrc</Word>
<Word>marginheight</Word>
<Word>marginwidth</Word>
<Word>maximizebutton</Word>
<Word>maxlength</Word>
<Word>media</Word>
<Word>method</Word>
<Word>methods</Word>
<Word>minimizebutton</Word>
<Word>multiple</Word>
<Word>name</Word>
<Word>nohref</Word>
<Word>noresize</Word>
<Word>noshade</Word>
<Word>nowrap</Word>
<Word>object</Word>
<Word>onabort</Word>
<Word>onblur</Word>
<Word>onchange</Word>
<Word>onclick</Word>
<Word>ondblclick</Word>
<Word>onerror</Word>
<Word>onfocus</Word>
<Word>onkeydown</Word>
<Word>onkeypress</Word>
<Word>onkeyup</Word>
<Word>onload</Word>
<Word>onmousedown</Word>
<Word>onmousemove</Word>
<Word>onmouseout</Word>
<Word>onmouseover</Word>
<Word>onmouseup</Word>
<Word>onreset</Word>
<Word>onselect</Word>
<Word>onsubmit</Word>
<Word>onunload</Word>
<Word>profile</Word>
<Word>prompt</Word>
<Word>readonly</Word>
<Word>rel</Word>
<Word>rev</Word>
<Word>rows</Word>
<Word>rowspan</Word>
<Word>rules</Word>
<Word>runat</Word>
<Word>scheme</Word>
<Word>scope</Word>
<Word>scrollamount</Word>
<Word>scrolldelay</Word>
<Word>scrolling</Word>
<Word>selected</Word>
<Word>shape</Word>
<Word>showintaskbar</Word>
<Word>singleinstance</Word>
<Word>size</Word>
<Word>span</Word>
<Word>src</Word>
<Word>standby</Word>
<Word>start</Word>
<Word>style</Word>
<Word>summary</Word>
<Word>sysmenu</Word>
<Word>tabindex</Word>
<Word>target</Word>
<Word>text</Word>
<Word>title</Word>
<Word>topmargin</Word>
<Word>type</Word>
<Word>urn</Word>
<Word>usemap</Word>
<Word>valign</Word>
<Word>value</Word>
<Word>valuetype</Word>
<Word>version</Word>
<Word>vlink</Word>
<Word>vrml</Word>
<Word>vspace</Word>
<Word>width</Word>
<Word>windowstate</Word>
<Word>wrap</Word>
</Keywords>
<Span color="String">
<Begin>"</Begin>
<End>"</End>
</Span>
<Span color="String">
<Begin>'</Begin>
<End>'</End>
</Span>
<Rule color="UnknownAttribute">[\d\w_]+(?=(\s*=))</Rule>
<Rule color="Digits">\b0[xX][0-9a-fA-F]+|(\b\d+(\.[0-9]+)?|\.[0-9]+)([eE][+-]?[0-9]+)?</Rule>
</RuleSet>
</SyntaxDefinition>

326
src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Highlighting/Resources/Java-Mode.xshd

@ -1,180 +1,152 @@ @@ -1,180 +1,152 @@
<?xml version="1.0"?>
<!-- syntaxdefinition for Java 2001 by Jonathan Pierce & Mike Krueger -->
<SyntaxDefinition name = "Java" extensions = ".java">
<Properties>
<Property name="LineComment" value="//"/>
</Properties>
<Digits name = "Digits" bold = "false" italic = "false" color = "DarkBlue"/>
<RuleSets>
<RuleSet ignorecase = "false">
<Delimiters>~!%^*()-+=|\#/{}[]:;"'&lt;&gt; , .?</Delimiters>
<Span name = "LINECOMMENT" rule = "TestSet" bold = "false" italic = "true" color = "SlateGray" stopateol = "true">
<Begin>//</Begin>
</Span>
<Span name = "BLOCKCOMMENT" rule = "TestSet" bold = "false" italic = "true" color = "SlateGray" stopateol = "false">
<Begin>/*</Begin>
<End>*/</End>
</Span>
<Span name = "STRING" bold = "false" italic = "false" color = "Magenta" stopateol = "true" escapecharacter="\">
<Begin>"</Begin>
<End>"</End>
</Span>
<Span name = "CHAR" bold = "false" italic = "false" color = "Magenta" stopateol = "true" escapecharacter="\">
<Begin>'</Begin>
<End>'</End>
</Span>
<MarkPrevious bold = "true" italic = "false" color = "MidnightBlue">(</MarkPrevious>
<KeyWords name = "Punctuation" bold = "false" italic = "false" color = "DarkGreen">
<Key word = "?" />
<Key word = "," />
<Key word = "." />
<Key word = "(" />
<Key word = ")" />
<Key word = "[" />
<Key word = "]" />
<Key word = "{" />
<Key word = "}" />
<Key word = "+" />
<Key word = "-" />
<Key word = "/" />
<Key word = "%" />
<Key word = "*" />
<Key word = "&lt;" />
<Key word = "&gt;" />
<Key word = "^" />
<Key word = "!" />
<Key word = "|" />
</KeyWords>
<KeyWords name = "AccessKeywords" bold="true" italic="false" color="Black">
<Key word = "this" />
<Key word = "super" />
</KeyWords>
<KeyWords name = "OperatorKeywords" bold="true" italic="false" color="DarkCyan">
<Key word = "new" />
<Key word = "instanceof" />
<Key word = "true" />
<Key word = "false" />
</KeyWords>
<KeyWords name = "SelectionStatements" bold="true" italic="false" color="Blue">
<Key word = "else" />
<Key word = "if" />
<Key word = "switch" />
<Key word = "case" />
</KeyWords>
<KeyWords name = "IterationStatements" bold="true" italic="false" color="Blue">
<Key word = "do" />
<Key word = "for" />
<Key word = "while" />
</KeyWords>
<KeyWords name = "JumpStatements" bold="false" italic="false" color="Navy">
<Key word = "break" />
<Key word = "continue" />
<Key word = "default" />
<Key word = "goto" />
<Key word = "return" />
</KeyWords>
<KeyWords name = "ExceptionHandlingStatements" bold="true" italic="false" color="Teal">
<Key word = "try" />
<Key word = "throw" />
<Key word = "catch" />
<Key word = "finally" />
</KeyWords>
<KeyWords name = "ValueTypes" bold="true" italic="false" color="Red">
<Key word = "boolean" />
<Key word = "double" />
<Key word = "int" />
<Key word = "short" />
<Key word = "long" />
<Key word = "float" />
<Key word = "byte" />
<Key word = "char" />
</KeyWords>
<KeyWords name = "ReferenceTypes" bold="false" italic="false" color="Red">
<Key word = "class" />
<Key word = "interface" />
<Key word = "object" />
</KeyWords>
<KeyWords name = "Void" bold="false" italic="false" color="Red">
<Key word = "void" />
</KeyWords>
<KeyWords name = "Modifiers" bold="false" italic="false" color="Brown">
<Key word = "abstract" />
<Key word = "const" />
<Key word = "static" />
<Key word = "final" />
<Key word = "native" />
<Key word = "extends" />
<Key word = "implements" />
<Key word = "volatile" />
<Key word = "transient" />
<Key word = "throws" />
<Key word = "strictfp" />
<Key word = "synchronized" />
</KeyWords>
<KeyWords name = "AccessModifiers" bold="true" italic="false" color="Blue">
<Key word = "public" />
<Key word = "protected" />
<Key word = "private" />
</KeyWords>
<KeyWords name = "NameSpaces" bold="true" italic="false" color="Green">
<Key word = "package" />
<Key word = "import" />
</KeyWords>
<KeyWords name = "Literals" bold="true" italic="false" color="Black">
<Key word = "null" />
</KeyWords>
</RuleSet>
<RuleSet name = "TestSet" ignorecase = "true">
<Delimiters>~!%^*()-+=|\#/{}[]:;"'&lt;&gt; , .?</Delimiters>
<KeyWords name = "Todoword" bold="true" italic="true" color="Red">
<Key word = "TODO" />
</KeyWords>
<KeyWords name = "JAVADOC comments" bold="true" italic="true" color="DarkGray">
<Key word = "@author" />
<Key word = "@version" />
<Key word = "@param" />
<Key word = "@return" />
<Key word = "@exception" />
<Key word = "@throws" />
<Key word = "@see" />
<Key word = "@since" />
<Key word = "@serial" />
<Key word = "@serialField" />
<Key word = "@serialData" />
<Key word = "@deprecated" />
</KeyWords>
</RuleSet>
</RuleSets>
<!-- converted to AvalonEdit format by Siegfried Pammer in 2010 -->
<SyntaxDefinition name="Java" extensions=".java" xmlns="http://icsharpcode.net/sharpdevelop/syntaxdefinition/2008">
<Color name="MethodName" foreground="DarkBlue" />
<Color name="Digits" foreground="DarkBlue" fontStyle="italic" />
<Color name="String" foreground="Magenta" />
<Color name="Character" foreground="Magenta" />
<Color name="Comment" foreground="SlateGray" />
<Color name="Punctuation" foreground="DarkGreen" />
<Color name="AccessKeywords" foreground="Black" fontWeight="bold" />
<Color name="OperatorKeywords" foreground="DarkCyan" fontWeight="bold" />
<Color name="SelectionStatements" foreground="Blue" fontWeight="bold" />
<Color name="IterationStatements" foreground="Blue" fontWeight="bold" />
<Color name="ExceptionHandlingStatements" foreground="Teal" fontWeight="bold" />
<Color name="ValueTypes" foreground="Red" fontWeight="bold" />
<Color name="ReferenceTypes" foreground="Red" />
<Color name="Void" foreground="Red" />
<Color name="JumpStatements" foreground="Navy" />
<Color name="Modifiers" foreground="Brown" />
<Color name="AccessModifiers" foreground="Blue" fontWeight="bold" />
<Color name="Package" foreground="Green" fontWeight="bold" />
<Color name="Literals" foreground="Black" fontWeight="bold" />
<Color name="CommentTags" foreground="Red" fontWeight="bold" fontStyle="italic" />
<Color name="JavaDocTags" foreground="DarkGray" fontWeight="bold" fontStyle="italic" />
<RuleSet ignoreCase="false">
<Rule color="Punctuation">
[?,.()\[\]{}+\-/%*&lt;&gt;^!|]+
</Rule>
<Keywords color="AccessKeywords">
<Word>this</Word>
<Word>super</Word>
</Keywords>
<Keywords color="OperatorKeywords">
<Word>new</Word>
<Word>instanceof</Word>
<Word>true</Word>
<Word>false</Word>
</Keywords>
<Keywords color="SelectionStatements">
<Word>else</Word>
<Word>if</Word>
<Word>switch</Word>
<Word>case</Word>
</Keywords>
<Keywords color="IterationStatements">
<Word>do</Word>
<Word>for</Word>
<Word>while</Word>
</Keywords>
<Keywords color="JumpStatements">
<Word>break</Word>
<Word>continue</Word>
<Word>default</Word>
<Word>goto</Word>
<Word>return</Word>
</Keywords>
<Keywords color="ExceptionHandlingStatements">
<Word>try</Word>
<Word>throw</Word>
<Word>catch</Word>
<Word>finally</Word>
</Keywords>
<Keywords color="ValueTypes">
<Word>boolean</Word>
<Word>double</Word>
<Word>int</Word>
<Word>short</Word>
<Word>long</Word>
<Word>float</Word>
<Word>byte</Word>
<Word>char</Word>
</Keywords>
<Keywords color="ReferenceTypes">
<Word>class</Word>
<Word>interface</Word>
<Word>object</Word>
</Keywords>
<Keywords color="Void">
<Word>void</Word>
</Keywords>
<Keywords color="Modifiers">
<Word>abstract</Word>
<Word>const</Word>
<Word>static</Word>
<Word>final</Word>
<Word>native</Word>
<Word>extends</Word>
<Word>implements</Word>
<Word>volatile</Word>
<Word>transient</Word>
<Word>throws</Word>
<Word>strictfp</Word>
<Word>synchronized</Word>
</Keywords>
<Keywords color="AccessModifiers">
<Word>public</Word>
<Word>protected</Word>
<Word>private</Word>
</Keywords>
<Keywords color="Package">
<Word>package</Word>
<Word>import</Word>
</Keywords>
<Keywords color="Literals">
<Word>null</Word>
</Keywords>
<Span color="Comment" ruleSet="TestSet">
<Begin>//</Begin>
</Span>
<Span color="Comment" ruleSet="TestSet" multiline="true">
<Begin>/\*</Begin>
<End>\*/</End>
</Span>
<Span color="String">
<Begin>"</Begin>
<End>"</End>
<RuleSet>
<Span begin="\\" end="." />
</RuleSet>
</Span>
<Span color="Character">
<Begin>'</Begin>
<End>'</End>
<RuleSet>
<Span begin="\\" end="." />
</RuleSet>
</Span>
<Rule color="MethodName">[\d\w_]+(?=(\s*\())</Rule>
<Rule color="Digits">\b0[xX][0-9a-fA-F]+|(\b\d+(\.[0-9]+)?|\.[0-9]+)([eE][+-]?[0-9]+)?</Rule>
</RuleSet>
<RuleSet name="TestSet" ignoreCase="true">
<Keywords color="CommentTags">
<Word>TODO</Word>
</Keywords>
<Keywords color="JavaDocTags">
<Word>@author</Word>
<Word>@version</Word>
<Word>@param</Word>
<Word>@return</Word>
<Word>@exception</Word>
<Word>@throws</Word>
<Word>@see</Word>
<Word>@since</Word>
<Word>@serial</Word>
<Word>@serialField</Word>
<Word>@serialData</Word>
<Word>@deprecated</Word>
</Keywords>
<Rule color="Digits">\b0[xX][0-9a-fA-F]+|(\b\d+(\.[0-9]+)?|\.[0-9]+)([eE][+-]?[0-9]+)?</Rule>
</RuleSet>
</SyntaxDefinition>

253
src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Highlighting/Resources/JavaScript-Mode.xshd

@ -1,136 +1,123 @@ @@ -1,136 +1,123 @@
<?xml version="1.0"?>
<!-- syntaxdefinition for JavaScript 2.0 by Svante Lidman -->
<SyntaxDefinition name ="JavaScript" extensions = ".js">
<Properties>
<Property name="LineComment" value="//"/>
</Properties>
<Digits name ="Digits" bold ="false" italic ="false" color ="DarkBlue"/>
<RuleSets>
<RuleSet ignorecase = "false">
<Delimiters>=!&gt;&lt;+-/*%&amp;|^~.}{,;][?:</Delimiters>
<Span name ="LineComment" bold ="false" italic ="false" color ="DarkSlateGray" stopateol ="true">
<Begin>//</Begin>
</Span>
<Span name ="BlockComment" bold ="false" italic ="false" color ="DarkSlateGray" stopateol ="false">
<Begin>/*</Begin>
<End>*/</End>
</Span>
<Span name ="String" bold ="false" italic ="false" color ="Sienna" stopateol ="false" escapecharacter="\">
<Begin>&quot;</Begin>
<End>&quot;</End>
</Span>
<Span name = "Character" bold = "false" italic = "false" color = "Sienna" stopateol = "true" escapecharacter="\">
<Begin>&apos;</Begin>
<End>&apos;</End>
</Span>
<KeyWords name ="JavaScriptKeyWords" bold="false" italic = "false" color = "Blue">
<Key word = "break" />
<Key word = "continue" />
<Key word = "delete" />
<Key word = "else" />
<Key word = "for" />
<Key word = "function" />
<Key word = "if" />
<Key word = "in" />
<Key word = "new" />
<Key word = "return" />
<Key word = "this" />
<Key word = "typeof" />
<Key word = "var" />
<Key word = "void" />
<Key word = "while" />
<Key word = "with" />
<!--ECMAScript keywords-->
<!-- Reserved for future use
(some are already used in some Javascript Engines)
-->
<Key word = "abstract" />
<Key word = "boolean" />
<Key word = "byte" />
<Key word = "case" />
<Key word = "catch" />
<Key word = "char" />
<Key word = "class" />
<Key word = "const" />
<Key word = "debugger" />
<Key word = "default" />
<Key word = "do" />
<Key word = "double" />
<Key word = "enum" />
<Key word = "export" />
<Key word = "extends" />
<Key word = "final" />
<Key word = "finally" />
<Key word = "float" />
<Key word = "goto" />
<Key word = "implements" />
<Key word = "import" />
<Key word = "instanceof" />
<Key word = "int" />
<Key word = "interface" />
<Key word = "long" />
<Key word = "native" />
<Key word = "package" />
<Key word = "private" />
<Key word = "protected" />
<Key word = "public" />
<Key word = "short" />
<Key word = "static" />
<Key word = "super" />
<Key word = "switch" />
<Key word = "synchronized" />
<Key word = "throw" />
<Key word = "throws" />
<Key word = "transient" />
<Key word = "try" />
<Key word = "volatile" />
</KeyWords>
<KeyWords name ="JavaScriptIntrinsics" bold="false" italic = "false" color = "Blue">
<Key word = "Array" />
<Key word = "Boolean" />
<Key word = "Date" />
<Key word = "Function" />
<Key word = "Global" />
<Key word = "Math" />
<Key word = "Number" />
<Key word = "Object" />
<Key word = "RegExp" />
<Key word = "String" />
</KeyWords>
<KeyWords name ="JavaScriptLiterals" bold="false" italic = "false" color = "Blue">
<Key word = "false" />
<Key word = "null" />
<Key word = "true" />
<Key word = "NaN" />
<Key word = "Infinity" />
</KeyWords>
<KeyWords name ="JavaScriptLiterals" bold="false" italic = "false" color = "Blue">
<Key word = "" />
</KeyWords>
<KeyWords name ="JavaScriptGlobalFunctions" bold="false" italic = "false" color = "Blue">
<Key word = "eval" />
<Key word = "parseInt" />
<Key word = "parseFloat" />
<Key word = "escape" />
<Key word = "unescape" />
<Key word = "isNaN" />
<Key word = "isFinite" />
</KeyWords>
</RuleSet>
</RuleSets>
<!-- converted to AvalonEdit format by Siegfried Pammer in 2010 -->
<SyntaxDefinition name="JavaScript" extensions=".js" xmlns="http://icsharpcode.net/sharpdevelop/syntaxdefinition/2008">
<Color name="Digits" foreground="DarkBlue" />
<Color name="Comment" foreground="DarkSlateGray" />
<Color name="String" foreground="Sienna" />
<Color name="Character" foreground="Sienna" />
<Color name="JavaScriptKeyWords" foreground="Blue" />
<Color name="JavaScriptIntrinsics" foreground="Blue" />
<Color name="JavaScriptLiterals" foreground="Blue" />
<Color name="JavaScriptGlobalFunctions" foreground="Blue" />
<RuleSet ignoreCase="false">
<Keywords color="JavaScriptKeyWords">
<Word>break</Word>
<Word>continue</Word>
<Word>delete</Word>
<Word>else</Word>
<Word>for</Word>
<Word>function</Word>
<Word>if</Word>
<Word>in</Word>
<Word>new</Word>
<Word>return</Word>
<Word>this</Word>
<Word>typeof</Word>
<Word>var</Word>
<Word>void</Word>
<Word>while</Word>
<Word>with</Word>
<Word>abstract</Word>
<Word>boolean</Word>
<Word>byte</Word>
<Word>case</Word>
<Word>catch</Word>
<Word>char</Word>
<Word>class</Word>
<Word>const</Word>
<Word>debugger</Word>
<Word>default</Word>
<Word>do</Word>
<Word>double</Word>
<Word>enum</Word>
<Word>export</Word>
<Word>extends</Word>
<Word>final</Word>
<Word>finally</Word>
<Word>float</Word>
<Word>goto</Word>
<Word>implements</Word>
<Word>import</Word>
<Word>instanceof</Word>
<Word>int</Word>
<Word>interface</Word>
<Word>long</Word>
<Word>native</Word>
<Word>package</Word>
<Word>private</Word>
<Word>protected</Word>
<Word>public</Word>
<Word>short</Word>
<Word>static</Word>
<Word>super</Word>
<Word>switch</Word>
<Word>synchronized</Word>
<Word>throw</Word>
<Word>throws</Word>
<Word>transient</Word>
<Word>try</Word>
<Word>volatile</Word>
</Keywords>
<Keywords color="JavaScriptIntrinsics">
<Word>Array</Word>
<Word>Boolean</Word>
<Word>Date</Word>
<Word>Function</Word>
<Word>Global</Word>
<Word>Math</Word>
<Word>Number</Word>
<Word>Object</Word>
<Word>RegExp</Word>
<Word>String</Word>
</Keywords>
<Keywords color="JavaScriptLiterals">
<Word>false</Word>
<Word>null</Word>
<Word>true</Word>
<Word>NaN</Word>
<Word>Infinity</Word>
</Keywords>
<Keywords color="JavaScriptGlobalFunctions">
<Word>eval</Word>
<Word>parseInt</Word>
<Word>parseFloat</Word>
<Word>escape</Word>
<Word>unescape</Word>
<Word>isNaN</Word>
<Word>isFinite</Word>
</Keywords>
<Span color="Comment">
<Begin>//</Begin>
</Span>
<Span color="Comment" multiline="true">
<Begin>/\*</Begin>
<End>\*/</End>
</Span>
<Span color="String" multiline="true">
<Begin>"</Begin>
<End>"</End>
<RuleSet>
<Span begin="\\" end="." />
</RuleSet>
</Span>
<Span color="Character">
<Begin>'</Begin>
<End>'</End>
<RuleSet>
<Span begin="\\" end="." />
</RuleSet>
</Span>
<Rule color="Digits">\b0[xX][0-9a-fA-F]+|(\b\d+(\.[0-9]+)?|\.[0-9]+)([eE][+-]?[0-9]+)?</Rule>
</RuleSet>
</SyntaxDefinition>

350
src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Highlighting/Resources/PHP-Mode.xshd

@ -1,198 +1,158 @@ @@ -1,198 +1,158 @@
<?xml version="1.0"?>
<!-- syntaxdefinition for PHP 2001 by Chad Smith & Mike Krueger -->
<SyntaxDefinition name ="PHP" extensions = ".php">
<Digits name ="Digits" bold ="false" italic ="false" color ="DarkBlue"/>
<RuleSets>
<RuleSet ignorecase = "false">
<Delimiters>~!%^*()-+=|\#/{}[]:;"'&lt;&gt; , .?</Delimiters>
<Span name ="PreprocessorDirectives" bold="false" italic = "false" color = "Green" stopateol ="true">
<Begin>#</Begin>
</Span>
<Span name ="LINECOMMENT" rule = "DocumentSet" bold ="false" italic ="true" color ="SlateGray" stopateol ="true">
<Begin>///</Begin>
</Span>
<Span name ="LINECOMMENT" rule = "TestSet" bold ="false" italic ="true" color ="SlateGray" stopateol ="true">
<Begin>//@!/@</Begin>
</Span>
<Span name ="BLOCKCOMMENT" rule = "TestSet" bold ="false" italic ="true" color ="SlateGray" stopateol ="false">
<Begin>/*</Begin>
<End>*/</End>
</Span>
<Span name ="STRING" bold ="false" italic ="false" color ="Magenta" stopateol ="true" escapecharacter="\">
<Begin>"</Begin>
<End>"</End>
</Span>
<Span name ="MORELINEDSTRING" bold ="false" italic ="false" color ="Magenta" stopateol ="false" escapecharacter="\">
<Begin>@@"</Begin>
<End>"</End>
</Span>
<Span name ="CHAR" bold ="false" italic ="false" color ="Magenta" stopateol ="true" escapecharacter="\">
<Begin>'</Begin>
<End>'</End>
</Span>
<MarkPrevious bold ="true" italic ="false" color ="MidnightBlue">(</MarkPrevious>
<KeyWords name ="Punctuation" bold ="false" italic ="false" color ="DarkGreen">
<Key word = "?" />
<Key word = "," />
<Key word = "." />
<Key word = "(" />
<Key word = ")" />
<Key word = "[" />
<Key word = "]" />
<Key word = "{" />
<Key word = "}" />
<Key word = "+" />
<Key word = "-" />
<Key word = "/" />
<Key word = "%" />
<Key word = "*" />
<Key word = "&lt;" />
<Key word = "&gt;" />
<Key word = "^" />
<Key word = "!" />
<Key word = "|" />
</KeyWords>
<KeyWords name ="AccessKeywords" bold="true" italic = "false" color = "Black">
<Key word = "global" />
<Key word = "my" />
</KeyWords>
<KeyWords name ="OperatorKeywords" bold="true" italic = "false" color = "DarkCyan">
<Key word = "and" />
<Key word = "or" />
<Key word = "new" />
<Key word = "xor" />
<Key word = "true" />
<Key word = "false" />
</KeyWords>
<KeyWords name ="SelectionStatements" bold="true" italic = "false" color = "Blue">
<Key word = "else" />
<Key word = "if" />
<Key word = "switch" />
<Key word = "case" />
<Key word = "endif" />
<Key word = "elseif" />
</KeyWords>
<KeyWords name ="IterationStatements" bold="true" italic = "false" color = "Blue">
<Key word = "do" />
<Key word = "for" />
<Key word = "foreach" />
<Key word = "while" />
<Key word = "endwhile" />
<Key word = "exit" />
</KeyWords>
<KeyWords name ="JumpStatements" bold="false" italic = "false" color = "Navy">
<Key word = "break" />
<Key word = "continue" />
<Key word = "default" />
<Key word = "goto" />
<Key word = "return" />
</KeyWords>
<KeyWords name ="ExceptionHandlingStatements" bold="true" italic = "false" color = "Teal">
<Key word = "require" />
<Key word = "include" />
<Key word = "function" />
<Key word = "return" />
<Key word = "old_function" />
</KeyWords>
<KeyWords name ="ValueTypes" bold="true" italic = "false" color = "Red">
<Key word = "int" />
<Key word = "integer" />
<Key word = "real" />
<Key word = "double" />
<Key word = "float" />
<Key word = "string" />
<Key word = "array" />
<Key word = "object" />
</KeyWords>
<KeyWords name ="ReferenceTypes" bold="false" italic = "false" color = "Red">
<Key word = "class" />
<Key word = "new" />
</KeyWords>
<KeyWords name ="Void" bold="false" italic = "false" color = "Red">
<Key word = "void" />
</KeyWords>
<KeyWords name ="AccessModifiers" bold="true" italic = "false" color = "Blue">
<Key word = "public" />
<Key word = "private" />
</KeyWords>
<KeyWords name ="GetSet" bold="false" italic = "false" color = "SaddleBrown">
<Key word = "get" />
<Key word = "set" />
</KeyWords>
<KeyWords name ="Literals" bold="true" italic = "false" color = "Black">
<Key word = "null" />
<Key word = "value" />
</KeyWords>
<KeyWords name ="Statements" bold="true" italic = "false" color = "DarkBlue">
<Key word = "var" />
<Key word = "extends" />
<Key word = "list" />
<Key word = "each" />
<Key word = "PHP_SELF" />
</KeyWords>
</RuleSet>
<RuleSet name ="TestSet" ignorecase = "true">
<Delimiters>~!@%^*()-+=|\#/{}[]:;"'&lt;&gt; , .?</Delimiters>
<KeyWords name ="Testword" bold="true" italic = "true" color = "Red">
<Key word = "TODO" />
</KeyWords>
</RuleSet>
<RuleSet name ="DocumentSet" ignorecase = "false">
<Delimiters>~!@%^*()-+=|\#/{}[]:;"'&lt;&gt; , .?</Delimiters>
<Span name ="XMLTAG" rule = "XMLDocuSet" bold ="false" italic ="true" color ="Gray" stopateol ="true">
<Begin>&lt;</Begin>
<End>&gt;</End>
</Span>
<KeyWords name ="Testword" bold="true" italic = "true" color = "Red">
<Key word = "TODO" />
</KeyWords>
</RuleSet>
<RuleSet name ="XMLDocuSet" ignorecase = "false">
<Delimiters>~!@%^*()-+=|\#/{}[]:;"'&lt;&gt; , .?</Delimiters>
<Span name ="STRING" bold ="true" italic ="true" color ="Silver" stopateol ="true">
<Begin>"</Begin>
<End>"</End>
</Span>
<KeyWords name ="Punctuation" bold ="true" italic ="true" color ="Gray">
<Key word = "/" />
<Key word = "|" />
<Key word = "=" />
</KeyWords>
</RuleSet>
</RuleSets>
<!-- converted to AvalonEdit format by Siegfried Pammer in 2010 -->
<SyntaxDefinition name ="PHP" extensions = ".php" xmlns="http://icsharpcode.net/sharpdevelop/syntaxdefinition/2008">
<Color name="Comment" foreground="Green" exampleText="// comment" />
<Color name="String" foreground="Blue" exampleText="$text = &quot;Hello, World!&quot;" />
<Color name="NumberLiteral" foreground="DarkBlue" exampleText="3.1415" />
<Color name="Punctuation" foreground="DarkGreen" exampleText="a(b + c)" />
<Color name="FunctionCall" foreground="MidnightBlue" fontWeight="bold" exampleText="abs(num);"/>
<Color name="AccessKeywords" foreground="Black" fontWeight="bold" exampleText="global $database;" />
<Color name="OperatorKeywords" foreground="DarkCyan" fontWeight="bold" exampleText="if (x === false and y === false) { }" />
<Color name="SelectionStatements" foreground="Blue" fontWeight="bold" exampleText="if (true) { } else { }" />
<Color name="IterationStatements" foreground="Blue" fontWeight="bold" exampleText="while (true) { }" />
<Color name="JumpStatements" foreground="Navy" fontWeight="bold" exampleText="if (x == 5) continue;" />
<Color name="ControlStatements" foreground="Teal" fontWeight="bold" exampleText="include(&quot;test.php&quot;);" />
<Color name="ValueTypes" foreground="Red" fontWeight="bold" exampleText="int test = 5;" />
<Color name="OtherTypes" foreground="Red" exampleText="object test = null;" />
<Color name="AccessModifiers" foreground="Blue" fontWeight="bold" exampleText="public function test() {}" />
<RuleSet>
<Span color="Comment">
<Begin>\#</Begin>
</Span>
<Span color="Comment">
<Begin>//</Begin>
</Span>
<Span color="Comment" multiline="true">
<Begin>/\*</Begin>
<End>\*/</End>
</Span>
<!-- Digits -->
<Rule color="NumberLiteral">
\b0[xX][0-9a-fA-F]+ # hex number
|
\b0[0-9]+ # octal number
|
( \b\d+(\.[0-9]+)? #number with optional floating point
| \.[0-9]+ #or just starting with floating point
)
([eE][+-]?[0-9]+)? # optional exponent
</Rule>
<Rule color="Punctuation">
[?,.:;()\[\]{}+\-/%*&lt;&gt;&amp;^!|~@]+
</Rule>
<!-- Mark previous rule-->
<Rule color="FunctionCall">
\b
[\d\w_]+ # an identifier
(?=\s*\() # followed by (
</Rule>
<Span color="String" multiline="true">
<Begin>'</Begin>
<End>'</End>
<RuleSet>
<!-- span for escape sequences -->
<Span begin="\\" end="."/>
</RuleSet>
</Span>
<Span color="String" multiline="true">
<Begin>"</Begin>
<End>"</End>
<RuleSet>
<!-- span for escape sequences -->
<Span begin="\\" end="."/>
</RuleSet>
</Span>
<!-- heredoc syntax -->
<Span color="String" multiline="true">
<Begin>&lt;&lt;&lt;\"?[\d\w_]+\"?$</Begin>
<End>^[\d\w_]+;</End>
</Span>
<!-- nowdoc syntax -->
<Span color="String" multiline="true">
<Begin>&lt;&lt;&lt;\'[\d\w_]+\'$</Begin>
<End>^[\d\w_]+;</End>
</Span>
<Keywords color="AccessKeywords">
<Word>global</Word>
<Word>my</Word>
<Word>var</Word>
</Keywords>
<Keywords color="OperatorKeywords">
<Word>and</Word>
<Word>or</Word>
<Word>new</Word>
<Word>clone</Word>
<Word>instanceof</Word>
<Word>xor</Word>
<Word>true</Word>
<Word>false</Word>
</Keywords>
<Keywords color="SelectionStatements">
<Word>else</Word>
<Word>else</Word>
<Word>switch</Word>
<Word>case</Word>
<Word>endif</Word>
<Word>elseif</Word>
</Keywords>
<Keywords color="IterationStatements">
<Word>do</Word>
<Word>for</Word>
<Word>foreach</Word>
<Word>while</Word>
<Word>endwhile</Word>
<Word>exit</Word>
</Keywords>
<Keywords color="JumpStatements">
<Word>break</Word>
<Word>continue</Word>
<Word>default</Word>
<Word>goto</Word>
<Word>return</Word>
</Keywords>
<Keywords color="ControlStatements">
<Word>require</Word>
<Word>include</Word>
<Word>require</Word>
<Word>include</Word>
<Word>function</Word>
</Keywords>
<Keywords color="ValueTypes">
<Word>int</Word>
<Word>integer</Word>
<Word>real</Word>
<Word>double</Word>
<Word>float</Word>
<Word>string</Word>
<Word>array</Word>
<Word>object</Word>
</Keywords>
<Keywords color="OtherTypes">
<Word>class</Word>
<Word>void</Word>
</Keywords>
<Keywords color="AccessModifiers">
<Word>public</Word>
<Word>private</Word>
</Keywords>
</RuleSet>
</SyntaxDefinition>

2
src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Rendering/NewLineElementGenerator.cs

@ -54,7 +54,7 @@ namespace ICSharpCode.AvalonEdit.Rendering @@ -54,7 +54,7 @@ namespace ICSharpCode.AvalonEdit.Rendering
} else {
return null;
}
return new NewLineTextElement(CurrentContext.TextView.cachedElements.GetSimpleLightGrayText(newlineText, CurrentContext));
return new NewLineTextElement(CurrentContext.TextView.cachedElements.GetTextForNonPrintableCharacter(newlineText, CurrentContext));
}
sealed class NewLineTextElement : FormattedTextElement

4
src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Rendering/SingleCharacterElementGenerator.cs

@ -88,9 +88,9 @@ namespace ICSharpCode.AvalonEdit.Rendering @@ -88,9 +88,9 @@ namespace ICSharpCode.AvalonEdit.Rendering
{
char c = CurrentContext.Document.GetCharAt(offset);
if (ShowSpaces && c == ' ') {
return new SpaceTextElement(CurrentContext.TextView.cachedElements.GetSimpleLightGrayText("\u00B7", CurrentContext));
return new SpaceTextElement(CurrentContext.TextView.cachedElements.GetTextForNonPrintableCharacter("\u00B7", CurrentContext));
} else if (ShowTabs && c == '\t') {
return new TabTextElement(CurrentContext.TextView.cachedElements.GetSimpleLightGrayText("\u00BB", CurrentContext));
return new TabTextElement(CurrentContext.TextView.cachedElements.GetTextForNonPrintableCharacter("\u00BB", CurrentContext));
} else if (ShowBoxForControlCharacters && char.IsControl(c)) {
var p = new VisualLineElementTextRunProperties(CurrentContext.GlobalTextRunProperties);
p.SetForegroundBrush(Brushes.White);

74
src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Rendering/TextView.cs

@ -110,8 +110,8 @@ namespace ICSharpCode.AvalonEdit.Rendering @@ -110,8 +110,8 @@ namespace ICSharpCode.AvalonEdit.Rendering
ClearVisualLines();
if (newValue != null) {
TextDocumentWeakEventManager.Changing.AddListener(newValue, this);
heightTree = new HeightTree(newValue, FontSize + 3);
formatter = TextFormatterFactory.Create(this);
heightTree = new HeightTree(newValue, DefaultLineHeight); // measuring DefaultLineHeight depends on formatter
cachedElements = new TextViewCachedElements();
}
InvalidateMeasure(DispatcherPriority.Normal);
@ -367,6 +367,23 @@ namespace ICSharpCode.AvalonEdit.Rendering @@ -367,6 +367,23 @@ namespace ICSharpCode.AvalonEdit.Rendering
}
#endregion
#region Brushes
/// <summary>
/// NonPrintableCharacterBrush dependency property.
/// </summary>
public static readonly DependencyProperty NonPrintableCharacterBrushProperty =
DependencyProperty.Register("NonPrintableCharacterBrush", typeof(Brush), typeof(TextView),
new FrameworkPropertyMetadata(Brushes.LightGray));
/// <summary>
/// Gets/sets the Brush used for displaying non-printable characters.
/// </summary>
public Brush NonPrintableCharacterBrush {
get { return (Brush)GetValue(NonPrintableCharacterBrushProperty); }
set { SetValue(NonPrintableCharacterBrushProperty, value); }
}
#endregion
#region Redraw methods / VisualLine invalidation
/// <summary>
/// Causes the text editor to regenerate all visual lines.
@ -1118,12 +1135,12 @@ namespace ICSharpCode.AvalonEdit.Rendering @@ -1118,12 +1135,12 @@ namespace ICSharpCode.AvalonEdit.Rendering
void IScrollInfo.LineUp()
{
((IScrollInfo)this).SetVerticalOffset(scrollOffset.Y - FontSize);
((IScrollInfo)this).SetVerticalOffset(scrollOffset.Y - DefaultLineHeight);
}
void IScrollInfo.LineDown()
{
((IScrollInfo)this).SetVerticalOffset(scrollOffset.Y + FontSize);
((IScrollInfo)this).SetVerticalOffset(scrollOffset.Y + DefaultLineHeight);
}
void IScrollInfo.LineLeft()
@ -1159,14 +1176,14 @@ namespace ICSharpCode.AvalonEdit.Rendering @@ -1159,14 +1176,14 @@ namespace ICSharpCode.AvalonEdit.Rendering
void IScrollInfo.MouseWheelUp()
{
((IScrollInfo)this).SetVerticalOffset(
scrollOffset.Y - (SystemParameters.WheelScrollLines * FontSize));
scrollOffset.Y - (SystemParameters.WheelScrollLines * DefaultLineHeight));
OnScrollChange();
}
void IScrollInfo.MouseWheelDown()
{
((IScrollInfo)this).SetVerticalOffset(
scrollOffset.Y + (SystemParameters.WheelScrollLines * FontSize));
scrollOffset.Y + (SystemParameters.WheelScrollLines * DefaultLineHeight));
OnScrollChange();
}
@ -1184,12 +1201,52 @@ namespace ICSharpCode.AvalonEdit.Rendering @@ -1184,12 +1201,52 @@ namespace ICSharpCode.AvalonEdit.Rendering
OnScrollChange();
}
double wideSpaceWidth; // Width of an 'x'. Used as basis for the tab width, and for scrolling.
double defaultLineHeight; // Height of a line containing 'x'. Used for scrolling.
double WideSpaceWidth {
get {
return FontSize / 2;
if (wideSpaceWidth == 0) {
MeasureWideSpaceWidthAndDefaultLineHeight();
}
return wideSpaceWidth;
}
}
double DefaultLineHeight {
get {
if (defaultLineHeight == 0) {
MeasureWideSpaceWidthAndDefaultLineHeight();
}
return defaultLineHeight;
}
}
void MeasureWideSpaceWidthAndDefaultLineHeight()
{
if (formatter != null) {
var textRunProperties = CreateGlobalTextRunProperties();
using (var line = formatter.FormatLine(
new SimpleTextSource("x", textRunProperties),
0, 32000,
new VisualLineTextParagraphProperties { defaultTextRunProperties = textRunProperties },
null))
{
wideSpaceWidth = Math.Max(1, line.WidthIncludingTrailingWhitespace);
defaultLineHeight = line.Height;
}
} else {
wideSpaceWidth = FontSize / 2;
defaultLineHeight = FontSize + 3;
}
}
void InvalidateWideSpaceWidthAndDefaultLineHeight()
{
wideSpaceWidth = 0;
defaultLineHeight = 0;
}
static double ValidateVisualOffset(double offset)
{
if (double.IsNaN(offset))
@ -1618,15 +1675,18 @@ namespace ICSharpCode.AvalonEdit.Rendering @@ -1618,15 +1675,18 @@ namespace ICSharpCode.AvalonEdit.Rendering
if (TextFormatterFactory.PropertyChangeAffectsTextFormatter(e.Property)) {
RecreateCachedElements();
RecreateTextFormatter();
InvalidateWideSpaceWidthAndDefaultLineHeight();
}
if (e.Property == Control.ForegroundProperty
|| e.Property == Control.FontFamilyProperty
|| e.Property == Control.FontSizeProperty
|| e.Property == Control.FontStretchProperty
|| e.Property == Control.FontStyleProperty
|| e.Property == Control.FontWeightProperty)
|| e.Property == Control.FontWeightProperty
|| e.Property == TextView.NonPrintableCharacterBrushProperty)
{
RecreateCachedElements();
InvalidateWideSpaceWidthAndDefaultLineHeight();
Redraw();
}
}

18
src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Rendering/TextViewCachedElements.cs

@ -12,28 +12,28 @@ namespace ICSharpCode.AvalonEdit.Rendering @@ -12,28 +12,28 @@ namespace ICSharpCode.AvalonEdit.Rendering
sealed class TextViewCachedElements : IDisposable
{
TextFormatter formatter;
Dictionary<string, TextLine> simpleLightGrayTexts;
Dictionary<string, TextLine> nonPrintableCharacterTexts;
public TextLine GetSimpleLightGrayText(string text, ITextRunConstructionContext context)
public TextLine GetTextForNonPrintableCharacter(string text, ITextRunConstructionContext context)
{
if (simpleLightGrayTexts == null)
simpleLightGrayTexts = new Dictionary<string, TextLine>();
if (nonPrintableCharacterTexts == null)
nonPrintableCharacterTexts = new Dictionary<string, TextLine>();
TextLine textLine;
if (!simpleLightGrayTexts.TryGetValue(text, out textLine)) {
if (!nonPrintableCharacterTexts.TryGetValue(text, out textLine)) {
var p = new VisualLineElementTextRunProperties(context.GlobalTextRunProperties);
p.SetForegroundBrush(Brushes.LightGray);
p.SetForegroundBrush(context.TextView.NonPrintableCharacterBrush);
if (formatter == null)
formatter = TextFormatterFactory.Create(context.TextView);
textLine = FormattedTextElement.PrepareText(formatter, text, p);
simpleLightGrayTexts[text] = textLine;
nonPrintableCharacterTexts[text] = textLine;
}
return textLine;
}
public void Dispose()
{
if (simpleLightGrayTexts != null) {
foreach (TextLine line in simpleLightGrayTexts.Values)
if (nonPrintableCharacterTexts != null) {
foreach (TextLine line in nonPrintableCharacterTexts.Values)
line.Dispose();
}
if (formatter != null)

40
src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/TextEditor.cs

@ -4,6 +4,7 @@ @@ -4,6 +4,7 @@
using System;
using System.ComponentModel;
using System.IO;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
@ -11,6 +12,7 @@ using System.Windows.Controls.Primitives; @@ -11,6 +12,7 @@ using System.Windows.Controls.Primitives;
using System.Windows.Data;
using System.Windows.Input;
using System.Windows.Markup;
using System.Windows.Media;
using System.Windows.Threading;
using ICSharpCode.AvalonEdit.Document;
using ICSharpCode.AvalonEdit.Editing;
@ -449,7 +451,7 @@ namespace ICSharpCode.AvalonEdit @@ -449,7 +451,7 @@ namespace ICSharpCode.AvalonEdit
#region ShowLineNumbers
/// <summary>
/// IsReadOnly dependency property.
/// ShowLineNumbers dependency property.
/// </summary>
public static readonly DependencyProperty ShowLineNumbersProperty =
DependencyProperty.Register("ShowLineNumbers", typeof(bool), typeof(TextEditor),
@ -468,8 +470,13 @@ namespace ICSharpCode.AvalonEdit @@ -468,8 +470,13 @@ namespace ICSharpCode.AvalonEdit
TextEditor editor = (TextEditor)d;
var leftMargins = editor.TextArea.LeftMargins;
if ((bool)e.NewValue) {
leftMargins.Insert(0, new LineNumberMargin());
leftMargins.Insert(1, DottedLineMargin.Create());
var lineNumbers = new LineNumberMargin();
leftMargins.Insert(0, lineNumbers);
leftMargins.Insert(1, DottedLineMargin.Create(editor));
lineNumbers.SetBinding(Control.ForegroundProperty,
new Binding("LineNumbersForeground") {
Source = editor
});
} else {
for (int i = 0; i < leftMargins.Count; i++) {
if (leftMargins[i] is LineNumberMargin) {
@ -484,6 +491,33 @@ namespace ICSharpCode.AvalonEdit @@ -484,6 +491,33 @@ namespace ICSharpCode.AvalonEdit
}
#endregion
#region LineNumbersForeground
/// <summary>
/// LineNumbersForeground dependency property.
/// </summary>
public static readonly DependencyProperty LineNumbersForegroundProperty =
DependencyProperty.Register("LineNumbersForeground", typeof(Brush), typeof(TextEditor),
new FrameworkPropertyMetadata(Brushes.Gray, OnLineNumbersForegroundChanged));
/// <summary>
/// Gets/sets the Brush used for displaying the foreground color of line numbers.
/// </summary>
public Brush LineNumbersForeground {
get { return (Brush)GetValue(LineNumbersForegroundProperty); }
set { SetValue(LineNumbersForegroundProperty, value); }
}
static void OnLineNumbersForegroundChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{
TextEditor editor = (TextEditor)d;
var lineNumberMargin = editor.TextArea.LeftMargins.FirstOrDefault(margin => margin is LineNumberMargin) as LineNumberMargin;;
if (lineNumberMargin != null) {
lineNumberMargin.SetValue(Control.ForegroundProperty, e.NewValue);
}
}
#endregion
#region TextBoxBase-like methods
/// <summary>
/// Appends text to the end of the document.

2
src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Utils/Deque.cs

@ -12,7 +12,7 @@ namespace ICSharpCode.AvalonEdit.Utils @@ -12,7 +12,7 @@ namespace ICSharpCode.AvalonEdit.Utils
/// </summary>
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1710:IdentifiersShouldHaveCorrectSuffix")]
[Serializable]
public class Deque<T> : ICollection<T>
public sealed class Deque<T> : ICollection<T>
{
T[] arr = Empty<T>.Array;
int size, head, tail;

32
src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Xml/AXmlParser.cs

@ -97,15 +97,8 @@ namespace ICSharpCode.AvalonEdit.Xml @@ -97,15 +97,8 @@ namespace ICSharpCode.AvalonEdit.Xml
/// <summary> Create new parser </summary>
public AXmlParser()
{
this.UnknownEntityReferenceIsError = true;
this.TrackedSegments = new TrackedSegmentCollection();
this.Lock = new ReaderWriterLockSlim(LockRecursionPolicy.SupportsRecursion);
this.userDocument = new AXmlDocument() { Parser = this };
this.userDocument.Document = this.userDocument;
// Track the document
this.TrackedSegments.AddParsedObject(this.userDocument, null);
this.userDocument.IsCached = false;
ClearInternal();
}
/// <summary> Throws exception if condition is false </summary>
@ -181,5 +174,28 @@ namespace ICSharpCode.AvalonEdit.Xml @@ -181,5 +174,28 @@ namespace ICSharpCode.AvalonEdit.Xml
return userDocument;
}
}
/// <summary>
/// Clears the parser data.
/// </summary>
/// <exception cref="InvalidOperationException">No write lock is held by the current thread.</exception>
public void Clear()
{
if (!Lock.IsWriteLockHeld)
throw new InvalidOperationException("Write lock needed!");
ClearInternal();
}
void ClearInternal()
{
this.UnknownEntityReferenceIsError = true;
this.TrackedSegments = new TrackedSegmentCollection();
this.userDocument = new AXmlDocument() { Parser = this };
this.userDocument.Document = this.userDocument;
// Track the document
this.TrackedSegments.AddParsedObject(this.userDocument, null);
this.userDocument.IsCached = false;
}
}
}

1
src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/themes/generic.xaml

@ -9,7 +9,6 @@ @@ -9,7 +9,6 @@
</ResourceDictionary.MergedDictionaries>
<Style TargetType="{x:Type editing:LineNumberMargin}">
<Setter Property="TextBlock.Foreground" Value="Gray"/>
<Setter Property="Control.Cursor" Value="/ICSharpCode.AvalonEdit;component/themes/RightArrow.cur"/>
</Style>
</ResourceDictionary>

9
src/Libraries/NRefactory/Project/Src/PrettyPrinter/CSharp/CSharpOutputVisitor.cs

@ -1956,12 +1956,15 @@ namespace ICSharpCode.NRefactory.PrettyPrinter @@ -1956,12 +1956,15 @@ namespace ICSharpCode.NRefactory.PrettyPrinter
else
TrackVisit(forNextStatement.LoopVariableExpression, data);
outputFormatter.Space();
PrimitiveExpression pe = forNextStatement.Step as PrimitiveExpression;
Expression stepExpr = forNextStatement.Step;
while (stepExpr is ParenthesizedExpression)
stepExpr = ((ParenthesizedExpression)stepExpr).Expression;
PrimitiveExpression pe = stepExpr as PrimitiveExpression;
if ((pe == null || !(pe.Value is int) || ((int)pe.Value) >= 0)
&& !(forNextStatement.Step is UnaryOperatorExpression))
&& !(stepExpr is UnaryOperatorExpression))
outputFormatter.PrintToken(Tokens.LessEqual);
else {
if (forNextStatement.Step is UnaryOperatorExpression && ((UnaryOperatorExpression)forNextStatement.Step).Op == UnaryOperatorType.Plus)
if (stepExpr is UnaryOperatorExpression && ((UnaryOperatorExpression)stepExpr).Op == UnaryOperatorType.Plus)
outputFormatter.PrintToken(Tokens.LessEqual);
else
outputFormatter.PrintToken(Tokens.GreaterEqual);

5
src/Main/Base/Project/Src/Bookmarks/Commands/MenuCommands.cs

@ -41,12 +41,11 @@ namespace ICSharpCode.SharpDevelop.Bookmarks @@ -41,12 +41,11 @@ namespace ICSharpCode.SharpDevelop.Bookmarks
protected override void Run(ITextEditor editor, IBookmarkMargin bookmarkMargin)
{
BookmarkManager.ToggleBookmark(editor, editor.Caret.Line,
b => b.CanToggle,
b => b.CanToggle && b.GetType() == typeof(SDBookmark),
location => new SDBookmark(editor.FileName, location));
}
}
public class PrevBookmark : BookmarkMenuCommand
public class PrevBookmark : BookmarkMenuCommand
{
protected override void Run(ITextEditor editor, IBookmarkMargin bookmarkMargin)
{

6
src/Main/Base/Project/Src/Editor/Search/ProvidedDocumentInformation.cs

@ -15,6 +15,7 @@ namespace ICSharpCode.SharpDevelop.Editor.Search @@ -15,6 +15,7 @@ namespace ICSharpCode.SharpDevelop.Editor.Search
ITextBuffer textBuffer;
FileName fileName;
int currentOffset;
bool documentCreatedFromTextBuffer;
public FileName FileName {
get {
@ -35,8 +36,8 @@ namespace ICSharpCode.SharpDevelop.Editor.Search @@ -35,8 +36,8 @@ namespace ICSharpCode.SharpDevelop.Editor.Search
}
}
public bool IsDocumentCreated {
get { return document != null; }
public bool IsDocumentCreatedFromTextBuffer {
get { return documentCreatedFromTextBuffer; }
}
public int CurrentOffset {
@ -109,6 +110,7 @@ namespace ICSharpCode.SharpDevelop.Editor.Search @@ -109,6 +110,7 @@ namespace ICSharpCode.SharpDevelop.Editor.Search
this.textBuffer = textBuffer;
this.fileName = FileName.Create(fileName);
this.endOffset = this.currentOffset = currentOffset;
documentCreatedFromTextBuffer = true;
}
}
}

29
src/Main/Base/Project/Src/Gui/Components/ColorPicker.xaml.cs

@ -2,15 +2,14 @@ @@ -2,15 +2,14 @@
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
using System;
using System.Collections.Generic;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Controls.Primitives;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using Widgets = ICSharpCode.SharpDevelop.Widgets;
namespace ICSharpCode.SharpDevelop.Gui
{
/// <summary>
@ -60,14 +59,22 @@ namespace ICSharpCode.SharpDevelop.Gui @@ -60,14 +59,22 @@ namespace ICSharpCode.SharpDevelop.Gui
void ButtonClick(object sender, RoutedEventArgs e)
{
e.Handled = true;
using (SharpDevelopColorDialog dlg = new SharpDevelopColorDialog()) {
dlg.WpfColor = this.Value;
if (dlg.ShowWpfDialog() == true) {
// use SetCurrentValue instead of SetValue so that two-way data binding can be used
SetCurrentValue(ValueProperty, dlg.WpfColor);
var control = new Widgets.ColorPicker();
Popup popup = new Popup() {
Child = control,
Placement = PlacementMode.Bottom,
PlacementTarget = this,
IsOpen = true,
StaysOpen = false
};
control.SetBinding(
Widgets.ColorPicker.ColorProperty,
new Binding("Value") {
Source = this,
Mode = BindingMode.TwoWay
}
}
);
}
}
}

22
src/Main/Base/Project/Src/Gui/Dialogs/NewFileDialog.cs

@ -9,8 +9,8 @@ using System.IO; @@ -9,8 +9,8 @@ using System.IO;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using ICSharpCode.Core;
using ICSharpCode.Core.Services;
using ICSharpCode.SharpDevelop.Editor;
using ICSharpCode.SharpDevelop.Gui.XmlForms;
using ICSharpCode.SharpDevelop.Internal.Templates;
@ -505,14 +505,20 @@ namespace ICSharpCode.SharpDevelop.Gui @@ -505,14 +505,20 @@ namespace ICSharpCode.SharpDevelop.Gui
}
}
ScriptRunner scriptRunner = new ScriptRunner();
foreach (FileDescriptionTemplate newfile in item.Template.FileDescriptionTemplates) {
if (!String.IsNullOrEmpty(newfile.BinaryFileName)) {
SaveFile(newfile, null, newfile.BinaryFileName);
} else {
SaveFile(newfile, scriptRunner.CompileScript(item.Template, newfile), null);
}
foreach (FileDescriptionTemplate newFile in item.Template.FileDescriptionTemplates) {
FileOperationResult result = FileUtility.ObservedSave(
() => {
if (!String.IsNullOrEmpty(newFile.BinaryFileName)) {
SaveFile(newFile, null, newFile.BinaryFileName);
} else {
SaveFile(newFile, scriptRunner.CompileScript(item.Template, newFile), null);
}
}, StringParser.Parse(newFile.Name)
);
if (result != FileOperationResult.OK)
return;
}
DialogResult = DialogResult.OK;
// raise FileCreated event for the new files.

6
src/Main/Base/Project/Src/Gui/IProgressMonitor.cs

@ -120,15 +120,13 @@ namespace ICSharpCode.SharpDevelop.Gui @@ -120,15 +120,13 @@ namespace ICSharpCode.SharpDevelop.Gui
public OperationStatus Status { get; set; }
public CancellationToken CancellationToken {
get { return CancellationToken.None; }
}
public CancellationToken CancellationToken { get; set; }
public double Progress { get; set; }
public IProgressMonitor CreateSubTask(double workAmount)
{
return new DummyProgressMonitor();
return new DummyProgressMonitor() { CancellationToken = this.CancellationToken };
}
public void Dispose()

1
src/Main/Base/Project/Src/Gui/Pads/TaskList/TaskView.cs

@ -106,6 +106,7 @@ namespace ICSharpCode.SharpDevelop.Gui @@ -106,6 +106,7 @@ namespace ICSharpCode.SharpDevelop.Gui
this.Columns.Add(file);
this.Columns.Add(path);
this.HideSelection = false;
this.FullRowSelect = true;
this.AutoArrange = true;
this.Alignment = ListViewAlignment.Left;

14
src/Main/Base/Project/Src/Services/File/FileService.cs

@ -412,8 +412,7 @@ namespace ICSharpCode.SharpDevelop @@ -412,8 +412,7 @@ namespace ICSharpCode.SharpDevelop
Directory.Delete(fileName, true);
}
} catch (Exception e) {
MessageService.ShowException(e, "Can't remove directory " + fileName);
// return;
MessageService.ShowHandledException(e, "Can't remove directory " + fileName);
}
} else {
try {
@ -424,8 +423,7 @@ namespace ICSharpCode.SharpDevelop @@ -424,8 +423,7 @@ namespace ICSharpCode.SharpDevelop
File.Delete(fileName);
}
} catch (Exception e) {
MessageService.ShowException(e, "Can't remove file " + fileName);
// return;
MessageService.ShowHandledException(e, "Can't remove file " + fileName);
}
}
}
@ -464,9 +462,9 @@ namespace ICSharpCode.SharpDevelop @@ -464,9 +462,9 @@ namespace ICSharpCode.SharpDevelop
}
} catch (Exception e) {
if (isDirectory) {
MessageService.ShowException(e, "Can't rename directory " + oldName);
MessageService.ShowHandledException(e, "Can't rename directory " + oldName);
} else {
MessageService.ShowException(e, "Can't rename file " + oldName);
MessageService.ShowHandledException(e, "Can't rename file " + oldName);
}
return false;
}
@ -508,9 +506,9 @@ namespace ICSharpCode.SharpDevelop @@ -508,9 +506,9 @@ namespace ICSharpCode.SharpDevelop
}
} catch (Exception e) {
if (isDirectory) {
MessageService.ShowException(e, "Can't copy directory " + oldName);
MessageService.ShowHandledException(e, "Can't copy directory " + oldName);
} else {
MessageService.ShowException(e, "Can't copy file " + oldName);
MessageService.ShowHandledException(e, "Can't copy file " + oldName);
}
return false;
}

20
src/Main/Base/Project/Src/Services/RefactoringService/RefactoringService.cs

@ -6,6 +6,7 @@ using System.Collections.Generic; @@ -6,6 +6,7 @@ using System.Collections.Generic;
using System.Diagnostics;
using System.Drawing;
using System.Linq;
using System.Threading;
using ICSharpCode.Core;
using ICSharpCode.SharpDevelop.Dom;
@ -228,6 +229,9 @@ namespace ICSharpCode.SharpDevelop.Refactoring @@ -228,6 +229,9 @@ namespace ICSharpCode.SharpDevelop.Refactoring
if (progressMonitor != null) progressMonitor.ShowingDialog = false;
return null;
}
CancellationToken ct = progressMonitor != null ? progressMonitor.CancellationToken : CancellationToken.None;
List<ProjectItem> files;
if (!string.IsNullOrEmpty(fileName)) {
// search just in given file
@ -249,7 +253,7 @@ namespace ICSharpCode.SharpDevelop.Refactoring @@ -249,7 +253,7 @@ namespace ICSharpCode.SharpDevelop.Refactoring
if (progressMonitor != null) {
progressMonitor.Progress += 1.0 / files.Count;
if (progressMonitor.CancellationToken.IsCancellationRequested)
if (ct.IsCancellationRequested)
return null;
}
// Don't read files we don't have a parser for.
@ -257,7 +261,14 @@ namespace ICSharpCode.SharpDevelop.Refactoring @@ -257,7 +261,14 @@ namespace ICSharpCode.SharpDevelop.Refactoring
if (ParserService.GetParser(itemFileName) != null) {
ITextBuffer content = finder.Create(itemFileName);
if (content != null) {
AddReferences(references, ownerClass, member, itemFileName, content.Text);
try {
AddReferences(references, ownerClass, member, itemFileName, content.Text, ct);
} catch (OperationCanceledException ex) {
if (ex.CancellationToken == ct)
return null;
else
throw;
}
}
}
}
@ -270,7 +281,8 @@ namespace ICSharpCode.SharpDevelop.Refactoring @@ -270,7 +281,8 @@ namespace ICSharpCode.SharpDevelop.Refactoring
/// </summary>
static void AddReferences(List<Reference> list,
IClass parentClass, IMember member,
string fileName, string fileContent)
string fileName, string fileContent,
CancellationToken cancellationToken)
{
TextFinder textFinder; // the class used to find the position to resolve
if (member == null) {
@ -292,6 +304,7 @@ namespace ICSharpCode.SharpDevelop.Refactoring @@ -292,6 +304,7 @@ namespace ICSharpCode.SharpDevelop.Refactoring
TextFinderMatch match = new TextFinderMatch(-1, 0);
while (true) {
cancellationToken.ThrowIfCancellationRequested();
match = textFinder.Find(fileContentForFinder, match.Position + 1);
if (match.Position < 0)
break;
@ -307,6 +320,7 @@ namespace ICSharpCode.SharpDevelop.Refactoring @@ -307,6 +320,7 @@ namespace ICSharpCode.SharpDevelop.Refactoring
if (expr.Expression != null) {
Point position = GetPosition(fileContent, match.ResolvePosition);
repeatResolve:
cancellationToken.ThrowIfCancellationRequested();
// TODO: Optimize by re-using the same resolver if multiple expressions were
// found in this file (the resolver should parse all methods at once)
ResolveResult rr = ParserService.Resolve(expr, position.Y, position.X, fileName, fileContent);

27
src/Main/Core/Project/Src/Services/MessageService/MessageService.cs

@ -52,6 +52,33 @@ namespace ICSharpCode.Core @@ -52,6 +52,33 @@ namespace ICSharpCode.Core
ServiceManager.Instance.MessageService.ShowException(ex, message);
}
/// <summary>
/// Shows an exception.
/// </summary>
public static void ShowHandledException(Exception ex)
{
ShowHandledException(ex, null);
}
/// <summary>
/// Shows an exception.
/// </summary>
public static void ShowHandledException(Exception ex, string message)
{
LoggingService.Error(message, ex);
LoggingService.Warn("Stack trace of last exception log:\n" + Environment.StackTrace);
message = GetMessage(message, ex);
ServiceManager.Instance.MessageService.ShowError(message);
}
static string GetMessage(string message, Exception ex)
{
if (message == null) {
return ex.Message;
}
return message + "\r\n\r\n" + ex.Message;
}
/// <summary>
/// Shows a warning message.
/// </summary>

2
src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/PropertyGrid/Editors/BrushEditor/ColorHelper.cs → src/Main/ICSharpCode.SharpDevelop.Widgets/Project/ColorHelper.cs

@ -7,7 +7,7 @@ using System.Linq; @@ -7,7 +7,7 @@ using System.Linq;
using System.Text;
using System.Windows.Media;
namespace ICSharpCode.WpfDesign.Designer.PropertyGrid.Editors.BrushEditor
namespace ICSharpCode.SharpDevelop.Widgets
{
public static class ColorHelper
{

20
src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/PropertyGrid/Editors/BrushEditor/ColorPicker.xaml → src/Main/ICSharpCode.SharpDevelop.Widgets/Project/ColorPicker.xaml

@ -1,9 +1,7 @@ @@ -1,9 +1,7 @@
<UserControl x:Class="ICSharpCode.WpfDesign.Designer.PropertyGrid.Editors.BrushEditor.ColorPicker"
<UserControl x:Class="ICSharpCode.SharpDevelop.Widgets.ColorPicker"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:Controls="clr-namespace:ICSharpCode.WpfDesign.Designer.Controls"
xmlns:BrushEditor="clr-namespace:ICSharpCode.WpfDesign.Designer.PropertyGrid.Editors.BrushEditor"
xmlns:widgets="http://icsharpcode.net/sharpdevelop/widgets"
xmlns:widgets="clr-namespace:ICSharpCode.SharpDevelop.Widgets"
x:Name="this"
Padding="5"
Width="373">
@ -55,7 +53,7 @@ @@ -55,7 +53,7 @@
</Border>
<DockPanel Margin="0 3 0 0">
<BrushEditor:HexTextBox Text="{Binding Hex, ElementName=this, UpdateSourceTrigger=PropertyChanged}"
<widgets:HexTextBox Text="{Binding Hex, ElementName=this, UpdateSourceTrigger=PropertyChanged}"
Width="70"
Margin="5 0 0 0"
DockPanel.Dock="Right" />
@ -143,7 +141,7 @@ @@ -143,7 +141,7 @@
<Border Margin="10 0 0 0"
DockPanel.Dock="Right">
<BrushEditor:Picker Orientation="Vertical"
<widgets:Picker Orientation="Vertical"
Value="{Binding H, ElementName=this}"
Minimum="360"
Maximum="0"
@ -180,15 +178,15 @@ @@ -180,15 +178,15 @@
Data="M 0 0 L -5 5 L 0 10 Z"
Fill="Black" />
</Grid>
</BrushEditor:Picker>
</widgets:Picker>
</Border>
<Border BorderBrush="Black"
BorderThickness="1">
<BrushEditor:Picker Value="{Binding S, ElementName=this}"
<widgets:Picker Value="{Binding S, ElementName=this}"
Marker="{Binding ElementName=point}"
ClipToBounds="True">
<BrushEditor:Picker Orientation="Vertical"
<widgets:Picker Orientation="Vertical"
Value="{Binding V, ElementName=this}"
Minimum="100"
Maximum="0"
@ -225,8 +223,8 @@ @@ -225,8 +223,8 @@
Margin="1"
IsHitTestVisible="False" />
</Grid>
</BrushEditor:Picker>
</BrushEditor:Picker>
</widgets:Picker>
</widgets:Picker>
</Border>
</DockPanel>

2
src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/PropertyGrid/Editors/BrushEditor/ColorPicker.xaml.cs → src/Main/ICSharpCode.SharpDevelop.Widgets/Project/ColorPicker.xaml.cs

@ -16,7 +16,7 @@ using System.Windows.Navigation; @@ -16,7 +16,7 @@ using System.Windows.Navigation;
using System.Windows.Shapes;
using System.ComponentModel;
namespace ICSharpCode.WpfDesign.Designer.PropertyGrid.Editors.BrushEditor
namespace ICSharpCode.SharpDevelop.Widgets
{
public partial class ColorPicker
{

9
src/Main/ICSharpCode.SharpDevelop.Widgets/Project/ICSharpCode.SharpDevelop.Widgets.csproj

@ -63,6 +63,10 @@ @@ -63,6 +63,10 @@
<Link>Configuration\GlobalAssemblyInfo.cs</Link>
</Compile>
<Compile Include="CollapsiblePanel.cs" />
<Compile Include="ColorHelper.cs" />
<Compile Include="ColorPicker.xaml.cs">
<DependentUpon>ColorPicker.xaml</DependentUpon>
</Compile>
<Compile Include="Configuration\AssemblyInfo.cs" />
<Compile Include="DragListener.cs" />
<Compile Include="ListViewSorting\AbstractListViewParseableColumnComparer.cs" />
@ -76,6 +80,7 @@ @@ -76,6 +80,7 @@
<Compile Include="NumericUpDown.cs">
<DependentUpon>NumericUpDown.xaml</DependentUpon>
</Compile>
<Compile Include="Picker.cs" />
<Compile Include="RadioButtonGroup.cs" />
<Compile Include="Resources\BitmapResources.cs" />
<Compile Include="SideBar\SideBar.cs">
@ -99,6 +104,10 @@ @@ -99,6 +104,10 @@
<EmbeddedResource Include="Resources\Icons.16x16.SortDescending.png" />
</ItemGroup>
<ItemGroup>
<Page Include="ColorPicker.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="NumericUpDown.xaml" />
<Page Include="themes\generic.xaml" />
<Page Include="ZoomScrollViewer.xaml" />

2
src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/PropertyGrid/Editors/BrushEditor/Picker.cs → src/Main/ICSharpCode.SharpDevelop.Widgets/Project/Picker.cs

@ -12,7 +12,7 @@ using System.Windows.Controls; @@ -12,7 +12,7 @@ using System.Windows.Controls;
using System.Windows.Media;
using System.Windows.Data;
namespace ICSharpCode.WpfDesign.Designer.PropertyGrid.Editors.BrushEditor
namespace ICSharpCode.SharpDevelop.Widgets
{
public class Picker : Grid
{
Loading…
Cancel
Save