Browse Source

Added F# addin created by Robert Pickering.

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@2960 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
shortcuts
Matt Ward 18 years ago
parent
commit
71b08634a4
  1. 3
      data/resources/image/BitmapResources/BitmapResources.res
  2. BIN
      data/resources/image/BitmapResources/backendicons/FSharp/F#.FileIcon.png
  3. BIN
      data/resources/image/BitmapResources/backendicons/FSharp/F#.ProjectIcon.png
  4. 4
      data/resources/layouts/Debug.xml
  5. 4
      data/resources/layouts/Default.xml
  6. 4
      data/resources/layouts/Plain.xml
  7. 18
      src/AddIns/BackendBindings/FSharp/FSharp.Build.Tasks.sln
  8. 25
      src/AddIns/BackendBindings/FSharp/FSharp.Build.Tasks/Project/Configuration/AssemblyInfo.cs
  9. 65
      src/AddIns/BackendBindings/FSharp/FSharp.Build.Tasks/Project/FSharp.Build.Tasks.csproj
  10. 69
      src/AddIns/BackendBindings/FSharp/FSharp.Build.Tasks/Project/SharpDevelop.Build.Fsc.targets
  11. 41
      src/AddIns/BackendBindings/FSharp/FSharp.Build.Tasks/Project/Src/CompilerCommandLineBuilder.cs
  12. 248
      src/AddIns/BackendBindings/FSharp/FSharp.Build.Tasks/Project/Src/Fsc.cs
  13. 78
      src/AddIns/BackendBindings/FSharp/FSharpBinding.sln
  14. 129
      src/AddIns/BackendBindings/FSharp/FSharpBinding/Project/FSharpBinding.addin
  15. 118
      src/AddIns/BackendBindings/FSharp/FSharpBinding/Project/FSharpBinding.fsproj
  16. 263
      src/AddIns/BackendBindings/FSharp/FSharpBinding/Project/Resources/FS-Mode.xshd
  17. 30
      src/AddIns/BackendBindings/FSharp/FSharpBinding/Project/Resources/FsOptions.xfrm
  18. 115
      src/AddIns/BackendBindings/FSharp/FSharpBinding/Project/Src/fsi.fs
  19. 25
      src/AddIns/BackendBindings/FSharp/FSharpBinding/Project/Src/languagebinding.fs
  20. 227
      src/AddIns/BackendBindings/FSharp/FSharpBinding/Project/Src/project.fs
  21. 27
      src/AddIns/BackendBindings/FSharp/FSharpBinding/Project/Templates/ConsoleProject.xpt
  22. 36
      src/AddIns/BackendBindings/FSharp/FSharpBinding/Project/Templates/EmptyClass.xft
  23. BIN
      src/AddIns/BackendBindings/FSharp/RequiredLibraries/FSharp.Build.Tasks.dll
  24. 69
      src/AddIns/BackendBindings/FSharp/RequiredLibraries/SharpDevelop.Build.Fsc.targets
  25. BIN
      src/Main/StartUp/Project/Resources/BitmapResources.resources
  26. 22
      src/Setup/Files.wxs
  27. 7
      src/Setup/Setup.wxs
  28. 13
      src/SharpDevelop.sln
  29. 2
      src/clean.bat
  30. 2
      src/debugbuild.bat
  31. 2
      src/releasebuild.bat

3
data/resources/image/BitmapResources/BitmapResources.res

@ -428,6 +428,9 @@ Boo.Project.EmptyProject = backendicons\boo\Boo.Project @@ -428,6 +428,9 @@ Boo.Project.EmptyProject = backendicons\boo\Boo.Project
Boo.Project.Form = backendicons\boo\Boo.Project.Form.png
Boo.ProjectIcon = backendicons\boo\Boo.ProjectIcon.png
F#.ProjectIcon = backendicons\FSharp\F#.ProjectIcon.png
F#.FileIcon = backendicons\FSharp\F#.FileIcon.png
# misc backend icons
FileIcons.XmlIcon = backendicons\miscFiles\Icons.16x16.XMLFileIcon.png
Icons.16x16.ResourceFileIcon = backendicons\miscFiles\Icons.16x16.ResourceFileIcon.png

BIN
data/resources/image/BitmapResources/backendicons/FSharp/F#.FileIcon.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 578 B

BIN
data/resources/image/BitmapResources/backendicons/FSharp/F#.ProjectIcon.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 292 B

4
data/resources/layouts/Debug.xml

@ -2,7 +2,7 @@ @@ -2,7 +2,7 @@
<!--DockPanel configuration file. Author: Weifen Luo, all rights reserved.-->
<!--!!! AUTOMATICALLY GENERATED FILE. DO NOT MODIFY !!!-->
<DockPanel FormatVersion="1.0" DockLeftPortion="0.196180555555556" DockRightPortion="0.172743055555556" DockTopPortion="0.25" DockBottomPortion="0.25" ActiveDocumentPane="-1" ActivePane="2">
<Contents Count="27">
<Contents Count="29">
<Content ID="0" PersistString="ICSharpCode.SharpDevelop.Project.ProjectBrowserPad" AutoHidePortion="0.25" IsHidden="False" IsFloat="False" />
<Content ID="1" PersistString="ICSharpCode.SharpDevelop.Gui.ClassBrowser.ClassBrowserPad" AutoHidePortion="0.25" IsHidden="False" IsFloat="False" />
<Content ID="2" PersistString="ICSharpCode.SharpDevelop.Gui.ErrorListPad" AutoHidePortion="0.25" IsHidden="False" IsFloat="False" />
@ -30,6 +30,8 @@ @@ -30,6 +30,8 @@
<Content ID="24" PersistString="ClassDiagramAddin.ClassEditorPad" AutoHidePortion="0.25" IsHidden="True" IsFloat="False" />
<Content ID="25" PersistString="ICSharpCode.UnitTesting.UnitTestsPad" AutoHidePortion="0.25" IsHidden="False" IsFloat="False" />
<Content ID="26" PersistString="SharpServerTools.Forms.ServerBrowserTool" AutoHidePortion="0.25" IsHidden="True" IsFloat="False" />
<Content ID="27" PersistString="FSharpBinding.FSharpInteractive" AutoHidePortion="0.25" IsHidden="True" IsFloat="False" />
<Content ID="28" PersistString="ICSharpCode.ServerTools.ServerBrowserHost" AutoHidePortion="0.25" IsHidden="True" IsFloat="False" />
</Contents>
<Panes Count="7">
<Pane ID="0" DockState="DockLeft" ActiveContent="0">

4
data/resources/layouts/Default.xml

@ -2,7 +2,7 @@ @@ -2,7 +2,7 @@
<!--DockPanel configuration file. Author: Weifen Luo, all rights reserved.-->
<!--!!! AUTOMATICALLY GENERATED FILE. DO NOT MODIFY !!!-->
<DockPanel FormatVersion="1.0" DockLeftPortion="0.196180555555556" DockRightPortion="0.172743055555556" DockTopPortion="0.25" DockBottomPortion="0.25" ActiveDocumentPane="-1" ActivePane="0">
<Contents Count="27">
<Contents Count="29">
<Content ID="0" PersistString="ICSharpCode.SharpDevelop.Project.ProjectBrowserPad" AutoHidePortion="0.25" IsHidden="False" IsFloat="False" />
<Content ID="1" PersistString="ICSharpCode.SharpDevelop.Gui.ClassBrowser.ClassBrowserPad" AutoHidePortion="0.25" IsHidden="False" IsFloat="False" />
<Content ID="2" PersistString="ICSharpCode.SharpDevelop.Gui.ErrorListPad" AutoHidePortion="0.25" IsHidden="False" IsFloat="False" />
@ -30,6 +30,8 @@ @@ -30,6 +30,8 @@
<Content ID="24" PersistString="ICSharpCode.SharpDevelop.Gui.ToolsPad" AutoHidePortion="0.25" IsHidden="False" IsFloat="False" />
<Content ID="25" PersistString="ClassDiagramAddin.ClassEditorPad" AutoHidePortion="0.25" IsHidden="True" IsFloat="False" />
<Content ID="26" PersistString="SharpServerTools.Forms.ServerBrowserTool" AutoHidePortion="0.25" IsHidden="True" IsFloat="False" />
<Content ID="27" PersistString="FSharpBinding.FSharpInteractive" AutoHidePortion="0.25" IsHidden="True" IsFloat="False" />
<Content ID="28" PersistString="ICSharpCode.ServerTools.ServerBrowserHost" AutoHidePortion="0.25" IsHidden="True" IsFloat="False" />
</Contents>
<Panes Count="5">
<Pane ID="0" DockState="DockRight" ActiveContent="5">

4
data/resources/layouts/Plain.xml

@ -2,7 +2,7 @@ @@ -2,7 +2,7 @@
<!-- DockPanel configuration file. Author: Weifen Luo, all rights reserved. -->
<!-- !!! AUTOMATICALLY GENERATED FILE. DO NOT MODIFY !!! -->
<DockPanel FormatVersion="1.0" DockLeftPortion="0.196180555555556" DockRightPortion="0.172743055555556" DockTopPortion="0.25" DockBottomPortion="0.25" ActiveDocumentPane="-1" ActivePane="-1">
<Contents Count="32">
<Contents Count="34">
<Content ID="0" PersistString="ICSharpCode.SharpDevelop.Project.ProjectBrowserPad" AutoHidePortion="0.25" IsHidden="True" IsFloat="False" />
<Content ID="1" PersistString="ICSharpCode.SharpDevelop.Gui.ClassBrowser.ClassBrowserPad" AutoHidePortion="0.25" IsHidden="True" IsFloat="False" />
<Content ID="2" PersistString="ICSharpCode.SharpDevelop.Gui.SideBarView" AutoHidePortion="0.25" IsHidden="True" IsFloat="False" />
@ -35,6 +35,8 @@ @@ -35,6 +35,8 @@
<Content ID="29" PersistString="SharpServerTools.Forms.ServerBrowserTool" AutoHidePortion="0.25" IsHidden="True" IsFloat="False" />
<Content ID="30" PersistString="ICSharpCode.XmlEditor.XPathQueryPad" AutoHidePortion="0.25" IsHidden="True" IsFloat="False" />
<Content ID="31" PersistString="SharpReportAddin.ReportExplorer" AutoHidePortion="0.25" IsHidden="True" IsFloat="False" />
<Content ID="32" PersistString="FSharpBinding.FSharpInteractive" AutoHidePortion="0.25" IsHidden="True" IsFloat="False" />
<Content ID="33" PersistString="ICSharpCode.ServerTools.ServerBrowserHost" AutoHidePortion="0.25" IsHidden="True" IsFloat="False" />
</Contents>
<Panes Count="5">
<Pane ID="0" DockState="DockRight" ActiveContent="-1">

18
src/AddIns/BackendBindings/FSharp/FSharp.Build.Tasks.sln

@ -0,0 +1,18 @@ @@ -0,0 +1,18 @@

