Browse Source

Merge branch '4.0'

pull/2/head
Daniel Grunwald 15 years ago
parent
commit
4f7ce03f90
  1. BIN
      data/resources/image/BitmapResources/ClassBrowserIcons/Icons.16x16.ExtensionMethod.png
  2. BIN
      data/resources/image/BitmapResources/ClassBrowserIcons/Icons.16x16.InternalExtensionMethod.png
  3. BIN
      data/resources/image/BitmapResources/ClassBrowserIcons/Icons.16x16.PrivateExtensionMethod.png
  4. BIN
      data/resources/image/BitmapResources/ClassBrowserIcons/Icons.16x16.ProtectedExtensionMethod.png
  5. 2
      data/resources/image/BitmapResources/build.bat
  6. 22
      data/templates/file/VBNet/VBNet.WPFPage.xft
  7. 59
      data/templates/file/VBNet/VBNet.WPFPageFunction.xft
  8. 24
      data/templates/file/VBNet/VBNet.WPFUserControl.xft
  9. 22
      data/templates/file/VBNet/VBNet.WPFWindow.xft
  10. 120
      data/templates/project/VBNet/MyWpfExtension.vb
  11. 99
      data/templates/project/VBNet/WPFApplication.xpt
  12. 25
      data/templates/project/VBNet/WPFAssemblyInfo.vb
  13. 103
      data/templates/project/VBNet/WPFNavigationApplication.xpt
  14. 14
      doc/ChangeLog.template.html
  15. 2
      src/AddIns/Analysis/UnitTesting/UnitTesting.addin
  16. 5
      src/AddIns/BackendBindings/CSharpBinding/Project/Resources/MyNamespaceSupportForCSharp.cs
  17. 4
      src/AddIns/BackendBindings/CSharpBinding/Project/Src/FormattingStrategy/CSharpFormattingStrategy.cs
  18. 8
      src/AddIns/BackendBindings/Ruby/IronRuby/README.txt
  19. BIN
      src/AddIns/BackendBindings/Ruby/IronRuby/bin/IronRuby.Libraries.Yaml.dll
  20. BIN
      src/AddIns/BackendBindings/Ruby/IronRuby/bin/IronRuby.Libraries.dll
  21. BIN
      src/AddIns/BackendBindings/Ruby/IronRuby/bin/IronRuby.dll
  22. BIN
      src/AddIns/BackendBindings/Ruby/IronRuby/bin/Microsoft.Dynamic.dll
  23. BIN
      src/AddIns/BackendBindings/Ruby/IronRuby/bin/Microsoft.Scripting.Debugging.dll
  24. BIN
      src/AddIns/BackendBindings/Ruby/IronRuby/bin/Microsoft.Scripting.Metadata.dll
  25. BIN
      src/AddIns/BackendBindings/Ruby/IronRuby/bin/Microsoft.Scripting.dll
  26. BIN
      src/AddIns/BackendBindings/Ruby/IronRuby/bin/ir.exe
  27. 17
      src/AddIns/BackendBindings/Ruby/IronRuby/bin/ir.exe.config
  28. 2
      src/AddIns/BackendBindings/Ruby/RubyBinding.sln
  29. 4
      src/AddIns/BackendBindings/Ruby/RubyBinding/Project/RubyBinding.csproj
  30. 35
      src/AddIns/BackendBindings/Ruby/RubyBinding/Project/Src/RubyAstWalker.cs
  31. 26
      src/AddIns/BackendBindings/Ruby/RubyBinding/Project/Src/RubyCodeDeserializer.cs
  32. 1
      src/AddIns/BackendBindings/Ruby/RubyBinding/Project/Src/RubyConsoleApplication.cs
  33. 2
      src/AddIns/BackendBindings/Ruby/RubyBinding/Project/Src/RubyControlFieldExpression.cs
  34. 4
      src/AddIns/BackendBindings/Ruby/RubyBinding/Project/Templates/ConsoleProject.xpt
  35. 4
      src/AddIns/BackendBindings/Ruby/RubyBinding/Project/Templates/FormsProject.xpt
  36. 4
      src/AddIns/BackendBindings/Ruby/RubyBinding/Project/Templates/WPFApplication.xpt
  37. 2
      src/AddIns/BackendBindings/Ruby/RubyBinding/Test/Gui/DebugRunRubyCommandTests.cs
  38. 2
      src/AddIns/BackendBindings/Ruby/RubyBinding/Test/Gui/RunRubyCommandTests.cs
  39. 4
      src/AddIns/BackendBindings/Ruby/RubyBinding/Test/Parsing/ParseClassMethodWithBodyTestFixture.cs
  40. 10
      src/AddIns/BackendBindings/Ruby/RubyBinding/Test/Testing/RubyConsoleApplicationTests.cs
  41. 1
      src/AddIns/BackendBindings/Ruby/RubyBinding/Test/Testing/RubyTestDebuggerRunsSelectedTestMethodTestFixture.cs
  42. 5
      src/AddIns/BackendBindings/Ruby/RubyBinding/Test/Testing/RubyTestRunnerApplicationTests.cs
  43. 1
      src/AddIns/BackendBindings/Ruby/RubyBinding/Test/Testing/RubyTestRunnerRunsSelectedTestMethodTestFixture.cs
  44. 27
      src/AddIns/BackendBindings/Scripting/Test/Utils/MockViewContent.cs
  45. 3
      src/AddIns/BackendBindings/VBNetBinding/Project/Src/MyNamespaceBuilder.cs
  46. 7
      src/AddIns/BackendBindings/WixBinding/Test/Utils/MockViewContent.cs
  47. 6
      src/AddIns/BackendBindings/XamlBinding/XamlBinding/CompilationUnitCreatorVisitor.cs
  48. 4
      src/AddIns/BackendBindings/XamlBinding/XamlBinding/XamlParser.cs
  49. 14
      src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/AvalonEditViewContent.cs
  50. 1
      src/AddIns/DisplayBindings/AvalonEdit.AddIn/themes/generic.xaml
  51. 15
      src/AddIns/DisplayBindings/XmlEditor/Test/Utils/MockViewContent.cs
  52. 29
      src/AddIns/Misc/Reports/ICSharpCode.Reports.Addin/Test/Designer/MockViewContend.cs
  53. 9
      src/Libraries/AvalonDock/AvalonDock/DockingManager.cs
  54. 5
      src/Libraries/AvalonDock/AvalonDock/NavigatorWindow.cs
  55. 2
      src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Document/ISegment.cs
  56. 35
      src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Document/OffsetChangeMap.cs
  57. 8
      src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Document/TextAnchor.cs
  58. 21
      src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Document/TextAnchorTree.cs
  59. 8
      src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Document/TextDocument.cs
  60. 2
      src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Editing/Caret.cs
  61. 25
      src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Editing/EditingCommandHandler.cs
  62. 4
      src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Editing/SimpleSelection.cs
  63. 7
      src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Rendering/TextView.cs
  64. 22
      src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/TextEditor.cs
  65. 1
      src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/TextEditor.xaml
  66. 5
      src/Libraries/NRefactory/Project/Src/Lexer/VBNet/ExpressionFinder.atg
  67. 20
      src/Libraries/NRefactory/Project/Src/Lexer/VBNet/Parser.cs
  68. 1310
      src/Libraries/NRefactory/Project/Src/Parser/VBNet/Parser.cs
  69. 7
      src/Libraries/NRefactory/Project/Src/Parser/VBNet/VBNET.ATG
  70. 6
      src/Main/Base/Project/Src/Commands/WindowCommands.cs
  71. 20
      src/Main/Base/Project/Src/Editor/AvalonEdit/AvalonEditDocumentAdapter.cs
  72. 10
      src/Main/Base/Project/Src/Editor/ITextAnchor.cs
  73. 75
      src/Main/Base/Project/Src/Gui/AbstractViewContent.cs
  74. 12
      src/Main/Base/Project/Src/Gui/IViewContent.cs
  75. 12
      src/Main/Base/Project/Src/Gui/Workbench/Layouts/AvalonDockLayout.cs
  76. 89
      src/Main/Base/Project/Src/Gui/Workbench/Layouts/AvalonWorkbenchWindow.cs
  77. 10
      src/Main/Base/Project/Src/Gui/Workbench/WpfWorkbench.cs
  78. 7
      src/Main/Base/Project/Src/Project/CompilableProject.cs
  79. 20
      src/Main/Base/Project/Src/Project/CustomTool.cs
  80. 11
      src/Main/Base/Project/Src/Util/FakeXmlViewContent.cs
  81. 4
      src/Main/ICSharpCode.SharpDevelop.Dom/Project/Src/CecilReader.cs
  82. 3
      src/Setup/Files.wxs
  83. 1
      src/Setup/Setup.wxs
  84. 2
      src/Tools/CheckFileHeaders/Main.cs

BIN
data/resources/image/BitmapResources/ClassBrowserIcons/Icons.16x16.ExtensionMethod.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 488 B

BIN
data/resources/image/BitmapResources/ClassBrowserIcons/Icons.16x16.InternalExtensionMethod.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 629 B

BIN
data/resources/image/BitmapResources/ClassBrowserIcons/Icons.16x16.PrivateExtensionMethod.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 650 B

BIN
data/resources/image/BitmapResources/ClassBrowserIcons/Icons.16x16.ProtectedExtensionMethod.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 611 B

2
data/resources/image/BitmapResources/build.bat

@ -1,3 +1,3 @@ @@ -1,3 +1,3 @@
resasm BitmapResources.res
move BitmapResources.resources ..\..\SharpDevelop\Src\Main\StartUp\Project\Resources\BitmapResources.resources
move BitmapResources.resources ..\..\..\..\Src\Main\StartUp\Project\Resources\BitmapResources.resources
pause

22
data/templates/file/VBNet/VBNet.WPFPage.xft

@ -33,7 +33,7 @@ @@ -33,7 +33,7 @@
${Path} -> Full path of the file
-->
<Files>
<File name="${FullName}" language="XML" buildAction="Page"><![CDATA[<Page x:Class="${StandardNamespace}.${ClassName}"
<File name="${FullName}" language="XML" buildAction="Page"><![CDATA[<Page x:Class="${ClassName}"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="${FileNameWithoutExtension}">
@ -52,16 +52,16 @@ Imports System.Windows.Documents @@ -52,16 +52,16 @@ Imports System.Windows.Documents
Imports System.Windows.Input
Imports System.Windows.Media
Namespace ${StandardNamespace}
''' <summary>
''' Interaction logic for ${FileName}
''' </summary>
Public Partial Class ${ClassName} Inherits Page
Public Sub New()
InitializeComponent()
End Sub
End Class
End Namespace]]></File>
''' <summary>
''' Interaction logic for ${FileName}
''' </summary>
Public Partial Class ${ClassName}
Inherits Page
Public Sub New()
InitializeComponent()
End Sub
End Class]]></File>
</Files>
<AdditionalOptions/>

59
data/templates/file/VBNet/VBNet.WPFPageFunction.xft

@ -37,7 +37,7 @@ @@ -37,7 +37,7 @@
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:sys="clr-namespace:System;assembly=mscorlib"
x:Class="${StandardNamespace}.${FileNameWithoutExtension}"
x:Class="${FileNameWithoutExtension}"
x:TypeArguments="sys:String"
Title="${FileNameWithoutExtension}">
<Grid>
@ -57,40 +57,37 @@ Imports System.Windows.Media.Imaging @@ -57,40 +57,37 @@ Imports System.Windows.Media.Imaging
Imports System.Windows.Navigation
Imports System.Windows.Shapes
Namespace ${StandardNamespace}
''' <summary>
''' Interaction logic for ${FileName}
''' </summary>
''' <summary>
''' Interaction logic for ${FileName}
''' </summary>
Public Partial Class ${FileNameWithoutExtension}
Inherits PageFunction(Of String)
Public Partial Class ${FileNameWithoutExtension}
Inherits PageFunction(Of String)
Public Sub New()
InitializeComponent()
End Sub
Public Sub New()
InitializeComponent()
End Sub
' The OnLoaded handler can be run automatically when the class is loaded. To use it, add Loaded="OnLoaded" to the attributes of the root element of the .xaml file and uncomment the following line.
' Private Sub OnLoaded(sender As Object, e As RoutedEventArgs)
' End Sub
'
' Sample Finish Handler
' Private Sub OnClickDone(sender As Object, e As RoutedEventArgs)
' OnFinish(New ReturnEventArgs(Of String)("The return value"))
' End Sub
' The OnLoaded handler can be run automatically when the class is loaded. To use it, add Loaded="OnLoaded" to the attributes of the root element of the .xaml file and uncomment the following line.
' Private Sub OnLoaded(sender As Object, e As RoutedEventArgs)
' End Sub
'
' Sample Finish Handler
' Private Sub OnClickDone(sender As Object, e As RoutedEventArgs)
' OnFinish(New ReturnEventArgs(Of String)("The return value"))
' End Sub
' To launch this page function, put this code in the launching page.
' Dim pageFunction As New ${FileNameWithoutExtension}()
' pageFunction.[Return] += New ReturnEventHandler(Of String)(OnFileNameWithoutExtensionReturned)
' _NavWin.Navigate(pageFunction)
'
' This handler goes in the launching page.
' Public Sub On${FileNameWithoutExtension}Returned(sender As Object, e As ReturnEventArgs(Of String))
' Console.WriteLine("${FileNameWithoutExtension} returned: " & e.Result)
' End Sub
End Class
End Namespace]]></File>
' To launch this page function, put this code in the launching page.
' Dim pageFunction As New ${FileNameWithoutExtension}()
' pageFunction.[Return] += New ReturnEventHandler(Of String)(OnFileNameWithoutExtensionReturned)
' _NavWin.Navigate(pageFunction)
'
' This handler goes in the launching page.
' Public Sub On${FileNameWithoutExtension}Returned(sender As Object, e As ReturnEventArgs(Of String))
' Console.WriteLine("${FileNameWithoutExtension} returned: " & e.Result)
' End Sub
End Class]]></File>
</Files>
<AdditionalOptions/>

24
data/templates/file/VBNet/VBNet.WPFUserControl.xft

