Browse Source

Move IronPython and IronRuby workbench code to common Scripting project.

pull/1/head
mrward 15 years ago
parent
commit
9d13c8e36b
  1. 1
      src/AddIns/BackendBindings/Python/PythonBinding/Project/PythonBinding.csproj
  2. 3
      src/AddIns/BackendBindings/Python/PythonBinding/Project/Src/ConvertToPythonMenuCommand.cs
  3. 19
      src/AddIns/BackendBindings/Python/PythonBinding/Project/Src/IPythonWorkbench.cs
  4. 3
      src/AddIns/BackendBindings/Python/PythonBinding/Project/Src/PythonTextEditorViewContent.cs
  5. 20
      src/AddIns/BackendBindings/Python/PythonBinding/Project/Src/PythonWorkbench.cs
  6. 3
      src/AddIns/BackendBindings/Python/PythonBinding/Project/Src/RunDebugPythonCommand.cs
  7. 6
      src/AddIns/BackendBindings/Python/PythonBinding/Project/Src/RunPythonCommand.cs
  8. 4
      src/AddIns/BackendBindings/Python/PythonBinding/Project/Src/SendLineToPythonConsoleCommand.cs
  9. 1
      src/AddIns/BackendBindings/Python/PythonBinding/Test/PythonBinding.Tests.csproj
  10. 46
      src/AddIns/BackendBindings/Python/PythonBinding/Test/Utils/MockWorkbench.cs
  11. 1
      src/AddIns/BackendBindings/Ruby/RubyBinding/Project/RubyBinding.csproj
  12. 3
      src/AddIns/BackendBindings/Ruby/RubyBinding/Project/Src/ConvertToRubyMenuCommand.cs
  13. 3
      src/AddIns/BackendBindings/Ruby/RubyBinding/Project/Src/RubyTextEditorViewContent.cs
  14. 18
      src/AddIns/BackendBindings/Ruby/RubyBinding/Project/Src/RubyWorkbench.cs
  15. 3
      src/AddIns/BackendBindings/Ruby/RubyBinding/Project/Src/RunDebugRubyCommand.cs
  16. 6
      src/AddIns/BackendBindings/Ruby/RubyBinding/Project/Src/RunRubyCommand.cs
  17. 4
      src/AddIns/BackendBindings/Ruby/RubyBinding/Project/Src/SendLineToRubyConsoleCommand.cs
  18. 1
      src/AddIns/BackendBindings/Ruby/RubyBinding/Test/RubyBinding.Tests.csproj
  19. 2
      src/AddIns/BackendBindings/Scripting/Project/ICSharpCode.Scripting.csproj
  20. 5
      src/AddIns/BackendBindings/Scripting/Project/Src/IScriptingWorkbench.cs
  21. 35
      src/AddIns/BackendBindings/Scripting/Project/Src/ScriptingWorkbench.cs
  22. 1
      src/AddIns/BackendBindings/Scripting/Test/ICSharpCode.Scripting.Tests.csproj
  23. 5
      src/AddIns/BackendBindings/Scripting/Test/Utils/MockWorkbench.cs

1
src/AddIns/BackendBindings/Python/PythonBinding/Project/PythonBinding.csproj

@ -89,7 +89,6 @@ @@ -89,7 +89,6 @@
<Compile Include="Src\AddInOptions.cs" />
<Compile Include="Src\CompilingOptionsPanel.cs" />
<Compile Include="Src\IPythonResolver.cs" />
<Compile Include="Src\IPythonWorkbench.cs" />
<Compile Include="Src\MemberName.cs" />
<Compile Include="Src\PythonBuiltInModuleMemberName.cs" />
<Compile Include="Src\PythonClassResolver.cs" />

3
src/AddIns/BackendBindings/Python/PythonBinding/Project/Src/ConvertToPythonMenuCommand.cs