Microsoft Visual Studio Solution File, Format Version 10.00
# Visual Studio 2008
# SharpDevelop 3.0.0.2956
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FSharp.Build.Tasks", "FSharp.Build.Tasks\Project\FSharp.Build.Tasks.csproj", "{674D485B-8340-498D-B91F-BE51543386C8}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{674D485B-8340-498D-B91F-BE51543386C8}.Debug|Any CPU.Build.0 = Debug|Any CPU
{674D485B-8340-498D-B91F-BE51543386C8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{674D485B-8340-498D-B91F-BE51543386C8}.Release|Any CPU.Build.0 = Release|Any CPU
{674D485B-8340-498D-B91F-BE51543386C8}.Release|Any CPU.ActiveCfg = Release|Any CPU
EndGlobalSection
EndGlobal

25
src/AddIns/BackendBindings/FSharp/FSharp.Build.Tasks/Project/Configuration/AssemblyInfo.cs

@ -0,0 +1,25 @@ @@ -0,0 +1,25 @@
// <file>
// <copyright see="prj:///doc/copyright.txt"/>
// <license see="prj:///doc/license.txt"/>
// <owner name="Robert Pickering" email="robert@strangelights.com"/>
// <version>$Revision$</version>
// </file>
using System.Reflection;
// Information about this assembly is defined by the following
// attributes.
//
// change them to the information which is associated with the assembly
// you compile.
[assembly: System.Runtime.InteropServices.ComVisible(false)]
[assembly: AssemblyTitle("FSharp.Build.Tasks")]
[assembly: AssemblyDescription("Provides F# build tasks for the F# addin.")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
[assembly: AssemblyCompany("ic#code")]
[assembly: AssemblyProduct("SharpDevelop")]
[assembly: AssemblyCopyright("2000-2008 AlphaSierraPapa")]
[assembly: AssemblyVersion("1.0")]

65
src/AddIns/BackendBindings/FSharp/FSharp.Build.Tasks/Project/FSharp.Build.Tasks.csproj

@ -0,0 +1,65 @@ @@ -0,0 +1,65 @@
<Project ToolsVersion="3.5" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<ProjectGuid>{674D485B-8340-498D-B91F-BE51543386C8}</ProjectGuid>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<OutputType>Library</OutputType>
<RootNamespace>FSharp.Build.Tasks</RootNamespace>
<AssemblyName>FSharp.Build.Tasks</AssemblyName>
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
<AllowUnsafeBlocks>False</AllowUnsafeBlocks>
<NoStdLib>False</NoStdLib>
<WarningLevel>4</WarningLevel>
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
<OutputPath>..\..\RequiredLibraries</OutputPath>
<DebugSymbols>true</DebugSymbols>
<DebugType>Full</DebugType>
<Optimize>False</Optimize>
<CheckForOverflowUnderflow>True</CheckForOverflowUnderflow>
<DefineConstants>DEBUG;TRACE</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
<OutputPath>..\..\RequiredLibraries</OutputPath>
<DebugSymbols>false</DebugSymbols>
<DebugType>None</DebugType>
<Optimize>True</Optimize>
<CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>
<DefineConstants>TRACE</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition=" '$(Platform)' == 'AnyCPU' ">
<RegisterForComInterop>False</RegisterForComInterop>
<GenerateSerializationAssemblies>Auto</GenerateSerializationAssemblies>
<BaseAddress>4194304</BaseAddress>
<PlatformTarget>AnyCPU</PlatformTarget>
<FileAlignment>4096</FileAlignment>
</PropertyGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.Targets" />
<ItemGroup>
<Reference Include="Microsoft.Build.Framework">
<Private>False</Private>
</Reference>
<Reference Include="Microsoft.Build.Tasks">
<Private>False</Private>
</Reference>
<Reference Include="Microsoft.Build.Utilities" />
<Reference Include="System">
<Private>False</Private>
</Reference>
<Reference Include="System.Configuration">
<Private>False</Private>
</Reference>
<Reference Include="System.Xml">
<Private>False</Private>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="Configuration\AssemblyInfo.cs" />
<Compile Include="Src\CompilerCommandLineBuilder.cs" />
<Compile Include="Src\Fsc.cs" />
<None Include="SharpDevelop.Build.Fsc.targets">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
</ItemGroup>
</Project>

69
src/AddIns/BackendBindings/FSharp/FSharp.Build.Tasks/Project/SharpDevelop.Build.Fsc.targets

@ -0,0 +1,69 @@ @@ -0,0 +1,69 @@
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<UsingTask TaskName="FSharp.Build.Tasks.Fsc" AssemblyFile="FSharp.Build.Tasks.dll" />
<UsingTask TaskName="CreateCSharpManifestResourceName" AssemblyName="Microsoft.Build.Tasks, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<PropertyGroup>
<MSBuildAllProjects>$(MSBuildAllProjects);$(FSharpBuildTasksPath)\SharpDevelop.Build.Fsc.targets</MSBuildAllProjects>
<DefaultLanguageSourceExtension>.fs</DefaultLanguageSourceExtension>
<Language>F#</Language>
</PropertyGroup>
<PropertyGroup>
<CreateManifestResourceNamesDependsOn>
</CreateManifestResourceNamesDependsOn>
</PropertyGroup>
<Target Name="CreateManifestResourceNames" Condition="'@(ResxWithNoCulture)@(ResxWithCulture)@(NonResxWithNoCulture)@(NonResxWithCulture)'!=''" DependsOnTargets="$(CreateManifestResourceNamesDependsOn)">
<!-- Create the target resource names for non-culture resx files. -->
<CreateCSharpManifestResourceName Condition="'@(ResxWithNoCulture)'!=''" ResourceFiles="@(ResxWithNoCulture)" RootNamespace="$(RootNamespace)">
<Output TaskParameter="ManifestResourceNames" ItemName="ManifestResourceWithNoCultureName" />
</CreateCSharpManifestResourceName>
<!-- Create the target resource names for culture resx files. -->
<CreateCSharpManifestResourceName Condition="'@(ResxWithCulture)'!=''" ResourceFiles="@(ResxWithCulture)" RootNamespace="$(RootNamespace)">
<Output TaskParameter="ManifestResourceNames" ItemName="ManifestResourceWithCultureName" />
</CreateCSharpManifestResourceName>
<!-- Create the target resource names for non-culture non-resx files. -->
<CreateCSharpManifestResourceName Condition="'@(NonResxWithNoCulture)'!=''" ResourceFiles="@(NonResxWithNoCulture)" RootNamespace="$(RootNamespace)">
<Output TaskParameter="ManifestResourceNames" ItemName="ManifestNonResxWithNoCulture" />
</CreateCSharpManifestResourceName>
<!-- Create the target resource names for culture non-resx files. -->
<CreateCSharpManifestResourceName Condition="'@(NonResxWithCulture)'!=''" ResourceFiles="@(NonResxWithCulture)" RootNamespace="$(RootNamespace)">
<Output TaskParameter="ManifestResourceNames" ItemName="ManifestNonResxWithCulture" />
</CreateCSharpManifestResourceName>
</Target>
<Target Name="CoreCompile" Inputs="$(MSBuildAllProjects);
@(Compile);
@(ReferencePath);
@(ManifestResourceWithNoCulture);
$(ApplicationIcon);
$(AssemblyOriginatorKeyFile);
@(ManifestNonResxWithNoCultureOnDisk);
@(ReferencePath);
@(CompiledLicenseFile);
$(Standalone);
$(NoMLLib)"
Outputs="@(DocFileItem);
@(IntermediateAssembly);
$(NonExistentFile)"
DependsOnTargets="$(CoreCompileDependsOn)">
<Fsc
DebugType="$(DebugType)"
EmitDebugInformation="$(DebugSymbols)"
FileAlignment="$(FileAlignment)"
KeyContainer="$(KeyContainerName)"
KeyFile="$(KeyOriginatorFile)"
Optimize="$(Optimize)"
OutputAssembly="@(IntermediateAssembly)"
Resources="@(ManifestResourceWithNoCulture);@(ManifestNonResxWithNoCultureOnDisk);@(CompiledLicenseFile)"
Sources="@(Compile)"
References="@(ReferencePath)"
TargetType="$(OutputType)"
Standalone="$(Standalone)"
NoMLLib="$(NoMLLib)" />
</Target>
<Import Project="$(MSBuildBinPath)\Microsoft.Common.targets" />
</Project>

41
src/AddIns/BackendBindings/FSharp/FSharp.Build.Tasks/Project/Src/CompilerCommandLineBuilder.cs

@ -0,0 +1,41 @@ @@ -0,0 +1,41 @@
// <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.Globalization;
using System.IO;
using Microsoft.Build.Framework;
using Microsoft.Build.Utilities;
using Microsoft.Build.Tasks;
namespace FSharp.Build.Tasks
{
public class CompilerCommandLineBuilder : CommandLineBuilder
{
public void AppendIntegerSwitch(string switchName, int value)
{
AppendSwitchUnquotedIfNotNull(switchName, value.ToString(NumberFormatInfo.InvariantInfo));
}
public void AppendFileNameIfNotNull(string switchName, ITaskItem fileItem)
{
if (fileItem != null) {
AppendFileNameIfNotNull(switchName, fileItem.ItemSpec);
}
}
public void AppendFileNameIfNotNull(string switchName, string fileName)
{
if (fileName != null) {
AppendSpaceIfNotEmpty();
AppendTextUnquoted(switchName);
AppendFileNameWithQuoting(fileName);
}
}
}
}

248
src/AddIns/BackendBindings/FSharp/FSharp.Build.Tasks/Project/Src/Fsc.cs

@ -0,0 +1,248 @@ @@ -0,0 +1,248 @@
// <file>
// <copyright see="prj:///doc/copyright.txt"/>
// <license see="prj:///doc/license.txt"/>
// <owner name="Robert Pickering" email="robert@strangelights.com"/>
// <version>$Revision$</version>
// </file>
using System;
using System.IO;
using System.CodeDom.Compiler;
using System.Configuration;
using System.Globalization;
using Microsoft.Build.Framework;
using Microsoft.Build.Utilities;
using Microsoft.Build.Tasks;
using System.Collections.Generic;
using System.Text.RegularExpressions;
namespace FSharp.Build.Tasks
{
public sealed class Fsc : ToolTask
{
string keyContainer;
string keyFile;
int fileAlignment;
bool standalone;
bool noMLLib;
ITaskItem[] sources;
ITaskItem[] resources;
ITaskItem[] references;
ITaskItem outputAssembly;
string debugType;
bool emitDebugInformation;
string targetType;
bool optimize;
public int FileAlignment {
get { return fileAlignment; }
set { fileAlignment = value; }
}
public string KeyContainer {
get { return keyContainer; }
set { keyContainer = value; }
}
public string KeyFile {
get { return keyFile; }
set { keyFile = value; }
}
public bool Standalone {
get { return standalone; }
set { standalone = value; }
}
public bool NoMLLib {
get { return noMLLib; }
set { noMLLib = value; }
}
public string DebugType {
get { return debugType; }
set { debugType = value; }
}
public bool EmitDebugInformation {
get { return emitDebugInformation; }
set { emitDebugInformation = value; }
}
public ITaskItem[] Sources {
get { return sources; }
set { sources = value; }
}
public ITaskItem[] References {
get { return references; }
set { references = value; }
}
public ITaskItem[] Resources {
get { return resources; }
set { resources = value; }
}
public bool Optimize {
get { return optimize; }
set { optimize = value; }
}
public ITaskItem OutputAssembly {
get { return outputAssembly; }
set { outputAssembly = value; }
}
public string TargetType {
get { return targetType; }
set { targetType = value; }
}
protected override string ToolName {
get { return "fsc.exe"; }
}
protected override string GenerateFullPathToTool()
{
string path = null;
if (Array.Exists<string>(ConfigurationManager.AppSettings.AllKeys, delegate(string k) { return k == "alt_fs_bin_path"; })) {
path = Path.Combine(ConfigurationManager.AppSettings["alt_fs_bin_path"], ToolName);
if (!File.Exists(path)) {
throw new Exception("you are trying to use the app setting alt_fs_bin_path, but fsc.exe is not localed in the given directory");
}
} else {
string[] paths = Environment.GetEnvironmentVariable("path").Split(';');
path = Array.Find(paths, delegate(string x) { return File.Exists(Path.Combine(x, "fsc.exe")); });
if (path != null) {
path = Path.Combine(path, ToolName);
} else {
string[] dirs = Directory.GetDirectories(Environment.GetEnvironmentVariable("ProgramFiles"));
List<FileInfo> files = new List<FileInfo>();
foreach (string dir in dirs) {
FileInfo file = new FileInfo(Path.Combine(Path.Combine(dir, "bin"), ToolName));
if (file.Exists) {
files.Add(file);
}
}
if (files.Count > 0) {
files.Sort(delegate(FileInfo x, FileInfo y) { return DateTime.Compare(x.CreationTime, y.CreationTime); });
path = files[0].FullName;
} else {
throw new Exception("can not find the fsi.exe, ensure a version of the F# compiler is installed");
}
}
}
return path;
}
protected override string GenerateCommandLineCommands()
{
CompilerCommandLineBuilder commandLine = new CompilerCommandLineBuilder();
if (((OutputAssembly == null) && (Sources != null)) && ((Sources.Length > 0))) {
OutputAssembly = new TaskItem(Path.GetFileNameWithoutExtension(this.Sources[0].ItemSpec));
if (string.Equals(this.TargetType, "library", StringComparison.InvariantCultureIgnoreCase)) {
OutputAssembly.ItemSpec += ".dll";
} else if (string.Equals(this.TargetType, "module", StringComparison.InvariantCultureIgnoreCase)) {
OutputAssembly.ItemSpec += ".netmodule";
} else {
OutputAssembly.ItemSpec += ".exe";
}
}
commandLine.AppendSwitch("-g");
if (Optimize) {
commandLine.AppendSwitch("-O3");
}
commandLine.AppendSwitchIfNotNull("--keyfile ", this.KeyFile);
if (noMLLib) {
commandLine.AppendSwitch("--no-mllib");
}
if (standalone) {
commandLine.AppendSwitch("--standalone");
}
if (Resources != null) {
foreach (ITaskItem item in Resources) {
commandLine.AppendSwitchIfNotNull("--resource ", item);
}
}
if (FileAlignment > 0) {
commandLine.AppendIntegerSwitch("--base-address ", FileAlignment);
}
commandLine.AppendSwitchIfNotNull("-o ", this.OutputAssembly);
if (string.Equals(this.TargetType, "library", StringComparison.InvariantCultureIgnoreCase)) {
commandLine.AppendSwitch("--target-dll");
} else if (string.Equals(this.TargetType, "winexe", StringComparison.InvariantCultureIgnoreCase)) {
commandLine.AppendSwitch("--target-winexe");
} else if (string.Equals(this.TargetType, "module", StringComparison.InvariantCultureIgnoreCase)) {
commandLine.AppendSwitch("--target-module");
}
if (References != null) {
foreach (ITaskItem reference in References) {
commandLine.AppendFileNameIfNotNull("-r ", reference);
}
}
commandLine.AppendFileNamesIfNotNull(this.Sources, " ");
return commandLine.ToString();
}
/// <summary>
/// Each line of output, from either standard output or standard error
/// is parsed and any compiler errors are logged. If the line cannot
/// be parsed it is logged using the specified message importance.
/// </summary>
protected override void LogEventsFromTextOutput(string singleLine, MessageImportance messageImportance)
{
CompilerError error = ParseLine(singleLine);
if (error != null) {
if (error.IsWarning) {
Log.LogWarning("warning", error.ErrorNumber, null, error.FileName, error.Line, error.Column, error.Line, error.Column, error.ErrorText);
} else {
Log.LogError("error", error.ErrorNumber, null, error.FileName, error.Line, error.Column, error.Line, error.Column, error.ErrorText);
}
} else {
Log.LogMessage(messageImportance, singleLine);
}
}
const string ErrorPattern = @"(?<file>[^\(]*)\((?<line>[0-9]*),(?<column>[0-9]*)\):\s(?<error>[^:]*):\s(?<number>[^:]*):\s(?<message>.*)";
static Regex ErrorRegex = new Regex(ErrorPattern, RegexOptions.Compiled);
const string ErrorPatternNoLine = @"(?<file>[^\(]*)\((?<line>[0-9]*),(?<column>[0-9]*)\):\s(?<error>[^:]*):\s(?<message>.*)";
static Regex ErrorNoLineRegex = new Regex(ErrorPatternNoLine, RegexOptions.Compiled);
CompilerError ParseLine(string line)
{
Match match = ErrorRegex.Match(line);
Match matchNoLine = ErrorNoLineRegex.Match(line);
if (match.Success) {
CompilerError error = new CompilerError();
error.Column = Int32.Parse(match.Result("${column}"));
error.Line = Int32.Parse(match.Result("${line}"));
error.FileName = Path.GetFullPath(match.Result("${file}"));
error.IsWarning = match.Result("${error}") == "warning";
error.ErrorNumber = match.Result("${number}");
error.ErrorText = match.Result("${message}");
return error;
} else if (matchNoLine.Success) {
CompilerError error = new CompilerError();
error.Column = Int32.Parse(matchNoLine.Result("${column}"));
error.FileName = Path.GetFullPath(matchNoLine.Result("${file}"));
error.IsWarning = matchNoLine.Result("${error}") == "warning";
error.ErrorNumber = matchNoLine.Result("${number}");
error.ErrorText = matchNoLine.Result("${message}");
return error;
}
return null;
}
}
}

78
src/AddIns/BackendBindings/FSharp/FSharpBinding.sln

@ -0,0 +1,78 @@ @@ -0,0 +1,78 @@

Microsoft Visual Studio Solution File, Format Version 10.00
# Visual Studio 2008
# SharpDevelop 3.0.0.2958
Project("{982E8BC1-ACD7-4dbf-96AB-B2CE67D6A008}") = "FSharpBinding", "FSharpBinding\Project\FSharpBinding.fsproj", "{99BAE3A2-C40D-40D2-A7B4-EBB4798F36E4}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FSharp.Build.Tasks", "FSharp.Build.Tasks\Project\FSharp.Build.Tasks.csproj", "{674D485B-8340-498D-B91F-BE51543386C8}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ICSharpCode.TextEditor", "..\..\..\Libraries\ICSharpCode.TextEditor\Project\ICSharpCode.TextEditor.csproj", "{2D18BE89-D210-49EB-A9DD-2246FBB3DF6D}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "log4net", "..\..\..\Libraries\log4net\src\log4net.csproj", "{F6A02431-167E-4347-BC43-65532C31CDB7}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ICSharpCode.SharpDevelop", "..\..\..\Main\Base\Project\ICSharpCode.SharpDevelop.csproj", "{2748AD25-9C63-4E12-877B-4DCE96FBED54}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ICSharpCode.Core", "..\..\..\Main\Core\Project\ICSharpCode.Core.csproj", "{35CEF10F-2D4C-45F2-9DD1-161E0FEC583C}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ICSharpCode.SharpDevelop.BuildWorker", "..\..\..\Main\ICSharpCode.SharpDevelop.BuildWorker\ICSharpCode.SharpDevelop.BuildWorker.csproj", "{C3CBC8E3-81D8-4C5B-9941-DCCD12D50B1F}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ICSharpCode.SharpDevelop.Dom", "..\..\..\Main\ICSharpCode.SharpDevelop.Dom\Project\ICSharpCode.SharpDevelop.Dom.csproj", "{924EE450-603D-49C1-A8E5-4AFAA31CE6F3}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ICSharpCode.SharpDevelop.Widgets", "..\..\..\Main\ICSharpCode.SharpDevelop.Widgets\Project\ICSharpCode.SharpDevelop.Widgets.csproj", "{8035765F-D51F-4A0C-A746-2FD100E19419}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NRefactory", "..\..\..\Libraries\NRefactory\Project\NRefactory.csproj", "{3A9AE6AA-BC07-4A2F-972C-581E3AE2F195}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WinFormsUI", "..\..\..\Libraries\DockPanel_Src\WinFormsUI\WinFormsUI.csproj", "{D3C782BA-178E-4235-A3BA-8C11DEBB6BEE}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{99BAE3A2-C40D-40D2-A7B4-EBB4798F36E4}.Debug|Any CPU.Build.0 = Debug|Any CPU
{99BAE3A2-C40D-40D2-A7B4-EBB4798F36E4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{99BAE3A2-C40D-40D2-A7B4-EBB4798F36E4}.Release|Any CPU.Build.0 = Release|Any CPU
{99BAE3A2-C40D-40D2-A7B4-EBB4798F36E4}.Release|Any CPU.ActiveCfg = Release|Any CPU
{674D485B-8340-498D-B91F-BE51543386C8}.Debug|Any CPU.Build.0 = Debug|Any CPU
{674D485B-8340-498D-B91F-BE51543386C8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{674D485B-8340-498D-B91F-BE51543386C8}.Release|Any CPU.Build.0 = Release|Any CPU
{674D485B-8340-498D-B91F-BE51543386C8}.Release|Any CPU.ActiveCfg = Release|Any CPU
{D3C782BA-178E-4235-A3BA-8C11DEBB6BEE}.Debug|Any CPU.Build.0 = Debug|Any CPU
{D3C782BA-178E-4235-A3BA-8C11DEBB6BEE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{D3C782BA-178E-4235-A3BA-8C11DEBB6BEE}.Release|Any CPU.Build.0 = Release|Any CPU
{D3C782BA-178E-4235-A3BA-8C11DEBB6BEE}.Release|Any CPU.ActiveCfg = Release|Any CPU
{2D18BE89-D210-49EB-A9DD-2246FBB3DF6D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{2D18BE89-D210-49EB-A9DD-2246FBB3DF6D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{2D18BE89-D210-49EB-A9DD-2246FBB3DF6D}.Release|Any CPU.Build.0 = Release|Any CPU
{2D18BE89-D210-49EB-A9DD-2246FBB3DF6D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{F6A02431-167E-4347-BC43-65532C31CDB7}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F6A02431-167E-4347-BC43-65532C31CDB7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{F6A02431-167E-4347-BC43-65532C31CDB7}.Release|Any CPU.Build.0 = Release|Any CPU
{F6A02431-167E-4347-BC43-65532C31CDB7}.Release|Any CPU.ActiveCfg = Release|Any CPU
{2748AD25-9C63-4E12-877B-4DCE96FBED54}.Debug|Any CPU.Build.0 = Debug|Any CPU
{2748AD25-9C63-4E12-877B-4DCE96FBED54}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{2748AD25-9C63-4E12-877B-4DCE96FBED54}.Release|Any CPU.Build.0 = Release|Any CPU
{2748AD25-9C63-4E12-877B-4DCE96FBED54}.Release|Any CPU.ActiveCfg = Release|Any CPU
{35CEF10F-2D4C-45F2-9DD1-161E0FEC583C}.Debug|Any CPU.Build.0 = Debug|Any CPU
{35CEF10F-2D4C-45F2-9DD1-161E0FEC583C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{35CEF10F-2D4C-45F2-9DD1-161E0FEC583C}.Release|Any CPU.Build.0 = Release|Any CPU
{35CEF10F-2D4C-45F2-9DD1-161E0FEC583C}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C3CBC8E3-81D8-4C5B-9941-DCCD12D50B1F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C3CBC8E3-81D8-4C5B-9941-DCCD12D50B1F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{C3CBC8E3-81D8-4C5B-9941-DCCD12D50B1F}.Release|Any CPU.Build.0 = Release|Any CPU
{C3CBC8E3-81D8-4C5B-9941-DCCD12D50B1F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{924EE450-603D-49C1-A8E5-4AFAA31CE6F3}.Debug|Any CPU.Build.0 = Debug|Any CPU
{924EE450-603D-49C1-A8E5-4AFAA31CE6F3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{924EE450-603D-49C1-A8E5-4AFAA31CE6F3}.Release|Any CPU.Build.0 = Release|Any CPU
{924EE450-603D-49C1-A8E5-4AFAA31CE6F3}.Release|Any CPU.ActiveCfg = Release|Any CPU
{8035765F-D51F-4A0C-A746-2FD100E19419}.Debug|Any CPU.Build.0 = Debug|Any CPU
{8035765F-D51F-4A0C-A746-2FD100E19419}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{8035765F-D51F-4A0C-A746-2FD100E19419}.Release|Any CPU.Build.0 = Release|Any CPU
{8035765F-D51F-4A0C-A746-2FD100E19419}.Release|Any CPU.ActiveCfg = Release|Any CPU
{3A9AE6AA-BC07-4A2F-972C-581E3AE2F195}.Debug|Any CPU.Build.0 = Debug|Any CPU
{3A9AE6AA-BC07-4A2F-972C-581E3AE2F195}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{3A9AE6AA-BC07-4A2F-972C-581E3AE2F195}.Release|Any CPU.Build.0 = Release|Any CPU
{3A9AE6AA-BC07-4A2F-972C-581E3AE2F195}.Release|Any CPU.ActiveCfg = Release|Any CPU
EndGlobalSection
EndGlobal

129
src/AddIns/BackendBindings/FSharp/FSharpBinding/Project/FSharpBinding.addin

@ -0,0 +1,129 @@ @@ -0,0 +1,129 @@
<AddIn name = "F# Binding"
author = "Robert Pickering"
copyright = "prj:///doc/copyright.txt"
description = "Backend binding for F#">
<Manifest>
<Identity name = "ICSharpCode.FSharpBinding"/>
</Manifest>
<Runtime>
<Import assembly = "FSharpBinding.dll"/>
<Import assembly = ":ICSharpCode.SharpDevelop"/>
<Import assembly = ":ICSharpCode.SharpDevelop.Dom"/>
</Runtime>
<Path name = "/SharpDevelop/Workbench/Ambiences">
<Class id = "F#"
class = "FSharpBindings.FSharpAmbience"/>
</Path>
<Path name = "/SharpDevelop/ViewContent/DefaultTextEditor/SyntaxModes">
<SyntaxMode id = "F# Syntax Mode"
name = "F#"
extensions = ".fs;.fsi"
resource = "FSharpBindings.Resources.FS-Mode.xshd" />
</Path>
<Path name = "/SharpDevelop/MSBuildEngine/CompileTaskNames">
<!-- Makes SharpDevelop show the text 'Compiling ProjectName...' when the task is started -->
<String id="fsc" text = "fsc"/>
</Path>
<Path name = "/SharpDevelop/BackendBindings/Templates">
<Directory id = "fsc" path = "./Templates" />
</Path>
<Path name = "/SharpDevelop/Workbench/FileFilter">
<FileFilter id = "F#"
insertbefore="AllFiles"
name = "F# (*.fs)"
extensions = "*.fs"/>
</Path>
<Path name = "/SharpDevelop/Workbench/Combine/FileFilter">
<FileFilter id = "FSharpProject"
insertbefore="AllFiles"
name = "F# Project Files (*.fsproj)"
class = "ICSharpCode.SharpDevelop.Project.LoadProject"
extensions = "*.fsproj"/>
</Path>
<!-- Project Explorer tree node builders -->
<Path name = "/SharpDevelop/Views/ProjectBrowser/NodeBuilders">
<Class id = "FSharpProjectBuilder"
insertbefore = "DefaultBuilder"
class = "FSharpBinding.FSharpProjectNodeBuilder"/>
</Path>
<Path path = "/SharpDevelop/BackendBindings/ProjectOptions/F#">
<DialogPanel id = "Application"
label = "${res:Dialog.ProjectOptions.ApplicationSettings}"
class = "ICSharpCode.SharpDevelop.Gui.OptionPanels.ApplicationSettings"/>
<DialogPanel id = "BuildEvents"
label = "${res:Dialog.ProjectOptions.BuildEvents}"
class = "ICSharpCode.SharpDevelop.Gui.OptionPanels.BuildEvents"/>
<DialogPanel id = "BuildOptions"
label = "${res:Dialog.ProjectOptions.BuildOptions}"
class = "CSharpBinding.OptionPanels.BuildOptions"/>
<DialogPanel id = "FsOptions"
label = "F# Options"
class = "FSharpBinding.FsOptions"/>
<Include id = "AllManaged" path="/SharpDevelop/BackendBindings/ProjectOptions/AllManaged"/>
</Path>
<Path name = "/SharpDevelop/Pads/ProjectBrowser/ContextMenu/FileNode">
<Condition name = "ProjectActive" activeproject="F#">
<MenuItem id = "MoveUp"
label = "Move Up"
class = "FSharpBinding.MoveUpFileEvent"/>
<MenuItem id = "MoveDown"
label = "Move Down"
class = "FSharpBinding.MoveDownFileEvent"/>
</Condition>
</Path>
<Path name = "/Workspace/Icons">
<Icon id = "F#Prj"
language = "F#"
resource = "F#.ProjectIcon"/>
<Icon id = "F#File"
extensions = ".fs"
resource = "F#.FileIcon"/>
</Path>
<Path name = "/SharpDevelop/Workbench/Pads">
<Pad id = "FSharpInteractive"
category = "Main"
title = "F# Interactive"
icon = "F#.ProjectIcon"
shortcut = "Control|Shift|B"
class = "FSharpBinding.FSharpInteractive"/>
</Path>
<Path name = "/SharpDevelop/ViewContent/DefaultTextEditor/ContextMenu">
<Condition name = "ProjectActive" activeproject="F#">
<MenuItem id = "SendToFSharpInteractive"
label = "Send To F# Interactive"
shortcut = "Alt|Return"
class= "FSharpBinding.SentToFSharpInteractive"/>
</Condition>
</Path>
<Path path = "/SharpDevelop/Workbench/LanguageBindings">
<LanguageBinding id = "F#"
guid = "{982E8BC1-ACD7-4dbf-96AB-B2CE67D6A008}"
supportedextensions = ".fs"
projectfileextension = ".fsproj"
class = "FSharpBinding.FSharpLanguageBinding" />
</Path>
<!--
Register path to SharpDevelop.Build.FSharp.targets for the MSBuild engine.
SharpDevelop.Build.FSharp.targets is in the F# AddIn directory
-->
<Path name = "/SharpDevelop/MSBuildEngine/AdditionalProperties">
<String id = "FSharpBuildTasksPath" text = "${AddInPath:ICSharpCode.FSharpBinding}"/>
</Path>
</AddIn>

118
src/AddIns/BackendBindings/FSharp/FSharpBinding/Project/FSharpBinding.fsproj

@ -0,0 +1,118 @@ @@ -0,0 +1,118 @@
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<ProjectGuid>{99BAE3A2-C40D-40D2-A7B4-EBB4798F36E4}</ProjectGuid>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<OutputType>Library</OutputType>
<RootNamespace>FSharpBindings</RootNamespace>
<AssemblyName>FSharpBinding</AssemblyName>
<Standalone>True</Standalone>
<NoMLLib>True</NoMLLib>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
<OutputPath>..\..\..\..\..\..\AddIns\AddIns\BackendBindings\FSharpBinding\</OutputPath>
<DebugSymbols>True</DebugSymbols>
<DebugType>Full</DebugType>
<Optimize>False</Optimize>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
<OutputPath>..\..\..\..\..\..\AddIns\AddIns\BackendBindings\FSharpBinding\</OutputPath>
<DebugSymbols>False</DebugSymbols>
<DebugType>None</DebugType>
<Optimize>True</Optimize>
</PropertyGroup>
<Import Project="$(FSharpBuildTasksPath)\SharpDevelop.Build.Fsc.Targets" />
<ItemGroup>
<Reference Include="FSharp.Build.Tasks">
<HintPath>..\..\RequiredLibraries\FSharp.Build.Tasks.dll</HintPath>
</Reference>
<Reference Include="log4net">
<HintPath>..\..\..\..\..\Libraries\log4net\bin\net\2.0\release\log4net.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="Microsoft.Build.Engine, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<RequiredTargetFramework>3.5</RequiredTargetFramework>
<Private>False</Private>
</Reference>
<Reference Include="Microsoft.Build.Framework, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<RequiredTargetFramework>3.5</RequiredTargetFramework>
<Private>False</Private>
</Reference>
<Reference Include="Mono.Cecil">
<HintPath>..\..\..\..\..\Libraries\Mono.Cecil\Mono.Cecil.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="System.Configuration">
<Private>False</Private>
</Reference>
<Reference Include="System.Core">
<RequiredTargetFramework>3.5</RequiredTargetFramework>
<Private>False</Private>
</Reference>
<Reference Include="System.Security">
<Private>False</Private>
</Reference>
<Compile Include="Src\project.fs" />
<Compile Include="Src\languagebinding.fs" />
<Compile Include="Src\fsi.fs" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Resources\FS-Mode.xshd" />
<EmbeddedResource Include="Resources\FsOptions.xfrm" />
<None Include="..\..\RequiredLibraries\SharpDevelop.Build.Fsc.targets">
<Link>SharpDevelop.Build.Fsc.targets</Link>
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="FSharpBinding.addin">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="Templates\ConsoleProject.xpt">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="Templates\EmptyClass.xft">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\..\..\Libraries\DockPanel_Src\WinFormsUI\WinFormsUI.csproj">
<Project>{D3C782BA-178E-4235-A3BA-8C11DEBB6BEE}</Project>
<Name>WinFormsUI</Name>
<Private>False</Private>
</ProjectReference>
<ProjectReference Include="..\..\..\..\..\Libraries\ICSharpCode.TextEditor\Project\ICSharpCode.TextEditor.csproj">
<Project>{2D18BE89-D210-49EB-A9DD-2246FBB3DF6D}</Project>
<Name>ICSharpCode.TextEditor</Name>
<Private>False</Private>
</ProjectReference>
<ProjectReference Include="..\..\..\..\..\Libraries\NRefactory\Project\NRefactory.csproj">
<Project>{3A9AE6AA-BC07-4A2F-972C-581E3AE2F195}</Project>
<Name>NRefactory</Name>
<Private>False</Private>
</ProjectReference>
<ProjectReference Include="..\..\..\..\..\Main\Base\Project\ICSharpCode.SharpDevelop.csproj">
<Project>{2748AD25-9C63-4E12-877B-4DCE96FBED54}</Project>
<Name>ICSharpCode.SharpDevelop</Name>
<Private>False</Private>
</ProjectReference>
<ProjectReference Include="..\..\..\..\..\Main\Core\Project\ICSharpCode.Core.csproj">
<Project>{35CEF10F-2D4C-45F2-9DD1-161E0FEC583C}</Project>
<Name>ICSharpCode.Core</Name>
<Private>False</Private>
</ProjectReference>
<ProjectReference Include="..\..\..\..\..\Main\ICSharpCode.SharpDevelop.BuildWorker\ICSharpCode.SharpDevelop.BuildWorker.csproj">
<Project>{C3CBC8E3-81D8-4C5B-9941-DCCD12D50B1F}</Project>
<Name>ICSharpCode.SharpDevelop.BuildWorker</Name>
<Private>False</Private>
</ProjectReference>
<ProjectReference Include="..\..\..\..\..\Main\ICSharpCode.SharpDevelop.Dom\Project\ICSharpCode.SharpDevelop.Dom.csproj">
<Project>{924EE450-603D-49C1-A8E5-4AFAA31CE6F3}</Project>
<Name>ICSharpCode.SharpDevelop.Dom</Name>
<Private>False</Private>
</ProjectReference>
<ProjectReference Include="..\..\..\..\..\Main\ICSharpCode.SharpDevelop.Widgets\Project\ICSharpCode.SharpDevelop.Widgets.csproj">
<Project>{8035765F-D51F-4A0C-A746-2FD100E19419}</Project>
<Name>ICSharpCode.SharpDevelop.Widgets</Name>
<Private>False</Private>
</ProjectReference>
</ItemGroup>
</Project>

263
src/AddIns/BackendBindings/FSharp/FSharpBinding/Project/Resources/FS-Mode.xshd

@ -0,0 +1,263 @@ @@ -0,0 +1,263 @@
<?xml version="1.0"?>
<!-- syntaxdefinition for F# 2000 by Robert Pickering -->
<SyntaxDefinition name = "F#" extensions = ".fs">
<Properties>
<Property name="LineComment" value="//"/>
</Properties>
<Digits name = "Digits" bold = "false" italic = "false" color = "DarkBlue"/>
<RuleSets>
<RuleSet ignorecase="false">
<Delimiters>&amp;&lt;&gt;~!%^*()-+=|\#/{}[]:;"' , .?</Delimiters>
<Span name = "PreprocessorDirectives" rule = "PreprocessorSet" bold="false" italic="false" color="Green" stopateol = "true">
<Begin>#</Begin>
</Span>
<Span name = "DocLineComment" rule = "DocCommentSet" bold = "false" italic = "false" color = "Green" stopateol = "true" noescapesequences="true">
<Begin bold = "false" italic = "false" color = "Gray">///@!/@</Begin>
</Span>
<Span name = "LineComment" rule = "CommentMarkerSet" bold = "false" italic = "false" color = "Green" stopateol = "true">
<Begin>//@!/@</Begin>
</Span>
<Span name = "LineComment2" rule = "CommentMarkerSet" bold = "false" italic = "false" color = "Green" stopateol = "true">
<Begin>////</Begin>
</Span>
<Span name = "BlockComment" rule = "CommentMarkerSet" bold = "false" italic = "false" color = "Green" stopateol = "false">
<Begin>(*</Begin>
<End>*)</End>
</Span>
<Span name = "String" bold = "false" italic = "false" color = "DarkBlue" stopateol = "false" escapecharacter="\">
<Begin>"</Begin>
<End>"</End>
</Span>
<Span name = "MultiLineString" bold = "false" italic = "false" color = "DarkBlue" stopateol = "false" escapecharacter='"'>
<Begin>@@"</Begin>
<End>"</End>
</Span>
<Span name = "Char" bold = "false" italic = "false" color = "Magenta" stopateol = "true" escapecharacter="\">
<Begin>&apos;</Begin>
<End>&apos;</End>
</Span>
<MarkPrevious bold = "true" italic = "false" color = "MidnightBlue">(</MarkPrevious>
<KeyWords name = "Punctuation" bold = "false" italic = "false" color = "DarkGreen">
<Key word = "?" />
<Key word = "," />
<Key word = "." />
<Key word = ";" />
<Key word = "(" />
<Key word = ")" />
<Key word = "[" />
<Key word = "]" />
<Key word = "{" />
<Key word = "}" />
<Key word = "+" />
<Key word = "-" />
<Key word = "/" />
<Key word = "%" />
<Key word = "*" />
<Key word = "&lt;" />
<Key word = "&gt;" />
<Key word = "^" />
<Key word = "=" />
<Key word = "~" />
<Key word = "!" />
<Key word = "|" />
<Key word = "&amp;" />
</KeyWords>
<KeyWords name = "CurrentKeywords" bold="false" italic="false" color="Blue">
<Key word = "abstract"/>
<Key word = "and"/>
<Key word = "as"/>
<Key word = "assert"/>
<Key word = "begin"/>
<Key word = "class"/>
<Key word = "default"/>
<Key word = "delegate"/>
<Key word = "do"/>
<Key word = "done"/>
<Key word = "downcast"/>
<Key word = "downto"/>
<Key word = "else"/>
<Key word = "end"/>
<Key word = "enum"/>
<Key word = "exception"/>
<Key word = "extern"/>
<Key word = "false"/>
<Key word = "finally"/>
<Key word = "for"/>
<Key word = "fun"/>
<Key word = "function"/>
<Key word = "if"/>
<Key word = "in"/>
<Key word = "inherit"/>
<Key word = "interface"/>
<Key word = "land"/>
<Key word = "lazy"/>
<Key word = "let"/>
<Key word = "match"/>
<Key word = "member"/>
<Key word = "module"/>
<Key word = "mutable"/>
<Key word = "namespace"/>
<Key word = "new"/>
<Key word = "null"/>
<Key word = "of"/>
<Key word = "open"/>
<Key word = "or"/>
<Key word = "override"/>
<Key word = "rec"/>
<Key word = "sig"/>
<Key word = "static"/>
<Key word = "struct"/>
<Key word = "then"/>
<Key word = "to"/>
<Key word = "true"/>
<Key word = "try"/>
<Key word = "type"/>
<Key word = "val"/>
<Key word = "when"/>
<Key word = "inline"/>
<Key word = "upcast"/>
<Key word = "while"/>
<Key word = "with"/>
<Key word = "void"/>
</KeyWords>
<KeyWords name = "ReservedKeywords" bold="false" italic="false" color="Red">
<Key word = "async"/>
<Key word = "atomic"/>
<Key word = "break"/>
<Key word = "checked"/>
<Key word = "component"/>
<Key word = "const"/>
<Key word = "constraint"/>
<Key word = "constructor"/>
<Key word = "continue"/>
<Key word = "decimal"/>
<Key word = "eager"/>
<Key word = "event"/>
<Key word = "external"/>
<Key word = "fixed"/>
<Key word = "functor"/>
<Key word = "include"/>
<Key word = "method"/>
<Key word = "mixin"/>
<Key word = "object"/>
<Key word = "process"/>
<Key word = "property"/>
<Key word = "protected"/>
<Key word = "public"/>
<Key word = "pure"/>
<Key word = "readonly"/>
<Key word = "return"/>
<Key word = "sealed"/>
<Key word = "virtual"/>
<Key word = "volatile"/>
</KeyWords>
</RuleSet>
<RuleSet name = "CommentMarkerSet" ignorecase = "false">
<Delimiters>&lt;&gt;~!@%^*()-+=|\#/{}[]:;"' , .?</Delimiters>
<KeyWords name = "ErrorWords" bold="true" italic="false" color="Red">
<Key word = "TODO" />
<Key word = "FIXME" />
</KeyWords>
<KeyWords name = "WarningWords" bold="true" italic="false" color="#EEE0E000">
<Key word = "HACK" />
<Key word = "UNDONE" />
</KeyWords>
</RuleSet>
<RuleSet name = "DocCommentSet" ignorecase = "false">
<Delimiters>&lt;&gt;~!@%^*()-+=|\#/{}[]:;"' , .?</Delimiters>
<Span name = "XmlTag" rule = "XmlDocSet" bold = "false" italic = "false" color = "Gray" stopateol = "true">
<Begin>&lt;</Begin>
<End>&gt;</End>
</Span>
<KeyWords name = "ErrorWords" bold="true" italic="false" color="Red">
<Key word = "TODO" />
<Key word = "FIXME" />
</KeyWords>
<KeyWords name = "WarningWords" bold="true" italic="false" color="#EEE0E000">
<Key word = "HACK" />
<Key word = "UNDONE" />
</KeyWords>
</RuleSet>
<RuleSet name = "PreprocessorSet" ignorecase="false">
<Delimiters>&amp;&lt;&gt;~!%^*()-+=|\#/{}[]:;"' , .?</Delimiters>
<KeyWords name = "PreprocessorDirectives" bold="true" italic="false" color="Green">
<Key word = "if" />
<Key word = "else" />
<Key word = "elif" />
<Key word = "endif" />
<Key word = "define" />
<Key word = "undef" />
<Key word = "warning" />
<Key word = "error" />
<Key word = "line" />
<Key word = "region" />
<Key word = "endregion" />
<Key word = "pragma" />
</KeyWords>
</RuleSet>
<RuleSet name = "XmlDocSet" ignorecase = "false">
<Delimiters>&lt;&gt;~!@%^*()-+=|\#/{}[]:;"' , .?</Delimiters>
<Span name = "String" bold = "true" italic = "false" color = "Silver" stopateol = "true">
<Begin>"</Begin>
<End>"</End>
</Span>
<KeyWords name = "Punctuation" bold = "true" italic = "false" color = "Gray">
<Key word = "/" />
<Key word = "|" />
<Key word = "=" />
</KeyWords>
<KeyWords name = "SpecialComment" bold="true" italic="false" color="Gray">
<Key word = "c" />
<Key word = "code" />
<Key word = "example" />
<Key word = "exception" />
<Key word = "list" />
<Key word = "para" />
<Key word = "param" />
<Key word = "paramref" />
<Key word = "permission" />
<Key word = "remarks" />
<Key word = "returns" />
<Key word = "see" />
<Key word = "seealso" />
<Key word = "summary" />
<Key word = "value" />
<Key word = "type" />
<Key word = "name" />
<Key word = "cref" />
<Key word = "item" />
<Key word = "term" />
<Key word = "description" />
<Key word = "listheader" />
</KeyWords>
</RuleSet>
</RuleSets>
</SyntaxDefinition>

30
src/AddIns/BackendBindings/FSharp/FSharpBinding/Project/Resources/FsOptions.xfrm

@ -0,0 +1,30 @@ @@ -0,0 +1,30 @@
<Components version="1.0">
<System.Windows.Forms.UserControl>
<Name value="XmlUserControl1" />
<ClientSize value="{Width=384, Height=256}" />
<Controls>
<System.Windows.Forms.GroupBox>
<Name value="groupBox1" />
<Location value="{X=8,Y=8}" />
<Text value="F# Specific Options" />
<Size value="{Width=364, Height=180}" />
<TabIndex value="0" />
<Anchor value="Top, Left, Right" />
<Controls>
<System.Windows.Forms.CheckBox>
<Name value="standaloneCheckBox" />
<Location value="{X=8,Y=16}" />
<TabIndex value="1" />
<Text value="Standalone" />
</System.Windows.Forms.CheckBox>
<System.Windows.Forms.CheckBox>
<Name value="nomllibCheckBox" />
<Location value="{X=8,Y=48}" />
<Text value="No ML Lib" />
<TabIndex value="2" />
</System.Windows.Forms.CheckBox>
</Controls >
</System.Windows.Forms.GroupBox>
</Controls>
</System.Windows.Forms.UserControl>
</Components>

115
src/AddIns/BackendBindings/FSharp/FSharpBinding/Project/Src/fsi.fs

@ -0,0 +1,115 @@ @@ -0,0 +1,115 @@
// <file>
// <copyright see="prj:///doc/copyright.txt"/>
// <license see="prj:///doc/license.txt"/>
// <owner name="Robert Pickering" email="robert@strangelights.com"/>
// <version>$Revision$</version>
// </file>
#light
namespace FSharpBinding
open System
open System.IO
open System.Configuration
open System.Collections.Generic
open System.Diagnostics
open System.Windows.Forms
open System.Xml
open ICSharpCode.SharpDevelop.Dom
open ICSharpCode.SharpDevelop.Dom.CSharp
open ICSharpCode.SharpDevelop.Internal.Templates
open ICSharpCode.SharpDevelop.Project
open ICSharpCode.Core
open ICSharpCode.SharpDevelop.Gui
open ICSharpCode.SharpDevelop.DefaultEditor.Gui.Editor
module TheControl =
let outputQueue = new Queue<string>()
let errorQueue = new Queue<string>()
let fsiProcess = new Process()
let panel = new Panel()
let input = new TextBox(Anchor = (AnchorStyles.Left ||| AnchorStyles.Top ||| AnchorStyles.Right),
Width = panel.Width)
input.KeyUp.Add(fun ea ->
if ea.KeyData = Keys.Return then
fsiProcess.StandardInput.WriteLine(input.Text)
input.Text <- "" )
let output = new TextBox(Multiline = true,
Top = input.Height,
Height = panel.Height - input.Height,
Width = panel.Width,
ReadOnly = true,
Anchor = (AnchorStyles.Left ||| AnchorStyles.Top ||| AnchorStyles.Right ||| AnchorStyles.Bottom))
panel.Controls.Add(input)
panel.Controls.Add(output)
if ConfigurationManager.AppSettings.AllKeys |> Array.exists (fun x -> x = "alt_fs_bin_path") then
let path = Path.Combine(ConfigurationManager.AppSettings.get_Item("alt_fs_bin_path"), "fsi.exe")
if File.Exists(path) then
fsiProcess.StartInfo.FileName <- path
else
failwith "you are trying to use the app setting alt_fs_bin_path, but fsi.exe is not localed in the given directory"
else
let path = Environment.GetEnvironmentVariable("PATH")
let paths = path.Split([|';'|])
let path = paths |> Array.tryfind (fun x -> File.Exists(Path.Combine(x, "fsi.exe")))
match path with
| Some x -> fsiProcess.StartInfo.FileName <- Path.Combine(x, "fsi.exe")
| None ->
let programFiles = Environment.GetEnvironmentVariable("ProgramFiles")
let fsdirs = Directory.GetDirectories(programFiles, "FSharp*")
let possibleFiles =
fsdirs |> Array.choose
(fun x ->
let fileInfo = new FileInfo(Path.Combine(x, "bin\fsi.exe"))
if fileInfo.Exists then
Some fileInfo
else
None)
possibleFiles |> Array.sort (fun x y -> DateTime.Compare(x.CreationTime, y.CreationTime))
if possibleFiles.Length > 0 then
fsiProcess.StartInfo.FileName <- possibleFiles.[0].FullName
else
failwith "can not find the fsi.exe, ensure a version of the F# compiler is installed"
fsiProcess.StartInfo.UseShellExecute <- false
fsiProcess.StartInfo.RedirectStandardError <- true
fsiProcess.StartInfo.RedirectStandardInput <- true
fsiProcess.StartInfo.RedirectStandardOutput <- true
fsiProcess.ErrorDataReceived.Add(fun ea -> lock errorQueue (fun () -> errorQueue.Enqueue(ea.Data)) )
fsiProcess.OutputDataReceived.Add(fun ea -> lock outputQueue (fun () -> outputQueue.Enqueue(ea.Data)) )
fsiProcess.Exited.Add(fun ea ->
output.AppendText("fsi.exe died" + Environment.NewLine)
output.AppendText("restarting ..." + Environment.NewLine)
fsiProcess.Start() |> ignore)
fsiProcess.Start() |> ignore
fsiProcess.BeginErrorReadLine()
fsiProcess.BeginOutputReadLine()
let timer = new Timer(Interval = 1000)
let readAll (q : Queue<string>) =
while q.Count > 0 do
output.AppendText(q.Dequeue() + Environment.NewLine)
timer.Tick.Add(fun _ ->
lock errorQueue (fun () -> readAll errorQueue)
lock outputQueue (fun () -> readAll outputQueue))
timer.Start()
type FSharpInteractive = class
inherit AbstractPadContent
new() = {}
override x.Control
with get() = TheControl.panel :> Control
end
type SentToFSharpInteractive = class
inherit AbstractMenuCommand
new () = {}
override x.Run() =
let window = WorkbenchSingleton.Workbench.ActiveWorkbenchWindow
if window <> null then
match window.ActiveViewContent :> obj with
| :? ITextEditorControlProvider as textArea ->
let textArea = textArea.TextEditorControl.ActiveTextAreaControl.TextArea
for selection in textArea.SelectionManager.SelectionCollection do
TheControl.fsiProcess.StandardInput.WriteLine(selection.SelectedText)
TheControl.fsiProcess.StandardInput.WriteLine(";;")
| _ -> ()
end

25
src/AddIns/BackendBindings/FSharp/FSharpBinding/Project/Src/languagebinding.fs

@ -0,0 +1,25 @@ @@ -0,0 +1,25 @@
// <file>
// <copyright see="prj:///doc/copyright.txt"/>
// <license see="prj:///doc/license.txt"/>
// <owner name="Robert Pickering" email="robert@strangelights.com"/>
// <version>$Revision$</version>
// </file>
#light
namespace FSharpBinding
open System
open System.Xml
open ICSharpCode.SharpDevelop.Internal.Templates
open ICSharpCode.SharpDevelop.Project
open FSharpBinding
type FSharpLanguageBinding() = class
interface ILanguageBinding with
member x.Language
with get () = "F#"
member x.LoadProject(engineProvider : IMSBuildEngineProvider, fileName : string, projectName : string) =
new FSharpProject(engineProvider, fileName, projectName ) :> IProject
member c.CreateProject(info : ProjectCreateInformation) =
new FSharpProject(info) :> IProject
end
end

227
src/AddIns/BackendBindings/FSharp/FSharpBinding/Project/Src/project.fs

@ -0,0 +1,227 @@ @@ -0,0 +1,227 @@
// <file>
// <copyright see="prj:///doc/copyright.txt"/>
// <license see="prj:///doc/license.txt"/>
// <owner name="Robert Pickering" email="robert@strangelights.com"/>
// <version>$Revision$</version>
// </file>
#light
namespace FSharpBinding
//Global todos
//TODO add "compiling" dialog to output the correct directory
//TODO output to correct directory :)
//TODO copy all config to the correct locations
//TODO add directory structure
open System
open System.ComponentModel
open System.Diagnostics
open System.Collections.Generic
open System.Windows.Forms
open System.IO
open System.Xml
open ICSharpCode.SharpDevelop.Dom
open ICSharpCode.SharpDevelop.Dom.CSharp
open ICSharpCode.SharpDevelop.Internal.Templates
open ICSharpCode.SharpDevelop.Project
open ICSharpCode.Core
open ICSharpCode.SharpDevelop.Gui
open ICSharpCode.SharpDevelop.Gui.OptionPanels
type FSharpProject = class
inherit CompilableProject as base
new (engineProvider : IMSBuildEngineProvider, fileName : string, projectName : string ) as x =
{ inherit CompilableProject(engineProvider) } then
base.Name <- projectName
x.LoadProject(fileName)
new (info : ProjectCreateInformation) as x =
{ inherit CompilableProject(info.Solution) } then
x.Create(info)
base.AddImport(@"$(FSharpBuildTasksPath)\SharpDevelop.Build.Fsc.Targets", null)
override x.GetDefaultItemType(fileName : string) =
if string.Equals(".fs", Path.GetExtension(fileName), StringComparison.InvariantCultureIgnoreCase) then
ItemType.Compile
else if string.Equals(".fsi", Path.GetExtension(fileName), StringComparison.InvariantCultureIgnoreCase) then
ItemType.Compile
else
base.GetDefaultItemType(fileName)
override x.Language
with get() = "F#"
override x.LanguageProperties
with get() = LanguageProperties.None
end
type FSharpProjectNode = class
inherit ProjectNode
new (project : IProject) as x =
{ inherit ProjectNode(project) }
member x.AddParentFolder((virtualName : string), (relativeDirectoryPath : string), (directoryNodeList :Dictionary<string, DirectoryNode>)) =
if (relativeDirectoryPath.Length = 0
|| string.Compare(virtualName, 0, relativeDirectoryPath, 0, relativeDirectoryPath.Length, StringComparison.InvariantCultureIgnoreCase) = 0) then
let pos = virtualName.IndexOf('/', relativeDirectoryPath.Length + 1)
if (pos > 0) then
let subFolderName = virtualName.Substring(relativeDirectoryPath.Length, pos - relativeDirectoryPath.Length);
let res,node = directoryNodeList.TryGetValue(subFolderName)
if (res) then
if (node.FileNodeStatus = FileNodeStatus.None) then
node.FileNodeStatus <- FileNodeStatus.InProject
else
let node = new DirectoryNode(Path.Combine(x.Directory, subFolderName), FileNodeStatus.Missing);
node.AddTo(x)
directoryNodeList.[subFolderName] <- node
override x.Initialize() =
//Debugger.Break()
let fileNodeDictionary
= new Dictionary<string, FileNode>(StringComparer.InvariantCultureIgnoreCase)
let directoryNodeList = new Dictionary<string, DirectoryNode>(StringComparer.InvariantCultureIgnoreCase)
let relativeDirectoryPath =
if (x.RelativePath.Length > 0) then
(x.RelativePath.Replace('\\', '/')) + "/"
else
string.Empty
for item in x.Project.Items do
match item with
| :? FileProjectItem as item ->
let virtualName = item.VirtualName.Replace('\\', '/')
let virtualName =
if (virtualName.EndsWith("/")) then
virtualName.Substring(0, virtualName.Length - 1)
else
virtualName
let fileName = Path.GetFileName(virtualName)
if (not (string.Equals(virtualName, relativeDirectoryPath + fileName, StringComparison.InvariantCultureIgnoreCase))) then
x.AddParentFolder(virtualName, relativeDirectoryPath, directoryNodeList);
//continue;
if (item.ItemType = ItemType.Folder || item.ItemType = ItemType.WebReferences) then
let newDirectoryNode = DirectoryNodeFactory.CreateDirectoryNode(x, x.Project, fileName)
if not (Directory.Exists(item.FileName)) then
newDirectoryNode.FileNodeStatus <- FileNodeStatus.Missing
newDirectoryNode.ProjectItem <- item
newDirectoryNode.AddTo(x)
directoryNodeList.[fileName] <- newDirectoryNode
else
let fileNode = new FileNode(item.FileName)
if not (File.Exists(item.FileName)) then
fileNode.FileNodeStatus <- FileNodeStatus.Missing
fileNode.ProjectItem <- item
fileNodeDictionary.[fileName] <- fileNode
fileNode.AddTo(x)
| _ -> ()
// Add files found in file system
if (System.IO.Directory.Exists(x.Directory)) then
for subDirectory in System.IO.Directory.GetDirectories(x.Directory) do
let filename = Path.GetFileName(subDirectory)
if (filename <> ".svn") then
let res, node = directoryNodeList.TryGetValue(filename)
if res then
if (node.FileNodeStatus = FileNodeStatus.None) then
node.FileNodeStatus <- FileNodeStatus.InProject;
else
let node = DirectoryNodeFactory.CreateDirectoryNode(x, x.Project, subDirectory)
node.AddTo(x)
for fullpath in System.IO.Directory.GetFiles(x.Directory) do
let file = Path.GetFileName(fullpath)
let res, node = fileNodeDictionary.TryGetValue(file)
if res then
if (node.FileNodeStatus = FileNodeStatus.None) then
node.FileNodeStatus <- FileNodeStatus.InProject
else
let node = new FileNode(file)
node.AddTo(x)
end
type FSharpProjectNodeBuilder() = class
interface IProjectNodeBuilder with
member x.CanBuildProjectTree(project : IProject) =
project :? FSharpProject
member x.AddProjectNode(solution : TreeNode, project : IProject) =
let prjNode = new FSharpProjectNode(project)
prjNode.AddTo(solution)
let referenceFolderNode = new ReferenceFolder(project)
referenceFolderNode.AddTo(prjNode)
prjNode :> TreeNode
end
end
module ProjectHelpers =
let forEachFileNode f (nodes : TreeNodeCollection) =
for node in nodes do
match node with
| :? FileNode as fileNode ->
if fileNode.ProjectItem <> null then
f fileNode
| _ -> ()
let reorderItems (nodes : TreeNodeCollection) (project : IProject) =
//ProjectService.MarkProjectDirty(project)
project.Save()
let doc = new XmlDocument()
doc.Load(project.FileName)
let nsmgr = new XmlNamespaceManager(doc.NameTable)
nsmgr.AddNamespace("proj", "http://schemas.microsoft.com/developer/msbuild/2003")
nodes |> forEachFileNode
(fun node ->
let docNode = doc.SelectSingleNode(Printf.sprintf @"//proj:Compile[@Include=""%s""]" (Path.GetFileName(node.FileName)), nsmgr)
docNode.ParentNode.RemoveChild(docNode) |> ignore)
let itemNode = doc.SelectSingleNode("//proj:ItemGroup", nsmgr)
nodes |> forEachFileNode
(fun node ->
let xmlElem = doc.CreateElement("", "Compile", "http://schemas.microsoft.com/developer/msbuild/2003")
let xmlAttr = doc.CreateAttribute("Include")
xmlAttr.InnerText <- Path.GetFileName(node.FileName)
xmlElem.Attributes.Append(xmlAttr) |> ignore
itemNode.AppendChild(xmlElem) |> ignore)
doc.Save(project.FileName)
type MoveUpFileEvent() =
inherit AbstractMenuCommand()
override x.Run() =
let node = ProjectBrowserPad.Instance.SelectedNode
match node with
| :? FileNode as fileNode ->
let parent = node.Parent
let nodeIndex = parent.Nodes.IndexOf(node)
if nodeIndex > 1 then
parent.Nodes.Remove(node)
parent.Nodes.Insert(nodeIndex -1, node)
ProjectHelpers.reorderItems parent.Nodes fileNode.Project
| _ -> ()
type MoveDownFileEvent() =
inherit AbstractMenuCommand()
override x.Run() =
let node = ProjectBrowserPad.Instance.SelectedNode
match node with
| :? FileNode as fileNode ->
let parent = node.Parent
let nodeIndex = parent.Nodes.IndexOf(node)
if nodeIndex < parent.Nodes.Count then
parent.Nodes.Remove(node)
parent.Nodes.Insert(nodeIndex +1, node)
ProjectHelpers.reorderItems parent.Nodes fileNode.Project
| _ -> ()
type FsOptions() =
inherit AbstractProjectOptionPanel()
override x.LoadPanelContents() =
let this = (type FsOptions)
let caller = this.Assembly
x.SetupFromXmlStream(caller.GetManifestResourceStream("FSharpBindings.Resources.FsOptions.xfrm"))
x.InitializeHelper()
x.helper.BindBoolean(x.Get<CheckBox>("standalone"), "Standalone", false) |> ignore
x.helper.BindBoolean(x.Get<CheckBox>("nomllib"), "NoMLLib", false) |> ignore

27
src/AddIns/BackendBindings/FSharp/FSharpBinding/Project/Templates/ConsoleProject.xpt

@ -0,0 +1,27 @@ @@ -0,0 +1,27 @@
<?xml version="1.0"?>
<Template originator = "Robert Pickering"
created = "06/10/2001"
lastModified = "02/01/2003">
<!-- Template Header -->
<TemplateConfiguration>
<Name>${res:Templates.Project.ConsoleProject.Name}</Name>
<Category>F#</Category>
<Icon>C#.Project.DOSProject</Icon>
<Description>${res:Templates.Project.ConsoleProject.Description}</Description>
</TemplateConfiguration>
<!-- Actions -->
<Actions>
<Open filename = "file.fs"/>
</Actions>
<!-- Template Content -->
<Project language = "F#">
<Files>
<File name="file.fs"><![CDATA[#light
module MyNamespace.MyModule
printfn "Hello world" ]]></File>
</Files>
</Project>
</Template>

36
src/AddIns/BackendBindings/FSharp/FSharpBinding/Project/Templates/EmptyClass.xft

@ -0,0 +1,36 @@ @@ -0,0 +1,36 @@
<?xml version="1.0"?>
<Template author="Robert Pickering" version="1.0">
<Config
name = "${res:Templates.File.EmptyClass.Name}"
icon = "Boo.File.EmptyFile"
category = "F#"
defaultname = "file${Number}.fs"
language = "F#"/>
<Description>${res:Templates.File.EmptyClass.Description}</Description>
<!--
Special new file templates:
${StandardNamespace} -> Standardnamespace of the current project or FileNameWithoutExtension
${FullName} -> Full generated path name
${FileName} -> File name with extension
${FileNameWithoutExtension} -> File name without extension
${Extension} -> Extension in the form ".cs"
${Path} -> Full path of the file
${ClassName} -> Class name (generally FileNameWithoutExtension w/o 'bad' characters)
-->
<Files>
<File name="${FullName}" language="Boo">
<![CDATA[#light
namespace ${StandardNamespace}
module ${FileNameWithoutExtension}
printfn "Hello world"
]]></File>
</Files>
<AdditionalOptions/>
</Template>

BIN
src/AddIns/BackendBindings/FSharp/RequiredLibraries/FSharp.Build.Tasks.dll

Binary file not shown.

69
src/AddIns/BackendBindings/FSharp/RequiredLibraries/SharpDevelop.Build.Fsc.targets

@ -0,0 +1,69 @@ @@ -0,0 +1,69 @@
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<UsingTask TaskName="FSharp.Build.Tasks.Fsc" AssemblyFile="FSharp.Build.Tasks.dll" />
<UsingTask TaskName="CreateCSharpManifestResourceName" AssemblyName="Microsoft.Build.Tasks, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<PropertyGroup>
<MSBuildAllProjects>$(MSBuildAllProjects);$(FSharpBuildTasksPath)\SharpDevelop.Build.Fsc.targets</MSBuildAllProjects>
<DefaultLanguageSourceExtension>.fs</DefaultLanguageSourceExtension>
<Language>F#</Language>
</PropertyGroup>
<PropertyGroup>
<CreateManifestResourceNamesDependsOn>
</CreateManifestResourceNamesDependsOn>
</PropertyGroup>
<Target Name="CreateManifestResourceNames" Condition="'@(ResxWithNoCulture)@(ResxWithCulture)@(NonResxWithNoCulture)@(NonResxWithCulture)'!=''" DependsOnTargets="$(CreateManifestResourceNamesDependsOn)">
<!-- Create the target resource names for non-culture resx files. -->
<CreateCSharpManifestResourceName Condition="'@(ResxWithNoCulture)'!=''" ResourceFiles="@(ResxWithNoCulture)" RootNamespace="$(RootNamespace)">
<Output TaskParameter="ManifestResourceNames" ItemName="ManifestResourceWithNoCultureName" />
</CreateCSharpManifestResourceName>
<!-- Create the target resource names for culture resx files. -->
<CreateCSharpManifestResourceName Condition="'@(ResxWithCulture)'!=''" ResourceFiles="@(ResxWithCulture)" RootNamespace="$(RootNamespace)">
<Output TaskParameter="ManifestResourceNames" ItemName="ManifestResourceWithCultureName" />
</CreateCSharpManifestResourceName>
<!-- Create the target resource names for non-culture non-resx files. -->
<CreateCSharpManifestResourceName Condition="'@(NonResxWithNoCulture)'!=''" ResourceFiles="@(NonResxWithNoCulture)" RootNamespace="$(RootNamespace)">
<Output TaskParameter="ManifestResourceNames" ItemName="ManifestNonResxWithNoCulture" />
</CreateCSharpManifestResourceName>
<!-- Create the target resource names for culture non-resx files. -->
<CreateCSharpManifestResourceName Condition="'@(NonResxWithCulture)'!=''" ResourceFiles="@(NonResxWithCulture)" RootNamespace="$(RootNamespace)">
<Output TaskParameter="ManifestResourceNames" ItemName="ManifestNonResxWithCulture" />
</CreateCSharpManifestResourceName>
</Target>
<Target Name="CoreCompile" Inputs="$(MSBuildAllProjects);
@(Compile);
@(ReferencePath);
@(ManifestResourceWithNoCulture);
$(ApplicationIcon);
$(AssemblyOriginatorKeyFile);
@(ManifestNonResxWithNoCultureOnDisk);
@(ReferencePath);
@(CompiledLicenseFile);
$(Standalone);
$(NoMLLib)"
Outputs="@(DocFileItem);
@(IntermediateAssembly);
$(NonExistentFile)"
DependsOnTargets="$(CoreCompileDependsOn)">
<Fsc
DebugType="$(DebugType)"
EmitDebugInformation="$(DebugSymbols)"
FileAlignment="$(FileAlignment)"
KeyContainer="$(KeyContainerName)"
KeyFile="$(KeyOriginatorFile)"
Optimize="$(Optimize)"
OutputAssembly="@(IntermediateAssembly)"
Resources="@(ManifestResourceWithNoCulture);@(ManifestNonResxWithNoCultureOnDisk);@(CompiledLicenseFile)"
Sources="@(Compile)"
References="@(ReferencePath)"
TargetType="$(OutputType)"
Standalone="$(Standalone)"
NoMLLib="$(NoMLLib)" />
</Target>
<Import Project="$(MSBuildBinPath)\Microsoft.Common.targets" />
</Project>

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

Binary file not shown.

22
src/Setup/Files.wxs

@ -1158,6 +1158,28 @@ @@ -1158,6 +1158,28 @@
</Component>
</Directory>
</Directory>
<Directory Id="FSharpBinding" Name="FSharpBinding">
<Component Guid="7C6826BE-C03E-43A4-AD27-17A9325C70DD" Id="FSharpBuildTasksDll" DiskId="1">
<File Source="..\..\AddIns\AddIns\BackendBindings\FSharpBinding\FSharp.Build.Tasks.dll" Name="FSharp.Build.Tasks.dll" Id="FSharp.Build.Tasks.dll" KeyPath="yes" Assembly=".net" AssemblyApplication="FSharp.Build.Tasks.dll" AssemblyManifest="FSharp.Build.Tasks.dll" />
</Component>
<Component Guid="6B4F28AF-133C-4FEB-98DB-67A5405AEB12" Id="FSharpBindingAddin" DiskId="1">
<File Source="..\..\AddIns\AddIns\BackendBindings\FSharpBinding\FSharpBinding.addin" Name="FSharpBinding.addin" Id="FSharpBinding.addin" KeyPath="yes" />
</Component>
<Component Guid="810CE373-569B-41C3-ADDA-D2F0E0EFD5DE" Id="FSharpBindingDll" DiskId="1">
<File Source="..\..\AddIns\AddIns\BackendBindings\FSharpBinding\FSharpBinding.dll" Name="FSharpBinding.dll" Id="FSharpBinding.dll" KeyPath="yes" Assembly=".net" AssemblyApplication="FSharpBinding.dll" AssemblyManifest="FSharpBinding.dll" />
</Component>
<Component Guid="0E893CB2-9662-4507-9745-156CC7B96FBA" Id="SharpDevelopBuildFscTargets" DiskId="1">
<File Source="..\..\AddIns\AddIns\BackendBindings\FSharpBinding\SharpDevelop.Build.Fsc.targets" Name="SharpDevelop.Build.Fsc.targets" Id="SharpDevelop.Build.Fsc.targets" KeyPath="yes" />
</Component>
<Directory Id="FSharpBindingTemplates" Name="Templates">
<Component Guid="37A7695A-BA60-45A6-9BDB-FAE663D7A4C0" Id="FSharpConsoleProjectTemplate" DiskId="1">
<File Source="..\..\AddIns\AddIns\BackendBindings\FSharpBinding\Templates\ConsoleProject.xpt" Name="ConsoleProject.xpt" Id="Templates.ConsoleProject1.xpt" KeyPath="yes" />
</Component>
<Component Guid="33142421-A648-4415-8C22-0F73479E0840" Id="FSharpEmptyClassTemplate" DiskId="1">
<File Source="..\..\AddIns\AddIns\BackendBindings\FSharpBinding\Templates\EmptyClass.xft" Name="EmptyClass.xft" Id="Templates.EmptyClass1.xft" KeyPath="yes" />
</Component>
</Directory>
</Directory>
</Directory>
<Directory Id="DisplayBindingsFolder" Name="DisplayBindings">
<Directory Id="FormsDesignerFolder" Name="FormsDesigner">

7
src/Setup/Setup.wxs

@ -402,6 +402,13 @@ @@ -402,6 +402,13 @@
<ComponentRef Id="SharpDevelopBuildPythonTargets"/>
<ComponentRef Id="ClassWizardDll"/>
<ComponentRef Id="ClassWizardAddin"/>
<ComponentRef Id="FSharpBindingDll"/>
<ComponentRef Id="FSharpBindingAddin"/>
<ComponentRef Id="FSharpBuildTasksDll"/>
<ComponentRef Id="SharpDevelopBuildFscTargets"/>
<ComponentRef Id="FSharpConsoleProjectTemplate"/>
<ComponentRef Id="FSharpEmptyClassTemplate"/>
</Feature>
<Feature Id="SharpDevelopFileAssociations"
Level="2"

13
src/SharpDevelop.sln

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

Microsoft Visual Studio Solution File, Format Version 10.00
# Visual Studio 2008
# SharpDevelop 3.0.0.2813
# SharpDevelop 3.0.0.2956
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "AddIns", "AddIns", "{14A277EE-7DF1-4529-B639-7D1EF334C1C5}"
ProjectSection(SolutionItems) = postProject
EndProjectSection
@ -86,6 +86,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WixBinding", "AddIns\Backen @@ -86,6 +86,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WixBinding", "AddIns\Backen
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "XamlBinding", "AddIns\BackendBindings\XamlBinding\Project\XamlBinding.csproj", "{7C96B65D-28A5-4F28-A35B-8D83CE831EE8}"
EndProject
Project("{982E8BC1-ACD7-4dbf-96AB-B2CE67D6A008}") = "FSharpBinding", "AddIns\BackendBindings\FSharp\FSharpBinding\Project\FSharpBinding.fsproj", "{99BAE3A2-C40D-40D2-A7B4-EBB4798F36E4}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Display Bindings", "Display Bindings", "{4EA396ED-64AD-4AD0-A67A-AB363F3E0C79}"
ProjectSection(SolutionItems) = postProject
EndProjectSection
@ -526,6 +528,14 @@ Global @@ -526,6 +528,14 @@ Global
{8CF1EB90-324F-4AA9-BAA2-DEF87392CE86}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{8CF1EB90-324F-4AA9-BAA2-DEF87392CE86}.Release|Any CPU.Build.0 = Release|Any CPU
{8CF1EB90-324F-4AA9-BAA2-DEF87392CE86}.Release|Any CPU.ActiveCfg = Release|Any CPU
{674D485B-8340-498D-B91F-BE51543386C8}.Debug|Any CPU.Build.0 = Debug|Any CPU
{674D485B-8340-498D-B91F-BE51543386C8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{674D485B-8340-498D-B91F-BE51543386C8}.Release|Any CPU.Build.0 = Release|Any CPU
{674D485B-8340-498D-B91F-BE51543386C8}.Release|Any CPU.ActiveCfg = Release|Any CPU
{99BAE3A2-C40D-40D2-A7B4-EBB4798F36E4}.Debug|Any CPU.Build.0 = Debug|Any CPU
{99BAE3A2-C40D-40D2-A7B4-EBB4798F36E4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{99BAE3A2-C40D-40D2-A7B4-EBB4798F36E4}.Release|Any CPU.Build.0 = Release|Any CPU
{99BAE3A2-C40D-40D2-A7B4-EBB4798F36E4}.Release|Any CPU.ActiveCfg = Release|Any CPU
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{4EA396ED-64AD-4AD0-A67A-AB363F3E0C79} = {14A277EE-7DF1-4529-B639-7D1EF334C1C5}
@ -554,6 +564,7 @@ Global @@ -554,6 +564,7 @@ Global
{E6F4983F-DE41-4AEC-88E7-1FA9AFB4E6FF} = {BDDDCD01-D2FE-4EAD-9425-4B6B91922C7C}
{869951D5-A0D6-4DC6-9F1D-E6B9A12AC446} = {BDDDCD01-D2FE-4EAD-9425-4B6B91922C7C}
{000E4F64-5D0D-4EB1-B0BF-1A62ADBC6EAD} = {BDDDCD01-D2FE-4EAD-9425-4B6B91922C7C}
{99BAE3A2-C40D-40D2-A7B4-EBB4798F36E4} = {FEB825FA-4AD8-425D-8E4A-B5A18EE1B81C}
{7C96B65D-28A5-4F28-A35B-8D83CE831EE8} = {FEB825FA-4AD8-425D-8E4A-B5A18EE1B81C}
{e1b288a2-08ee-4318-8bbb-8ab72c69e33e} = {FEB825FA-4AD8-425D-8E4A-B5A18EE1B81C}
{DBCF20A1-BA13-4582-BFA9-74DE4D987B73} = {FEB825FA-4AD8-425D-8E4A-B5A18EE1B81C}

2
src/clean.bat

@ -1,2 +1,2 @@ @@ -1,2 +1,2 @@
%windir%\microsoft.net\framework\v3.5\msbuild /t:clean SharpDevelop.sln "/p:BooBinPath=%CD%\AddIns\BackendBindings\Boo\RequiredLibraries"
%windir%\microsoft.net\framework\v3.5\msbuild /t:clean SharpDevelop.sln "/p:BooBinPath=%CD%\AddIns\BackendBindings\Boo\RequiredLibraries" "/p:FSharpBuildTasksPath=%CD%\AddIns\BackendBindings\FSharp\RequiredLibraries"
@IF %ERRORLEVEL% NEQ 0 PAUSE

2
src/debugbuild.bat

@ -1,2 +1,2 @@ @@ -1,2 +1,2 @@
%windir%\microsoft.net\framework\v3.5\msbuild SharpDevelop.sln "/p:BooBinPath=%CD%\AddIns\BackendBindings\Boo\RequiredLibraries"
%windir%\microsoft.net\framework\v3.5\msbuild SharpDevelop.sln "/p:BooBinPath=%CD%\AddIns\BackendBindings\Boo\RequiredLibraries" "/p:FSharpBuildTasksPath=%CD%\AddIns\BackendBindings\FSharp\RequiredLibraries"
@IF %ERRORLEVEL% NEQ 0 PAUSE

2
src/releasebuild.bat

@ -1,2 +1,2 @@ @@ -1,2 +1,2 @@
%windir%\microsoft.net\framework\v3.5\msbuild /property:Configuration=Release SharpDevelop.sln "/p:BooBinPath=%CD%\AddIns\BackendBindings\Boo\RequiredLibraries"
%windir%\microsoft.net\framework\v3.5\msbuild /property:Configuration=Release SharpDevelop.sln "/p:BooBinPath=%CD%\AddIns\BackendBindings\Boo\RequiredLibraries" "/p:FSharpBuildTasksPath=%CD%\AddIns\BackendBindings\FSharp\RequiredLibraries"
@IF %ERRORLEVEL% NEQ 0 PAUSE
Loading…
Cancel
Save