@ -33,14 +33,14 @@ @@ -33,14 +33,14 @@
${Path} -> Full path of the file
-->
<Files>
<File name="${FullName}" language="C#"><![CDATA[<UserControl x:Class="${StandardNamespace}.${ClassName}"
<File name="${FullName}" language="XML"><![CDATA[<UserControl x:Class="${ClassName}"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<Grid>
</Grid>
</UserControl>]]></File>
<File name="${FullName}.cs" language="VBNET" DependentUpon="${FileName}" SubType="Code"><![CDATA[${StandardHeader.VBNET}
<File name="${FullName}.vb" language="VBNET" DependentUpon="${FileName}" SubType="Code"><![CDATA[${StandardHeader.VBNET}
Imports System
Imports System.Collections.Generic
Imports System.Text
@ -51,16 +51,16 @@ Imports System.Windows.Documents @@ -51,16 +51,16 @@ Imports System.Windows.Documents
Imports System.Windows.Input
Imports System.Windows.Media
Namespace ${StandardNamespace}
''' <summary>
''' Interaction logic for ${FileName}
''' </summary>
Public Partial Class ${ClassName} Inherits UserControl
Public Sub New()
InitializeComponent()
End Sub
End Class
End Namespace]]></File>
''' <summary>
''' Interaction logic for ${FileName}
''' </summary>
Public Partial Class ${ClassName}
Inherits UserControl
Public Sub New()
InitializeComponent()
End Sub
End Class]]></File>
</Files>
<AdditionalOptions/>

22
data/templates/file/VBNet/VBNet.WPFWindow.xft

@ -33,7 +33,7 @@ @@ -33,7 +33,7 @@
${Path} -> Full path of the file
-->
<Files>
<File name="${FullName}" language="XML" buildAction="Page"><![CDATA[<Window x:Class="${StandardNamespace}.${ClassName}"
<File name="${FullName}" language="XML" buildAction="Page"><![CDATA[<Window x:Class="${ClassName}"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="${StandardNamespace}" Height="300" Width="300">
@ -52,16 +52,16 @@ Imports System.Windows.Documents @@ -52,16 +52,16 @@ Imports System.Windows.Documents
Imports System.Windows.Input
Imports System.Windows.Media
Namespace ${StandardNamespace}
' <summary>
' Interaction logic for ${FileName}
' </summary>
Public Partial Class ${ClassName} Inherits Window
Public Sub New()
InitializeComponent()
End Sub
End Class
End Namespace]]></File>
''' <summary>
''' Interaction logic for ${FileName}
''' </summary>
Public Partial Class ${ClassName}
Inherits Window
Public Sub New()
InitializeComponent()
End Sub
End Class]]></File>
</Files>
<AdditionalOptions/>

120
data/templates/project/VBNet/MyWpfExtension.vb

@ -0,0 +1,120 @@ @@ -0,0 +1,120 @@
Namespace My
<Global.Microsoft.VisualBasic.HideModuleName()>
Module MyWpfExtension
<System.ThreadStatic()> Private m_computer As MyComputer
<System.ThreadStatic()> Private m_user As MyUser
<System.ThreadStatic()> Private m_windows As MyWindows
<System.ThreadStatic()> Private m_log As MyLog
''' <summary>
''' Returns the application object for the running application
''' </summary>
Friend ReadOnly Property Application() As MyApplication
Get
Return CType(Global.System.Windows.Application.Current, MyApplication)
End Get
End Property
''' <summary>
''' Returns information about the host computer.
''' </summary>
Friend ReadOnly Property Computer() As Global.Microsoft.VisualBasic.Devices.Computer
Get
If m_computer Is Nothing Then
m_computer = New MyComputer()
End If
Return m_computer
End Get
End Property
''' <summary>
''' Returns information for the current user. If you wish to run the application with the current
''' Windows user credentials, call My.User.InitializeWithWindowsUser().
''' </summary>
Friend ReadOnly Property User() As Global.Microsoft.VisualBasic.ApplicationServices.User
Get
If m_user Is Nothing Then
m_user = New MyUser()
End If
Return m_user
End Get
End Property
''' <summary>
''' Returns the application log. The listeners can be configured by the application's configuration file.
''' </summary>
Friend ReadOnly Property Log() As Global.Microsoft.VisualBasic.Logging.Log
Get
If m_log Is Nothing Then
m_log = New MyLog()
End If
Return m_log
End Get
End Property
''' <summary>
''' Returns the collection of Windows defined in the project.
''' </summary>
Friend ReadOnly Property Windows() As MyWindows
<Global.System.Diagnostics.DebuggerHidden()>
Get
If m_windows Is Nothing Then
m_windows = New MyWindows()
End If
Return m_windows
End Get
End Property
<Global.Microsoft.VisualBasic.MyGroupCollection("System.Windows.Window", "Create__Instance__", "Dispose__Instance__", "My.MyWpfExtenstionModule.Windows")>
Friend NotInheritable Class MyWindows
<Global.System.Diagnostics.DebuggerHidden()>
Private Shared Function Create__Instance__(Of T As {New, Global.System.Windows.Window})(ByVal Instance As T) As T
If Instance Is Nothing Then
If m_WindowBeingCreated IsNot Nothing Then
If m_WindowBeingCreated.ContainsKey(GetType(T)) = True Then
Throw New Global.System.InvalidOperationException("The window cannot be accessed via My.Windows from the Window constructor.")
End If
Else
m_WindowBeingCreated = New Global.System.Collections.Hashtable()
End If
m_WindowBeingCreated.Add(GetType(T), Nothing)
Return New T()
m_WindowBeingCreated.Remove(GetType(T))
Else
Return Instance
End If
End Function
<Global.System.Diagnostics.DebuggerHidden()>
Private Sub Dispose__Instance__(Of T As Global.System.Windows.Window)(ByRef instance As T)
instance = Nothing
End Sub
<Global.System.ThreadStatic()> Private Shared m_WindowBeingCreated As Global.System.Collections.Hashtable
End Class
End Module
End Namespace
Partial Class MyComputer
Inherits Global.Microsoft.VisualBasic.Devices.Computer
End Class
Partial Class MyUser
Inherits Global.Microsoft.VisualBasic.ApplicationServices.User
End Class
Partial Class MyLog
Inherits Global.Microsoft.VisualBasic.Logging.Log
End Class
Partial Class MyApplication
Inherits Global.System.Windows.Application
Friend ReadOnly Property Info() As Global.Microsoft.VisualBasic.ApplicationServices.AssemblyInfo
<Global.System.Diagnostics.DebuggerHidden()>
Get
Return New Global.Microsoft.VisualBasic.ApplicationServices.AssemblyInfo(Global.System.Reflection.Assembly.GetExecutingAssembly())
End Get
End Property
End Class

99
data/templates/project/VBNet/WPFApplication.xpt

@ -0,0 +1,99 @@ @@ -0,0 +1,99 @@
<?xml version="1.0"?>
<Template originator = "Siegfried Oleg Pammer" created = "26/10/2010">
<!-- Template Header -->
<TemplateConfiguration>
<Name>${res:Templates.Project.WinFXApplication.Name}</Name>
<Category>VBNet</Category>
<Subcategory>WPF</Subcategory>
<Icon>VBNet.Project.Form</Icon>
<Description>${res:Templates.Project.WinFXApplication.Description}</Description>
<SupportedTargetFrameworks>v3.0;v3.5Client</SupportedTargetFrameworks>
</TemplateConfiguration>
<!-- Actions -->
<Actions>
<Open filename = "Window1.xaml"/>
</Actions>
<Project language = "VBNet">
<ProjectItems>
<Reference Include="System" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
<Reference Include="PresentationCore">
<RequiredTargetFramework>3.0</RequiredTargetFramework>
</Reference>
<Reference Include="PresentationFramework">
<RequiredTargetFramework>3.0</RequiredTargetFramework>
</Reference>
<Reference Include="WindowsBase">
<RequiredTargetFramework>3.0</RequiredTargetFramework>
</Reference>
</ProjectItems>
<PropertyGroup>
<OutputType>WinExe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<MyType>Custom</MyType>
</PropertyGroup>
<Files>
<File name="App.xaml" buildAction="ApplicationDefinition" language="XML"><![CDATA[<Application x:Class="App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
StartupUri="Window1.xaml">
<Application.Resources>
</Application.Resources>
</Application>]]></File>
<File name="App.xaml.vb" SubType="Code" DependentUpon="App.xaml"><![CDATA[${StandardHeader.VBNET}
Imports System
Imports System.Windows
Imports System.Data
Imports System.Xml
Imports System.Configuration
''' <summary>
''' Interaction logic for App.xaml
''' </summary>
Public Partial Class App
Inherits Application
End Class]]></File>
<File name="Window1.xaml" buildAction="Page" language="XML"><![CDATA[<Window x:Class="Window1"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="${StandardNamespace}" Height="300" Width="300"
>
<Grid>
</Grid>
</Window>]]></File>
<File name="Window1.xaml.vb" SubType="Code" DependentUpon="Window1.xaml"><![CDATA[${StandardHeader.VBNET}
Imports System
Imports System.Collections.Generic
Imports System.Text
Imports System.Windows
Imports System.Windows.Controls
Imports System.Windows.Data
Imports System.Windows.Documents
Imports System.Windows.Input
Imports System.Windows.Media
''' <summary>
''' Interaction logic for Window1.xaml
''' </summary>
Public Partial Class Window1
Inherits Window
Public Sub New()
InitializeComponent()
End Sub
End Class]]></File>
<File name="Properties\WPFAssemblyInfo.vb" src="WPFAssemblyInfo.vb" />
<File name="Properties\AssemblyInfo.vb" src="DefaultAssemblyInfo.vb" />
<File name="Properties\MyExtensions\MyWpfExtension.vb" src="MyWpfExtension.vb" />
</Files>
</Project>
</Template>

25
data/templates/project/VBNet/WPFAssemblyInfo.vb

@ -0,0 +1,25 @@ @@ -0,0 +1,25 @@
#Region "Imports directives"
Imports System.Resources
Imports System.Windows
#End Region
' In order to begin building localizable applications, set
' <UICulture>CultureYouAreCodingWith</UICulture> in your .vbproj file
' inside a <PropertyGroup>. For example, if you are using US english
' in your source files, set the <UICulture> to en-US. Then uncomment
' the NeutralResourceLanguage attribute below. Update the "en-US" in
' the line below to match the UICulture setting in the project file.
'<Assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)>
' themeDictionaryLocation = where theme specific resource dictionaries are located
' (used if a resource is not found in the page,
' or application resource dictionaries)
' genericDictionaryLocation = where the generic resource dictionary is located
' (used if a resource is not found in the page,
' app, or any theme specific resource dictionaries)
<Assembly: ThemeInfo(ResourceDictionaryLocation.None, ResourceDictionaryLocation.SourceAssembly)>

103
data/templates/project/VBNet/WPFNavigationApplication.xpt

@ -0,0 +1,103 @@ @@ -0,0 +1,103 @@
<?xml version="1.0"?>
<Template originator = "Siegfried Oleg Pammer" created = "26/10/2010">
<!-- Template Header -->
<TemplateConfiguration>
<Name>${res:Templates.Project.WinFXNavigationApplication.Name}</Name>
<Category>VBNet</Category>
<Subcategory>WPF</Subcategory>
<Icon>VBNet.Project.Form</Icon>
<Description>${res:Templates.Project.WinFXNavigationApplication.Description}</Description>
<SupportedTargetFrameworks>v3.0;v3.5Client</SupportedTargetFrameworks>
</TemplateConfiguration>
<!-- Actions -->
<Actions>
<Open filename = "Page1.xaml"/>
</Actions>
<Project language = "VBNet">
<ProjectItems>
<Reference Include="System" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
<Reference Include="PresentationCore">
<RequiredTargetFramework>3.0</RequiredTargetFramework>
</Reference>
<Reference Include="PresentationFramework">
<RequiredTargetFramework>3.0</RequiredTargetFramework>
</Reference>
<Reference Include="WindowsBase">
<RequiredTargetFramework>3.0</RequiredTargetFramework>
</Reference>
</ProjectItems>
<PropertyGroup>
<OutputType>WinExe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<MyType>Custom</MyType>
</PropertyGroup>
<Files>
<File name="App.xaml" buildAction="ApplicationDefinition" language="XML"><![CDATA[<Application x:Class="App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
StartupUri="Page1.xaml"
>
<Application.Resources>
</Application.Resources>
</Application>]]></File>
<File name="App.xaml.vb" SubType="Code" DependentUpon="App.xaml"><![CDATA[${StandardHeader.VBNET}
Imports System
Imports System.Windows
Imports System.Data
Imports System.Xml
Imports System.Configuration
''' <summary>
''' Interaction logic for App.xaml
''' </summary>
Public Partial Class App
Inherits Application
End Class]]></File>
<File name="Page1.xaml" language="XML" buildAction="Page"><![CDATA[<Page x:Class="Page1"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="Page1"
>
<Grid>
</Grid>
</Page>]]></File>
<File name="Page1.xaml.vb" language="VBNet" DependentUpon="Page1.xaml" SubType="Code"><![CDATA[${StandardHeader.VBNET}
Imports System
Imports System.Collections.Generic
Imports System.Text
Imports System.Windows
Imports System.Windows.Controls
Imports System.Windows.Data
Imports System.Windows.Documents
Imports System.Windows.Input
Imports System.Windows.Media
Imports System.Windows.Media.Imaging
Imports System.Windows.Navigation
Imports System.Windows.Shapes
''' <summary>
''' Interaction logic for Page1.xaml
''' </summary>
Public Partial Class Page1
Inherits Page
Public Sub New()
InitializeComponent()
End Sub
End Class]]></File>
<File name="Properties\AssemblyInfo.vb" src="DefaultAssemblyInfo.vb" />
<File name="Properties\WPFAssemblyInfo.vb" src="WPFAssemblyInfo.vb" />
<File name="Properties\MyExtensions\MyWpfExtension.vb" src="MyWpfExtension.vb" />
</Files>
</Project>
</Template>

14
doc/ChangeLog.template.html

@ -6,10 +6,20 @@ @@ -6,10 +6,20 @@
<p>
SharpDevelop $INSERTVERSION$ ($INSERTDATE$)
<ul>
<li>Update NUnit to version 2.5.8</li>
<li>Update to Boo 0.9.4 (pre-release build) for .NET 4</li>
<li>Bug fixes</li>
</ul>
</p>
<p>
SharpDevelop 4.0 Beta 4 [4.0.0.6842] (10/26/2010)
<ul>
<li>Bug fixes</li>
<li>SharpDevelop Reports: Grouping support in table layouts, automatic page break after group + more</li>
<li>Improvements to IronPython code completion</li>
<li>Added back Chinese and Russian translations</li>
<li>Update to Boo 0.9.4 (pre-release build) for .NET 4</li>
<li>Update NUnit to version 2.5.8</li>
<li>Update to IronPython 2.6.2</li>
</ul>
</p>

2
src/AddIns/Analysis/UnitTesting/UnitTesting.addin

@ -20,7 +20,7 @@ @@ -20,7 +20,7 @@
<Path name="/SharpDevelop/UnitTesting/TestFrameworks">
<TestFramework id="nunit"
class="ICSharpCode.UnitTesting.NUnitTestFramework"
supportedProjects=".csproj;.vbproj" />
supportedProjects=".csproj;.vbproj;.booproj" />
</Path>
<Path name="/SharpDevelop/Workbench/Pads">

5
src/AddIns/BackendBindings/CSharpBinding/Project/Resources/MyNamespaceSupportForCSharp.cs

@ -1,7 +1,4 @@ @@ -1,7 +1,4 @@
// 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;
using System.Collections.Generic;
using System.Diagnostics;
#if WindowsApplication

4
src/AddIns/BackendBindings/CSharpBinding/Project/Src/FormattingStrategy/CSharpFormattingStrategy.cs

@ -332,7 +332,9 @@ namespace CSharpBinding.FormattingStrategy @@ -332,7 +332,9 @@ namespace CSharpBinding.FormattingStrategy
tag += ">";
}
if (!tag.StartsWith("/")) {
textArea.Document.Insert(textArea.Caret.Offset, "</" + tag.Substring(1));
int caretOffset = textArea.Caret.Offset;
textArea.Document.Insert(caretOffset, "</" + tag.Substring(1));
textArea.Caret.Offset = caretOffset;
}
}
}

8
src/AddIns/BackendBindings/Ruby/IronRuby/README.txt

@ -7,12 +7,15 @@ Authors: @@ -7,12 +7,15 @@ Authors:
Dino Viehland, and everyone else from the community who reports bugs,
builds libraries, and helps enrich IronRuby.
Project Contact: Jimmy Schementi <jimmy@schementi.com>
Project Contacts:
Jimmy Schementi <jschementi@gmail.com>
Miguel de Icaza <miguel@gnome.org>
Tomas Matousek <tomas_matousek@hotmail.com>
== About
IronRuby is a Open Source implementation of the Ruby programming language
(http://www.ruby-lang.org) for .NET, heavily relying on Microsoft's
(http://www.ruby-lang.org) for .NET, heavily relying on the
Dynamic Language Runtime (http://dlr.codeplex.com).
The project's #1 goal is to be a true Ruby implementation, meaning it runs
@ -34,7 +37,6 @@ Will run rubyfile.rb with the IronRuby compiler. @@ -34,7 +37,6 @@ Will run rubyfile.rb with the IronRuby compiler.
/bin IronRuby binaries, ir.exe, iirb, irake, igem, iri, irdoc, etc.
/lib Ruby standard library, including RubyGems
/silverlight Silverlight binaries and scripts
CHANGELOG.txt Changes for each release
RELEASE.txt Release notes
LICENSE.Ruby.txt Ruby license

BIN
src/AddIns/BackendBindings/Ruby/IronRuby/bin/IronRuby.Libraries.Yaml.dll

Binary file not shown.

BIN
src/AddIns/BackendBindings/Ruby/IronRuby/bin/IronRuby.Libraries.dll

Binary file not shown.

BIN
src/AddIns/BackendBindings/Ruby/IronRuby/bin/IronRuby.dll

Binary file not shown.

BIN
src/AddIns/BackendBindings/Ruby/IronRuby/bin/Microsoft.Dynamic.dll

Binary file not shown.

BIN
src/AddIns/BackendBindings/Ruby/IronRuby/bin/Microsoft.Scripting.Debugging.dll

Binary file not shown.

BIN
src/AddIns/BackendBindings/Ruby/IronRuby/bin/Microsoft.Scripting.Metadata.dll

Binary file not shown.

BIN
src/AddIns/BackendBindings/Ruby/IronRuby/bin/Microsoft.Scripting.dll

Binary file not shown.

BIN
src/AddIns/BackendBindings/Ruby/IronRuby/bin/ir.exe

Binary file not shown.

17
src/AddIns/BackendBindings/Ruby/IronRuby/bin/ir.exe.config

@ -1,17 +0,0 @@ @@ -1,17 +0,0 @@
<?xml version='1.0'?>
<configuration>
<configSections>
<section name='microsoft.scripting' type='Microsoft.Scripting.Hosting.Configuration.Section, Microsoft.Scripting, Version=1.1.0.1, Culture=neutral, PublicKeyToken=31bf3856ad364e35' requirePermission='false'/>
</configSections>
<microsoft.scripting>
<languages>
<language names='IronPython;Python;py' extensions='.py' displayName='IronPython 2.7 Alpha 1' type='IronPython.Runtime.PythonContext, IronPython, Version=2.7.0.1, Culture=neutral, PublicKeyToken=31bf3856ad364e35'/>
<language names='IronRuby;Ruby;rb' extensions='.rb' displayName='IronRuby' type='IronRuby.Runtime.RubyContext, IronRuby, Version=1.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'/>
</languages>
<options>
<set language='Ruby' option='LibraryPaths' value='..\lib\IronRuby;..\lib\ruby\site_ruby\1.8;..\lib\ruby\site_ruby;..\lib\ruby\1.8'/>
</options>
</microsoft.scripting>
</configuration>

2
src/AddIns/BackendBindings/Ruby/RubyBinding.sln

@ -1,7 +1,7 @@ @@ -1,7 +1,7 @@

Microsoft Visual Studio Solution File, Format Version 11.00
# Visual Studio 2010
# SharpDevelop 4.0.0.6737
# SharpDevelop 4.0.0.6808
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RubyBinding", "RubyBinding\Project\RubyBinding.csproj", "{C896FFFF-5B6C-4B0E-B6DF-049865F501B4}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RubyBinding.Tests", "RubyBinding\Test\RubyBinding.Tests.csproj", "{01DF0475-0CB2-4E81-971B-BADC60CDE3A5}"

4
src/AddIns/BackendBindings/Ruby/RubyBinding/Project/RubyBinding.csproj

@ -136,10 +136,6 @@ @@ -136,10 +136,6 @@
<Link>Chiron.exe.config</Link>
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="..\..\IronRuby\bin\ir.exe.config">
<Link>ir.exe.config</Link>
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="..\..\IronRuby\LICENSE.APACHE.html">
<Link>LICENSE.APACHE.html</Link>
<CopyToOutputDirectory>Always</CopyToOutputDirectory>

35
src/AddIns/BackendBindings/Ruby/RubyBinding/Project/Src/RubyAstWalker.cs

@ -17,6 +17,11 @@ namespace ICSharpCode.RubyBinding @@ -17,6 +17,11 @@ namespace ICSharpCode.RubyBinding
{
public class RubyAstWalker : Walker
{
/// <summary>
/// Length of "def".
/// </summary>
const int MethodDefinitionLength = 3;
DefaultCompilationUnit compilationUnit;
DefaultClass currentClass;
DefaultClass globalClass;
@ -146,13 +151,35 @@ namespace ICSharpCode.RubyBinding @@ -146,13 +151,35 @@ namespace ICSharpCode.RubyBinding
/// </summary>
DomRegion GetMethodRegion(MethodDefinition methodDef)
{
SourceLocation parametersEndLocation = methodDef.Parameters.Location.End;
if (ParametersEndLocationNeedsCorrecting(parametersEndLocation)) {
parametersEndLocation = CorrectParametersEndLocation(parametersEndLocation);
}
SourceLocation parametersEndLocation = GetParametersEndLocation(methodDef);
return CreateRegion(methodDef.Location.Start, parametersEndLocation);
}
SourceLocation GetParametersEndLocation(MethodDefinition methodDef)
{
SourceLocation parametersEndLocation = methodDef.Parameters.Location.End;
if (parametersEndLocation.IsValid) {
if (ParametersEndLocationNeedsCorrecting(parametersEndLocation)) {
parametersEndLocation = CorrectParametersEndLocation(parametersEndLocation);
}
} else {
return GetParametersEndLocationBasedOnMethodNameEnd(methodDef);
}
return parametersEndLocation;
}
SourceLocation GetParametersEndLocationBasedOnMethodNameEnd(MethodDefinition methodDef)
{
const int methodParenthesesLength = 2;
const int spaceLength = 1;
int methodDefinitionLength = methodDef.Name.Length + MethodDefinitionLength + methodParenthesesLength + spaceLength;
SourceLocation methodStartLocation = methodDef.Location.Start;
int index = methodStartLocation.Index + methodDefinitionLength;
int column = methodStartLocation.Column + methodDefinitionLength;
int line = methodStartLocation.Line;
return new SourceLocation(index, line, column);
}
/// <summary>
/// Returns true if the IronRuby parser has not found the closing bracket for a method
/// and moved to the next line.

26
src/AddIns/BackendBindings/Ruby/RubyBinding/Project/Src/RubyCodeDeserializer.cs

@ -52,9 +52,10 @@ namespace ICSharpCode.RubyBinding @@ -52,9 +52,10 @@ namespace ICSharpCode.RubyBinding
public object Deserialize(string name, MethodCall methodCall)
{
if (methodCall.Target is ArrayItemAccess) {
return DeserializeCreateArrayExpression(name, methodCall);
} else if ("new".Equals(methodCall.MethodName, StringComparison.InvariantCultureIgnoreCase)) {
if ("new".Equals(methodCall.MethodName, StringComparison.InvariantCultureIgnoreCase)) {
if (IsArrayCreation(methodCall)) {
return DeserializeCreateArrayExpression(name, methodCall);
}
return CreateInstance(name, methodCall);
} else if ("|".Equals(methodCall.MethodName)) {
return DeserializeBitwiseOr(methodCall);
@ -62,11 +63,20 @@ namespace ICSharpCode.RubyBinding @@ -62,11 +63,20 @@ namespace ICSharpCode.RubyBinding
return CreateInstance(name, methodCall);
}
bool IsArrayCreation(MethodCall methodCall)
{
MethodCall targetMethodCall = methodCall.Target as MethodCall;
if (targetMethodCall != null) {
return targetMethodCall.MethodName == "[]";
}
return false;
}
public static object Deserialize(StringConstructor stringConstructor)
{
if (stringConstructor.Parts.Count > 0) {
StringLiteral literal = stringConstructor.Parts[0] as StringLiteral;
MutableString mutableString = literal.GetMutableString(RubyEncoding.UTF8);
MutableString mutableString = literal.GetMutableString();
return mutableString.ConvertToString();
}
return String.Empty;
@ -171,7 +181,7 @@ namespace ICSharpCode.RubyBinding @@ -171,7 +181,7 @@ namespace ICSharpCode.RubyBinding
Type GetType(RubyControlFieldExpression field)
{
string typeName = field.FullMemberName;
if (!string.IsNullOrEmpty(typeName)) {
if (!String.IsNullOrEmpty(typeName)) {
return componentCreator.GetType(typeName);
}
return null;
@ -184,8 +194,8 @@ namespace ICSharpCode.RubyBinding @@ -184,8 +194,8 @@ namespace ICSharpCode.RubyBinding
/// </summary>
object DeserializeCreateArrayExpression(string name, MethodCall methodCall)
{
ArrayItemAccess arrayAccess = methodCall.Target as ArrayItemAccess;
ConstantVariable constantVariable = arrayAccess.Arguments.Expressions[0] as ConstantVariable;
MethodCall arrayCreationMethodCall = methodCall.Target as MethodCall;
ConstantVariable constantVariable = arrayCreationMethodCall.Arguments.Expressions[0] as ConstantVariable;
string arrayTypeName = RubyControlFieldExpression.GetQualifiedName(constantVariable);
ArrayConstructor arrayConstructor = methodCall.Arguments.Expressions[0] as ArrayConstructor;
@ -198,7 +208,7 @@ namespace ICSharpCode.RubyBinding @@ -198,7 +208,7 @@ namespace ICSharpCode.RubyBinding
object instance = Deserialize(arrayItemExpression);
array.SetValue(instance, i);
}
return array;
return array;
}
object Deserialize(SelfReference selfRef)

1
src/AddIns/BackendBindings/Ruby/RubyBinding/Project/Src/RubyConsoleApplication.cs

@ -31,6 +31,7 @@ namespace ICSharpCode.RubyBinding @@ -31,6 +31,7 @@ namespace ICSharpCode.RubyBinding
protected override void AddArguments(ScriptingCommandLineBuilder commandLine)
{
commandLine.AppendOption("--disable-gems");
commandLine.AppendBooleanOptionIfTrue("-D", Debug);
AppendLoadPaths(commandLine);
commandLine.AppendQuotedStringIfNotEmpty(ScriptFileName);

2
src/AddIns/BackendBindings/Ruby/RubyBinding/Project/Src/RubyControlFieldExpression.cs

@ -286,7 +286,7 @@ namespace ICSharpCode.RubyBinding @@ -286,7 +286,7 @@ namespace ICSharpCode.RubyBinding
MethodCall clrMemberMethodCall = methodCall.Target as MethodCall;
SymbolLiteral literal = clrMemberMethodCall.Arguments.Expressions[1] as SymbolLiteral;
MutableString mutableString = literal.GetMutableString(RubyEncoding.UTF8);
MutableString mutableString = literal.GetMutableString();
string methodBeingCalledByClrMemberMethod = mutableString.ConvertToString();
// Remove two members since these are 'clr_member' and 'call'.

4
src/AddIns/BackendBindings/Ruby/RubyBinding/Project/Templates/ConsoleProject.xpt

@ -22,14 +22,14 @@ @@ -22,14 +22,14 @@
<PropertyGroup configuration="Debug" escapeValue="false">
<DebugInfo>True</DebugInfo>
<StartArguments>-1.9 -D Program.rb</StartArguments>
<StartArguments>--disable-gems -D Program.rb</StartArguments>
<StartWorkingDirectory>.\</StartWorkingDirectory>
<StartAction>Program</StartAction>
<StartProgram>${addinpath:ICSharpCode.RubyBinding}\ir.exe</StartProgram>
</PropertyGroup>
<PropertyGroup configuration="Release" escapeValue="false">
<StartArguments>-1.9 Program.rb</StartArguments>
<StartArguments>--disable-gems Program.rb</StartArguments>
<StartWorkingDirectory>.\</StartWorkingDirectory>
<StartAction>Program</StartAction>
<StartProgram>${addinpath:ICSharpCode.RubyBinding}\ir.exe</StartProgram>

4
src/AddIns/BackendBindings/Ruby/RubyBinding/Project/Templates/FormsProject.xpt

@ -21,14 +21,14 @@ @@ -21,14 +21,14 @@
<PropertyGroup configuration="Debug" escapeValue="false">
<DebugInfo>True</DebugInfo>
<StartArguments>-1.9 -D Program.rb</StartArguments>
<StartArguments>--disable-gems -D Program.rb</StartArguments>
<StartWorkingDirectory>.\</StartWorkingDirectory>
<StartAction>Program</StartAction>
<StartProgram>${addinpath:ICSharpCode.RubyBinding}\ir.exe</StartProgram>
</PropertyGroup>
<PropertyGroup configuration="Release" escapeValue="false">
<StartArguments>-1.9 Program.rb</StartArguments>
<StartArguments>--disable-gems Program.rb</StartArguments>
<StartWorkingDirectory>.\</StartWorkingDirectory>
<StartAction>Program</StartAction>
<StartProgram>${addinpath:ICSharpCode.RubyBinding}\ir.exe</StartProgram>

4
src/AddIns/BackendBindings/Ruby/RubyBinding/Project/Templates/WPFApplication.xpt

@ -19,7 +19,7 @@ @@ -19,7 +19,7 @@
<OutputType>WinExe</OutputType>
<MainFile>Application.rb</MainFile>
<DebugInfo>True</DebugInfo>
<StartArguments>-1.9 -D Application.rb</StartArguments>
<StartArguments>--disable-gems -D Application.rb</StartArguments>
<StartWorkingDirectory>.\</StartWorkingDirectory>
<StartAction>Program</StartAction>
<StartProgram>${addinpath:ICSharpCode.RubyBinding}\ir.exe</StartProgram>
@ -28,7 +28,7 @@ @@ -28,7 +28,7 @@
<PropertyGroup configuration="Release" escapeValue="false">
<OutputType>WinExe</OutputType>
<MainFile>Application.rb</MainFile>
<StartArguments>-1.9 Application.py</StartArguments>
<StartArguments>--disable-gems Application.py</StartArguments>
<StartWorkingDirectory>.\</StartWorkingDirectory>
<StartAction>Program</StartAction>
<StartProgram>${addinpath:ICSharpCode.RubyBinding}\ir.exe</StartProgram>

2
src/AddIns/BackendBindings/Ruby/RubyBinding/Test/Gui/DebugRunRubyCommandTests.cs

@ -52,7 +52,7 @@ namespace RubyBinding.Tests.Gui @@ -52,7 +52,7 @@ namespace RubyBinding.Tests.Gui
public void Run_RubyFileOpen_ProcessInfoArgsHasDebugArgument()
{
string arguments = debugger.ProcessStartInfo.Arguments;
string expectedArguments = "-D \"test.rb\"";
string expectedArguments = "--disable-gems -D \"test.rb\"";
Assert.AreEqual(expectedArguments, arguments);
}

2
src/AddIns/BackendBindings/Ruby/RubyBinding/Test/Gui/RunRubyCommandTests.cs

@ -62,7 +62,7 @@ namespace RubyBinding.Tests.Gui @@ -62,7 +62,7 @@ namespace RubyBinding.Tests.Gui
public void Run_RubyFileOpen_ProcessInfoArgsContainsFileNameActiveInTextEditor()
{
string arguments = debugger.ProcessStartInfo.Arguments;
string expectedArguments = "/c \"\"C:\\IronRuby\\ir.exe\" \"test.rb\"\" & pause";
string expectedArguments = "/c \"\"C:\\IronRuby\\ir.exe\" --disable-gems \"test.rb\"\" & pause";
Assert.AreEqual(expectedArguments, arguments);
}

4
src/AddIns/BackendBindings/Ruby/RubyBinding/Test/Parsing/ParseClassMethodWithBodyTestFixture.cs

@ -68,7 +68,7 @@ namespace RubyBinding.Tests.Parsing @@ -68,7 +68,7 @@ namespace RubyBinding.Tests.Parsing
public void MethodBodyRegion()
{
int startLine = 2;
int startColumn = 11; // IronRuby parser includes the as part of the method parameters
int startColumn = 11;
int endLine = 4;
int endColumn = 5;
DomRegion region = new DomRegion(startLine, startColumn, endLine, endColumn);
@ -84,7 +84,7 @@ namespace RubyBinding.Tests.Parsing @@ -84,7 +84,7 @@ namespace RubyBinding.Tests.Parsing
int startLine = 2;
int startColumn = 2;
int endLine = 2;
int endColumn = 11; // IronRuby parser includes the as part of the method parameters
int endColumn = 11;
DomRegion region = new DomRegion(startLine, startColumn, endLine, endColumn);
Assert.AreEqual(region.ToString(), method.Region.ToString());
}

10
src/AddIns/BackendBindings/Ruby/RubyBinding/Test/Testing/RubyConsoleApplicationTests.cs

@ -33,11 +33,11 @@ namespace RubyBinding.Tests.Testing @@ -33,11 +33,11 @@ namespace RubyBinding.Tests.Testing
}
[Test]
public void GetArguments_DebugIsTrue_ReturnsDebugOption()
public void GetArguments_DebugIsTrue_ReturnsDisableGemsAndDebugOption()
{
app.Debug = true;
string args = app.GetArguments();
string expectedCommandLine = "-D";
string expectedCommandLine = "--disable-gems -D";
Assert.AreEqual(expectedCommandLine, args);
}
@ -47,7 +47,7 @@ namespace RubyBinding.Tests.Testing @@ -47,7 +47,7 @@ namespace RubyBinding.Tests.Testing
{
app.ScriptFileName = @"d:\projects\my ruby\test.rb";
string args = app.GetArguments();
string expectedCommandLine = "\"d:\\projects\\my ruby\\test.rb\"";
string expectedCommandLine = "--disable-gems \"d:\\projects\\my ruby\\test.rb\"";
Assert.AreEqual(expectedCommandLine, args);
}
@ -61,7 +61,7 @@ namespace RubyBinding.Tests.Testing @@ -61,7 +61,7 @@ namespace RubyBinding.Tests.Testing
string args = app.GetArguments();
string expectedCommandLine =
"-D \"d:\\projects\\my ruby\\test.rb\" -- responseFile.txt";
"--disable-gems -D \"d:\\projects\\my ruby\\test.rb\" -- responseFile.txt";
Assert.AreEqual(expectedCommandLine, args);
}
@ -80,7 +80,7 @@ namespace RubyBinding.Tests.Testing @@ -80,7 +80,7 @@ namespace RubyBinding.Tests.Testing
{
app.Debug = true;
ProcessStartInfo startInfo = app.GetProcessStartInfo();
string expectedCommandLine = "-D";
string expectedCommandLine = "--disable-gems -D";
Assert.AreEqual(expectedCommandLine, startInfo.Arguments);
}

1
src/AddIns/BackendBindings/Ruby/RubyBinding/Test/Testing/RubyTestDebuggerRunsSelectedTestMethodTestFixture.cs

@ -115,6 +115,7 @@ namespace RubyBinding.Tests.Testing @@ -115,6 +115,7 @@ namespace RubyBinding.Tests.Testing
RunTestsOnSelectedTestMethod();
string expectedCommandLine =
"--disable-gems " +
"-D " +
"\"-Ic:\\sharpdevelop\\addins\\rubybinding\\TestRunner\" " +
"\"c:\\sharpdevelop\\addins\\rubybinding\\TestRunner\\sdtest.rb\" " +

5
src/AddIns/BackendBindings/Ruby/RubyBinding/Test/Testing/RubyTestRunnerApplicationTests.cs

@ -52,6 +52,7 @@ namespace RubyBinding.Tests.Testing @@ -52,6 +52,7 @@ namespace RubyBinding.Tests.Testing
ProcessStartInfo processStartInfo = GetProcessStartInfoFromTestRunnerApp(selectedTests);
string expectedCommandLine =
"--disable-gems " +
"\"-Ic:\\rubybinding\\TestRunner\" " +
"\"c:\\rubybinding\\TestRunner\\sdtest.rb\" " +
"--testcase=MyTests " +
@ -77,6 +78,7 @@ namespace RubyBinding.Tests.Testing @@ -77,6 +78,7 @@ namespace RubyBinding.Tests.Testing
ProcessStartInfo processStartInfo = GetProcessStartInfoFromTestRunnerApp(selectedTests);
string expectedCommandLine =
"--disable-gems " +
"\"-Ic:\\rubybinding\\TestRunner\" " +
"\"c:\\rubybinding\\TestRunner\\sdtest.rb\" " +
"--name=MyMethod " +
@ -99,6 +101,7 @@ namespace RubyBinding.Tests.Testing @@ -99,6 +101,7 @@ namespace RubyBinding.Tests.Testing
ProcessStartInfo processStartInfo = GetProcessStartInfoFromTestRunnerApp(selectedTests);
string expectedCommandLine =
"--disable-gems " +
"\"-Ic:\\rubybinding\\AddIns\\TestRunner\" " +
"\"c:\\rubybinding\\AddIns\\TestRunner\\sdtest.rb\" " +
"-- " +
@ -117,6 +120,7 @@ namespace RubyBinding.Tests.Testing @@ -117,6 +120,7 @@ namespace RubyBinding.Tests.Testing
ProcessStartInfo processStartInfo = GetProcessStartInfoFromTestRunnerApp(selectedTests);
string expectedCommandLine =
"--disable-gems " +
"\"-Ic:\\ruby\\lib\" " +
"\"-Ic:\\rubybinding\\TestRunner\" " +
"\"c:\\rubybinding\\TestRunner\\sdtest.rb\" " +
@ -148,6 +152,7 @@ namespace RubyBinding.Tests.Testing @@ -148,6 +152,7 @@ namespace RubyBinding.Tests.Testing
ProcessStartInfo processStartInfo = GetProcessStartInfoFromTestRunnerApp(tests);
string expectedCommandLine =
"--disable-gems " +
"\"-Ic:\\rubybinding\\TestRunner\" " +
"\"-Ic:\\projects\\rbproject\" " +
"\"c:\\rubybinding\\TestRunner\\sdtest.rb\" " +

1
src/AddIns/BackendBindings/Ruby/RubyBinding/Test/Testing/RubyTestRunnerRunsSelectedTestMethodTestFixture.cs

@ -96,6 +96,7 @@ namespace RubyBinding.Tests.Testing @@ -96,6 +96,7 @@ namespace RubyBinding.Tests.Testing
RunTestsOnSelectedTestMethod();
string expectedCommandLine =
"--disable-gems " +
"\"-Ic:\\sharpdevelop\\addins\\rubybinding\\TestRunner\" " +
"\"c:\\sharpdevelop\\addins\\rubybinding\\TestRunner\\sdtest.rb\" " +
"--name=MyTestMethod " +

27
src/AddIns/BackendBindings/Scripting/Test/Utils/MockViewContent.cs

@ -21,20 +21,24 @@ namespace ICSharpCode.Scripting.Tests.Utils @@ -21,20 +21,24 @@ namespace ICSharpCode.Scripting.Tests.Utils
{
}
public event EventHandler TitleNameChanged;
public event EventHandler TabPageTextChanged;
public event EventHandler Disposed;
public event EventHandler InfoTipChanged;
public event EventHandler TitleNameChanged;
public event EventHandler TabPageTextChanged;
public event EventHandler Disposed;
public event EventHandler IsDirtyChanged;
public string TitleName {
get {
throw new NotImplementedException();
}
set {
}
public string InfoTip {
get {
throw new NotImplementedException();
}
}
public bool IsReadOnly {
get {
throw new NotImplementedException();
@ -164,7 +168,7 @@ namespace ICSharpCode.Scripting.Tests.Utils @@ -164,7 +168,7 @@ namespace ICSharpCode.Scripting.Tests.Utils
throw new NotImplementedException();
}
}
public void Save(OpenedFile file, System.IO.Stream stream)
{
throw new NotImplementedException();
@ -194,7 +198,7 @@ namespace ICSharpCode.Scripting.Tests.Utils @@ -194,7 +198,7 @@ namespace ICSharpCode.Scripting.Tests.Utils
{
throw new NotImplementedException();
}
protected virtual void OnTitleNameChanged(EventArgs e)
{
if (TitleNameChanged != null) {
@ -202,6 +206,13 @@ namespace ICSharpCode.Scripting.Tests.Utils @@ -202,6 +206,13 @@ namespace ICSharpCode.Scripting.Tests.Utils
}
}
protected virtual void OnInfoTipChanged(EventArgs e)
{
if (InfoTipChanged != null) {
InfoTipChanged(this, e);
}
}
protected virtual void OnTabPageTextChanged(EventArgs e)
{
if (TabPageTextChanged != null) {

3
src/AddIns/BackendBindings/VBNetBinding/Project/Src/MyNamespaceBuilder.cs

@ -15,6 +15,9 @@ namespace ICSharpCode.VBNetBinding @@ -15,6 +15,9 @@ namespace ICSharpCode.VBNetBinding
/// </summary>
public static void BuildNamespace(VBNetProject project, IProjectContent pc)
{
if ("custom".Equals(project.GetEvaluatedProperty("MyType"), StringComparison.OrdinalIgnoreCase))
return;
ICompilationUnit cu = new DefaultCompilationUnit(pc);
//cu.FileName = "GeneratedMyNamespace.vb"; // leave FileName null - fixes SD2-854
string ns;

7
src/AddIns/BackendBindings/WixBinding/Test/Utils/MockViewContent.cs

@ -40,6 +40,7 @@ namespace WixBinding.Tests.Utils @@ -40,6 +40,7 @@ namespace WixBinding.Tests.Utils
public event EventHandler Disposed;
public event EventHandler IsDirtyChanged;
public event EventHandler TitleNameChanged;
public event EventHandler InfoTipChanged;
#pragma warning restore 67
public IList<OpenedFile> Files {
@ -129,6 +130,12 @@ namespace WixBinding.Tests.Utils @@ -129,6 +130,12 @@ namespace WixBinding.Tests.Utils
}
}
public string InfoTip {
get {
throw new NotImplementedException();
}
}
public bool IsReadOnly {
get {
throw new NotImplementedException();

6
src/AddIns/BackendBindings/XamlBinding/XamlBinding/CompilationUnitCreatorVisitor.cs

@ -5,10 +5,11 @@ using System; @@ -5,10 +5,11 @@ using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;
using ICSharpCode.AvalonEdit.Xml;
using ICSharpCode.SharpDevelop.Dom;
using System.Text;
using ICSharpCode.SharpDevelop.Project;
namespace ICSharpCode.XamlBinding
{
@ -134,6 +135,9 @@ namespace ICSharpCode.XamlBinding @@ -134,6 +135,9 @@ namespace ICSharpCode.XamlBinding
}
IClass AddClass(string className, AXmlElement element) {
if (projectContent.Language == LanguageProperties.VBNet && projectContent.Project is IProject)
className = ((IProject)projectContent.Project).RootNamespace + "." + className;
DefaultClass c = new DefaultClass(CompilationUnit, className);
string modifierValue = (element.GetAttributeValue(CompletionDataHelper.XamlNamespace, "ClassModifier") ?? string.Empty).Trim();

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

@ -2,16 +2,14 @@ @@ -2,16 +2,14 @@
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
using System;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Xml;
using ICSharpCode.AvalonEdit.Document;
using ICSharpCode.AvalonEdit.Xml;
using ICSharpCode.Core;
using ICSharpCode.SharpDevelop;
using ICSharpCode.SharpDevelop.Dom;
using ICSharpCode.SharpDevelop.Editor;
using ICSharpCode.SharpDevelop.Project;
namespace ICSharpCode.XamlBinding

14
src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/AvalonEditViewContent.cs

@ -57,7 +57,8 @@ namespace ICSharpCode.AvalonEdit.AddIn @@ -57,7 +57,8 @@ namespace ICSharpCode.AvalonEdit.AddIn
void codeEditor_Document_UndoStack_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e)
{
PrimaryFile.IsDirty = !codeEditor.Document.UndoStack.IsOriginalFile;
if (!isLoading)
PrimaryFile.IsDirty = !codeEditor.Document.UndoStack.IsOriginalFile;
}
void PrimaryFile_IsDirtyChanged(object sender, EventArgs e)
@ -126,13 +127,13 @@ namespace ICSharpCode.AvalonEdit.AddIn @@ -126,13 +127,13 @@ namespace ICSharpCode.AvalonEdit.AddIn
}
}
//bool isLoading;
bool isLoading;
public override void Load(OpenedFile file, Stream stream)
{
if (file != PrimaryFile)
return;
//isLoading = true;
isLoading = true;
try {
BookmarksDetach();
codeEditor.PrimaryTextEditor.SyntaxHighlighting =
@ -143,11 +144,16 @@ namespace ICSharpCode.AvalonEdit.AddIn @@ -143,11 +144,16 @@ namespace ICSharpCode.AvalonEdit.AddIn
}
codeEditor.Load(stream);
// Load() causes the undo stack to think stuff changed, so re-mark the file as original if necessary
if (!this.PrimaryFile.IsDirty) {
codeEditor.Document.UndoStack.MarkAsOriginalFile();
}
// we set the file name after loading because this will place the fold markers etc.
codeEditor.FileName = FileName.Create(file.FileName);
BookmarksAttach();
} finally {
//isLoading = false;
isLoading = false;
}
}

1
src/AddIns/DisplayBindings/AvalonEdit.AddIn/themes/generic.xaml

@ -5,6 +5,7 @@ @@ -5,6 +5,7 @@
xmlns:core="http://icsharpcode.net/sharpdevelop/core"
>
<Style TargetType="{x:Type local:SharpDevelopTextEditor}">
<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.WindowTextBrushKey}}" />
<Setter Property="Background" Value="{DynamicResource {x:Static SystemColors.WindowBrushKey}}" />
<Setter Property="Template">
<Setter.Value>

15
src/AddIns/DisplayBindings/XmlEditor/Test/Utils/MockViewContent.cs

@ -26,6 +26,15 @@ namespace XmlEditor.Tests.Utils @@ -26,6 +26,15 @@ namespace XmlEditor.Tests.Utils
}
}
public event EventHandler InfoTipChanged;
protected virtual void OnInfoTipChanged(EventArgs e)
{
if (InfoTipChanged != null) {
InfoTipChanged(this, e);
}
}
public event EventHandler Disposed;
protected virtual void OnDisposed(EventArgs e)
@ -77,6 +86,12 @@ namespace XmlEditor.Tests.Utils @@ -77,6 +86,12 @@ namespace XmlEditor.Tests.Utils
}
}
public string InfoTip {
get {
throw new NotImplementedException();
}
}
public System.Collections.Generic.IList<ICSharpCode.SharpDevelop.OpenedFile> Files {
get {
throw new NotImplementedException();

29
src/AddIns/Misc/Reports/ICSharpCode.Reports.Addin/Test/Designer/MockViewContend.cs

@ -23,11 +23,12 @@ namespace ICSharpCode.Reports.Addin.Test.Designer @@ -23,11 +23,12 @@ namespace ICSharpCode.Reports.Addin.Test.Designer
{
}
public event EventHandler TitleNameChanged;
public event EventHandler TabPageTextChanged;
public event EventHandler Disposed;
public event EventHandler InfoTipChanged;
public event EventHandler TitleNameChanged;
public event EventHandler TabPageTextChanged;
public event EventHandler Disposed;
public event EventHandler IsDirtyChanged;
public object Control
{
get {return null;}
@ -37,11 +38,14 @@ namespace ICSharpCode.Reports.Addin.Test.Designer @@ -37,11 +38,14 @@ namespace ICSharpCode.Reports.Addin.Test.Designer
get {
throw new NotImplementedException();
}
set {
}
public string InfoTip {
get {
throw new NotImplementedException();
}
}
public bool IsReadOnly {
get {
throw new NotImplementedException();
@ -160,7 +164,7 @@ namespace ICSharpCode.Reports.Addin.Test.Designer @@ -160,7 +164,7 @@ namespace ICSharpCode.Reports.Addin.Test.Designer
throw new NotImplementedException();
}
}
public void Save(OpenedFile file, System.IO.Stream stream)
{
throw new NotImplementedException();
@ -190,7 +194,7 @@ namespace ICSharpCode.Reports.Addin.Test.Designer @@ -190,7 +194,7 @@ namespace ICSharpCode.Reports.Addin.Test.Designer
{
throw new NotImplementedException();
}
protected virtual void OnTitleNameChanged(EventArgs e)
{
if (TitleNameChanged != null) {
@ -198,6 +202,13 @@ namespace ICSharpCode.Reports.Addin.Test.Designer @@ -198,6 +202,13 @@ namespace ICSharpCode.Reports.Addin.Test.Designer
}
}
protected virtual void OnInfoTipChanged(EventArgs e)
{
if (InfoTipChanged != null) {
InfoTipChanged(this, e);
}
}
protected virtual void OnTabPageTextChanged(EventArgs e)
{
if (TabPageTextChanged != null) {
@ -217,7 +228,7 @@ namespace ICSharpCode.Reports.Addin.Test.Designer @@ -217,7 +228,7 @@ namespace ICSharpCode.Reports.Addin.Test.Designer
if (IsDirtyChanged != null) {
IsDirtyChanged(this, e);
}
}
}
public object InitiallyFocusedControl {
get {

9
src/Libraries/AvalonDock/AvalonDock/DockingManager.cs

@ -1054,7 +1054,8 @@ namespace AvalonDock @@ -1054,7 +1054,8 @@ namespace AvalonDock
protected override void OnKeyDown(KeyEventArgs e)
{
bool isCtrlDown = Keyboard.Modifiers == ModifierKeys.Control;
// accept Control or Control+Shift
bool isCtrlDown = (Keyboard.Modifiers & ~ModifierKeys.Shift) == ModifierKeys.Control;
bool _navigatorWindowIsVisible = navigatorWindow != null ? navigatorWindow.IsVisible : false;
Debug.WriteLine(string.Format("OnKeyDn {0} CtrlDn={1}", e.Key, isCtrlDown));
@ -1078,7 +1079,8 @@ namespace AvalonDock @@ -1078,7 +1079,8 @@ namespace AvalonDock
protected override void OnKeyUp(KeyEventArgs e)
{
bool isCtrlDown = Keyboard.Modifiers == ModifierKeys.Control;
// accept Control or Control+Shift
bool isCtrlDown = (Keyboard.Modifiers & ~ModifierKeys.Shift) == ModifierKeys.Control;
bool _navigatorWindowIsVisible = navigatorWindow != null ? navigatorWindow.IsVisible : false;
Debug.WriteLine(string.Format("OnKeyUp {0} CtrlDn={1}", e.Key, isCtrlDown));
@ -1087,10 +1089,11 @@ namespace AvalonDock @@ -1087,10 +1089,11 @@ namespace AvalonDock
if (!_navigatorWindowIsVisible && e.Key == Key.Tab)
{
ShowNavigatorWindow();
_navigatorWindowIsVisible = true;
}
if (_navigatorWindowIsVisible)
navigatorWindow.HandleKey(e.Key);
e.Handled = navigatorWindow.HandleKey(e.Key);
}
else
{

5
src/Libraries/AvalonDock/AvalonDock/NavigatorWindow.cs

@ -196,7 +196,10 @@ namespace AvalonDock @@ -196,7 +196,10 @@ namespace AvalonDock
{
if (key == Key.Tab)
{
MoveToNextContent();
if ((Keyboard.Modifiers & ModifierKeys.Shift) == ModifierKeys.Shift)
MoveToPreviousContent();
else
MoveToNextContent();
return true;
}
else if (key == Key.Down)

2
src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Document/ISegment.cs

@ -208,7 +208,7 @@ namespace ICSharpCode.AvalonEdit.Document @@ -208,7 +208,7 @@ namespace ICSharpCode.AvalonEdit.Document
this.start.MovementType = AnchorMovementType.AfterInsertion;
this.end = document.CreateAnchor(offset + length);
this.end.SurviveDeletion = true;
this.start.MovementType = AnchorMovementType.BeforeInsertion;
this.end.MovementType = AnchorMovementType.BeforeInsertion;
}
/// <inheritdoc/>

35
src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Document/OffsetChangeMap.cs

@ -52,7 +52,12 @@ namespace ICSharpCode.AvalonEdit.Document @@ -52,7 +52,12 @@ namespace ICSharpCode.AvalonEdit.Document
/// causes anchors to always survive irrespective of their <see cref="TextAnchor.SurviveDeletion"/> setting.
/// If the text keeps its old size, this is implemented as OffsetChangeMap.Empty.
/// </remarks>
CharacterReplace
CharacterReplace,
/// <summary>
/// Like 'Normal', but anchors with <see cref="TextAnchor.MovementType"/> = Default will stay in front of the
/// insertion instead of being moved behind it.
/// </summary>
KeepAnchorBeforeInsertion
}
/// <summary>
@ -201,7 +206,9 @@ namespace ICSharpCode.AvalonEdit.Document @@ -201,7 +206,9 @@ namespace ICSharpCode.AvalonEdit.Document
public struct OffsetChangeMapEntry : IEquatable<OffsetChangeMapEntry>
{
readonly int offset;
readonly int insertionLength;
// MSB: DefaultAnchorMovementIsBeforeInsertion
readonly uint insertionLengthWithMovementFlag;
// MSB: RemovalNeverCausesAnchorDeletion; other 31 bits: RemovalLength
readonly uint removalLengthWithDeletionFlag;
@ -218,7 +225,7 @@ namespace ICSharpCode.AvalonEdit.Document @@ -218,7 +225,7 @@ namespace ICSharpCode.AvalonEdit.Document
/// Returns 0 if this entry represents a removal.
/// </summary>
public int InsertionLength {
get { return insertionLength; }
get { return (int)(insertionLengthWithMovementFlag & 0x7fffffff); }
}
/// <summary>
@ -236,11 +243,19 @@ namespace ICSharpCode.AvalonEdit.Document @@ -236,11 +243,19 @@ namespace ICSharpCode.AvalonEdit.Document
get { return (removalLengthWithDeletionFlag & 0x80000000) != 0; }
}
/// <summary>
/// Gets whether default anchor movement causes the anchor to stay in front of the caret.
/// </summary>
public bool DefaultAnchorMovementIsBeforeInsertion {
get { return (insertionLengthWithMovementFlag & 0x80000000) != 0; }
}
/// <summary>
/// Gets the new offset where the specified offset moves after this document change.
/// </summary>
public int GetNewOffset(int oldOffset, AnchorMovementType movementType)
{
int insertionLength = this.InsertionLength;
int removalLength = this.RemovalLength;
if (!(removalLength == 0 && oldOffset == offset)) {
// we're getting trouble (both if statements in here would apply)
@ -259,8 +274,10 @@ namespace ICSharpCode.AvalonEdit.Document @@ -259,8 +274,10 @@ namespace ICSharpCode.AvalonEdit.Document
// b) there was no removal and we insert at the caret position
if (movementType == AnchorMovementType.AfterInsertion)
return offset + insertionLength;
else
else if (movementType == AnchorMovementType.BeforeInsertion)
return offset;
else
return this.DefaultAnchorMovementIsBeforeInsertion ? offset : offset + insertionLength;
}
/// <summary>
@ -274,24 +291,26 @@ namespace ICSharpCode.AvalonEdit.Document @@ -274,24 +291,26 @@ namespace ICSharpCode.AvalonEdit.Document
this.offset = offset;
this.removalLengthWithDeletionFlag = (uint)removalLength;
this.insertionLength = insertionLength;
this.insertionLengthWithMovementFlag = (uint)insertionLength;
}
/// <summary>
/// Creates a new OffsetChangeMapEntry instance.
/// </summary>
public OffsetChangeMapEntry(int offset, int removalLength, int insertionLength, bool removalNeverCausesAnchorDeletion)
public OffsetChangeMapEntry(int offset, int removalLength, int insertionLength, bool removalNeverCausesAnchorDeletion, bool defaultAnchorMovementIsBeforeInsertion)
: this(offset, removalLength, insertionLength)
{
if (removalNeverCausesAnchorDeletion)
this.removalLengthWithDeletionFlag |= 0x80000000;
if (defaultAnchorMovementIsBeforeInsertion)
this.insertionLengthWithMovementFlag |= 0x80000000;
}
/// <inheritdoc/>
public override int GetHashCode()
{
unchecked {
return offset + 3559 * insertionLength + 3571 * (int)removalLengthWithDeletionFlag;
return offset + 3559 * (int)insertionLengthWithMovementFlag + 3571 * (int)removalLengthWithDeletionFlag;
}
}
@ -304,7 +323,7 @@ namespace ICSharpCode.AvalonEdit.Document @@ -304,7 +323,7 @@ namespace ICSharpCode.AvalonEdit.Document
/// <inheritdoc/>
public bool Equals(OffsetChangeMapEntry other)
{
return offset == other.offset && insertionLength == other.insertionLength && removalLengthWithDeletionFlag == other.removalLengthWithDeletionFlag;
return offset == other.offset && insertionLengthWithMovementFlag == other.insertionLengthWithMovementFlag && removalLengthWithDeletionFlag == other.removalLengthWithDeletionFlag;
}
/// <summary>

8
src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Document/TextAnchor.cs

@ -56,7 +56,7 @@ namespace ICSharpCode.AvalonEdit.Document @@ -56,7 +56,7 @@ namespace ICSharpCode.AvalonEdit.Document
/// <remarks>Anchor movement is ambiguous if text is inserted exactly at the anchor's location.
/// Does the anchor stay before the inserted text, or does it move after it?
/// The property <see cref="MovementType"/> will be used to determine which of these two options the anchor will choose.
/// The default value is <see cref="AnchorMovementType.BeforeInsertion"/>.</remarks>
/// The default value is <see cref="AnchorMovementType.Default"/>.</remarks>
public AnchorMovementType MovementType { get; set; }
/// <summary>
@ -174,6 +174,12 @@ namespace ICSharpCode.AvalonEdit.Document @@ -174,6 +174,12 @@ namespace ICSharpCode.AvalonEdit.Document
/// </summary>
public enum AnchorMovementType
{
/// <summary>
/// When text is inserted at the anchor position, the type of the insertion
/// determines where the caret moves to. For normal insertions, the anchor will stay
/// behind the inserted text.
/// </summary>
Default,
/// <summary>
/// When text is inserted at the anchor position, the anchor will stay
/// before the inserted text.

21
src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Document/TextAnchorTree.cs

@ -61,7 +61,7 @@ namespace ICSharpCode.AvalonEdit.Document @@ -61,7 +61,7 @@ namespace ICSharpCode.AvalonEdit.Document
}
#region Insert Text
void InsertText(int offset, int length)
void InsertText(int offset, int length, bool defaultAnchorMovementIsBeforeInsertion)
{
if (length == 0 || root == null || offset > root.totalLength)
return;
@ -69,7 +69,7 @@ namespace ICSharpCode.AvalonEdit.Document @@ -69,7 +69,7 @@ namespace ICSharpCode.AvalonEdit.Document
// find the range of nodes that are placed exactly at offset
// beginNode is inclusive, endNode is exclusive
if (offset == root.totalLength) {
PerformInsertText(FindActualBeginNode(root.RightMost), null, length);
PerformInsertText(FindActualBeginNode(root.RightMost), null, length, defaultAnchorMovementIsBeforeInsertion);
} else {
TextAnchorNode endNode = FindNode(ref offset);
Debug.Assert(endNode.length > 0);
@ -79,7 +79,7 @@ namespace ICSharpCode.AvalonEdit.Document @@ -79,7 +79,7 @@ namespace ICSharpCode.AvalonEdit.Document
endNode.length += length;
UpdateAugmentedData(endNode);
} else {
PerformInsertText(FindActualBeginNode(endNode.Predecessor), endNode, length);
PerformInsertText(FindActualBeginNode(endNode.Predecessor), endNode, length, defaultAnchorMovementIsBeforeInsertion);
}
}
DeleteMarkedNodes();
@ -99,7 +99,7 @@ namespace ICSharpCode.AvalonEdit.Document @@ -99,7 +99,7 @@ namespace ICSharpCode.AvalonEdit.Document
// Sorts the nodes in the range [beginNode, endNode) by MovementType
// and inserts the length between the BeforeInsertion and the AfterInsertion nodes.
void PerformInsertText(TextAnchorNode beginNode, TextAnchorNode endNode, int length)
void PerformInsertText(TextAnchorNode beginNode, TextAnchorNode endNode, int length, bool defaultAnchorMovementIsBeforeInsertion)
{
Debug.Assert(beginNode != null);
// endNode may be null at the end of the anchor tree
@ -114,10 +114,13 @@ namespace ICSharpCode.AvalonEdit.Document @@ -114,10 +114,13 @@ namespace ICSharpCode.AvalonEdit.Document
if (anchor == null) {
// afterInsert.Add(temp);
MarkNodeForDelete(temp);
} else if (anchor.MovementType == AnchorMovementType.AfterInsertion) {
// afterInsert.Add(temp);
} else {
} else if (defaultAnchorMovementIsBeforeInsertion
? anchor.MovementType != AnchorMovementType.AfterInsertion
: anchor.MovementType == AnchorMovementType.BeforeInsertion)
{
beforeInsert.Add(temp);
// } else {
// afterInsert.Add(temp);
}
temp = temp.Successor;
}
@ -182,7 +185,7 @@ namespace ICSharpCode.AvalonEdit.Document @@ -182,7 +185,7 @@ namespace ICSharpCode.AvalonEdit.Document
// Thus, we handle this case on a separate code path
// (the code below looks like it does something similar, but it can only split
// the set of deletion survivors, not all nodes at an offset)
InsertText(entry.Offset, entry.InsertionLength);
InsertText(entry.Offset, entry.InsertionLength, entry.DefaultAnchorMovementIsBeforeInsertion);
return;
}
// When handling a replacing text change, we need to:
@ -244,7 +247,7 @@ namespace ICSharpCode.AvalonEdit.Document @@ -244,7 +247,7 @@ namespace ICSharpCode.AvalonEdit.Document
// survivors - from firstDeletionSurvivor (inclusive) to node (exclusive).
// This ensures that nodes immediately before or after the replaced segment
// stay where they are (independent from their MovementType)
PerformInsertText(firstDeletionSurvivor, node, entry.InsertionLength);
PerformInsertText(firstDeletionSurvivor, node, entry.InsertionLength, entry.DefaultAnchorMovementIsBeforeInsertion);
} else if (node != null) {
// No deletion survivors:
// just perform the insertion

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

@ -7,8 +7,8 @@ using System.Collections.ObjectModel; @@ -7,8 +7,8 @@ using System.Collections.ObjectModel;
using System.Diagnostics;
using System.Linq;
using System.Globalization;
using System.Linq.Expressions;
using System.Threading;
using ICSharpCode.AvalonEdit.Utils;
namespace ICSharpCode.AvalonEdit.Document
@ -490,6 +490,10 @@ namespace ICSharpCode.AvalonEdit.Document @@ -490,6 +490,10 @@ namespace ICSharpCode.AvalonEdit.Document
case OffsetChangeMappingType.Normal:
Replace(offset, length, text, null);
break;
case OffsetChangeMappingType.KeepAnchorBeforeInsertion:
Replace(offset, length, text, OffsetChangeMap.FromSingleElement(
new OffsetChangeMapEntry(offset, length, text.Length, false, true)));
break;
case OffsetChangeMappingType.RemoveAndInsert:
if (length == 0 || text.Length == 0) {
// only insertion or only removal?
@ -514,7 +518,7 @@ namespace ICSharpCode.AvalonEdit.Document @@ -514,7 +518,7 @@ namespace ICSharpCode.AvalonEdit.Document
OffsetChangeMapEntry entry = new OffsetChangeMapEntry(offset + length - 1, 1, 1 + text.Length - length);
Replace(offset, length, text, OffsetChangeMap.FromSingleElement(entry));
} else if (text.Length < length) {
OffsetChangeMapEntry entry = new OffsetChangeMapEntry(offset + text.Length, length - text.Length, 0, true);
OffsetChangeMapEntry entry = new OffsetChangeMapEntry(offset + text.Length, length - text.Length, 0, true, false);
Replace(offset, length, text, OffsetChangeMap.FromSingleElement(entry));
} else {
Replace(offset, length, text, OffsetChangeMap.Empty);

2
src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Editing/Caret.cs

@ -145,7 +145,7 @@ namespace ICSharpCode.AvalonEdit.Editing @@ -145,7 +145,7 @@ namespace ICSharpCode.AvalonEdit.Editing
{
InvalidateVisualColumn();
if (storedCaretOffset >= 0) {
int newCaretOffset = e.GetNewOffset(storedCaretOffset, AnchorMovementType.AfterInsertion);
int newCaretOffset = e.GetNewOffset(storedCaretOffset, AnchorMovementType.Default);
TextDocument document = textArea.Document;
if (document != null) {
// keep visual column

25
src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Editing/EditingCommandHandler.cs

@ -110,8 +110,12 @@ namespace ICSharpCode.AvalonEdit.Editing @@ -110,8 +110,12 @@ namespace ICSharpCode.AvalonEdit.Editing
start = end = null;
}
} else {
start = textArea.Document.GetLineByOffset(textArea.Selection.SurroundingSegment.Offset);
end = textArea.Document.GetLineByOffset(textArea.Selection.SurroundingSegment.EndOffset);
ISegment segment = textArea.Selection.SurroundingSegment;
start = textArea.Document.GetLineByOffset(segment.Offset);
end = textArea.Document.GetLineByOffset(segment.EndOffset);
// don't include the last line if no characters on it are selected
if (start != end && end.Offset == segment.EndOffset)
end = end.PreviousLine;
}
if (start != null) {
transformLine(textArea, start);
@ -178,15 +182,20 @@ namespace ICSharpCode.AvalonEdit.Editing @@ -178,15 +182,20 @@ namespace ICSharpCode.AvalonEdit.Editing
if (textArea != null && textArea.Document != null) {
using (textArea.Document.RunUpdate()) {
if (textArea.Selection.IsMultiline(textArea.Document)) {
DocumentLine start = textArea.Document.GetLineByOffset(textArea.Selection.SurroundingSegment.Offset);
DocumentLine end = textArea.Document.GetLineByOffset(textArea.Selection.SurroundingSegment.EndOffset);
var segment = textArea.Selection.SurroundingSegment;
DocumentLine start = textArea.Document.GetLineByOffset(segment.Offset);
DocumentLine end = textArea.Document.GetLineByOffset(segment.EndOffset);
// don't include the last line if no characters on it are selected
if (start != end && end.Offset == segment.EndOffset)
end = end.PreviousLine;
DocumentLine current = start;
while (true) {
int offset = start.Offset;
int offset = current.Offset;
if (textArea.ReadOnlySectionProvider.CanInsert(offset))
textArea.Document.Insert(offset, textArea.Options.IndentationString);
if (start == end)
textArea.Document.Replace(offset, 0, textArea.Options.IndentationString, OffsetChangeMappingType.KeepAnchorBeforeInsertion);
if (current == end)
break;
start = start.NextLine;
current = current.NextLine;
}
} else {
string indentationString = textArea.Options.GetIndentationString(textArea.Caret.Column);

4
src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Editing/SimpleSelection.cs

@ -109,8 +109,8 @@ namespace ICSharpCode.AvalonEdit.Editing @@ -109,8 +109,8 @@ namespace ICSharpCode.AvalonEdit.Editing
if (e == null)
throw new ArgumentNullException("e");
return new SimpleSelection(
e.GetNewOffset(startOffset, AnchorMovementType.AfterInsertion),
e.GetNewOffset(endOffset, AnchorMovementType.AfterInsertion)
e.GetNewOffset(startOffset, AnchorMovementType.Default),
e.GetNewOffset(endOffset, AnchorMovementType.Default)
);
}

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

@ -547,15 +547,18 @@ namespace ICSharpCode.AvalonEdit.Rendering @@ -547,15 +547,18 @@ namespace ICSharpCode.AvalonEdit.Rendering
TextParagraphProperties paragraphProperties = CreateParagraphProperties(globalTextRunProperties);
while (heightTree.GetIsCollapsed(documentLine)) {
documentLine = heightTree.GetLineByNumber(documentLine.LineNumber - 1);
documentLine = documentLine.PreviousLine;
}
l = BuildVisualLine(documentLine,
globalTextRunProperties, paragraphProperties,
elementGenerators.ToArray(), lineTransformers.ToArray(),
lastAvailableSize);
l.VisualTop = heightTree.GetVisualPosition(documentLine);
allVisualLines.Add(l);
// update all visual top values (building the line might have changed visual top of other lines due to word wrapping)
foreach (var line in allVisualLines) {
line.VisualTop = heightTree.GetVisualPosition(line.FirstDocumentLine);
}
}
return l;
}

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

@ -7,11 +7,11 @@ using System.IO; @@ -7,11 +7,11 @@ using System.IO;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Controls.Primitives;
using System.Windows.Data;
using System.Windows.Input;
using System.Windows.Markup;
using System.Windows.Threading;
using ICSharpCode.AvalonEdit.Document;
using ICSharpCode.AvalonEdit.Editing;
using ICSharpCode.AvalonEdit.Highlighting;
@ -1065,7 +1065,25 @@ namespace ICSharpCode.AvalonEdit @@ -1065,7 +1065,25 @@ namespace ICSharpCode.AvalonEdit
{
const double MinimumScrollPercentage = 0.3;
if (scrollViewer != null) {
TextView textView = textArea.TextView;
TextDocument document = textView.Document;
if (scrollViewer != null && document != null) {
IScrollInfo scrollInfo = textView;
if (!scrollInfo.CanHorizontallyScroll) {
// Word wrap is enabled. Ensure that we have up-to-date info about line height so that we scroll
// to the correct position.
// This avoids that the user has to repeat the ScrollTo() call several times when there are very long lines.
VisualLine vl = textView.GetOrConstructVisualLine(document.GetLineByNumber(line));
double remainingHeight = scrollViewer.ViewportHeight / 2;
while (remainingHeight > 0) {
DocumentLine prevLine = vl.FirstDocumentLine.PreviousLine;
if (prevLine == null)
break;
vl = textView.GetOrConstructVisualLine(prevLine);
remainingHeight -= vl.Height;
}
}
Point p = textArea.TextView.GetVisualPosition(new TextViewPosition(line, Math.Max(1, column)), VisualYPosition.LineMiddle);
double verticalPos = p.Y - scrollViewer.ViewportHeight / 2;
if (Math.Abs(verticalPos - scrollViewer.VerticalOffset) > MinimumScrollPercentage * scrollViewer.ViewportHeight) {

1
src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/TextEditor.xaml

@ -4,6 +4,7 @@ @@ -4,6 +4,7 @@
xmlns:editing="clr-namespace:ICSharpCode.AvalonEdit.Editing"
>
<Style TargetType="{x:Type AvalonEdit:TextEditor}">
<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.WindowTextBrushKey}}" />
<Setter Property="Background" Value="{DynamicResource {x:Static SystemColors.WindowBrushKey}}" />
<Setter Property="FlowDirection" Value="LeftToRight"/> <!-- AvalonEdit does not support RTL, so ensure we use LTR by default -->
<Setter Property="Template">

5
src/Libraries/NRefactory/Project/Src/Lexer/VBNet/ExpressionFinder.atg

@ -1325,6 +1325,7 @@ AccessModifier = @@ -1325,6 +1325,7 @@ AccessModifier =
TypeModifier =
AccessModifier |
"MustInherit" |
"NotInheritable" |
"Shadows" |
"Partial"
@ -1353,8 +1354,8 @@ MemberModifier = @@ -1353,8 +1354,8 @@ MemberModifier =
ParameterModifier =
"ByVal" |
"ByRef" |
"Optional" |
"ParamArray"
"Optional" |
"ParamArray"
.
END ExpressionFinder .

20
src/Libraries/NRefactory/Project/Src/Lexer/VBNet/Parser.cs

@ -8495,16 +8495,16 @@ partial class ExpressionFinder { @@ -8495,16 +8495,16 @@ partial class ExpressionFinder {
public BitArray GetExpectedSet() { return GetExpectedSet(currentState); }
static readonly BitArray[] set = {
new BitArray(new int[] {1, 256, 1048576, 537395328, 134234624, 444604481, 131200, 0}),
new BitArray(new int[] {1, 256, 1048576, 537395328, 134234624, 444596289, 131200, 0}),
new BitArray(new int[] {1, 256, 1048576, 537395328, 134234112, 444596289, 131200, 0}),
new BitArray(new int[] {0, 256, 1048576, 537395328, 134234112, 444596289, 131200, 0}),
new BitArray(new int[] {0, 256, 1048576, 537395328, 134234112, 444596288, 131200, 0}),
new BitArray(new int[] {0, 0, 1048576, 537395328, 134234112, 444596288, 131200, 0}),
new BitArray(new int[] {1, 256, 1048576, 537395328, 402670080, 444604481, 131200, 0}),
new BitArray(new int[] {1, 256, 1048576, 537395328, 402670080, 444596289, 131200, 0}),
new BitArray(new int[] {1, 256, 1048576, 537395328, 402669568, 444596289, 131200, 0}),
new BitArray(new int[] {0, 256, 1048576, 537395328, 402669568, 444596289, 131200, 0}),
new BitArray(new int[] {0, 256, 1048576, 537395328, 402669568, 444596288, 131200, 0}),
new BitArray(new int[] {0, 0, 1048576, 537395328, 402669568, 444596288, 131200, 0}),
new BitArray(new int[] {4, 1140850688, 8388687, 1108347140, 821280, 17105920, -2144335872, 65}),
new BitArray(new int[] {0, 256, 1048576, -1601568064, 671109120, 1589117122, 393600, 3328}),
new BitArray(new int[] {0, 256, 1048576, -1601568064, 671105024, 1589117122, 393600, 3328}),
new BitArray(new int[] {5, 1140850944, 26214479, -493220892, 671926304, 1606227139, -2143942272, 3393}),
new BitArray(new int[] {5, 1140850944, 26214479, -493220892, 940361760, 1606227139, -2143942272, 3393}),
new BitArray(new int[] {0, 256, 1048576, -1601699136, 671105024, 1589117122, 393600, 3328}),
new BitArray(new int[] {0, 0, 1048576, -1601699136, 671105024, 1589117122, 393600, 3328}),
new BitArray(new int[] {0, 0, 1048576, -2138570624, 134234112, 67108864, 393216, 0}),
@ -8577,7 +8577,7 @@ partial class ExpressionFinder { @@ -8577,7 +8577,7 @@ partial class ExpressionFinder {
new BitArray(new int[] {4, 1140850688, 8388975, 1108347140, 821280, 21316608, -2144335872, 65}),
new BitArray(new int[] {5242880, -2147483584, 0, 0, 0, 0, 0, 0}),
new BitArray(new int[] {-2, -1, -3, -1, -134217729, -1, -1, -1}),
new BitArray(new int[] {7, 1157628162, 26477055, -493212676, 680323109, 2147308999, -533262382, 3395}),
new BitArray(new int[] {7, 1157628162, 26477055, -493212676, 948758565, 2147308999, -533262382, 3395}),
new BitArray(new int[] {918528, 0, 0, 0, 0, 0, 0, 0}),
new BitArray(new int[] {-909310, -1258291209, 65, 1074825472, 72844320, 231424, 22030368, 4160}),
new BitArray(new int[] {-843774, -1258291209, 65, 1074825472, 72844320, 231424, 22030368, 4160}),
@ -8620,12 +8620,12 @@ partial class ExpressionFinder { @@ -8620,12 +8620,12 @@ partial class ExpressionFinder {
new BitArray(new int[] {4, 1140850688, 8388687, 1108347136, 821280, 17105920, -2144335872, 65}),
new BitArray(new int[] {7340034, -2147483614, 0, 0, 0, 0, 0, 0}),
new BitArray(new int[] {7340034, -2147483616, 0, 0, 0, 0, 0, 0}),
new BitArray(new int[] {0, 256, 1048576, 537526400, 134234112, 444596289, 131200, 0}),
new BitArray(new int[] {0, 256, 1048576, 537526400, 402669568, 444596289, 131200, 0}),
new BitArray(new int[] {1028, 1140850688, 8650975, 1108355356, 9218084, 17106176, -533656048, 67}),
new BitArray(new int[] {70254594, 32, 0, 0, 0, 0, 0, 0}),
new BitArray(new int[] {0, 0, 8388608, 33554432, 2048, 0, 32768, 0}),
new BitArray(new int[] {2097154, 0, 0, 0, 0, 3072, 0, 0}),
new BitArray(new int[] {0, 0, 0, 536870912, 0, 444596288, 128, 0}),
new BitArray(new int[] {0, 0, 0, 536870912, 268435456, 444596288, 128, 0}),
new BitArray(new int[] {0, 0, 0, 536871488, 536870912, 1522008258, 384, 3328}),
new BitArray(new int[] {0, 0, 262288, 8216, 8396800, 256, 1610679824, 2}),
new BitArray(new int[] {-1073741824, 33554432, 0, 0, 0, 16, 0, 0}),

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

File diff suppressed because it is too large Load Diff

7
src/Libraries/NRefactory/Project/Src/Parser/VBNet/VBNET.ATG

@ -2127,6 +2127,7 @@ ObjectCreateExpression<out Expression oce> @@ -2127,6 +2127,7 @@ ObjectCreateExpression<out Expression oce>
List<Expression> arguments = null;
ArrayList dimensions = null;
oce = null;
Location startLocation = la.Location;
bool canBeNormal; bool canBeReDim;
.) =
"New"
@ -2198,6 +2199,12 @@ ObjectCreateExpression<out Expression oce> @@ -2198,6 +2199,12 @@ ObjectCreateExpression<out Expression oce>
.)
)
]
(.
if (oce != null) {
oce.StartLocation = startLocation;
oce.EndLocation = t.EndLocation;
}
.)
.
LambdaExpr<out Expression expr>

6
src/Main/Base/Project/Src/Commands/WindowCommands.cs

@ -11,7 +11,8 @@ namespace ICSharpCode.SharpDevelop.Commands @@ -11,7 +11,8 @@ namespace ICSharpCode.SharpDevelop.Commands
{
public override void Run()
{
if (WorkbenchSingleton.Workbench.ActiveWorkbenchWindow == null) {
if (WorkbenchSingleton.Workbench.ActiveWorkbenchWindow == null ||
WorkbenchSingleton.Workbench.WorkbenchWindowCollection.Count == 0) {
return;
}
int index = WorkbenchSingleton.Workbench.WorkbenchWindowCollection.IndexOf(WorkbenchSingleton.Workbench.ActiveWorkbenchWindow);
@ -23,7 +24,8 @@ namespace ICSharpCode.SharpDevelop.Commands @@ -23,7 +24,8 @@ namespace ICSharpCode.SharpDevelop.Commands
{
public override void Run()
{
if (WorkbenchSingleton.Workbench.ActiveWorkbenchWindow == null) {
if (WorkbenchSingleton.Workbench.ActiveWorkbenchWindow == null ||
WorkbenchSingleton.Workbench.WorkbenchWindowCollection.Count == 0) {
return;
}
int index = WorkbenchSingleton.Workbench.WorkbenchWindowCollection.IndexOf(WorkbenchSingleton.Workbench.ActiveWorkbenchWindow);

20
src/Main/Base/Project/Src/Editor/AvalonEdit/AvalonEditDocumentAdapter.cs

@ -330,26 +330,10 @@ namespace ICSharpCode.SharpDevelop.Editor.AvalonEdit @@ -330,26 +330,10 @@ namespace ICSharpCode.SharpDevelop.Editor.AvalonEdit
public ICSharpCode.SharpDevelop.Editor.AnchorMovementType MovementType {
get {
switch (anchor.MovementType) {
case ICSharpCode.AvalonEdit.Document.AnchorMovementType.AfterInsertion:
return ICSharpCode.SharpDevelop.Editor.AnchorMovementType.AfterInsertion;
case ICSharpCode.AvalonEdit.Document.AnchorMovementType.BeforeInsertion:
return ICSharpCode.SharpDevelop.Editor.AnchorMovementType.BeforeInsertion;
default:
throw new NotSupportedException();
}
return (ICSharpCode.SharpDevelop.Editor.AnchorMovementType)anchor.MovementType;
}
set {
switch (value) {
case ICSharpCode.SharpDevelop.Editor.AnchorMovementType.AfterInsertion:
anchor.MovementType = ICSharpCode.AvalonEdit.Document.AnchorMovementType.AfterInsertion;
break;
case ICSharpCode.SharpDevelop.Editor.AnchorMovementType.BeforeInsertion:
anchor.MovementType = ICSharpCode.AvalonEdit.Document.AnchorMovementType.BeforeInsertion;
break;
default:
throw new NotSupportedException();
}
anchor.MovementType = (ICSharpCode.AvalonEdit.Document.AnchorMovementType)value;
}
}

10
src/Main/Base/Project/Src/Editor/ITextAnchor.cs

@ -63,15 +63,21 @@ namespace ICSharpCode.SharpDevelop.Editor @@ -63,15 +63,21 @@ namespace ICSharpCode.SharpDevelop.Editor
/// </summary>
public enum AnchorMovementType
{
/// <summary>
/// When text is inserted at the anchor position, the type of the insertion
/// determines where the caret moves to. For normal insertions, the anchor will stay
/// behind the inserted text.
/// </summary>
Default = ICSharpCode.AvalonEdit.Document.AnchorMovementType.Default,
/// <summary>
/// Behaves like a start marker - when text is inserted at the anchor position, the anchor will stay
/// before the inserted text.
/// </summary>
BeforeInsertion,
BeforeInsertion = ICSharpCode.AvalonEdit.Document.AnchorMovementType.BeforeInsertion,
/// <summary>
/// Behave like an end marker - when text is insered at the anchor position, the anchor will move
/// after the inserted text.
/// </summary>
AfterInsertion
AfterInsertion = ICSharpCode.AvalonEdit.Document.AnchorMovementType.AfterInsertion
}
}

75
src/Main/Base/Project/Src/Gui/AbstractViewContent.cs

@ -348,18 +348,19 @@ namespace ICSharpCode.SharpDevelop.Gui @@ -348,18 +348,19 @@ namespace ICSharpCode.SharpDevelop.Gui
string IViewContent.TitleName {
get {
if (titleName != null)
if (titleName != null) {
return titleName;
else if (files.Count > 0)
} else if (files.Count > 0) {
return Path.GetFileName(files[0].FileName);
else
} else {
return "[Default Title]";
}
}
}
public string TitleName {
get { return titleName; }
protected set {
set {
if (titleNameLocalizeExtension != null) {
titleNameLocalizeExtension.PropertyChanged -= OnTitleNameLocalizationChanged;
titleNameLocalizeExtension = null;
@ -391,6 +392,72 @@ namespace ICSharpCode.SharpDevelop.Gui @@ -391,6 +392,72 @@ namespace ICSharpCode.SharpDevelop.Gui
}
}
#endregion
#region InfoTip
public event EventHandler InfoTipChanged;
void OnInfoTipChanged()
{
if (InfoTipChanged != null)
{
InfoTipChanged(this, EventArgs.Empty);
}
}
string infoTip;
LanguageDependentExtension infoTipLocalizeExtension;
string IViewContent.InfoTip {
get {
if (infoTip != null)
return infoTip;
else if (files.Count > 0)
return files[0].FileName;
else
return null;
}
}
public string InfoTip
{
get { return infoTip; }
set
{
if (infoTipLocalizeExtension != null)
{
infoTipLocalizeExtension.PropertyChanged -= OnInfoTipLocalizationChanged;
infoTipLocalizeExtension = null;
}
if (infoTip != value)
{
infoTip = value;
OnInfoTipChanged();
}
}
}
/// <summary>
/// Sets a localized info tip that will update automatically when the language changes.
/// </summary>
/// <param name="text">The input to the string parser which will localize info tip.</param>
protected void SetLocalizedInfoTip(string text)
{
infoTipLocalizeExtension = new StringParseExtension(text) { UsesAccessors = false };
infoTipLocalizeExtension.PropertyChanged += OnInfoTipLocalizationChanged;
OnInfoTipLocalizationChanged(null, null);
}
void OnInfoTipLocalizationChanged(object sender, EventArgs e)
{
string value = infoTipLocalizeExtension.Value;
if (infoTip != value)
{
infoTip = value;
OnInfoTipChanged();
}
}
#endregion
#region IDisposable
public event EventHandler Disposed;

12
src/Main/Base/Project/Src/Gui/IViewContent.cs

@ -83,6 +83,18 @@ namespace ICSharpCode.SharpDevelop.Gui @@ -83,6 +83,18 @@ namespace ICSharpCode.SharpDevelop.Gui
/// </summary>
event EventHandler TitleNameChanged;
/// <summary>
/// The tooltip that will be shown when you hover the mouse over the title
/// </summary>
string InfoTip {
get;
}
/// <summary>
/// Is called each time the info tip for the content has changed.
/// </summary>
event EventHandler InfoTipChanged;
/// <summary>
/// Saves the content to the location <code>fileName</code>
/// </summary>

12
src/Main/Base/Project/Src/Gui/Workbench/Layouts/AvalonDockLayout.cs

@ -42,7 +42,8 @@ namespace ICSharpCode.SharpDevelop.Gui @@ -42,7 +42,8 @@ namespace ICSharpCode.SharpDevelop.Gui
#if DEBUG
internal void WriteState(TextWriter output)
{
output.WriteLine("AvalonDock: ActiveContent = " + WpfWorkbench.GetElementName(dockingManager.ActiveContent));
output.WriteLine("AvalonDock: ActiveDocument = " + WpfWorkbench.GetElementName(dockingManager.ActiveDocument));
}
#endif
@ -57,10 +58,19 @@ namespace ICSharpCode.SharpDevelop.Gui @@ -57,10 +58,19 @@ namespace ICSharpCode.SharpDevelop.Gui
void dockingManager_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e)
{
if (e.PropertyName == "ActiveContent") {
#if DEBUG
if (WpfWorkbench.enableFocusDebugOutput)
LoggingService.Debug("AvalonDock: ActiveContent changed to " + WpfWorkbench.GetElementName(dockingManager.ActiveContent));
#endif
if (ActiveContentChanged != null)
ActiveContentChanged(this, e);
CommandManager.InvalidateRequerySuggested();
} else if (e.PropertyName == "ActiveDocument") {
#if DEBUG
if (WpfWorkbench.enableFocusDebugOutput)
LoggingService.Debug("AvalonDock: ActiveDocument changed to " + WpfWorkbench.GetElementName(dockingManager.ActiveDocument));
#endif
if (ActiveWorkbenchWindowChanged != null)
ActiveWorkbenchWindowChanged(this, e);
CommandManager.InvalidateRequerySuggested();

89
src/Main/Base/Project/Src/Gui/Workbench/Layouts/AvalonWorkbenchWindow.cs

@ -135,8 +135,12 @@ namespace ICSharpCode.SharpDevelop.Gui @@ -135,8 +135,12 @@ namespace ICSharpCode.SharpDevelop.Gui
void UpdateActiveViewContent()
{
UpdateTitle();
UpdateTitleAndInfoTip();
IViewContent newActiveViewContent = this.ActiveViewContent;
if (newActiveViewContent != null)
IsLocked = newActiveViewContent.IsReadOnly;
if (oldActiveViewContent != newActiveViewContent && ActiveViewContentChanged != null) {
ActiveViewContentChanged(this, EventArgs.Empty);
}
@ -262,7 +266,7 @@ namespace ICSharpCode.SharpDevelop.Gui @@ -262,7 +266,7 @@ namespace ICSharpCode.SharpDevelop.Gui
if (this.DragEnabledArea != null) {
this.DragEnabledArea.ContextMenu = MenuService.CreateContextMenu(this, contextMenuPath);
UpdateTitle(); // set tooltip
UpdateInfoTip(); // set tooltip
}
}
@ -347,6 +351,13 @@ namespace ICSharpCode.SharpDevelop.Gui @@ -347,6 +351,13 @@ namespace ICSharpCode.SharpDevelop.Gui
UpdateTitle();
}
}
void OnInfoTipChanged(object sender, EventArgs e)
{
if (sender == ActiveViewContent) {
UpdateInfoTip();
}
}
void OnIsDirtyChanged(object sender, EventArgs e)
{
@ -354,36 +365,54 @@ namespace ICSharpCode.SharpDevelop.Gui @@ -354,36 +365,54 @@ namespace ICSharpCode.SharpDevelop.Gui
CommandManager.InvalidateRequerySuggested();
}
void UpdateTitleAndInfoTip()
{
UpdateInfoTip();
UpdateTitle();
}
void UpdateInfoTip()
{
IViewContent content = ActiveViewContent;
if (content != null)
{
string newInfoTip = content.InfoTip;
if (newInfoTip != this.InfoTip) {
this.InfoTip = newInfoTip;
if (DragEnabledArea != null)
DragEnabledArea.ToolTip = this.InfoTip;
OnInfoTipChanged();
}
}
}
void UpdateTitle()
{
IViewContent content = ActiveViewContent;
if (content != null) {
this.InfoTip = content.PrimaryFileName;
string newTitle = content.TitleName;
if (this.IsDirty) {
if (content.IsDirty)
newTitle += "*";
}
IsLocked = content.IsReadOnly;
if (newTitle != Title) {
Title = newTitle;
OnTitleChanged(EventArgs.Empty);
OnTitleChanged();
}
}
}
void RegisterNewContent(IViewContent content)
{
Debug.Assert(content.WorkbenchWindow == null);
content.WorkbenchWindow = this;
content.TabPageTextChanged += OnTabPageTextChanged;
content.TitleNameChanged += OnTitleNameChanged;
content.IsDirtyChanged += OnIsDirtyChanged;
content.TitleNameChanged += OnTitleNameChanged;
content.InfoTipChanged += OnInfoTipChanged;
content.IsDirtyChanged += OnIsDirtyChanged;
this.dockLayout.Workbench.OnViewOpened(new ViewContentEventArgs(content));
}
@ -392,9 +421,10 @@ namespace ICSharpCode.SharpDevelop.Gui @@ -392,9 +421,10 @@ namespace ICSharpCode.SharpDevelop.Gui
content.WorkbenchWindow = null;
content.TabPageTextChanged -= OnTabPageTextChanged;
content.TitleNameChanged -= OnTitleNameChanged;
content.IsDirtyChanged -= OnIsDirtyChanged;
content.TitleNameChanged -= OnTitleNameChanged;
content.InfoTipChanged -= OnInfoTipChanged;
content.IsDirtyChanged -= OnIsDirtyChanged;
this.dockLayout.Workbench.OnViewClosed(new ViewContentEventArgs(content));
}
@ -466,16 +496,27 @@ namespace ICSharpCode.SharpDevelop.Gui @@ -466,16 +496,27 @@ namespace ICSharpCode.SharpDevelop.Gui
}
}
}
void OnTitleChanged(EventArgs e)
void OnTitleChanged()
{
if (TitleChanged != null) {
TitleChanged(this, e);
if (TitleChanged != null)
{
TitleChanged(this, EventArgs.Empty);
}
}
public event EventHandler TitleChanged;
void OnInfoTipChanged()
{
if (InfoTipChanged != null)
{
InfoTipChanged(this, EventArgs.Empty);
}
}
public event EventHandler InfoTipChanged;
public override string ToString()
{
return "[AvalonWorkbenchWindow: " + this.Title + "]";

10
src/Main/Base/Project/Src/Gui/Workbench/WpfWorkbench.cs

@ -653,11 +653,11 @@ namespace ICSharpCode.SharpDevelop.Gui @@ -653,11 +653,11 @@ namespace ICSharpCode.SharpDevelop.Gui
}
#if DEBUG
bool toggle;
internal static bool enableFocusDebugOutput;
void WpfWorkbench_PreviewGotKeyboardFocus(object sender, KeyboardFocusChangedEventArgs e)
{
if (toggle) {
if (enableFocusDebugOutput) {
LoggingService.Debug("GotKeyboardFocus: oldFocus=" + e.OldFocus + ", newFocus=" + e.NewFocus);
if (e.NewFocus is IWorkbenchWindow)
{
@ -667,7 +667,7 @@ namespace ICSharpCode.SharpDevelop.Gui @@ -667,7 +667,7 @@ namespace ICSharpCode.SharpDevelop.Gui
void WpfWorkbench_PreviewLostKeyboardFocus(object sender, KeyboardFocusChangedEventArgs e)
{
if (toggle) {
if (enableFocusDebugOutput) {
LoggingService.Debug("LostKeyboardFocus: oldFocus=" + e.OldFocus + ", newFocus=" + e.NewFocus);
if (e.NewFocus is IWorkbenchWindow)
{
@ -679,7 +679,7 @@ namespace ICSharpCode.SharpDevelop.Gui @@ -679,7 +679,7 @@ namespace ICSharpCode.SharpDevelop.Gui
{
base.OnPreviewKeyDown(e);
if (!e.Handled && e.Key == Key.D && e.KeyboardDevice.Modifiers == (ModifierKeys.Control | ModifierKeys.Shift | ModifierKeys.Alt)) {
toggle = !toggle;
enableFocusDebugOutput = !enableFocusDebugOutput;
StringWriter output = new StringWriter();
output.WriteLine("Keyboard.FocusedElement = " + GetElementName(Keyboard.FocusedElement));
@ -717,7 +717,7 @@ namespace ICSharpCode.SharpDevelop.Gui @@ -717,7 +717,7 @@ namespace ICSharpCode.SharpDevelop.Gui
}
}
static string GetElementName(object element)
internal static string GetElementName(object element)
{
if (element == null)
return "<null>";

7
src/Main/Base/Project/Src/Project/CompilableProject.cs

@ -612,7 +612,12 @@ namespace ICSharpCode.SharpDevelop.Project @@ -612,7 +612,12 @@ namespace ICSharpCode.SharpDevelop.Project
XElement startup = configuration.Element("startup");
if (startup == null) {
startup = new XElement("startup");
configuration.AddFirst(startup);
if (configuration.HasElements && configuration.Elements().First().Name == "configSections") {
// <configSections> must be first element
configuration.Elements().First().AddAfterSelf(startup);
} else {
configuration.AddFirst(startup);
}
}
XElement supportedRuntime = startup.Element("supportedRuntime");
if (supportedRuntime == null) {

20
src/Main/Base/Project/Src/Project/CustomTool.cs

@ -7,8 +7,9 @@ using System.CodeDom.Compiler; @@ -7,8 +7,9 @@ using System.CodeDom.Compiler;
using System.Collections;
using System.Collections.Generic;
using System.IO;
using System.Text.RegularExpressions;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using ICSharpCode.Core;
using ICSharpCode.SharpDevelop.Gui;
@ -293,7 +294,7 @@ namespace ICSharpCode.SharpDevelop.Project @@ -293,7 +294,7 @@ namespace ICSharpCode.SharpDevelop.Project
}
static bool initialized;
static List<CustomToolRun> toolRuns = new List<CustomToolRun>();
static Queue<CustomToolRun> toolRuns = new Queue<CustomToolRun>();
static Dictionary<string, CustomToolDescriptor> toolDict;
static List<CustomToolDescriptor> customToolList;
static CustomToolRun activeToolRun;
@ -390,9 +391,7 @@ namespace ICSharpCode.SharpDevelop.Project @@ -390,9 +391,7 @@ namespace ICSharpCode.SharpDevelop.Project
WorkbenchSingleton.AssertMainThread();
string fileName = baseItem.FileName;
if (toolRuns.Exists(delegate(CustomToolRun run) {
return FileUtility.IsEqualFileName(run.file, fileName);
}))
if (toolRuns.Any(run => FileUtility.IsEqualFileName(run.file, fileName)))
{
// file already in queue, do not enqueue it again
return;
@ -439,7 +438,7 @@ namespace ICSharpCode.SharpDevelop.Project @@ -439,7 +438,7 @@ namespace ICSharpCode.SharpDevelop.Project
static void RunCustomTool(CustomToolRun run)
{
if (activeToolRun != null) {
toolRuns.Add(run);
toolRuns.Enqueue(run);
} else {
try {
run.customTool.GenerateCode(run.baseItem, run.context);
@ -462,9 +461,12 @@ namespace ICSharpCode.SharpDevelop.Project @@ -462,9 +461,12 @@ namespace ICSharpCode.SharpDevelop.Project
WorkbenchSingleton.SafeThreadAsyncCall(
delegate {
activeToolRun = null;
CustomToolRun nextRun = toolRuns[0];
toolRuns.RemoveAt(0);
RunCustomTool(nextRun);
if(toolRuns.Count > 0) {
CustomToolRun nextRun = toolRuns.Dequeue();
if(nextRun != null) {
RunCustomTool(nextRun);
}
}
});
}
}

11
src/Main/Base/Project/Src/Util/FakeXmlViewContent.cs

@ -89,6 +89,11 @@ namespace ICSharpCode.SharpDevelop.Util @@ -89,6 +89,11 @@ namespace ICSharpCode.SharpDevelop.Util
add { }
remove { }
}
event EventHandler IViewContent.InfoTipChanged {
add { }
remove { }
}
public event EventHandler Disposed;
@ -153,6 +158,12 @@ namespace ICSharpCode.SharpDevelop.Util @@ -153,6 +158,12 @@ namespace ICSharpCode.SharpDevelop.Util
throw new NotImplementedException();
}
}
string IViewContent.InfoTip {
get {
throw new NotImplementedException();
}
}
bool IViewContent.CloseWithSolution {
get {

4
src/Main/ICSharpCode.SharpDevelop.Dom/Project/Src/CecilReader.cs

@ -56,7 +56,9 @@ namespace ICSharpCode.SharpDevelop.Dom @@ -56,7 +56,9 @@ namespace ICSharpCode.SharpDevelop.Dom
a.PositionalArguments.Add(GetValue(pc, member, argument));
}
foreach (CustomAttributeNamedArgument entry in att.Properties) {
a.NamedArguments.Add(entry.Name, GetValue(pc, member, entry.Argument));
// some obfuscated assemblies may contain duplicate named arguments; we'll have to ignore those
if (!a.NamedArguments.ContainsKey(entry.Name))
a.NamedArguments.Add(entry.Name, GetValue(pc, member, entry.Argument));
}
} catch (InvalidOperationException) {
// Workaround for Cecil bug. (some types cannot be resolved)

3
src/Setup/Files.wxs

@ -1111,9 +1111,6 @@ @@ -1111,9 +1111,6 @@
<Component Guid="7CB6802E-BC09-4796-904C-45EEAD91A5CF" Id="IrExe" DiskId="1">
<File Source="..\..\AddIns\BackendBindings\RubyBinding\ir.exe" Name="ir.exe" Id="ir.exe" KeyPath="yes" Assembly=".net" AssemblyApplication="ir.exe" AssemblyManifest="ir.exe" />
</Component>
<Component Guid="2F7C175B-7CCD-46D2-9B4E-A942CA14145B" Id="IrExeConfig" DiskId="1">
<File Source="..\..\AddIns\BackendBindings\RubyBinding\ir.exe.config" Name="ir.exe.config" Id="ir.exe.config" KeyPath="yes" />
</Component>
<Component Guid="1CE0CC65-3534-4357-BFB7-CB9F0C4E1495" Id="IronRubyDll" DiskId="1">
<File Source="..\..\AddIns\BackendBindings\RubyBinding\IronRuby.dll" Name="IronRuby.dll" Id="IronRuby.dll" KeyPath="yes" Assembly=".net" AssemblyApplication="IronRuby.dll" AssemblyManifest="IronRuby.dll" />
</Component>

1
src/Setup/Setup.wxs

@ -421,7 +421,6 @@ @@ -421,7 +421,6 @@
<ComponentRef Id="PythonBindingSdTestRunnerPy"/>
<ComponentRef Id="IrExe"/>
<ComponentRef Id="IrExeConfig"/>
<ComponentRef Id="IronRubyDll"/>
<ComponentRef Id="IronRubyLibrariesDll"/>
<ComponentRef Id="IronRubyLicenseApacheHtml"/>

2
src/Tools/CheckFileHeaders/Main.cs

@ -67,6 +67,8 @@ namespace CheckFileHeaders @@ -67,6 +67,8 @@ namespace CheckFileHeaders
continue;
if (subdir.EndsWith("Debugger.Core\\Mono.Cecil"))
continue;
if (subdir.EndsWith("CSharpBinding\\Project\\Resources"))
continue;
if (Path.GetFullPath(subdir).EndsWith("src\\Tools"))
continue;
count += Run(subdir);

Loading…
Cancel
Save