@ -7,6 +7,7 @@ @@ -7,6 +7,7 @@
using System;
using ICSharpCode.Core;
using ICSharpCode.Scripting;
using ICSharpCode.SharpDevelop;
using ICSharpCode.SharpDevelop.Gui;
@ -24,7 +25,7 @@ namespace ICSharpCode.PythonBinding @@ -24,7 +25,7 @@ namespace ICSharpCode.PythonBinding
Run(new PythonWorkbench());
}
protected void Run(IPythonWorkbench workbench)
protected void Run(IScriptingWorkbench workbench)
{
view = new PythonTextEditorViewContent(workbench);
string code = GeneratePythonCode();

19
src/AddIns/BackendBindings/Python/PythonBinding/Project/Src/IPythonWorkbench.cs

@ -1,19 +0,0 @@ @@ -1,19 +0,0 @@
// <file>
// <copyright see="prj:///doc/copyright.txt"/>
// <license see="prj:///doc/license.txt"/>
// <owner name="Matthew Ward" email="mrward@users.sourceforge.net"/>
// <version>$Revision$</version>
// </file>
using System;
using ICSharpCode.Scripting;
using ICSharpCode.SharpDevelop.Gui;
namespace ICSharpCode.PythonBinding
{
public interface IPythonWorkbench
{
IScriptingConsolePad GetScriptingConsolePad();
IViewContent ActiveViewContent { get; }
}
}

3
src/AddIns/BackendBindings/Python/PythonBinding/Project/Src/PythonTextEditorViewContent.cs

@ -7,6 +7,7 @@ @@ -7,6 +7,7 @@
using System;
using ICSharpCode.Core;
using ICSharpCode.Scripting;
using ICSharpCode.SharpDevelop.Editor;
using ICSharpCode.SharpDevelop.Gui;
@ -20,7 +21,7 @@ namespace ICSharpCode.PythonBinding @@ -20,7 +21,7 @@ namespace ICSharpCode.PythonBinding
ITextEditor textEditor;
ITextEditorOptions textEditorOptions;
public PythonTextEditorViewContent(IPythonWorkbench workbench)
public PythonTextEditorViewContent(IScriptingWorkbench workbench)
{
Init(workbench.ActiveViewContent);
}

20
src/AddIns/BackendBindings/Python/PythonBinding/Project/Src/PythonWorkbench.cs

@ -1,4 +1,4 @@ @@ -1,4 +1,4 @@
// <file>
// <file>
// <copyright see="prj:///doc/copyright.txt"/>
// <license see="prj:///doc/license.txt"/>
// <owner name="Matthew Ward" email="mrward@users.sourceforge.net"/>
@ -7,28 +7,14 @@ @@ -7,28 +7,14 @@
using System;
using ICSharpCode.Scripting;
using ICSharpCode.SharpDevelop;
using ICSharpCode.SharpDevelop.Gui;
namespace ICSharpCode.PythonBinding
{
public class PythonWorkbench : IPythonWorkbench
public class PythonWorkbench : ScriptingWorkbench
{
IWorkbench workbench;
public PythonWorkbench()
: base(typeof(PythonConsolePad))
{
workbench = WorkbenchSingleton.Workbench;
}
public IViewContent ActiveViewContent {
get { return workbench.ActiveViewContent; }
}
public IScriptingConsolePad GetScriptingConsolePad()
{
PadDescriptor padDescriptor = workbench.GetPad(typeof(PythonConsolePad));
return padDescriptor.PadContent as IScriptingConsolePad;
}
}
}

3
src/AddIns/BackendBindings/Python/PythonBinding/Project/Src/RunDebugPythonCommand.cs

@ -7,6 +7,7 @@ @@ -7,6 +7,7 @@
using System;
using ICSharpCode.Core;
using ICSharpCode.Scripting;
using ICSharpCode.SharpDevelop.Debugging;
using ICSharpCode.SharpDevelop.Gui;
using ICSharpCode.SharpDevelop.Util;
@ -15,7 +16,7 @@ namespace ICSharpCode.PythonBinding @@ -15,7 +16,7 @@ namespace ICSharpCode.PythonBinding
{
public class RunDebugPythonCommand : RunPythonCommand
{
public RunDebugPythonCommand(IPythonWorkbench workbench, PythonAddInOptions options, IDebugger debugger)
public RunDebugPythonCommand(IScriptingWorkbench workbench, PythonAddInOptions options, IDebugger debugger)
: base(workbench, options, debugger)
{
Debug = true;

6
src/AddIns/BackendBindings/Python/PythonBinding/Project/Src/RunPythonCommand.cs

@ -8,7 +8,9 @@ @@ -8,7 +8,9 @@
using System;
using System.Diagnostics;
using System.IO;
using ICSharpCode.Core;
using ICSharpCode.Scripting;
using ICSharpCode.SharpDevelop.Debugging;
using ICSharpCode.SharpDevelop.Gui;
using ICSharpCode.SharpDevelop.Util;
@ -23,7 +25,7 @@ namespace ICSharpCode.PythonBinding @@ -23,7 +25,7 @@ namespace ICSharpCode.PythonBinding
{
IDebugger debugger;
PythonAddInOptions options;
IPythonWorkbench workbench;
IScriptingWorkbench workbench;
PythonConsoleApplication ipy;
public RunPythonCommand()
@ -31,7 +33,7 @@ namespace ICSharpCode.PythonBinding @@ -31,7 +33,7 @@ namespace ICSharpCode.PythonBinding
{
}
public RunPythonCommand(IPythonWorkbench workbench, PythonAddInOptions options, IDebugger debugger)
public RunPythonCommand(IScriptingWorkbench workbench, PythonAddInOptions options, IDebugger debugger)
{
this.workbench = workbench;
this.debugger = debugger;

4
src/AddIns/BackendBindings/Python/PythonBinding/Project/Src/SendLineToPythonConsoleCommand.cs

@ -15,7 +15,7 @@ namespace ICSharpCode.PythonBinding @@ -15,7 +15,7 @@ namespace ICSharpCode.PythonBinding
{
public class SendLineToPythonConsoleCommand : AbstractCommand
{
IPythonWorkbench workbench;
IScriptingWorkbench workbench;
IScriptingConsolePad consolePad;
PythonTextEditorViewContent textEditorView;
ITextEditor activeTextEditor;
@ -27,7 +27,7 @@ namespace ICSharpCode.PythonBinding @@ -27,7 +27,7 @@ namespace ICSharpCode.PythonBinding
{
}
public SendLineToPythonConsoleCommand(IPythonWorkbench workbench)
public SendLineToPythonConsoleCommand(IScriptingWorkbench workbench)
{
this.workbench = workbench;

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

@ -434,7 +434,6 @@ @@ -434,7 +434,6 @@
<Compile Include="Utils\DerivedPythonDesignerGenerator.cs" />
<Compile Include="Utils\DerivedPythonDesignerLoader.cs" />
<Compile Include="Utils\DerivedPythonFormsDesignerDisplayBinding.cs" />
<Compile Include="Utils\MockWorkbench.cs" />
<Compile Include="Utils\PythonMSBuildEngineHelper.cs" />
<Compile Include="Utils\TestablePythonConsole.cs" />
<EmbeddedResource Include="..\Project\PythonBinding.addin">

46
src/AddIns/BackendBindings/Python/PythonBinding/Test/Utils/MockWorkbench.cs

@ -1,46 +0,0 @@ @@ -1,46 +0,0 @@
// <file>
// <copyright see="prj:///doc/copyright.txt"/>
// <license see="prj:///doc/license.txt"/>
// <owner name="Matthew Ward" email="mrward@users.sourceforge.net"/>
// <version>$Revision$</version>
// </file>
using System;
using System.Collections.Generic;
using System.Windows.Forms;
using ICSharpCode.Core;
using ICSharpCode.PythonBinding;
using ICSharpCode.Scripting;
using ICSharpCode.Scripting.Tests.Utils;
using ICSharpCode.SharpDevelop;
using ICSharpCode.SharpDevelop.Gui;
namespace PythonBinding.Tests.Utils
{
public class MockWorkbench : IPythonWorkbench
{
public MockScriptingConsolePad MockScriptingConsolePad = new MockScriptingConsolePad();
public MockEditableViewContent ActiveMockEditableViewContent;
public static MockWorkbench CreateWorkbenchWithOneViewContent(string fileName)
{
MockEditableViewContent viewContent = new MockEditableViewContent();
viewContent.PrimaryFileName = new FileName(fileName);
MockWorkbench workbench = new MockWorkbench();
workbench.ActiveMockEditableViewContent = viewContent;
return workbench;
}
public IViewContent ActiveViewContent {
get { return ActiveMockEditableViewContent; }
}
public IScriptingConsolePad GetScriptingConsolePad()
{
return MockScriptingConsolePad;
}
}
}

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

@ -86,7 +86,6 @@ @@ -86,7 +86,6 @@
<Link>Configuration\GlobalAssemblyInfo.cs</Link>
</Compile>
<Compile Include="Configuration\AssemblyInfo.cs" />
<Compile Include="Src\IRubyWorkbench.cs" />
<Compile Include="Src\RubyConsoleApplication.cs" />
<Compile Include="Src\ConvertProjectToRubyProjectCommand.cs" />
<Compile Include="Src\ConvertToRubyMenuCommand.cs" />

3
src/AddIns/BackendBindings/Ruby/RubyBinding/Project/Src/ConvertToRubyMenuCommand.cs

@ -7,6 +7,7 @@ @@ -7,6 +7,7 @@
using System;
using ICSharpCode.Core;
using ICSharpCode.Scripting;
using ICSharpCode.SharpDevelop;
using ICSharpCode.SharpDevelop.Dom;
using ICSharpCode.SharpDevelop.Gui;
@ -25,7 +26,7 @@ namespace ICSharpCode.RubyBinding @@ -25,7 +26,7 @@ namespace ICSharpCode.RubyBinding
Run(new RubyWorkbench());
}
protected void Run(IRubyWorkbench workbench)
protected void Run(IScriptingWorkbench workbench)
{
view = new RubyTextEditorViewContent(workbench);
string code = GenerateRubyCode();

3
src/AddIns/BackendBindings/Ruby/RubyBinding/Project/Src/RubyTextEditorViewContent.cs

@ -7,6 +7,7 @@ @@ -7,6 +7,7 @@
using System;
using ICSharpCode.Core;
using ICSharpCode.Scripting;
using ICSharpCode.SharpDevelop.Editor;
using ICSharpCode.SharpDevelop.Gui;
@ -20,7 +21,7 @@ namespace ICSharpCode.RubyBinding @@ -20,7 +21,7 @@ namespace ICSharpCode.RubyBinding
ITextEditor textEditor;
ITextEditorOptions textEditorOptions;
public RubyTextEditorViewContent(IRubyWorkbench workbench)
public RubyTextEditorViewContent(IScriptingWorkbench workbench)
{
Init(workbench.ActiveViewContent);
}

18
src/AddIns/BackendBindings/Ruby/RubyBinding/Project/Src/RubyWorkbench.cs

@ -12,23 +12,11 @@ using ICSharpCode.SharpDevelop.Gui; @@ -12,23 +12,11 @@ using ICSharpCode.SharpDevelop.Gui;
namespace ICSharpCode.RubyBinding
{
public class RubyWorkbench : IRubyWorkbench
{
IWorkbench workbench;
public class RubyWorkbench : ScriptingWorkbench
{
public RubyWorkbench()
: base(typeof(RubyConsolePad))
{
workbench = WorkbenchSingleton.Workbench;
}
public IViewContent ActiveViewContent {
get { return workbench.ActiveViewContent; }
}
public IScriptingConsolePad GetScriptingConsolePad()
{
PadDescriptor padDescriptor = workbench.GetPad(typeof(RubyConsolePad));
return padDescriptor.PadContent as IScriptingConsolePad;
}
}
}

3
src/AddIns/BackendBindings/Ruby/RubyBinding/Project/Src/RunDebugRubyCommand.cs

@ -7,6 +7,7 @@ @@ -7,6 +7,7 @@
using System;
using ICSharpCode.Core;
using ICSharpCode.Scripting;
using ICSharpCode.SharpDevelop.Debugging;
using ICSharpCode.SharpDevelop.Gui;
using ICSharpCode.SharpDevelop.Util;
@ -15,7 +16,7 @@ namespace ICSharpCode.RubyBinding @@ -15,7 +16,7 @@ namespace ICSharpCode.RubyBinding
{
public class RunDebugRubyCommand : RunRubyCommand
{
public RunDebugRubyCommand(IRubyWorkbench workbench, RubyAddInOptions options, IDebugger debugger)
public RunDebugRubyCommand(IScriptingWorkbench workbench, RubyAddInOptions options, IDebugger debugger)
: base(workbench, options, debugger)
{
Debug = true;

6
src/AddIns/BackendBindings/Ruby/RubyBinding/Project/Src/RunRubyCommand.cs

@ -8,7 +8,9 @@ @@ -8,7 +8,9 @@
using System;
using System.Diagnostics;
using System.IO;
using ICSharpCode.Core;
using ICSharpCode.Scripting;
using ICSharpCode.SharpDevelop.Debugging;
using ICSharpCode.SharpDevelop.Gui;
using ICSharpCode.SharpDevelop.Util;
@ -23,7 +25,7 @@ namespace ICSharpCode.RubyBinding @@ -23,7 +25,7 @@ namespace ICSharpCode.RubyBinding
{
IDebugger debugger;
RubyAddInOptions options;
IRubyWorkbench workbench;
IScriptingWorkbench workbench;
bool debug;
public RunRubyCommand()
@ -31,7 +33,7 @@ namespace ICSharpCode.RubyBinding @@ -31,7 +33,7 @@ namespace ICSharpCode.RubyBinding
{
}
public RunRubyCommand(IRubyWorkbench workbench, RubyAddInOptions options, IDebugger debugger)
public RunRubyCommand(IScriptingWorkbench workbench, RubyAddInOptions options, IDebugger debugger)
{
this.workbench = workbench;
this.debugger = debugger;

4
src/AddIns/BackendBindings/Ruby/RubyBinding/Project/Src/SendLineToRubyConsoleCommand.cs

@ -15,7 +15,7 @@ namespace ICSharpCode.RubyBinding @@ -15,7 +15,7 @@ namespace ICSharpCode.RubyBinding
{
public class SendLineToRubyConsoleCommand : AbstractCommand
{
IRubyWorkbench workbench;
IScriptingWorkbench workbench;
IScriptingConsolePad consolePad;
RubyTextEditorViewContent textEditorView;
ITextEditor activeTextEditor;
@ -27,7 +27,7 @@ namespace ICSharpCode.RubyBinding @@ -27,7 +27,7 @@ namespace ICSharpCode.RubyBinding
{
}
public SendLineToRubyConsoleCommand(IRubyWorkbench workbench)
public SendLineToRubyConsoleCommand(IScriptingWorkbench workbench)
{
this.workbench = workbench;

1
src/AddIns/BackendBindings/Ruby/RubyBinding/Test/RubyBinding.Tests.csproj

@ -328,7 +328,6 @@ @@ -328,7 +328,6 @@
<Compile Include="Utils\DerivedRubyDesignerGenerator.cs" />
<Compile Include="Utils\DerivedRubyDesignerLoader.cs" />
<Compile Include="Utils\DerivedRubyFormsDesignerDisplayBinding.cs" />
<Compile Include="Utils\MockWorkbench.cs" />
<Compile Include="Utils\RubyBindingAddInFile.cs" />
<Compile Include="Utils\RubyMSBuildEngineHelper.cs" />
<Compile Include="Utils\RubyParserHelper.cs" />

2
src/AddIns/BackendBindings/Scripting/Project/ICSharpCode.Scripting.csproj

@ -74,6 +74,7 @@ @@ -74,6 +74,7 @@
<Compile Include="Src\IScriptingConsoleTextEditor.cs" />
<Compile Include="Src\IScriptingDesignerGenerator.cs" />
<Compile Include="Src\IScriptingFileService.cs" />
<Compile Include="Src\IScriptingWorkbench.cs" />
<Compile Include="Src\ScriptingCodeBuilder.cs" />
<Compile Include="Src\ScriptingConsoleCompletionData.cs" />
<Compile Include="Src\ScriptingConsoleCompletionDataProvider.cs" />
@ -81,6 +82,7 @@ @@ -81,6 +82,7 @@
<Compile Include="Src\ScriptingConsoleTextEditorKeyEventArgs.cs" />
<Compile Include="Src\ScriptingFileService.cs" />
<Compile Include="Src\ScriptingNameCreationService.cs" />
<Compile Include="Src\ScriptingWorkbench.cs" />
<Compile Include="Src\StringListLock.cs" />
<Compile Include="Src\ThreadSafeScriptingConsoleTextEditor.cs" />
</ItemGroup>

5
src/AddIns/BackendBindings/Ruby/RubyBinding/Project/Src/IRubyWorkbench.cs → src/AddIns/BackendBindings/Scripting/Project/Src/IScriptingWorkbench.cs

@ -6,12 +6,11 @@ @@ -6,12 +6,11 @@
// </file>
using System;
using ICSharpCode.Scripting;
using ICSharpCode.SharpDevelop.Gui;
namespace ICSharpCode.RubyBinding
namespace ICSharpCode.Scripting
{
public interface IRubyWorkbench
public interface IScriptingWorkbench
{
IScriptingConsolePad GetScriptingConsolePad();
IViewContent ActiveViewContent { get; }

35
src/AddIns/BackendBindings/Scripting/Project/Src/ScriptingWorkbench.cs

@ -0,0 +1,35 @@ @@ -0,0 +1,35 @@
// <file>
// <copyright see="prj:///doc/copyright.txt"/>
// <license see="prj:///doc/license.txt"/>
// <owner name="Matthew Ward" email="mrward@users.sourceforge.net"/>
// <version>$Revision$</version>
// </file>
using System;
using ICSharpCode.SharpDevelop;
using ICSharpCode.SharpDevelop.Gui;
namespace ICSharpCode.Scripting
{
public class ScriptingWorkbench : IScriptingWorkbench
{
Type consolePadType;
IWorkbench workbench;
public ScriptingWorkbench(Type consolePadType)
{
this.consolePadType = consolePadType;
workbench = WorkbenchSingleton.Workbench;
}
public IViewContent ActiveViewContent {
get { return workbench.ActiveViewContent; }
}
public IScriptingConsolePad GetScriptingConsolePad()
{
PadDescriptor padDescriptor = workbench.GetPad(consolePadType);
return padDescriptor.PadContent as IScriptingConsolePad;
}
}
}

1
src/AddIns/BackendBindings/Scripting/Test/ICSharpCode.Scripting.Tests.csproj

@ -123,6 +123,7 @@ @@ -123,6 +123,7 @@
<Compile Include="Utils\MockTextEditorViewContent.cs" />
<Compile Include="Utils\MockTypeResolutionService.cs" />
<Compile Include="Utils\MockViewContent.cs" />
<Compile Include="Utils\MockWorkbench.cs" />
<Compile Include="Utils\MSBuildEngineHelper.cs" />
<Compile Include="Utils\NullPropertyUserControl.cs" />
<Compile Include="Utils\SupportInitCustomControl.cs" />

5
src/AddIns/BackendBindings/Ruby/RubyBinding/Test/Utils/MockWorkbench.cs → src/AddIns/BackendBindings/Scripting/Test/Utils/MockWorkbench.cs

@ -10,15 +10,14 @@ using System.Collections.Generic; @@ -10,15 +10,14 @@ using System.Collections.Generic;
using System.Windows.Forms;
using ICSharpCode.Core;
using ICSharpCode.RubyBinding;
using ICSharpCode.Scripting;
using ICSharpCode.Scripting.Tests.Utils;
using ICSharpCode.SharpDevelop;
using ICSharpCode.SharpDevelop.Gui;
namespace RubyBinding.Tests.Utils
namespace ICSharpCode.Scripting.Tests.Utils
{
public class MockWorkbench : IRubyWorkbench
public class MockWorkbench : IScriptingWorkbench
{
public MockScriptingConsolePad MockScriptingConsolePad = new MockScriptingConsolePad();
public MockEditableViewContent ActiveMockEditableViewContent;
Loading…
Cancel
Save