diff --git a/src/AddIns/BackendBindings/FSharp/FSharpBinding.sln b/src/AddIns/BackendBindings/FSharp/FSharpBinding.sln deleted file mode 100644 index 11137f312d..0000000000 --- a/src/AddIns/BackendBindings/FSharp/FSharpBinding.sln +++ /dev/null @@ -1,66 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 10.00 -# Visual Studio 2008 -# SharpDevelop 3.0.0.3280 -Project("{982E8BC1-ACD7-4dbf-96AB-B2CE67D6A008}") = "FSharpBinding", "FSharpBinding\Project\FSharpBinding.fsproj", "{99BAE3A2-C40D-40D2-A7B4-EBB4798F36E4}" -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}") = "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 - {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 - {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 diff --git a/src/AddIns/BackendBindings/FSharp/FSharpBinding/Project/FSharpBinding.fsproj b/src/AddIns/BackendBindings/FSharp/FSharpBinding/Project/FSharpBinding.fsproj deleted file mode 100644 index 2f02de0ba8..0000000000 --- a/src/AddIns/BackendBindings/FSharp/FSharpBinding/Project/FSharpBinding.fsproj +++ /dev/null @@ -1,207 +0,0 @@ - - - - Debug - AnyCPU - 8.0.30703 - 2.0 - {a7e6c2fe-6933-44a2-a420-aa6a38d421e9} - Library - FSharpBinding - FSharpBinding - v3.5 - 512 - FShapBinding - - - true - full - false - ..\..\..\..\..\..\AddIns\AddIns\BackendBindings\FSharpBinding - DEBUG;TRACE - prompt - 3 - - - - - pdbonly - true - ..\..\..\..\..\..\AddIns\AddIns\BackendBindings\FSharpBinding - TRACE - prompt - 3 - --standalone - - - - - - - - - Always - - - Always - - - Always - - - - - ..\..\..\..\..\Libraries\log4net\log4net.dll - False - - - Microsoft.Build.Engine - Microsoft.Build.Engine.dll - - - ..\..\..\..\..\Libraries\Mono.Cecil\Mono.Cecil.dll - False - - - - System.Configuration - System.configuration.dll - - - System.Security - System.Security.dll - - - System.Web - System.Web.dll - - - System.EnterpriseServices - System.EnterpriseServices.dll - - - System.Runtime.Remoting - System.Runtime.Remoting.dll - - - System.DirectoryServices - System.DirectoryServices.dll - - - System.Runtime.Serialization.Formatters.Soap - System.Runtime.Serialization.Formatters.Soap.dll - - - System.DirectoryServices.Protocols - System.DirectoryServices.Protocols.dll - - - System.Web.RegularExpressions - System.Web.RegularExpressions.dll - - - System.Web.Services - System.Web.Services.dll - - - System.Design - System.Design.dll - - - System.Drawing.Design - System.Drawing.Design.dll - - - System.Deployment - System.Deployment.dll - - - Accessibility - Accessibility.dll - - - System.ServiceProcess - System.ServiceProcess.dll - - - System.Configuration.Install - System.Configuration.Install.dll - - - Microsoft.VisualC - Microsoft.VisualC.dll - - - 3.5 - - - System.Drawing - System.Drawing.dll - - - System.Windows.Forms - System.Windows.Forms.dll - - - System.Xml - System.XML.dll - - - ICSharpCode.Core.WinForms - {857CA1A3-FC88-4BE0-AB6A-D1EE772AB288} - False - - - ICSharpCode.TextEditor - {2d18be89-d210-49eb-a9dd-2246fbb3df6d} - False - - - NRefactory - {3a9ae6aa-bc07-4a2f-972c-581e3ae2f195} - False - - - ICSharpCode.SharpDevelop - {2748ad25-9c63-4e12-877b-4dce96fbed54} - False - - - ICSharpCode.Core - {35cef10f-2d4c-45f2-9dd1-161e0fec583c} - False - - - ICSharpCode.SharpDevelop.Dom - {924ee450-603d-49c1-a8e5-4afaa31ce6f3} - False - - - ICSharpCode.SharpDevelop.Widgets - {8035765f-d51f-4a0c-a746-2fd100e19419} - False - - - - - {D3C782BA-178E-4235-A3BA-8C11DEBB6BEE} - WinFormsUI - False - - - {C3CBC8E3-81D8-4C5B-9941-DCCD12D50B1F} - ICSharpCode.SharpDevelop.BuildWorker - False - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/AddIns/BackendBindings/FSharp/FSharpBinding/Project/Src/fsi.fs b/src/AddIns/BackendBindings/FSharp/FSharpBinding/Project/Src/fsi.fs deleted file mode 100644 index 43f67bc2d3..0000000000 --- a/src/AddIns/BackendBindings/FSharp/FSharpBinding/Project/Src/fsi.fs +++ /dev/null @@ -1,147 +0,0 @@ -// -// -// -// -// $Revision$ -// - -#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() - let errorQueue = new Queue() - let fsiProcess = new Process() - let panel = new Panel() - let input = new TextBox(Anchor = (AnchorStyles.Left ||| AnchorStyles.Top ||| AnchorStyles.Right), - Width = panel.Width) - let output = new TextBox(Multiline = true, - Top = input.Height, - Height = panel.Height - input.Height, - Width = panel.Width, - ReadOnly = true, - ScrollBars = ScrollBars.Both, - WordWrap = false, - Anchor = (AnchorStyles.Left ||| AnchorStyles.Top ||| AnchorStyles.Right ||| AnchorStyles.Bottom)) - panel.Controls.Add(input) - panel.Controls.Add(output) - let foundCompiler = - 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 - true - else - output.Text <- - "you are trying to use the app setting alt_fs_bin_path, but fsi.exe is not localed in the given directory" - false - else - let path = Environment.GetEnvironmentVariable("PATH") - let paths = path.Split([|';'|]) - let path = paths |> Array.tryFind (fun x -> try File.Exists(Path.Combine(x, "fsi.exe")) with _ -> false) - match path with - | Some x -> - fsiProcess.StartInfo.FileName <- Path.Combine(x, "fsi.exe") - true - | None -> - let programFiles = Environment.GetEnvironmentVariable("ProgramFiles") - let fsdirs = Directory.GetDirectories(programFiles, "FSharp*") - let possibleFiles = - fsdirs |> Array.choose - (fun x -> - LoggingService.Debug("Trying to find fsi in '" + x + "'") - let fileInfo = new FileInfo(Path.Combine(x, "bin\\fsi.exe")) - if fileInfo.Exists then - Some fileInfo - else - None) - let possibleFiles = possibleFiles |> Array.sortBy (fun x -> x.CreationTime) - if possibleFiles.Length > 0 then - fsiProcess.StartInfo.FileName <- possibleFiles.[0].FullName - true - else - output.Text <- - "Can not find the fsi.exe, ensure a version of the F# compiler is installed." + Environment.NewLine + - "Please see http://research.microsoft.com/fsharp for details of how to install the compiler" - false - if foundCompiler then - input.KeyUp.Add(fun ea -> - if ea.KeyData = Keys.Return then - fsiProcess.StandardInput.WriteLine(input.Text) - input.Text <- "" ) - //fsiProcess.StartInfo.Arguments <- "--fsi-server sharpdevelopfsi" - fsiProcess.StartInfo.UseShellExecute <- false - fsiProcess.StartInfo.CreateNoWindow <- true - 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) = - 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() - else - input.KeyUp.Add(fun ea -> - if ea.KeyData = Keys.Return then - output.Text <- - (output.Text + Environment.NewLine + - "F# not installed - could not execute command") - input.Text <- "" ) - -type FSharpInteractive = class - inherit AbstractPadContent - new() = {} - override x.Control - with get() = TheControl.panel :> Control -end - -type SentToFSharpInteractive = class - inherit AbstractMenuCommand - new () = {} - override x.Run() = - if TheControl.foundCompiler then - let window = WorkbenchSingleton.Workbench.ActiveWorkbenchWindow - if window <> null then - match window.ActiveViewContent :> obj with - | :? ITextEditorControlProvider as textArea -> - let textArea = textArea.TextEditorControl.ActiveTextAreaControl.TextArea - let pad = WorkbenchSingleton.Workbench.GetPad(typeof) - pad.BringPadToFront() - if textArea.SelectionManager.HasSomethingSelected then - for selection in textArea.SelectionManager.SelectionCollection do - TheControl.fsiProcess.StandardInput.WriteLine(selection.SelectedText) - else - let line = textArea.Document.GetLineNumberForOffset(textArea.Caret.Offset) - let lineSegment = textArea.Document.GetLineSegment(line) - let lineText = textArea.Document.GetText(lineSegment.Offset, lineSegment.TotalLength) - TheControl.fsiProcess.StandardInput.WriteLine(lineText) - TheControl.fsiProcess.StandardInput.WriteLine(";;") - | _ -> () -end diff --git a/src/AddIns/BackendBindings/FSharp/FSharpBinding/Project/Src/languagebinding.fs b/src/AddIns/BackendBindings/FSharp/FSharpBinding/Project/Src/languagebinding.fs deleted file mode 100644 index d1b084fcfa..0000000000 --- a/src/AddIns/BackendBindings/FSharp/FSharpBinding/Project/Src/languagebinding.fs +++ /dev/null @@ -1,25 +0,0 @@ -// -// -// -// -// $Revision$ -// - -#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 \ No newline at end of file diff --git a/src/AddIns/BackendBindings/FSharp/FSharpBinding/Project/Src/project.fs b/src/AddIns/BackendBindings/FSharp/FSharpBinding/Project/Src/project.fs deleted file mode 100644 index 5275634615..0000000000 --- a/src/AddIns/BackendBindings/FSharp/FSharpBinding/Project/Src/project.fs +++ /dev/null @@ -1,231 +0,0 @@ -// -// -// -// -// $Revision$ -// - -#light -namespace FSharpBinding - -//Global todos -//TODO add "compiling" dialog to output the 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 - 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) - try - base.AddImport(@"$(MSBuildExtensionsPath)\FSharp\1.0\Microsoft.FSharp.Targets", null) - with - | :? Microsoft.Build.BuildEngine.InvalidProjectFileException as ex -> - raise (ProjectLoadException("Please ensure that the F# compiler is installed on your computer.\n\n" + ex.Message, ex)) - 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) = - { inherit ProjectNode(project) } - member x.AddParentFolder((virtualName : string), (relativeDirectoryPath : string), (directoryNodeList :Dictionary)) = - 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(StringComparer.InvariantCultureIgnoreCase) - let directoryNodeList = new Dictionary(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") - let d = new Dictionary() - nodes |> forEachFileNode - (fun node -> - let docNode = doc.SelectSingleNode(Printf.sprintf @"//proj:Compile[@Include=""%s""]" (Path.GetFileName(node.FileName)), nsmgr) - if docNode <> null then - d.[node] <- docNode - docNode.ParentNode.RemoveChild(docNode) |> ignore) - let itemNode = doc.SelectSingleNode("//proj:ItemGroup", nsmgr) - nodes |> forEachFileNode - (fun node -> - let found, xmlElem = d.TryGetValue(node) - if found then - 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 = (typeof) - let caller = this.Assembly - x.SetupFromXmlStream(caller.GetManifestResourceStream("FsOptions.xfrm")) - x.InitializeHelper() - x.helper.BindBoolean(x.Get("standalone"), "Standalone", false) |> ignore - x.helper.BindBoolean(x.Get("nomllib"), "NoMLLib", false) |> ignore diff --git a/src/AddIns/BackendBindings/FSharp/FSharpBinding/Project/FSharpBinding.addin b/src/AddIns/BackendBindings/FSharpBinding/FSharpBinding.addin similarity index 98% rename from src/AddIns/BackendBindings/FSharp/FSharpBinding/Project/FSharpBinding.addin rename to src/AddIns/BackendBindings/FSharpBinding/FSharpBinding.addin index 8a065b0129..abfbba1163 100644 --- a/src/AddIns/BackendBindings/FSharp/FSharpBinding/Project/FSharpBinding.addin +++ b/src/AddIns/BackendBindings/FSharpBinding/FSharpBinding.addin @@ -25,7 +25,7 @@ + resource = "FSharpBinding.Resources.FS-Mode.xshd" /> diff --git a/src/AddIns/BackendBindings/FSharpBinding/FSharpBinding.csproj b/src/AddIns/BackendBindings/FSharpBinding/FSharpBinding.csproj new file mode 100644 index 0000000000..0be64838da --- /dev/null +++ b/src/AddIns/BackendBindings/FSharpBinding/FSharpBinding.csproj @@ -0,0 +1,99 @@ + + + {E954F3CB-A446-492F-A664-2B376EBC86E8} + Debug + AnyCPU + Library + FSharpBinding + FSharpBinding + v3.5 + Properties + C:\Users\Daniel\AppData\Roaming\ICSharpCode/SharpDevelop3.0\Settings.SourceAnalysis + False + False + 4 + false + ..\..\..\..\AddIns\AddIns\BackendBindings\FSharpBinding\ + + + AnyCPU + False + Auto + 4194304 + 4096 + + + true + Full + False + True + DEBUG;TRACE + + + False + None + True + False + TRACE + + + + + + + + 3.5 + + + + + 3.5 + + + + + Properties\GlobalAssemblyInfo.cs + + + + + + + + + + + + + Always + + + Always + + + Always + + + + + {2D18BE89-D210-49EB-A9DD-2246FBB3DF6D} + ICSharpCode.TextEditor + False + + + {2748AD25-9C63-4E12-877B-4DCE96FBED54} + ICSharpCode.SharpDevelop + False + + + {35CEF10F-2D4C-45F2-9DD1-161E0FEC583C} + ICSharpCode.Core + False + + + {924EE450-603D-49C1-A8E5-4AFAA31CE6F3} + ICSharpCode.SharpDevelop.Dom + False + + + \ No newline at end of file diff --git a/src/AddIns/BackendBindings/FSharpBinding/FSharpInteractive.cs b/src/AddIns/BackendBindings/FSharpBinding/FSharpInteractive.cs new file mode 100644 index 0000000000..76c9244cc2 --- /dev/null +++ b/src/AddIns/BackendBindings/FSharpBinding/FSharpInteractive.cs @@ -0,0 +1,174 @@ +// +// +// +// +// $Revision$ +// + +using ICSharpCode.SharpDevelop.DefaultEditor.Gui.Editor; +using System; +using System.Collections.Generic; +using System.Configuration; +using System.Diagnostics; +using System.IO; +using System.Linq; +using System.Windows.Forms; +using ICSharpCode.Core; +using ICSharpCode.SharpDevelop; +using ICSharpCode.SharpDevelop.Gui; + +namespace FSharpBinding +{ + public class FSharpInteractive : AbstractPadContent + { + Queue outputQueue = new Queue(); + internal readonly Process fsiProcess = new Process(); + Panel panel = new Panel(); + TextBox input, output; + internal readonly bool foundCompiler; + + public FSharpInteractive() + { + input = new TextBox { + Anchor = AnchorStyles.Left | AnchorStyles.Top | AnchorStyles.Right, + Width = panel.Width + }; + output = new TextBox { + Multiline = true, + Top = input.Height, + Height = panel.Height - input.Height, + Width = panel.Width, + ReadOnly = true, + ScrollBars = ScrollBars.Both, + WordWrap = false, + Anchor = AnchorStyles.Left | AnchorStyles.Top | AnchorStyles.Right | AnchorStyles.Bottom + }; + panel.Controls.Add(input); + panel.Controls.Add(output); + + if (Array.Exists(ConfigurationManager.AppSettings.AllKeys, x => x == "alt_fs_bin_path")) { + string path = Path.Combine(ConfigurationManager.AppSettings["alt_fs_bin_path"], "fsi.exe"); + if (File.Exists(path)) { + fsiProcess.StartInfo.FileName = path; + foundCompiler = true; + } else { + output.Text = "you are trying to use the app setting alt_fs_bin_path, but fsi.exe is not localed in the given directory"; + foundCompiler = false; + } + } else { + string[] paths = Environment.GetEnvironmentVariable("PATH").Split(';'); + string path = Array.Find(paths, x => { + try { + return File.Exists(Path.Combine(x, "fsi.exe")); + } catch { + return false; + }}); + if (path != null) { + fsiProcess.StartInfo.FileName = Path.Combine(path, "fsi.exe"); + foundCompiler = true; + } else { + string programFiles = Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles); + var possibleFiles = from fsdir in Directory.GetDirectories(programFiles, "FSharp*") + //LoggingService.Debug("Trying to find fsi in '" + fsdir + "'"); + let fileInfo = new FileInfo(Path.Combine(fsdir, "bin\\fsi.exe")) + where fileInfo.Exists + orderby fileInfo.CreationTime + select fileInfo; + FileInfo file = possibleFiles.FirstOrDefault(); + if (file != null) { + fsiProcess.StartInfo.FileName = file.FullName; + foundCompiler = true; + } else { + output.Text = "Can not find the fsi.exe, ensure a version of the F# compiler is installed." + Environment.NewLine + + "Please see http://research.microsoft.com/fsharp for details of how to install the compiler"; + foundCompiler = false; + } + } + } + + if (foundCompiler) { + input.KeyUp += delegate(object sender, KeyEventArgs e) { + if (e.KeyData == Keys.Return) { + fsiProcess.StandardInput.WriteLine(input.Text); + input.Text = ""; + } + }; + //fsiProcess.StartInfo.Arguments <- "--fsi-server sharpdevelopfsi"; + fsiProcess.StartInfo.UseShellExecute = false; + fsiProcess.StartInfo.CreateNoWindow = true; + fsiProcess.StartInfo.RedirectStandardError = true; + fsiProcess.StartInfo.RedirectStandardInput = true; + fsiProcess.StartInfo.RedirectStandardOutput = true; + fsiProcess.ErrorDataReceived += delegate(object sender, DataReceivedEventArgs e) { + lock (outputQueue) { + outputQueue.Enqueue(e.Data); + } + WorkbenchSingleton.SafeThreadAsyncCall(ReadAll); + }; + fsiProcess.OutputDataReceived += delegate(object sender, DataReceivedEventArgs e) { + lock (outputQueue) { + outputQueue.Enqueue(e.Data); + } + WorkbenchSingleton.SafeThreadAsyncCall(ReadAll); + }; + fsiProcess.Exited += delegate(object sender, EventArgs e) { + lock (outputQueue) { + outputQueue.Enqueue("fsi.exe died"); + outputQueue.Enqueue("restarting ..."); + } + WorkbenchSingleton.SafeThreadAsyncCall(ReadAll); + fsiProcess.Start(); + }; + fsiProcess.Start(); + fsiProcess.BeginErrorReadLine(); + fsiProcess.BeginOutputReadLine(); + } else { + input.KeyUp += delegate(object sender, KeyEventArgs e) { + if (e.KeyData == Keys.Return) { + output.AppendText(Environment.NewLine + "F# not installed - could not execute command"); + input.Text = ""; + } + }; + } + } + + void ReadAll() + { + lock (outputQueue) { + while (outputQueue.Count > 0) + output.AppendText(outputQueue.Dequeue() + Environment.NewLine); + } + } + + public override Control Control { + get { return panel; } + } + } + + public class SentToFSharpInteractive : AbstractMenuCommand + { + public override void Run() + { + PadDescriptor pad = WorkbenchSingleton.Workbench.GetPad(typeof(FSharpInteractive)); + pad.BringPadToFront(); + FSharpInteractive fsharpInteractive = (FSharpInteractive)pad.PadContent; + if (fsharpInteractive.foundCompiler) { + ITextEditorControlProvider editorProvider = WorkbenchSingleton.Workbench.ActiveViewContent as ITextEditorControlProvider; + if (editorProvider != null) { + var textArea = editorProvider.TextEditorControl.ActiveTextAreaControl.TextArea; + if (textArea.SelectionManager.HasSomethingSelected) { + foreach (var selection in textArea.SelectionManager.SelectionCollection) { + fsharpInteractive.fsiProcess.StandardInput.WriteLine(selection.SelectedText); + } + } else { + var line = textArea.Document.GetLineNumberForOffset(textArea.Caret.Offset); + var lineSegment = textArea.Document.GetLineSegment(line); + var lineText = textArea.Document.GetText(lineSegment.Offset, lineSegment.TotalLength); + fsharpInteractive.fsiProcess.StandardInput.WriteLine(lineText); + } + fsharpInteractive.fsiProcess.StandardInput.WriteLine(";;"); + } + } + } + } +} diff --git a/src/AddIns/BackendBindings/FSharpBinding/FSharpLanguageBinding.cs b/src/AddIns/BackendBindings/FSharpBinding/FSharpLanguageBinding.cs new file mode 100644 index 0000000000..289100f909 --- /dev/null +++ b/src/AddIns/BackendBindings/FSharpBinding/FSharpLanguageBinding.cs @@ -0,0 +1,29 @@ +// +// +// +// +// $Revision$ +// + +using ICSharpCode.SharpDevelop.Project; +using System; + +namespace FSharpBinding +{ + public class FSharpLanguageBinding : ILanguageBinding + { + public string Language { + get { return "F#"; } + } + + public IProject LoadProject(IMSBuildEngineProvider engineProvider, string fileName, string projectName) + { + return new FSharpProject(engineProvider, fileName, projectName); + } + + public IProject CreateProject(ICSharpCode.SharpDevelop.Internal.Templates.ProjectCreateInformation info) + { + return new FSharpProject(info); + } + } +} diff --git a/src/AddIns/BackendBindings/FSharpBinding/FSharpProject.cs b/src/AddIns/BackendBindings/FSharpBinding/FSharpProject.cs new file mode 100644 index 0000000000..edef9226c2 --- /dev/null +++ b/src/AddIns/BackendBindings/FSharpBinding/FSharpProject.cs @@ -0,0 +1,63 @@ +// +// +// +// +// $Revision$ +// + +using System; +using ICSharpCode.SharpDevelop.Dom; +using ICSharpCode.SharpDevelop.Internal.Templates; +using ICSharpCode.SharpDevelop.Project; +using Microsoft.Build.BuildEngine; +using System.IO; + +namespace FSharpBinding +{ + //Global todos + //TODO add "compiling" dialog to output the correct directory + //TODO copy all config to the correct locations + //TODO add directory structure + + public class FSharpProject : CompilableProject + { + public FSharpProject(IMSBuildEngineProvider engineProvider, string fileName, string projectName) : base(engineProvider) + { + this.Name = projectName; + this.LoadProject(fileName); + } + + public FSharpProject(ProjectCreateInformation info) : base(info.Solution) + { + this.Create(info); + try { + this.AddImport(@"$(MSBuildExtensionsPath)\FSharp\1.0\Microsoft.FSharp.Targets", null); + } catch (InvalidProjectFileException ex) { + throw new ProjectLoadException("Please ensure that the F# compiler is installed on your computer.\n\n" + ex.Message, ex); + } + } + + public override ItemType GetDefaultItemType(string fileName) + { + if (string.Equals(".fs", Path.GetExtension(fileName), StringComparison.InvariantCultureIgnoreCase)) { + return ItemType.Compile; + } else if (string.Equals(".fsi", Path.GetExtension(fileName), StringComparison.InvariantCultureIgnoreCase)) { + return ItemType.Compile; + } else { + return base.GetDefaultItemType(fileName); + } + } + + public override string Language { + get { + return "F#"; + } + } + + public override LanguageProperties LanguageProperties { + get { + return LanguageProperties.None; + } + } + } +} diff --git a/src/AddIns/BackendBindings/FSharpBinding/FSharpProjectNode.cs b/src/AddIns/BackendBindings/FSharpBinding/FSharpProjectNode.cs new file mode 100644 index 0000000000..e1324aa941 --- /dev/null +++ b/src/AddIns/BackendBindings/FSharpBinding/FSharpProjectNode.cs @@ -0,0 +1,110 @@ +// +// +// +// +// $Revision$ +// + +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; + +using ICSharpCode.SharpDevelop.Project; + +namespace FSharpBinding +{ + public class FSharpProjectNode : ProjectNode + { + public FSharpProjectNode(IProject project) : base(project) + { + } + + public void AddParentFolder(string virtualName, string relativeDirectoryPath, Dictionary directoryNodeList) + { + if ((relativeDirectoryPath.Length == 0) + || (string.Compare(virtualName, 0, relativeDirectoryPath, 0, relativeDirectoryPath.Length, StringComparison.InvariantCultureIgnoreCase) == 0)) + { + int pos = virtualName.IndexOf('/', relativeDirectoryPath.Length + 1); + if (pos > 0) { + string subFolderName = virtualName.Substring(relativeDirectoryPath.Length, pos - relativeDirectoryPath.Length); + DirectoryNode node; + if (directoryNodeList.TryGetValue(subFolderName, out node)) { + if (node.FileNodeStatus == FileNodeStatus.None) { + node.FileNodeStatus = FileNodeStatus.InProject; + } + } else { + node = new DirectoryNode(Path.Combine(this.Directory, subFolderName), FileNodeStatus.Missing); + node.AddTo(this); + directoryNodeList[subFolderName] = node; + } + } + } + } + + protected override void Initialize() + { + Dictionary fileNodeDictionary = new Dictionary((IEqualityComparer) StringComparer.InvariantCultureIgnoreCase); + Dictionary directoryNodeList = new Dictionary((IEqualityComparer) StringComparer.InvariantCultureIgnoreCase); + string relativeDirectoryPath = (this.RelativePath.Length <= 0) ? string.Empty : (this.RelativePath.Replace('\\', '/') + "/"); + + foreach (FileProjectItem item in this.Project.Items.OfType()) { + string virtualName = item.VirtualName.Replace('\\', '/'); + if (virtualName.EndsWith("/", StringComparison.Ordinal)) + virtualName = virtualName.Substring(0, virtualName.Length - 1); + string fileName = Path.GetFileName(virtualName); + if (!string.Equals(virtualName, relativeDirectoryPath + fileName, StringComparison.InvariantCultureIgnoreCase)) { + this.AddParentFolder(virtualName, relativeDirectoryPath, directoryNodeList); + // continue; + } + + if (item.ItemType == ItemType.Folder || item.ItemType == ItemType.WebReferences) { + DirectoryNode newDirectoryNode = DirectoryNodeFactory.CreateDirectoryNode(this, this.Project, fileName); + if (!System.IO.Directory.Exists(item.FileName)) { + newDirectoryNode.FileNodeStatus = FileNodeStatus.Missing; + } + newDirectoryNode.ProjectItem = item; + newDirectoryNode.AddTo(this); + directoryNodeList[fileName] = newDirectoryNode; + } else { + FileNode fileNode = new FileNode(item.FileName); + if (!File.Exists(item.FileName)) { + fileNode.FileNodeStatus = FileNodeStatus.Missing; + } + fileNode.ProjectItem = item; + fileNodeDictionary[fileName] = fileNode; + fileNode.AddTo(this); + } + } + + // Add files found in file system + if (System.IO.Directory.Exists(this.Directory)) { + foreach (string subDirectory in System.IO.Directory.GetDirectories(this.Directory)) { + string filename = Path.GetFileName(subDirectory); + if (filename != ".svn") { + DirectoryNode node; + if (directoryNodeList.TryGetValue(filename, out node)) { + if (node.FileNodeStatus == FileNodeStatus.None) + node.FileNodeStatus = FileNodeStatus.InProject; + } else { + node = DirectoryNodeFactory.CreateDirectoryNode(this, this.Project, subDirectory); + node.AddTo(this); + } + } + } + + foreach (string fullpath in System.IO.Directory.GetFiles(this.Directory)) { + string file = Path.GetFileName(fullpath); + FileNode node; + if (fileNodeDictionary.TryGetValue(file, out node)) { + if (node.FileNodeStatus == FileNodeStatus.None) + node.FileNodeStatus = FileNodeStatus.InProject; + } else { + node = new FileNode(file); + node.AddTo(this); + } + } + } + } + } +} diff --git a/src/AddIns/BackendBindings/FSharpBinding/FSharpProjectNodeBuilder.cs b/src/AddIns/BackendBindings/FSharpBinding/FSharpProjectNodeBuilder.cs new file mode 100644 index 0000000000..00ccc1d4fc --- /dev/null +++ b/src/AddIns/BackendBindings/FSharpBinding/FSharpProjectNodeBuilder.cs @@ -0,0 +1,29 @@ +// +// +// +// +// $Revision$ +// + +using System; +using ICSharpCode.SharpDevelop.Project; +using System.Windows.Forms; + +namespace FSharpBinding +{ + public class FSharpProjectNodeBuilder : IProjectNodeBuilder + { + public bool CanBuildProjectTree(IProject project) + { + return project is FSharpProject; + } + + public TreeNode AddProjectNode(TreeNode motherNode, IProject project) + { + FSharpProjectNode prjNode = new FSharpProjectNode(project); + prjNode.AddTo(motherNode); + new ReferenceFolder(project).AddTo(prjNode); + return prjNode; + } + } +} diff --git a/src/AddIns/BackendBindings/FSharpBinding/FsOptions.cs b/src/AddIns/BackendBindings/FSharpBinding/FsOptions.cs new file mode 100644 index 0000000000..698f3fba85 --- /dev/null +++ b/src/AddIns/BackendBindings/FSharpBinding/FsOptions.cs @@ -0,0 +1,24 @@ +// +// +// +// +// $Revision$ +// + +using System; +using ICSharpCode.SharpDevelop.Gui.OptionPanels; +using System.Windows.Forms; + +namespace FSharpBinding +{ + public class FsOptions : AbstractProjectOptionPanel + { + public override void LoadPanelContents() + { + SetupFromXmlStream(typeof(FsOptions).Assembly.GetManifestResourceStream("FSharpBinding.Resources.FsOptions.xfrm")); + InitializeHelper(); + helper.BindBoolean(Get("standalone"), "Standalone", false); + helper.BindBoolean(Get("nomllib"), "NoMLLib", false); + } + } +} diff --git a/src/AddIns/BackendBindings/FSharpBinding/ProjectHelpers.cs b/src/AddIns/BackendBindings/FSharpBinding/ProjectHelpers.cs new file mode 100644 index 0000000000..d74766b61f --- /dev/null +++ b/src/AddIns/BackendBindings/FSharpBinding/ProjectHelpers.cs @@ -0,0 +1,89 @@ +// +// +// +// +// $Revision$ +// + +using ICSharpCode.Core; +using System; +using System.Collections.Generic; +using System.IO; +using System.Windows.Forms; +using System.Xml; +using ICSharpCode.SharpDevelop.Project; + +namespace FSharpBinding +{ + public static class ProjectHelpers + { + public static IEnumerable getFileNodes(TreeNodeCollection nodes) + { + foreach (TreeNode node in nodes) { + FileNode fileNode = node as FileNode; + if (fileNode != null && fileNode.ProjectItem != null) { + yield return fileNode; + } + } + } + + public static void reorderItems(TreeNodeCollection nodes, IProject project) + { + //ProjectService.MarkProjectDirty(project) + project.Save(); + XmlDocument doc = new XmlDocument(); + doc.Load(project.FileName); + XmlNamespaceManager nsmgr = new XmlNamespaceManager(doc.NameTable); + nsmgr.AddNamespace("proj", "http://schemas.microsoft.com/developer/msbuild/2003"); + var d = new Dictionary(); + foreach (FileNode node in getFileNodes(nodes)) { + var docNode = doc.SelectSingleNode("//proj:Compile[@Include=\"" + Path.GetFileName(node.FileName) + "\"]", nsmgr); + if (docNode != null) { + d[node] = docNode; + docNode.ParentNode.RemoveChild(docNode); + } + } + var itemNode = doc.SelectSingleNode("//proj:ItemGroup", nsmgr); + foreach (FileNode node in getFileNodes(nodes)) { + XmlNode xmlElem; + if (d.TryGetValue(node, out xmlElem)) + itemNode.AppendChild(xmlElem); + } + doc.Save(project.FileName); + } + } + + public class MoveUpFileEvent : AbstractMenuCommand + { + public override void Run() + { + FileNode node = ProjectBrowserPad.Instance.SelectedNode as FileNode; + if (node != null) { + TreeNode parent = node.Parent; + int nodeIndex = parent.Nodes.IndexOf(node); + if (nodeIndex > 1) { + parent.Nodes.Remove(node); + parent.Nodes.Insert(nodeIndex - 1, node); + } + ProjectHelpers.reorderItems(parent.Nodes, node.Project); + } + } + } + + public class MoveDownFileEvent : AbstractMenuCommand + { + public override void Run() + { + FileNode node = ProjectBrowserPad.Instance.SelectedNode as FileNode; + if (node != null) { + TreeNode parent = node.Parent; + int nodeIndex = parent.Nodes.IndexOf(node); + if (nodeIndex < parent.Nodes.Count) { + parent.Nodes.Remove(node); + parent.Nodes.Insert(nodeIndex + 1, node); + } + ProjectHelpers.reorderItems(parent.Nodes, node.Project); + } + } + } +} diff --git a/src/AddIns/BackendBindings/FSharpBinding/Properties/AssemblyInfo.cs b/src/AddIns/BackendBindings/FSharpBinding/Properties/AssemblyInfo.cs new file mode 100644 index 0000000000..aed55fa510 --- /dev/null +++ b/src/AddIns/BackendBindings/FSharpBinding/Properties/AssemblyInfo.cs @@ -0,0 +1,16 @@ +#region Using directives + +using System; +using System.Reflection; +using System.Runtime.InteropServices; + +#endregion + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("FSharpBinding")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] diff --git a/src/AddIns/BackendBindings/FSharp/FSharpBinding/Project/Resources/FS-Mode.xshd b/src/AddIns/BackendBindings/FSharpBinding/Resources/FS-Mode.xshd similarity index 100% rename from src/AddIns/BackendBindings/FSharp/FSharpBinding/Project/Resources/FS-Mode.xshd rename to src/AddIns/BackendBindings/FSharpBinding/Resources/FS-Mode.xshd diff --git a/src/AddIns/BackendBindings/FSharp/FSharpBinding/Project/Resources/FsOptions.xfrm b/src/AddIns/BackendBindings/FSharpBinding/Resources/FsOptions.xfrm similarity index 100% rename from src/AddIns/BackendBindings/FSharp/FSharpBinding/Project/Resources/FsOptions.xfrm rename to src/AddIns/BackendBindings/FSharpBinding/Resources/FsOptions.xfrm diff --git a/src/AddIns/BackendBindings/FSharp/FSharpBinding/Project/Templates/ConsoleProject.xpt b/src/AddIns/BackendBindings/FSharpBinding/Templates/ConsoleProject.xpt similarity index 100% rename from src/AddIns/BackendBindings/FSharp/FSharpBinding/Project/Templates/ConsoleProject.xpt rename to src/AddIns/BackendBindings/FSharpBinding/Templates/ConsoleProject.xpt diff --git a/src/AddIns/BackendBindings/FSharp/FSharpBinding/Project/Templates/EmptyClass.xft b/src/AddIns/BackendBindings/FSharpBinding/Templates/EmptyClass.xft similarity index 100% rename from src/AddIns/BackendBindings/FSharp/FSharpBinding/Project/Templates/EmptyClass.xft rename to src/AddIns/BackendBindings/FSharpBinding/Templates/EmptyClass.xft diff --git a/src/SharpDevelop.sln b/src/SharpDevelop.sln index 1521cc7fb6..7ee019c191 100644 --- a/src/SharpDevelop.sln +++ b/src/SharpDevelop.sln @@ -1,7 +1,7 @@  Microsoft Visual Studio Solution File, Format Version 10.00 # Visual Studio 2008 -# SharpDevelop 3.2.0.5385 +# SharpDevelop 3.1.0.4977 Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "AddIns", "AddIns", "{14A277EE-7DF1-4529-B639-7D1EF334C1C5}" ProjectSection(SolutionItems) = postProject EndProjectSection @@ -78,6 +78,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Backends", "Backends", "{FE ProjectSection(SolutionItems) = postProject EndProjectSection EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FSharpBinding", "AddIns\BackendBindings\FSharpBinding\FSharpBinding.csproj", "{E954F3CB-A446-492F-A664-2B376EBC86E8}" +EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "XamlBinding", "AddIns\BackendBindings\Xaml\XamlBinding\XamlBinding.csproj", "{7C96B65D-28A5-4F28-A35B-8D83CE831EE8}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Python", "Python", "{8CF9DB5A-A2F6-4A88-BABA-100912EAF6E8}" @@ -100,8 +102,6 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NRefactoryToBooConverter", EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WixBinding", "AddIns\BackendBindings\WixBinding\Project\WixBinding.csproj", "{e1b288a2-08ee-4318-8bbb-8ab72c69e33e}" EndProject -Project("{982E8BC1-ACD7-4dbf-96AB-B2CE67D6A008}") = "FSharpBinding", "AddIns\BackendBindings\FSharp\FSharpBinding\Project\FSharpBinding.fsproj", "{99BAE3A2-C40D-40D2-A7B4-EBB4798F36E4}" -EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RubyBinding", "AddIns\BackendBindings\Ruby\RubyBinding\Project\RubyBinding.csproj", "{C896FFFF-5B6C-4B0E-B6DF-049865F501B4}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Display Bindings", "Display Bindings", "{4EA396ED-64AD-4AD0-A67A-AB363F3E0C79}" @@ -374,10 +374,6 @@ Global {8D732610-8FC6-43BA-94C9-7126FD7FE361}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {8D732610-8FC6-43BA-94C9-7126FD7FE361}.Release|Any CPU.Build.0 = Release|Any CPU {8D732610-8FC6-43BA-94C9-7126FD7FE361}.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 {E618A9CD-A39F-4925-A538-E8A3FEF24E54}.Debug|Any CPU.Build.0 = Debug|Any CPU {E618A9CD-A39F-4925-A538-E8A3FEF24E54}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {E618A9CD-A39F-4925-A538-E8A3FEF24E54}.Release|Any CPU.Build.0 = Release|Any CPU @@ -422,6 +418,10 @@ Global {D81F5C91-D7DB-46E5-BC99-49488FB6814C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {D81F5C91-D7DB-46E5-BC99-49488FB6814C}.Release|Any CPU.Build.0 = Release|Any CPU {D81F5C91-D7DB-46E5-BC99-49488FB6814C}.Release|Any CPU.ActiveCfg = Release|Any CPU + {E954F3CB-A446-492F-A664-2B376EBC86E8}.Debug|Any CPU.Build.0 = Debug|Any CPU + {E954F3CB-A446-492F-A664-2B376EBC86E8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {E954F3CB-A446-492F-A664-2B376EBC86E8}.Release|Any CPU.Build.0 = Release|Any CPU + {E954F3CB-A446-492F-A664-2B376EBC86E8}.Release|Any CPU.ActiveCfg = Release|Any CPU EndGlobalSection GlobalSection(NestedProjects) = preSolution {4EA396ED-64AD-4AD0-A67A-AB363F3E0C79} = {14A277EE-7DF1-4529-B639-7D1EF334C1C5} @@ -457,7 +457,6 @@ Global {869951D5-A0D6-4DC6-9F1D-E6B9A12AC446} = {BDDDCD01-D2FE-4EAD-9425-4B6B91922C7C} {000E4F64-5D0D-4EB1-B0BF-1A62ADBC6EAD} = {BDDDCD01-D2FE-4EAD-9425-4B6B91922C7C} {C896FFFF-5B6C-4B0E-B6DF-049865F501B4} = {FEB825FA-4AD8-425D-8E4A-B5A18EE1B81C} - {99BAE3A2-C40D-40D2-A7B4-EBB4798F36E4} = {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} {4AC2D5F1-F671-480C-A075-6BF62B3721B2} = {FEB825FA-4AD8-425D-8E4A-B5A18EE1B81C} @@ -466,6 +465,7 @@ Global {1F1AC7CD-D154-45BB-8EAF-804CA8055F5A} = {FEB825FA-4AD8-425D-8E4A-B5A18EE1B81C} {8CF9DB5A-A2F6-4A88-BABA-100912EAF6E8} = {FEB825FA-4AD8-425D-8E4A-B5A18EE1B81C} {7C96B65D-28A5-4F28-A35B-8D83CE831EE8} = {FEB825FA-4AD8-425D-8E4A-B5A18EE1B81C} + {E954F3CB-A446-492F-A664-2B376EBC86E8} = {FEB825FA-4AD8-425D-8E4A-B5A18EE1B81C} {D332F2D1-2CF1-43B7-903C-844BD5211A7E} = {8CF9DB5A-A2F6-4A88-BABA-100912EAF6E8} {8D732610-8FC6-43BA-94C9-7126FD7FE361} = {8CF9DB5A-A2F6-4A88-BABA-100912EAF6E8} {DB137F0B-9B62-4232-AE92-F7BE0280B8D3} = {4EA396ED-64AD-4AD0-A67A-AB363F3E0C79}