├── ext
├── Xwt.dll
├── libstetic.dll
├── Mono.Addins.dll
├── libsteticui.dll
├── Mono.Debugging.dll
├── Mono.TextEditor.dll
├── MonoDevelop.Core.dll
├── MonoDevelop.Ide.dll
├── Newtonsoft.Json.dll
├── Mono.Addins.Setup.dll
├── MonoDevelop.GtkCore.dll
├── MonoDevelop.Debugger.dll
├── ICSharpCode.NRefactory.dll
├── ICSharpCode.SharpZipLib.dll
├── MonoDevelop.Refactoring.dll
├── MonoDevelop.SourceEditor2.dll
├── ICSharpCode.NRefactory.CSharp.dll
├── MonoDevelop.DesignerSupport.dll
└── update deps.bat
├── .gitmodules
├── MonoDevelop.DBinding
├── icons
│ ├── out-16.png
│ ├── ref-16.png
│ ├── dfile16.png
│ ├── dfile32.png
│ ├── dproj16.png
│ ├── dproj32.png
│ ├── lazy-16.png
│ ├── static-16.png
│ ├── d-asm-avx-16.png
│ ├── d-asm-fpu-16.png
│ ├── d-asm-mmx-16.png
│ ├── d-asm-sse-16.png
│ ├── d-asm-sse2-16.png
│ ├── d-asm-sse3-16.png
│ ├── d-asm-x64-16.png
│ ├── d-asm-x86-16.png
│ ├── d-asm-sse4.1-16.png
│ ├── d-asm-sse4.2-16.png
│ ├── d-asm-ssse3-16.png
│ ├── element-alias-16.png
│ ├── element-local-16.png
│ ├── element-local-16.psd
│ ├── element-union-16.png
│ ├── element-parameter-16.png
│ ├── element-abstract-class-16.png
│ └── element-abstract-method-16.png
├── Building
│ └── CompilerPresets
│ │ ├── ConfigPresets.resources
│ │ ├── gdc.xml
│ │ ├── ldc2.xml
│ │ ├── dmd.xml
│ │ └── PresetLoader.cs
├── Projects
│ ├── Dub
│ │ ├── DefinitionFormats
│ │ │ ├── JSON
│ │ │ │ ├── JSONThing.cs
│ │ │ │ ├── JSONValueLeaf.cs
│ │ │ │ ├── JSONArray.cs
│ │ │ │ ├── JSONObject.cs
│ │ │ │ └── JSONThingDeserializer.cs
│ │ │ ├── PackageJson.cs
│ │ │ ├── SDL
│ │ │ │ ├── SDLObject.cs
│ │ │ │ ├── SDLDeclaration.cs
│ │ │ │ └── SdlParser.cs
│ │ │ ├── DubFileFormat.cs
│ │ │ └── DubFileManager.cs
│ │ ├── DubProjectItemTypeHandler.cs
│ │ ├── DubProjectConfiguration.cs
│ │ ├── DubSolution.cs
│ │ ├── DubSubPackage.cs
│ │ ├── DubSettings.cs
│ │ └── DubBuildSettings.cs
│ ├── DConfigurationMode.cs
│ ├── ProjectJsonConfig.cs
│ ├── DProjectBinding.cs
│ ├── ProjectPad
│ │ └── DProjectNodeExtension.cs
│ ├── VisualD
│ │ ├── VisualDProjectReferenceCollection.cs
│ │ ├── VisualDProject.cs
│ │ └── VisualDPrjConfig.cs
│ └── DefaultDReferencesCollection.cs
├── Profiler
│ ├── Commands
│ │ ├── ProfilerCommands.cs
│ │ └── ProfilerModeHandler.cs
│ └── Gui
│ │ ├── CodeCoverageEditorExtension.cs
│ │ └── DProfilerPad.cs
├── Debugging
│ ├── DExecutionCommand.cs
│ ├── LazyEvaluationValue.cs
│ ├── DebugSymbolValueProvider.cs
│ ├── IDBacktraceHelpers.cs
│ └── ObjectCacheNode.cs
├── Formatting
│ ├── DPolicy.xml
│ ├── Indentation
│ │ ├── doc.txt
│ │ ├── DIndentEngine.cs
│ │ └── DIndentationTracker.cs
│ ├── FormattingPanel.cs
│ ├── FormattingPanelWidget.cs
│ ├── DFormattingPolicy.cs
│ └── DietTemplateFormattingPanel.cs
├── Unittest
│ ├── Commands
│ │ ├── UnittestCommands.cs
│ │ └── UnittestCommandHandler.cs
│ ├── UnittestSettings.cs
│ └── UnittestCore.cs
├── OptionPanels
│ ├── EditCompilerName.cs
│ ├── ProjectIncludesWidgetBinding.cs
│ ├── ProjectDependencyPanelBinding.cs
│ ├── ResourcesCompilerOptions.cs
│ ├── ProjectIncludesWidget.cs
│ ├── DubOptionPanel.cs
│ ├── ProjectDependenciesWidget.cs
│ ├── UnittestOptions.cs
│ └── CompilerOptions.cs
├── Parser
│ ├── FoldingParser.cs
│ └── DPseudoUnresolvedFile.cs
├── templates
│ ├── EmptyRCFile.xft.xml
│ ├── EmptyDFile.xft.xml
│ ├── EmptyDClass.xft.xml
│ ├── AnsiFile.cs
│ ├── EmptyProject.xpt.xml
│ ├── StaticLibrary.xpt.xml
│ ├── ConsoleProject.xpt.xml
│ ├── SharedLibrary.xpt.xml
│ └── DFileDescriptionTemplate.cs
├── Refactoring
│ ├── CodeActions
│ │ └── DCodeActionSource.cs
│ ├── Renaming
│ │ ├── DRenameHandler.cs
│ │ ├── DRenameNameDialog.cs
│ │ └── DRenameRefactoring.cs
│ ├── TextDocumentAdapter.cs
│ ├── DustMiteIntegration
│ │ └── DustMite.cs
│ ├── RefactoringCommandsExtension.cs
│ ├── DRefactoringContext.cs
│ ├── ImportSymbolSelectionDlg.cs
│ └── SortImportsCommandHandler.cs
├── AssemblyInfo.cs
├── DLanguageBinding.cs
├── ProjectFormats.xml
├── GuiBuilder
│ ├── GtkDProjectServiceExtension.cs
│ ├── ProjectResourceProvider.cs
│ └── GuiBuilderWindow.cs
├── Resolver
│ └── MonoDParseCacheView.cs
├── DietTemplateSyntaxDefinition.xml
├── Gui
│ ├── EditorPathbarProvider.cs
│ └── MixinInsightExtension.cs
├── gtk-gui
│ ├── MonoDevelop.D.ProjectDependenciesWidget.cs
│ ├── MonoDevelop.D.OptionPanels.DubOptionPanel.cs
│ ├── MonoDevelop.D.ResourcesCompilerOptionsPanel.cs
│ ├── MonoDevelop.D.ImportSymbolSelectionDlg.cs
│ ├── generated.cs
│ └── MonoDevelop.D.OptionPanels.EditCompilerName.cs
├── Completion
│ ├── AstUpdater.cs
│ ├── TooltipInfoGen.cs
│ └── TooltipMarkupGen.cs
└── Highlighting
│ ├── HighlightUsagesExtension.cs
│ └── DietTemplateSyntaxMode.cs
├── addin-project.xml
├── make symlink.bat
├── license.txt
├── MonoDevelop.DBinding.sln
└── readme.md
/ext/Xwt.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aBothe/Mono-D/HEAD/ext/Xwt.dll
--------------------------------------------------------------------------------
/ext/libstetic.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aBothe/Mono-D/HEAD/ext/libstetic.dll
--------------------------------------------------------------------------------
/ext/Mono.Addins.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aBothe/Mono-D/HEAD/ext/Mono.Addins.dll
--------------------------------------------------------------------------------
/ext/libsteticui.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aBothe/Mono-D/HEAD/ext/libsteticui.dll
--------------------------------------------------------------------------------
/ext/Mono.Debugging.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aBothe/Mono-D/HEAD/ext/Mono.Debugging.dll
--------------------------------------------------------------------------------
/ext/Mono.TextEditor.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aBothe/Mono-D/HEAD/ext/Mono.TextEditor.dll
--------------------------------------------------------------------------------
/ext/MonoDevelop.Core.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aBothe/Mono-D/HEAD/ext/MonoDevelop.Core.dll
--------------------------------------------------------------------------------
/ext/MonoDevelop.Ide.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aBothe/Mono-D/HEAD/ext/MonoDevelop.Ide.dll
--------------------------------------------------------------------------------
/ext/Newtonsoft.Json.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aBothe/Mono-D/HEAD/ext/Newtonsoft.Json.dll
--------------------------------------------------------------------------------
/ext/Mono.Addins.Setup.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aBothe/Mono-D/HEAD/ext/Mono.Addins.Setup.dll
--------------------------------------------------------------------------------
/ext/MonoDevelop.GtkCore.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aBothe/Mono-D/HEAD/ext/MonoDevelop.GtkCore.dll
--------------------------------------------------------------------------------
/.gitmodules:
--------------------------------------------------------------------------------
1 | [submodule "Parser"]
2 | path = Parser
3 | url = https://github.com/aBothe/D_Parser.git
4 |
--------------------------------------------------------------------------------
/ext/MonoDevelop.Debugger.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aBothe/Mono-D/HEAD/ext/MonoDevelop.Debugger.dll
--------------------------------------------------------------------------------
/ext/ICSharpCode.NRefactory.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aBothe/Mono-D/HEAD/ext/ICSharpCode.NRefactory.dll
--------------------------------------------------------------------------------
/ext/ICSharpCode.SharpZipLib.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aBothe/Mono-D/HEAD/ext/ICSharpCode.SharpZipLib.dll
--------------------------------------------------------------------------------
/ext/MonoDevelop.Refactoring.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aBothe/Mono-D/HEAD/ext/MonoDevelop.Refactoring.dll
--------------------------------------------------------------------------------
/ext/MonoDevelop.SourceEditor2.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aBothe/Mono-D/HEAD/ext/MonoDevelop.SourceEditor2.dll
--------------------------------------------------------------------------------
/MonoDevelop.DBinding/icons/out-16.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aBothe/Mono-D/HEAD/MonoDevelop.DBinding/icons/out-16.png
--------------------------------------------------------------------------------
/MonoDevelop.DBinding/icons/ref-16.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aBothe/Mono-D/HEAD/MonoDevelop.DBinding/icons/ref-16.png
--------------------------------------------------------------------------------
/ext/ICSharpCode.NRefactory.CSharp.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aBothe/Mono-D/HEAD/ext/ICSharpCode.NRefactory.CSharp.dll
--------------------------------------------------------------------------------
/ext/MonoDevelop.DesignerSupport.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aBothe/Mono-D/HEAD/ext/MonoDevelop.DesignerSupport.dll
--------------------------------------------------------------------------------
/MonoDevelop.DBinding/icons/dfile16.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aBothe/Mono-D/HEAD/MonoDevelop.DBinding/icons/dfile16.png
--------------------------------------------------------------------------------
/MonoDevelop.DBinding/icons/dfile32.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aBothe/Mono-D/HEAD/MonoDevelop.DBinding/icons/dfile32.png
--------------------------------------------------------------------------------
/MonoDevelop.DBinding/icons/dproj16.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aBothe/Mono-D/HEAD/MonoDevelop.DBinding/icons/dproj16.png
--------------------------------------------------------------------------------
/MonoDevelop.DBinding/icons/dproj32.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aBothe/Mono-D/HEAD/MonoDevelop.DBinding/icons/dproj32.png
--------------------------------------------------------------------------------
/MonoDevelop.DBinding/icons/lazy-16.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aBothe/Mono-D/HEAD/MonoDevelop.DBinding/icons/lazy-16.png
--------------------------------------------------------------------------------
/MonoDevelop.DBinding/icons/static-16.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aBothe/Mono-D/HEAD/MonoDevelop.DBinding/icons/static-16.png
--------------------------------------------------------------------------------
/MonoDevelop.DBinding/icons/d-asm-avx-16.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aBothe/Mono-D/HEAD/MonoDevelop.DBinding/icons/d-asm-avx-16.png
--------------------------------------------------------------------------------
/MonoDevelop.DBinding/icons/d-asm-fpu-16.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aBothe/Mono-D/HEAD/MonoDevelop.DBinding/icons/d-asm-fpu-16.png
--------------------------------------------------------------------------------
/MonoDevelop.DBinding/icons/d-asm-mmx-16.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aBothe/Mono-D/HEAD/MonoDevelop.DBinding/icons/d-asm-mmx-16.png
--------------------------------------------------------------------------------
/MonoDevelop.DBinding/icons/d-asm-sse-16.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aBothe/Mono-D/HEAD/MonoDevelop.DBinding/icons/d-asm-sse-16.png
--------------------------------------------------------------------------------
/MonoDevelop.DBinding/icons/d-asm-sse2-16.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aBothe/Mono-D/HEAD/MonoDevelop.DBinding/icons/d-asm-sse2-16.png
--------------------------------------------------------------------------------
/MonoDevelop.DBinding/icons/d-asm-sse3-16.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aBothe/Mono-D/HEAD/MonoDevelop.DBinding/icons/d-asm-sse3-16.png
--------------------------------------------------------------------------------
/MonoDevelop.DBinding/icons/d-asm-x64-16.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aBothe/Mono-D/HEAD/MonoDevelop.DBinding/icons/d-asm-x64-16.png
--------------------------------------------------------------------------------
/MonoDevelop.DBinding/icons/d-asm-x86-16.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aBothe/Mono-D/HEAD/MonoDevelop.DBinding/icons/d-asm-x86-16.png
--------------------------------------------------------------------------------
/MonoDevelop.DBinding/icons/d-asm-sse4.1-16.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aBothe/Mono-D/HEAD/MonoDevelop.DBinding/icons/d-asm-sse4.1-16.png
--------------------------------------------------------------------------------
/MonoDevelop.DBinding/icons/d-asm-sse4.2-16.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aBothe/Mono-D/HEAD/MonoDevelop.DBinding/icons/d-asm-sse4.2-16.png
--------------------------------------------------------------------------------
/MonoDevelop.DBinding/icons/d-asm-ssse3-16.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aBothe/Mono-D/HEAD/MonoDevelop.DBinding/icons/d-asm-ssse3-16.png
--------------------------------------------------------------------------------
/MonoDevelop.DBinding/icons/element-alias-16.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aBothe/Mono-D/HEAD/MonoDevelop.DBinding/icons/element-alias-16.png
--------------------------------------------------------------------------------
/MonoDevelop.DBinding/icons/element-local-16.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aBothe/Mono-D/HEAD/MonoDevelop.DBinding/icons/element-local-16.png
--------------------------------------------------------------------------------
/MonoDevelop.DBinding/icons/element-local-16.psd:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aBothe/Mono-D/HEAD/MonoDevelop.DBinding/icons/element-local-16.psd
--------------------------------------------------------------------------------
/MonoDevelop.DBinding/icons/element-union-16.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aBothe/Mono-D/HEAD/MonoDevelop.DBinding/icons/element-union-16.png
--------------------------------------------------------------------------------
/MonoDevelop.DBinding/icons/element-parameter-16.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aBothe/Mono-D/HEAD/MonoDevelop.DBinding/icons/element-parameter-16.png
--------------------------------------------------------------------------------
/MonoDevelop.DBinding/icons/element-abstract-class-16.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aBothe/Mono-D/HEAD/MonoDevelop.DBinding/icons/element-abstract-class-16.png
--------------------------------------------------------------------------------
/MonoDevelop.DBinding/icons/element-abstract-method-16.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aBothe/Mono-D/HEAD/MonoDevelop.DBinding/icons/element-abstract-method-16.png
--------------------------------------------------------------------------------
/MonoDevelop.DBinding/Building/CompilerPresets/ConfigPresets.resources:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aBothe/Mono-D/HEAD/MonoDevelop.DBinding/Building/CompilerPresets/ConfigPresets.resources
--------------------------------------------------------------------------------
/MonoDevelop.DBinding/Projects/Dub/DefinitionFormats/JSON/JSONThing.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace MonoDevelop.D.Projects.Dub.DefinitionFormats
4 | {
5 | public interface JSONThing{ }
6 | }
7 |
8 |
--------------------------------------------------------------------------------
/MonoDevelop.DBinding/Profiler/Commands/ProfilerCommands.cs:
--------------------------------------------------------------------------------
1 |
2 | namespace MonoDevelop.D.Profiler.Commands
3 | {
4 | public enum ProfilerCommands
5 | {
6 | SwitchProfilerMode,
7 | }
8 | }
9 |
10 |
--------------------------------------------------------------------------------
/MonoDevelop.DBinding/Projects/DConfigurationMode.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace MonoDevelop.D
4 | {
5 | [Flags]
6 | public enum DConfigurationMode
7 | {
8 | Default,
9 | Unittest,
10 | Profile,
11 | }
12 | }
13 |
14 |
--------------------------------------------------------------------------------
/MonoDevelop.DBinding/Projects/Dub/DefinitionFormats/JSON/JSONValueLeaf.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace MonoDevelop.D.Projects.Dub.DefinitionFormats
4 | {
5 | public class JSONValueLeaf : JSONThing
6 | {
7 | public string Value { get; set; }
8 | }
9 | }
10 |
11 |
--------------------------------------------------------------------------------
/MonoDevelop.DBinding/Projects/ProjectJsonConfig.cs:
--------------------------------------------------------------------------------
1 | namespace MonoDevelop.D.Projects
2 | {
3 | public class ExtendedProjectConfig
4 | {
5 | public string BuildCommand;
6 | public string BuildArguments;
7 | public string RunCommand;
8 | public string RunArguments;
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/addin-project.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | MonoDevelop.DBinding/bin/Debug/MonoDevelop.D.dll
4 | MonoDevelop.DBinding.sln
5 | Debug
6 |
7 |
8 |
--------------------------------------------------------------------------------
/MonoDevelop.DBinding/Projects/Dub/DefinitionFormats/PackageJson.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | namespace MonoDevelop.D.Projects.Dub.DefinitionFormats
8 | {
9 | class PackageJson : DubJson
10 | {
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/MonoDevelop.DBinding/Projects/Dub/DefinitionFormats/JSON/JSONArray.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 |
4 | namespace MonoDevelop.D.Projects.Dub.DefinitionFormats
5 | {
6 | public class JSONArray : JSONThing
7 | {
8 | public readonly List Items = new List();
9 | }
10 | }
11 |
12 |
--------------------------------------------------------------------------------
/MonoDevelop.DBinding/Debugging/DExecutionCommand.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using MonoDevelop.Core.Execution;
3 |
4 | namespace MonoDevelop.D.Debugging
5 | {
6 | public class DExecutionCommand : NativeExecutionCommand
7 | {
8 | public DExecutionCommand (string exe, string args = null) : base(exe, args)
9 | {
10 | }
11 | }
12 | }
13 |
14 |
--------------------------------------------------------------------------------
/make symlink.bat:
--------------------------------------------------------------------------------
1 | @echo off
2 |
3 | rem Creates a symlink between the Mono-D output directory and the addins dictionary of MonoDevelop
4 | rem to save copying the lib files over and over again
5 |
6 | rem TODO: Fit to target path
7 | mklink /D /J "%APPDATA%\..\Local\XamarinStudio-5.0\LocalInstall\Addins\mono-d" MonoDevelop.DBinding\bin\Debug
8 |
9 | pause
--------------------------------------------------------------------------------
/MonoDevelop.DBinding/Formatting/DPolicy.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | True
4 | True
5 | True
6 |
--------------------------------------------------------------------------------
/MonoDevelop.DBinding/Projects/Dub/DefinitionFormats/JSON/JSONObject.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 |
4 | namespace MonoDevelop.D.Projects.Dub.DefinitionFormats
5 | {
6 | public class JSONObject : JSONThing
7 | {
8 | public readonly Dictionary Properties = new Dictionary();
9 | }
10 | }
11 |
12 |
--------------------------------------------------------------------------------
/MonoDevelop.DBinding/Unittest/Commands/UnittestCommands.cs:
--------------------------------------------------------------------------------
1 | //
2 | // UnittestCommands.cs
3 | //
4 | // Author:
5 | // Foerdi
6 | //
7 | // https://github.com/aBothe/Mono-D/pull/334
8 | //
9 | // Copyright (c) 2013
10 |
11 |
12 | namespace MonoDevelop.D.Unittest.Commands
13 | {
14 | public enum UnittestCommands
15 | {
16 | RunAll,
17 | }
18 | }
19 |
20 |
--------------------------------------------------------------------------------
/MonoDevelop.DBinding/OptionPanels/EditCompilerName.cs:
--------------------------------------------------------------------------------
1 |
2 | namespace MonoDevelop.D.OptionPanels
3 | {
4 | public partial class EditCompilerName : Gtk.Dialog
5 | {
6 | public EditCompilerName ()
7 | {
8 | this.Build ();
9 | }
10 |
11 | public string PresetName {
12 | get { return txtPresetName.Text.Trim (); }
13 | set { txtPresetName.Text = value; }
14 | }
15 | }
16 | }
17 |
18 |
--------------------------------------------------------------------------------
/MonoDevelop.DBinding/Parser/FoldingParser.cs:
--------------------------------------------------------------------------------
1 | using System.IO;
2 | using MonoDevelop.Ide.TypeSystem;
3 |
4 | namespace MonoDevelop.D.Parser
5 | {
6 | public class FoldingParser : IFoldingParser
7 | {
8 | public ParsedDocument Parse(string fileName, string content)
9 | {
10 | using (var s = new StringReader(content))
11 | return DParserWrapper.LastParsedMod = DParserWrapper.Instance.Parse(true, fileName, s);
12 | }
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/MonoDevelop.DBinding/Projects/Dub/DefinitionFormats/SDL/SDLObject.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | namespace MonoDevelop.D.Projects.Dub.DefinitionFormats.SDL
8 | {
9 | public class SDLObject : SDLDeclaration
10 | {
11 | public readonly SDLDeclaration[] Children;
12 |
13 | public SDLObject(string name, IEnumerable> attributes, SDLDeclaration[] children) : base(name, attributes) {
14 | Children = children;
15 | }
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/MonoDevelop.DBinding/templates/EmptyRCFile.xft.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
7 | <_Name>Resource Script
8 | md-resource-file-icon
9 | <_Category>Misc
10 | <_Description>Creates an empty resource script (*.rc) for Win32 Applications.
11 |
12 |
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/MonoDevelop.DBinding/templates/EmptyDFile.xft.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
7 | <_Name>Empty File
8 | d-file32
9 | <_Category>General
10 | D
11 | <_Description>Creates an empty D source file.
12 |
13 |
14 |
15 |
16 |
18 |
19 |
--------------------------------------------------------------------------------
/MonoDevelop.DBinding/Formatting/Indentation/doc.txt:
--------------------------------------------------------------------------------
1 | Module info:
2 |
3 | DTextEditorIndentation.cs contains the binding between the Indent engine and MonoDevelop's Text Editor component.
4 |
5 | DIndentationTracker.cs is an intermediate helper that creates indent strings (tabs, spaces) for specific locations inside a document.
6 |
7 | DIndentEngine is the main engine that flies through the code roughly and puts/pops items on/off the indent stack for instance
8 | after it has hit a { or } in the code.
9 |
10 | IndentStack helps the IndentEngine to keep track of the indents that were required theoretically.
--------------------------------------------------------------------------------
/MonoDevelop.DBinding/Projects/Dub/DefinitionFormats/SDL/SDLDeclaration.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | namespace MonoDevelop.D.Projects.Dub.DefinitionFormats.SDL
8 | {
9 | public class SDLDeclaration
10 | {
11 | public readonly string Name;
12 | public readonly Tuple[] Attributes;
13 |
14 | public SDLDeclaration(string name, IEnumerable> attributes)
15 | {
16 | this.Name = name;
17 | this.Attributes = attributes.ToArray();
18 | }
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/MonoDevelop.DBinding/Profiler/Gui/CodeCoverageEditorExtension.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using MonoDevelop.Ide.Gui.Content;
3 |
4 | namespace MonoDevelop.D.Profiler.Gui
5 | {
6 | public class CodeCoverageEditorExtension : TextEditorExtension
7 | {
8 | public override bool ExtendsEditor (MonoDevelop.Ide.Gui.Document doc, IEditableTextBuffer editor)
9 | {
10 | return doc.IsFile && DLanguageBinding.IsDFile(doc.FileName);
11 | }
12 |
13 | public override void Initialize ()
14 | {
15 | Document.Window.AttachViewContent (new CodeCoverageView (Document));
16 | base.Initialize ();
17 | }
18 | }
19 | }
20 |
21 |
--------------------------------------------------------------------------------
/license.txt:
--------------------------------------------------------------------------------
1 |
2 | Copyright 2012 Alexander Bothe
3 |
4 | Licensed under the Apache License, Version 2.0 (the "License");
5 | you may not use this file except in compliance with the License.
6 | You may obtain a copy of the License at
7 |
8 | http://www.apache.org/licenses/LICENSE-2.0
9 |
10 | Unless required by applicable law or agreed to in writing, software
11 | distributed under the License is distributed on an "AS IS" BASIS,
12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | See the License for the specific language governing permissions and
14 | limitations under the License.
15 |
--------------------------------------------------------------------------------
/MonoDevelop.DBinding/templates/EmptyDClass.xft.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
7 | <_Name>Empty Class
8 | d-file32
9 | <_Category>General
10 | D
11 | <_Description>Creates a new D class
12 |
13 |
14 |
15 |
16 |
26 |
27 |
--------------------------------------------------------------------------------
/MonoDevelop.DBinding/Refactoring/CodeActions/DCodeActionSource.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 | using MonoDevelop.CodeActions;
3 |
4 | namespace MonoDevelop.D.Refactoring.CodeActions
5 | {
6 | public class DCodeActionSource : ICodeActionProviderSource
7 | {
8 | readonly List providers = new List ();
9 |
10 | public DCodeActionSource ()
11 | {
12 | //TODO: Add nice code refactorings like "Extract Method", "Create Class of selected identifier", "Optimize out while(true)" and so on..
13 | }
14 |
15 | public IEnumerable GetProviders ()
16 | {
17 | return providers;
18 | }
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/MonoDevelop.DBinding/OptionPanels/ProjectIncludesWidgetBinding.cs:
--------------------------------------------------------------------------------
1 | using MonoDevelop.Ide.Gui.Dialogs;
2 | using Gtk;
3 | using MonoDevelop.D.Projects;
4 |
5 | namespace MonoDevelop.D.OptionsPanels
6 | {
7 | public class ProjectIncludesWidgetBinding : MultiConfigItemOptionsPanel
8 | {
9 | ProjectIncludesWidget w;
10 |
11 | public override Widget CreatePanelWidget ()
12 | {
13 | if(w==null)
14 | w = new ProjectIncludesWidget(ConfiguredProject as DProject, CurrentConfiguration as DProjectConfiguration);
15 |
16 | return w;
17 | }
18 |
19 | public override void ApplyChanges ()
20 | {
21 | w.Store();
22 | }
23 |
24 | public override void LoadConfigData ()
25 | {
26 | w.Load();
27 | }
28 | }
29 | }
30 |
31 |
--------------------------------------------------------------------------------
/MonoDevelop.DBinding/OptionPanels/ProjectDependencyPanelBinding.cs:
--------------------------------------------------------------------------------
1 | using MonoDevelop.Ide.Gui.Dialogs;
2 | using Gtk;
3 | using MonoDevelop.D.Projects;
4 |
5 | namespace MonoDevelop.D.OptionsPanels
6 | {
7 | public class ProjectDependencyPanelBinding : MultiConfigItemOptionsPanel
8 | {
9 | ProjectDependenciesWidget w;
10 |
11 | public override Widget CreatePanelWidget ()
12 | {
13 | if(w==null)
14 | w = new ProjectDependenciesWidget(ConfiguredProject as DProject, CurrentConfiguration as DProjectConfiguration);
15 |
16 | return w;
17 | }
18 |
19 | public override void ApplyChanges ()
20 | {
21 | w.Store();
22 | }
23 |
24 | public override void LoadConfigData ()
25 | {
26 | w.Load();
27 | }
28 | }
29 | }
30 |
31 |
--------------------------------------------------------------------------------
/MonoDevelop.DBinding/templates/AnsiFile.cs:
--------------------------------------------------------------------------------
1 | using MonoDevelop.Ide.Templates;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.IO;
5 | using System.Linq;
6 | using System.Text;
7 |
8 | namespace MonoDevelop.D.templates
9 | {
10 | class AnsiFile : TextFileDescriptionTemplate
11 | {
12 | public override System.IO.Stream CreateFileContent(MonoDevelop.Projects.SolutionItem policyParent, MonoDevelop.Projects.Project project, string language, string fileName, string identifier)
13 | {
14 | var s = base.CreateFileContent(policyParent, project, language, fileName, identifier);
15 |
16 | using (var r = new StreamReader(s))
17 | return new MemoryStream(Encoding.ASCII.GetBytes(r.ReadToEnd()), false);
18 | }
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/MonoDevelop.DBinding/Formatting/FormattingPanel.cs:
--------------------------------------------------------------------------------
1 | using MonoDevelop.Ide.Gui.Dialogs;
2 | using Gtk;
3 |
4 | namespace MonoDevelop.D.Formatting
5 | {
6 | class FormattingPanel : MimeTypePolicyOptionsPanel
7 | {
8 | FormattingPanelWidget panel;
9 | DFormattingPolicy pol;
10 |
11 | public override Widget CreatePanelWidget ()
12 | {
13 | return panel = new FormattingPanelWidget ();
14 | }
15 |
16 | protected override void LoadFrom (DFormattingPolicy policy)
17 | {
18 | panel.Load(pol = policy);
19 | }
20 |
21 | protected override DFormattingPolicy GetPolicy ()
22 | {
23 | if (pol == null)
24 | pol = new DFormattingPolicy();
25 |
26 | panel.Save(pol);
27 | return pol;
28 | }
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/MonoDevelop.DBinding/templates/EmptyProject.xpt.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | <_Name>Empty D Project
7 | <_Category>D
8 | d-project32
9 | D
10 | <_Description>Creates an empty D solution.
11 |
12 |
13 |
14 |
15 |
16 |
21 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/MonoDevelop.DBinding/Formatting/Indentation/DIndentEngine.cs:
--------------------------------------------------------------------------------
1 | using D_Parser.Formatting;
2 | using D_Parser.Formatting.Indent;
3 | using MonoDevelop.Ide.Gui.Content;
4 |
5 | namespace MonoDevelop.D.Formatting.Indentation
6 | {
7 | public class DIndentEngine : IndentEngine, IDocumentStateEngine, DFormattingOptionsFactory
8 | {
9 | DFormattingPolicy policy;
10 | TextStylePolicy textStyle;
11 |
12 | public DIndentEngine(DFormattingPolicy policy, TextStylePolicy textStyle)
13 | : base(policy.Options, textStyle.TabsToSpaces, textStyle.IndentWidth, policy.KeepAlignmentSpaces)
14 | {
15 | this.policy = policy;
16 | this.textStyle = textStyle;
17 | }
18 |
19 | protected override IndentEngine Construct()
20 | {
21 | return new DIndentEngine(policy, textStyle);
22 | }
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/MonoDevelop.DBinding/templates/StaticLibrary.xpt.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | <_Name>Static Library Project
7 | <_Category>D
8 | d-project32
9 | D
10 | <_Description>Creates a static library
11 |
12 |
13 |
14 |
15 |
16 |
21 |
22 |
23 |
24 |
31 |
32 |
33 |
34 |
35 |
--------------------------------------------------------------------------------
/MonoDevelop.DBinding/Refactoring/Renaming/DRenameHandler.cs:
--------------------------------------------------------------------------------
1 | // by Alexander Bothe (info@alexanderbothe.com)
2 | using D_Parser.Dom;
3 | using MonoDevelop.Refactoring;
4 |
5 | namespace MonoDevelop.D.Refactoring
6 | {
7 | public class DRenameHandler : AbstractRefactoringCommandHandler
8 | {
9 | protected override void Update (RefactoringOptions options, MonoDevelop.Components.Commands.CommandInfo info)
10 | {
11 | var renameRefactoring = new DRenameRefactoring ();
12 | if (!renameRefactoring.IsValid (options))
13 | info.Bypass = true;
14 | }
15 |
16 | /// must be a DSymbol
17 | protected override void Run(object data)
18 | {
19 | var doc = Ide.IdeApp.Workbench.ActiveDocument;
20 |
21 | if(doc!=null)
22 | this.Run(new RefactoringOptions(doc) { SelectedItem = data });
23 | }
24 |
25 | protected override void Run (RefactoringOptions options)
26 | {
27 | var renameRefactoring = new DRenameRefactoring ();
28 | if (renameRefactoring.IsValid (options))
29 | renameRefactoring.Run (options);
30 | }
31 | }
32 | }
33 |
34 |
--------------------------------------------------------------------------------
/MonoDevelop.DBinding/Debugging/LazyEvaluationValue.cs:
--------------------------------------------------------------------------------
1 | using D_Parser.Resolver;
2 | using D_Parser.Resolver.ExpressionSemantics;
3 | using System;
4 | using System.Collections.Generic;
5 | using System.Linq;
6 | using System.Text;
7 |
8 | namespace MonoDevelop.D.Debugging
9 | {
10 | ///
11 | /// Used when child items of a value shall not be evaluated yet because their values might be too complex to evaluate
12 | /// and thus must explicitly be acquired by the user.
13 | ///
14 | public class LazyEvaluationValue : ISymbolValue
15 | {
16 |
17 | public AbstractType RepresentedType
18 | {
19 | get;
20 | set;
21 | }
22 |
23 | public R Accept(ISymbolValueVisitor v)
24 | {
25 | throw new NotImplementedException();
26 | }
27 |
28 | public bool Equals(ISymbolValue other)
29 | {
30 | throw new NotImplementedException();
31 | }
32 |
33 | public string ToCode()
34 | {
35 | throw new NotImplementedException();
36 | }
37 |
38 | public void Accept(ISymbolValueVisitor vis)
39 | {
40 | throw new NotImplementedException();
41 | }
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/MonoDevelop.DBinding/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 |
3 | // Information about this assembly is defined by the following attributes.
4 | // Change them to the values specific to your project.
5 |
6 | [assembly: AssemblyTitle("MonoDevelop.D")]
7 | [assembly: AssemblyDescription("")]
8 | [assembly: AssemblyConfiguration("")]
9 | [assembly: AssemblyCompany("")]
10 | [assembly: AssemblyProduct("")]
11 | [assembly: AssemblyCopyright("Alexander Bothe")]
12 | [assembly: AssemblyTrademark("")]
13 | [assembly: AssemblyCulture("")]
14 |
15 | // The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}".
16 | // The form "{Major}.{Minor}.*" will automatically update the build and revision,
17 | // and "{Major}.{Minor}.{Build}.*" will update just the revision.
18 |
19 | [assembly: AssemblyVersion("1.0.0.0")]
20 |
21 | // The following attributes are used to specify the signing key for the assembly,
22 | // if desired. See the Mono documentation for more information about signing.
23 |
24 | //[assembly: AssemblyDelaySign(false)]
25 | //[assembly: AssemblyKeyFile("")]
26 |
27 |
--------------------------------------------------------------------------------
/MonoDevelop.DBinding/Projects/DProjectBinding.cs:
--------------------------------------------------------------------------------
1 | using MonoDevelop.Projects;
2 | using System.Xml;
3 | using System.IO;
4 |
5 | namespace MonoDevelop.D.Projects
6 | {
7 | public class DProjectBinding:IProjectBinding
8 | {
9 | public bool CanCreateSingleFileProject(string sourceFile)
10 | {
11 | return DLanguageBinding.IsDFile(sourceFile);
12 | }
13 |
14 | public Project CreateProject(ProjectCreateInformation info, XmlElement projectOptions)
15 | {
16 | return new DProject(info,projectOptions);
17 | }
18 |
19 | public Project CreateSingleFileProject(string sourceFile)
20 | {
21 | // Create project information using sourceFile's path
22 | var info = new ProjectCreateInformation()
23 | {
24 | ProjectName = Path.GetFileNameWithoutExtension(sourceFile),
25 | SolutionPath = Path.GetDirectoryName(sourceFile),
26 | ProjectBasePath = Path.GetDirectoryName(sourceFile),
27 | };
28 |
29 | var prj = CreateProject(info, null);
30 | prj.AddFile(sourceFile);
31 | return prj;
32 | }
33 |
34 | public string Name
35 | {
36 | get { return "D"; }
37 | }
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/MonoDevelop.DBinding/DLanguageBinding.cs:
--------------------------------------------------------------------------------
1 | using MonoDevelop.Core;
2 | using MonoDevelop.Projects;
3 |
4 | namespace MonoDevelop.D
5 | {
6 | public class DLanguageBinding: ILanguageBinding
7 | {
8 | public static bool IsDFile(string fileName)
9 | {
10 | return fileName.EndsWith(".d", System.StringComparison.OrdinalIgnoreCase) || fileName.EndsWith(".di", System.StringComparison.OrdinalIgnoreCase);
11 | }
12 |
13 | public FilePath GetFileName(FilePath fileNameWithoutExtension)
14 | {
15 | return fileNameWithoutExtension.ChangeExtension(".d");
16 | }
17 |
18 | public bool IsSourceCodeFile(FilePath fileName)
19 | {
20 | return IsDFile(fileName);
21 | }
22 |
23 | public string Language {
24 | get {
25 | return "D";
26 | }
27 | }
28 |
29 | public string SingleLineCommentTag {
30 | get {
31 | return "//";
32 | }
33 | }
34 |
35 | public string BlockCommentStartTag {
36 | get {
37 | return "/*";
38 | }
39 | }
40 |
41 | public string BlockCommentEndTag {
42 | get {
43 | return "*/";
44 | }
45 | }
46 | }
47 | }
48 |
49 |
--------------------------------------------------------------------------------
/MonoDevelop.DBinding/ProjectFormats.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/MonoDevelop.DBinding/Profiler/Gui/DProfilerPad.cs:
--------------------------------------------------------------------------------
1 | using MonoDevelop.Ide.Gui.Pads;
2 | using MonoDevelop.D.Profiler.Gui;
3 | using MonoDevelop.Ide.Gui.Components;
4 | using MonoDevelop.Ide.Gui;
5 | using MonoDevelop.D.Profiler.Commands;
6 | using MonoDevelop.D.Projects;
7 |
8 | namespace MonoDevelop.D.Profiler.Gui
9 | {
10 | public class DProfilerPad : TreeViewPad
11 | {
12 | private ProfilerPadWidget widget;
13 | public TraceLogParser TraceParser {get; private set;}
14 |
15 | public ProfilerPadWidget Widget
16 | {
17 | get { return widget; }
18 | }
19 |
20 | public DProfilerPad ()
21 | {
22 | widget = new ProfilerPadWidget(this);
23 | TraceParser = new TraceLogParser(widget);
24 | }
25 |
26 | public override void Initialize (NodeBuilder[] builders, TreePadOption[] options, string contextMenuPath)
27 | {
28 | base.Initialize (builders, options, contextMenuPath);
29 |
30 | widget.ShowAll();
31 | }
32 |
33 | public override Gtk.Widget Control
34 | {
35 | get { return widget; }
36 | }
37 |
38 | public void AnalyseTraceFile()
39 | {
40 | TraceParser.Parse();
41 | }
42 | }
43 | }
44 |
45 |
--------------------------------------------------------------------------------
/ext/update deps.bat:
--------------------------------------------------------------------------------
1 | @echo off
2 |
3 | set xsbin=C:\Program Files (x86)\Xamarin Studio\bin
4 | set xsaddin=C:\Program Files (x86)\Xamarin Studio\Addins
5 |
6 | echo \bin:
7 | copy "%xsbin%\Mono.Addins.dll" .
8 | copy "%xsbin%\Mono.Addins.Setup.dll" .
9 | copy "%xsbin%\Mono.Debugging.dll" .
10 | copy "%xsbin%\Mono.TextEditor.dll" .
11 | copy "%xsbin%\MonoDevelop.Core.dll" .
12 | copy "%xsbin%\MonoDevelop.Ide.dll" .
13 | copy "%xsbin%\Newtonsoft.Json.dll" .
14 | copy "%xsbin%\ICSharpCode.NRefactory.dll" .
15 | copy "%xsbin%\ICSharpCode.NRefactory.CSharp.dll" .
16 | copy "%xsbin%\ICSharpCode.SharpZipLib.dll" .
17 | copy "%xsbin%\Xwt.dll" .
18 |
19 | echo \Addins:
20 | copy "%xsaddin%\MonoDevelop.Debugger\MonoDevelop.Debugger.dll" .
21 | copy "%xsaddin%\MonoDevelop.DesignerSupport\MonoDevelop.DesignerSupport.dll" .
22 | copy "%xsaddin%\MonoDevelop.GtkCore\MonoDevelop.GtkCore.dll" .
23 | copy "%xsaddin%\MonoDevelop.GtkCore\libsteticui.dll" .
24 | copy "%xsaddin%\MonoDevelop.GtkCore\libstetic.dll" .
25 | copy "%xsaddin%\MonoDevelop.Refactoring\MonoDevelop.Refactoring.dll" .
26 | copy "%xsaddin%\DisplayBindings\SourceEditor\MonoDevelop.SourceEditor2.dll" .
27 |
28 |
--------------------------------------------------------------------------------
/MonoDevelop.DBinding/Formatting/FormattingPanelWidget.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace MonoDevelop.D.Formatting
4 | {
5 | [System.ComponentModel.ToolboxItem(true)]
6 | public partial class FormattingPanelWidget : Gtk.Bin
7 | {
8 | public void Save(DFormattingPolicy p)
9 | {
10 | if (p == null)
11 | throw new ArgumentNullException("p");
12 |
13 | p.CommentOutStandardHeaders = chk_CommentOutStdHeaders.Active;
14 | p.InsertStarAtCommentNewLine = chk_InsertStarAtCommentNewLine.Active;
15 | p.KeepAlignmentSpaces = check_KeepAlignmentSpaces.Active;
16 | p.IndentPastedCodeLines = check_IndentPastedCodeLines.Active;
17 | }
18 |
19 | public void Load(DFormattingPolicy p)
20 | {
21 | if (p == null)
22 | throw new ArgumentNullException("p");
23 |
24 | chk_CommentOutStdHeaders.Active = p.CommentOutStandardHeaders;
25 | chk_InsertStarAtCommentNewLine.Active = p.InsertStarAtCommentNewLine;
26 | check_KeepAlignmentSpaces.Active = p.KeepAlignmentSpaces;
27 | check_IndentPastedCodeLines.Active = p.IndentPastedCodeLines;
28 | }
29 |
30 | public FormattingPanelWidget ()
31 | {
32 | this.Build ();
33 | }
34 | }
35 | }
36 |
37 |
--------------------------------------------------------------------------------
/MonoDevelop.DBinding/templates/ConsoleProject.xpt.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | <_Name>Console Project
7 | <_Category>D
8 | d-project32
9 | D
10 | <_Description>Creates a simple D Hello World project.
11 |
12 |
13 |
14 |
15 |
16 |
21 |
22 |
23 |
24 | before program returns
34 | stdin.readln();
35 | }
36 | ]]>
37 |
38 |
39 |
40 |
41 |
42 |
43 |
--------------------------------------------------------------------------------
/MonoDevelop.DBinding/Projects/Dub/DubProjectItemTypeHandler.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.IO;
3 | using System.Xml;
4 | using Mono.Addins;
5 | using MonoDevelop.Projects.Formats.MSBuild;
6 | using MonoDevelop.Core;
7 | using MonoDevelop.Projects.Extensions;
8 | using MonoDevelop.Projects;
9 | using MonoDevelop.D.Projects.Dub.DefinitionFormats;
10 |
11 | namespace MonoDevelop.D.Projects.Dub
12 | {
13 | class DubProjectItemTypeHandler : ItemTypeNode
14 | {
15 | public Type ItemType { get { return typeof(DubProject); } }
16 |
17 | public override bool CanHandleItem (SolutionEntityItem item)
18 | {
19 | return ItemType != null && ItemType.IsAssignableFrom (item.GetType ());
20 | }
21 |
22 | public override bool CanHandleFile (string fileName, string typeGuid)
23 | {
24 | return string.Compare (typeGuid, this.Guid, true) == 0 || DubFileManager.Instance.CanLoad (fileName);
25 | }
26 |
27 | public override SolutionEntityItem LoadSolutionItem (IProgressMonitor monitor, string fileName, MSBuildFileFormat expectedFormat, string itemGuid)
28 | {
29 | return DubFileManager.Instance.LoadProject (fileName, Ide.IdeApp.Workspace.GetAllSolutions () [0], monitor);
30 | }
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/MonoDevelop.DBinding/Refactoring/TextDocumentAdapter.cs:
--------------------------------------------------------------------------------
1 | using D_Parser.Refactoring;
2 | using Mono.TextEditor;
3 | using MonoDevelop.Ide.Gui;
4 | using System;
5 | using System.Collections.Generic;
6 | using System.Linq;
7 | using System.Text;
8 |
9 | namespace MonoDevelop.D.Refactoring
10 | {
11 | class TextDocumentAdapter : ITextDocument
12 | {
13 | readonly TextEditorData doc;
14 |
15 | public TextDocumentAdapter(TextEditorData doc)
16 | {
17 | this.doc = doc;
18 | }
19 |
20 | public int Length
21 | {
22 | get {
23 | return doc.Length;
24 | }
25 | }
26 |
27 | public char GetCharAt(int offset)
28 | {
29 | return doc.GetCharAt(offset);
30 | }
31 |
32 | public void Remove(int offset, int length)
33 | {
34 | doc.Remove(offset, length);
35 | }
36 |
37 | public void Insert(int offset, string text)
38 | {
39 | doc.Insert(offset, text);
40 | }
41 |
42 | public int LocationToOffset(int line, int col)
43 | {
44 | return doc.LocationToOffset(line, col);
45 | }
46 |
47 | public int OffsetToLineNumber(int offset)
48 | {
49 | return doc.OffsetToLineNumber(offset);
50 | }
51 |
52 | public string EolMarker
53 | {
54 | get { return doc.EolMarker; }
55 | }
56 |
57 | public string GetLineIndent(int line)
58 | {
59 | return doc.GetLineIndent(line);
60 | }
61 | }
62 | }
63 |
--------------------------------------------------------------------------------
/MonoDevelop.DBinding/OptionPanels/ResourcesCompilerOptions.cs:
--------------------------------------------------------------------------------
1 | using MonoDevelop.D.Building;
2 | using MonoDevelop.Ide.Gui.Dialogs;
3 |
4 | namespace MonoDevelop.D
5 | {
6 | public partial class ResourcesCompilerOptionsPanel : Gtk.Bin
7 | {
8 | public ResourcesCompilerOptionsPanel ()
9 | {
10 | this.Build ();
11 | }
12 |
13 | public void Load()
14 | {
15 | text_CompilerExecutable.Text=Win32ResourceCompiler.Instance. Executable;
16 | text_BuildArgs.Text = Win32ResourceCompiler.Instance.Arguments;
17 | }
18 |
19 | public bool Validate()
20 | {
21 | return text_CompilerExecutable.Text!="" && text_BuildArgs.Text!="";
22 | }
23 |
24 | public void Store()
25 | {
26 | Win32ResourceCompiler.Instance.Executable = text_CompilerExecutable.Text;
27 | Win32ResourceCompiler.Instance.Arguments = text_BuildArgs.Text;
28 | }
29 | }
30 |
31 | public class ResourceCompilerOptionsBinding : OptionsPanel
32 | {
33 | private ResourcesCompilerOptionsPanel panel;
34 |
35 | public override Gtk.Widget CreatePanelWidget ()
36 | {
37 | panel = new ResourcesCompilerOptionsPanel ();
38 | panel.Load();
39 | return panel;
40 | }
41 |
42 | public override bool ValidateChanges()
43 | {
44 | return panel.Validate();
45 | }
46 |
47 | public override void ApplyChanges ()
48 | {
49 | panel.Store ();
50 | }
51 | }
52 | }
53 |
54 |
--------------------------------------------------------------------------------
/MonoDevelop.DBinding/Projects/Dub/DubProjectConfiguration.cs:
--------------------------------------------------------------------------------
1 | using MonoDevelop.Projects;
2 |
3 | namespace MonoDevelop.D.Projects.Dub
4 | {
5 | public class DubProjectConfiguration : ProjectConfiguration
6 | {
7 | public const string DefaultConfigId = "Default";
8 | public DubBuildSettings BuildSettings = new DubBuildSettings();
9 |
10 | public Building.DCompileTarget TargetType
11 | {
12 | get{
13 | string targetType = null;
14 | var prj = base.ParentItem as DubProject;
15 | prj.CommonBuildSettings.TryGetTargetTypeProperty (prj, Selector, ref targetType);
16 | BuildSettings.TryGetTargetTypeProperty (prj, Selector, ref targetType);
17 |
18 | if (targetType == null)
19 | return Building.DCompileTarget.Executable;
20 |
21 | switch (targetType.ToLowerInvariant ()) {
22 | case "shared":
23 | return Building.DCompileTarget.SharedLibrary;
24 | case "static":
25 | return Building.DCompileTarget.StaticLibrary;
26 | default:
27 | return Building.DCompileTarget.Executable;
28 | }
29 | }
30 | }
31 |
32 | public override void CopyFrom (ItemConfiguration conf)
33 | {
34 | var cfg = conf as DubProjectConfiguration;
35 | if (cfg != null) {
36 | BuildSettings = cfg.BuildSettings;
37 | }
38 | base.CopyFrom (conf);
39 | }
40 |
41 | public DubProjectConfiguration()
42 | {
43 | Platform = "AnyCPU";
44 | ExternalConsole = true;
45 | PauseConsoleOutput = true;
46 | DebugMode = true;
47 | }
48 | }
49 | }
50 |
--------------------------------------------------------------------------------
/MonoDevelop.DBinding/GuiBuilder/GtkDProjectServiceExtension.cs:
--------------------------------------------------------------------------------
1 | //
2 | // GtkDProjectServiceExtension.cs
3 | //
4 | // Author:
5 | // Alexander Bothe
6 | //
7 | // Copyright (c) 2014 Alexander Bothe
8 | //
9 | // Permission is hereby granted, free of charge, to any person obtaining a copy
10 | // of this software and associated documentation files (the "Software"), to deal
11 | // in the Software without restriction, including without limitation the rights
12 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13 | // copies of the Software, and to permit persons to whom the Software is
14 | // furnished to do so, subject to the following conditions:
15 | //
16 | // The above copyright notice and this permission notice shall be included in
17 | // all copies or substantial portions of the Software.
18 | //
19 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
25 | // THE SOFTWARE.
26 | using System;
27 | using MonoDevelop.Projects;
28 |
29 | namespace MonoDevelop.D
30 | {
31 | ///
32 | /// Responsible for generating the gtkD-Code when building a project
33 | ///
34 | public class GtkDProjectServiceExtension : ProjectServiceExtension
35 | {
36 | public GtkDProjectServiceExtension ()
37 | {
38 | }
39 | }
40 | }
41 |
42 |
--------------------------------------------------------------------------------
/MonoDevelop.DBinding/Debugging/DebugSymbolValueProvider.cs:
--------------------------------------------------------------------------------
1 | using D_Parser.Dom;
2 | using D_Parser.Dom.Expressions;
3 | using D_Parser.Resolver;
4 | using D_Parser.Resolver.ExpressionSemantics;
5 | using System;
6 | using System.Collections.Generic;
7 | using System.Linq;
8 | using System.Text;
9 |
10 | namespace MonoDevelop.D.Debugging
11 | {
12 | class DebugSymbolValueProvider : StandardValueProvider
13 | {
14 | public readonly DLocalExamBacktrace Backtrace;
15 | Dictionary cache = new Dictionary();
16 |
17 | public class DebugVariable : DVariable
18 | {
19 | public IDBacktraceSymbol Symbol;
20 | }
21 |
22 | public void ResetCache()
23 | {
24 | cache.Clear();
25 | }
26 |
27 | public DebugSymbolValueProvider(DLocalExamBacktrace b, ResolutionContext ctxt)
28 | : base(ctxt)
29 | {
30 | this.Backtrace = b;
31 | }
32 |
33 | public override DVariable GetLocal(string LocalName, IdentifierExpression id = null)
34 | {
35 | Backtrace.TryUpdateStackFrameInfo();
36 | var symb = Backtrace.BacktraceHelper.FindSymbol(LocalName);
37 |
38 | if (symb != null)
39 | {
40 | DebugVariable dv;
41 | if(!cache.TryGetValue(symb, out dv))
42 | cache[symb] = dv = new DebugVariable { Symbol = symb, Name = LocalName };
43 | return dv;
44 | }
45 |
46 | return base.GetLocal(LocalName, id);
47 | }
48 |
49 | public override bool ConstantOnly
50 | {
51 | get { return false; }
52 | set { }
53 | }
54 |
55 | public override ISymbolValue this[DVariable n]
56 | {
57 | get
58 | {
59 | var dv = n as DebugVariable;
60 | if (dv != null)
61 | return Backtrace.EvaluateSymbol(dv.Symbol);
62 |
63 | return base[n];
64 | }
65 | set
66 | {
67 | //TODO?
68 | base[n] = value;
69 | }
70 | }
71 | }
72 | }
73 |
--------------------------------------------------------------------------------
/MonoDevelop.DBinding/Resolver/MonoDParseCacheView.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using D_Parser.Misc;
3 | using System.Collections.Generic;
4 | using D_Parser.Dom;
5 | using MonoDevelop.D.Projects;
6 | using MonoDevelop.D.Building;
7 | using MonoDevelop.D.Projects.Dub;
8 |
9 | namespace MonoDevelop.D
10 | {
11 | public class MonoDParseCacheView : ParseCacheView
12 | {
13 | readonly Dictionary> cache = new Dictionary>();
14 | readonly ISet globalIncludes = new HashSet();
15 |
16 | public MonoDParseCacheView()
17 | {
18 | Add (globalIncludes, DCompilerService.Instance.GetDefaultCompiler ().IncludePaths);
19 | }
20 |
21 | static void Add(ISet results, IEnumerable paths)
22 | {
23 | RootPackage pack;
24 | foreach(var p in paths)
25 | if((pack = GlobalParseCache.GetRootPackage (p)) != null) {
26 | results.Add (pack);
27 | }
28 | }
29 |
30 | public override IEnumerable EnumRootPackagesSurroundingModule (DModule module)
31 | {
32 | if (module == null)
33 | return globalIncludes;
34 |
35 | ISet results;
36 | if (cache.TryGetValue (module, out results))
37 | return results;
38 |
39 | results = new HashSet ();
40 |
41 | foreach(var prj in Ide.IdeApp.Workspace.GetAllProjects()) {
42 | var dprj = prj as AbstractDProject;
43 |
44 | if (dprj == null || !prj.IsFileInProject(module.FileName))
45 | continue;
46 |
47 | Add (results, dprj.GetSourcePaths ());
48 |
49 | Add (results, dprj.IncludePaths);
50 |
51 | if (dprj.LinkedFilePackage != null)
52 | results.Add (dprj.LinkedFilePackage);
53 | }
54 |
55 | if (results.Count == 0)
56 | results = globalIncludes;
57 |
58 | cache [module] = results;
59 | return results;
60 | }
61 | }
62 | }
63 |
64 |
--------------------------------------------------------------------------------
/MonoDevelop.DBinding/DietTemplateSyntaxDefinition.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | //
4 | "
5 |
6 | //-
7 | //
8 |
9 |
10 | block
11 |
12 |
13 |
14 | extends
15 |
16 |
17 |
18 | include
19 |
20 |
21 |
22 | "
23 | "
24 |
25 |
26 | #[a-zA-Z_-][a-zA-Z0-9_-]*
27 | ^\s*(?!block|include|extends)\w+(\.\w[\w-_]*)*
28 |
29 |
30 | \\(['"\\abfnrtv]|x[0-9a-fA-F]{2,4}|0\d\d)
31 |
32 |
33 |
34 | ""
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 | TODO
43 | FIXME
44 | HACK
45 | UNDONE
46 |
47 |
48 |
49 |
50 |
51 | TODO
52 | FIXME
53 | HACK
54 | UNDONE
55 |
56 |
57 | /+
58 | +/
59 |
60 |
61 |
--------------------------------------------------------------------------------
/MonoDevelop.DBinding/templates/SharedLibrary.xpt.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | <_Name>Shared Library Project
7 | <_Category>D
8 | d-project32
9 | D
10 | <_Description>Creates a shared library
11 |
12 |
13 |
14 |
15 |
16 |
21 |
22 |
23 |
38 |
39 |
40 |
70 |
71 |
72 |
73 |
74 |
--------------------------------------------------------------------------------
/MonoDevelop.DBinding/Formatting/DFormattingPolicy.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using D_Parser.Formatting;
3 | using MonoDevelop.Core.Serialization;
4 | using MonoDevelop.Projects.Policies;
5 |
6 | namespace MonoDevelop.D.Formatting
7 | {
8 | [PolicyType("D formatting")]
9 | public class DFormattingPolicy: IEquatable, DFormattingOptionsFactory
10 | {
11 | public DFormattingPolicy()
12 | {
13 | //TODO: Generate default attributes or so
14 | CommentOutStandardHeaders = true;
15 | InsertStarAtCommentNewLine = true;
16 | IndentSwitchBody = true;
17 | LabelIndentStyle = GotoLabelIndentStyle.OneLess;
18 | KeepAlignmentSpaces = true;
19 | IndentPastedCodeLines = true;
20 | }
21 |
22 | public bool Equals (DFormattingPolicy other)
23 | {
24 | return base.Equals (other);
25 | }
26 |
27 | public DFormattingPolicy Clone ()
28 | {
29 | var p = new DFormattingPolicy ();
30 |
31 | p.CommentOutStandardHeaders = CommentOutStandardHeaders;
32 | p.InsertStarAtCommentNewLine = InsertStarAtCommentNewLine;
33 | p.KeepAlignmentSpaces = KeepAlignmentSpaces;
34 | p.o = o.Clone() as DFormattingOptions;
35 |
36 | return p;
37 | }
38 |
39 | DFormattingOptions o = DFormattingOptions.CreateDStandard();
40 |
41 | public DFormattingOptions Options {
42 | get {
43 | return o;
44 | }
45 | }
46 |
47 | [ItemProperty]
48 | public bool CommentOutStandardHeaders { get; set; }
49 | [ItemProperty]
50 | public bool InsertStarAtCommentNewLine { get; set; }
51 |
52 | #region Indenting
53 | [ItemProperty]
54 | public bool IndentSwitchBody {
55 | get{ return o.IndentSwitchBody; }
56 | set{ o.IndentSwitchBody = value; }
57 | }
58 | [ItemProperty]
59 | public GotoLabelIndentStyle LabelIndentStyle {
60 | get{ return o.LabelIndentStyle; }
61 | set{ o.LabelIndentStyle = value; }
62 | }
63 | [ItemProperty]
64 | public bool KeepAlignmentSpaces { get; set; }
65 | [ItemProperty]
66 | public bool IndentPastedCodeLines { get; set; }
67 | #endregion
68 | }
69 | }
70 |
--------------------------------------------------------------------------------
/MonoDevelop.DBinding/Projects/Dub/DefinitionFormats/DubFileFormat.cs:
--------------------------------------------------------------------------------
1 | using MonoDevelop.Core;
2 | using MonoDevelop.Projects.Extensions;
3 | using System;
4 | using System.Collections.Generic;
5 | using MonoDevelop.Projects;
6 | using System.Linq;
7 | using System.IO;
8 |
9 | namespace MonoDevelop.D.Projects.Dub.DefinitionFormats
10 | {
11 | public class DubFileFormat : IFileFormat
12 | {
13 | public bool CanReadFile(FilePath file, Type expectedObjectType)
14 | {
15 | return DubFileManager.Instance.CanLoad(file.FileName) &&
16 | (expectedObjectType.Equals(typeof(WorkspaceItem)) ||
17 | expectedObjectType.Equals(typeof(SolutionEntityItem)));
18 | }
19 |
20 | public bool CanWriteFile(object obj)
21 | {
22 | return true; // Everything has to be manipulated manually (atm)!
23 | }
24 |
25 | public void ConvertToFormat(object obj)
26 | {
27 |
28 | }
29 |
30 | public IEnumerable GetCompatibilityWarnings(object obj)
31 | {
32 | yield return string.Empty;
33 | }
34 |
35 | public List GetItemFiles(object obj)
36 | {
37 | return new List();
38 | }
39 |
40 | public FilePath GetValidFormatName(object obj, FilePath fileName)
41 | {
42 | return fileName;
43 | }
44 |
45 | public object ReadFile(FilePath file, Type expectedType, IProgressMonitor monitor)
46 | {
47 | if (expectedType.IsAssignableFrom(typeof(WorkspaceItem)))
48 | return DubFileManager.Instance.LoadAsSolution(file, monitor);
49 | if (expectedType.IsAssignableFrom(typeof(SolutionEntityItem)))
50 | return DubFileManager.Instance.LoadProject(file, Ide.IdeApp.Workspace.GetAllSolutions().First(), monitor);
51 | return null;
52 | }
53 |
54 | public bool SupportsFramework(Core.Assemblies.TargetFramework framework)
55 | {
56 | return false;
57 | }
58 |
59 | public bool SupportsMixedFormats { get { return true; } }
60 |
61 | public void WriteFile(FilePath file, object obj, IProgressMonitor monitor)
62 | {
63 | //monitor.ReportError ("Can't write dub package information! Change it manually in the definition file!", new InvalidOperationException ());
64 | }
65 | }
66 | }
--------------------------------------------------------------------------------
/MonoDevelop.DBinding/Refactoring/DustMiteIntegration/DustMite.cs:
--------------------------------------------------------------------------------
1 | //
2 | // DustMite.cs
3 | //
4 | // Author:
5 | // Alexander Bothe
6 | //
7 | // Copyright (c) 2014 Alexander Bothe
8 | //
9 | // Permission is hereby granted, free of charge, to any person obtaining a copy
10 | // of this software and associated documentation files (the "Software"), to deal
11 | // in the Software without restriction, including without limitation the rights
12 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13 | // copies of the Software, and to permit persons to whom the Software is
14 | // furnished to do so, subject to the following conditions:
15 | //
16 | // The above copyright notice and this permission notice shall be included in
17 | // all copies or substantial portions of the Software.
18 | //
19 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
25 | // THE SOFTWARE.
26 | using System;
27 | using MonoDevelop.Components.Commands;
28 | using MonoDevelop.D.Projects;
29 | using MonoDevelop.Core;
30 | using MonoDevelop.Ide;
31 |
32 | namespace MonoDevelop.D.Refactoring
33 | {
34 | public class DustMite : CommandHandler
35 | {
36 | #region Properties
37 | public static readonly object InvokeCommandId;
38 | AbstractDProject prj;
39 |
40 | #endregion
41 |
42 | protected override void Update (CommandInfo info)
43 | {
44 | prj = Ide.IdeApp.ProjectOperations.CurrentSelectedItem as AbstractDProject;
45 | info.Bypass = prj != null;
46 | base.Update (info);
47 | }
48 |
49 | protected override void Run ()
50 | {
51 | using (var dlg = new DustMiteArgDlg (prj))
52 | MessageService.RunCustomDialog (dlg);
53 | }
54 | }
55 | }
56 |
57 |
--------------------------------------------------------------------------------
/MonoDevelop.DBinding/Projects/ProjectPad/DProjectNodeExtension.cs:
--------------------------------------------------------------------------------
1 | //
2 | // DProjectNodeExtension.cs
3 | //
4 | // Author:
5 | // Alexander Bothe
6 | //
7 | // Copyright (c) 2013 Alexander Bothe
8 | //
9 | // Permission is hereby granted, free of charge, to any person obtaining a copy
10 | // of this software and associated documentation files (the "Software"), to deal
11 | // in the Software without restriction, including without limitation the rights
12 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13 | // copies of the Software, and to permit persons to whom the Software is
14 | // furnished to do so, subject to the following conditions:
15 | //
16 | // The above copyright notice and this permission notice shall be included in
17 | // all copies or substantial portions of the Software.
18 | //
19 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
25 | // THE SOFTWARE.
26 |
27 | using System;
28 | using MonoDevelop.D.Projects;
29 | using MonoDevelop.Ide.Gui.Components;
30 |
31 | namespace MonoDevelop.D.Projects.ProjectPad
32 | {
33 | ///
34 | /// Extends project nodes which represent D projects by their references.
35 | ///
36 | public class DProjectNodeExtension : NodeBuilderExtension
37 | {
38 | public override bool CanBuildNode (Type dataType)
39 | {
40 | return dataType.IsSubclassOf(typeof(AbstractDProject));
41 | }
42 |
43 | public override void BuildChildNodes(ITreeBuilder builder, object dataObject)
44 | {
45 | var project = dataObject as AbstractDProject;
46 |
47 | var refs = project.References;
48 | if(refs != null)
49 | builder.AddChild (refs);
50 |
51 | base.BuildChildNodes(builder, dataObject);
52 | }
53 | }
54 | }
55 |
--------------------------------------------------------------------------------
/MonoDevelop.DBinding/Gui/EditorPathbarProvider.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using D_Parser.Dom;
4 | using Gtk;
5 | using MonoDevelop.Components;
6 | using MonoDevelop.D.Completion;
7 | using MonoDevelop.D.Parser;
8 | using MonoDevelop.Ide;
9 | using MonoDevelop.Ide.Gui;
10 | using D_Parser.Resolver.ASTScanner;
11 |
12 |
13 | namespace MonoDevelop.D.Gui
14 | {
15 | class EditorPathbarProvider : DropDownBoxListWindow.IListDataProvider
16 | {
17 | object tag;
18 | List memberList = new List ();
19 |
20 | Document document { get; set; }
21 |
22 | public EditorPathbarProvider (Document doc, object tag)
23 | {
24 | this.document = doc;
25 | this.tag = ((INode)tag).Parent;
26 |
27 | Reset ();
28 | }
29 |
30 | #region IListDataProvider implementation
31 |
32 | public int IconCount {
33 | get {
34 | return memberList.Count;
35 | }
36 | }
37 |
38 | public void Reset ()
39 | {
40 | memberList.Clear ();
41 | if (!(tag is IBlockNode))
42 | return;
43 | var blockNode = (tag as IBlockNode);
44 | foreach(var nd in blockNode.Children)
45 | if (AbstractVisitor.CanAddMemberOfType(MemberFilter.All, nd))
46 | memberList.Add(nd);
47 |
48 | memberList.Sort ((x, y) => x.Name.CompareTo(y.Name));
49 | }
50 |
51 | public string GetMarkup (int n)
52 | {
53 | return memberList[n].Name + DParameterDataProvider.GetNodeParamString(memberList[n]);
54 | }
55 |
56 | Xwt.Drawing.Image DropDownBoxListWindow.IListDataProvider.GetIcon(int n)
57 | {
58 | var icon = DIcons.GetNodeIcon(memberList[n] as DNode);
59 | return ImageService.GetIcon(icon.Name, IconSize.Menu);
60 | }
61 |
62 | public object GetTag (int n)
63 | {
64 | return memberList[n];
65 | }
66 |
67 | public void ActivateItem (int n)
68 | {
69 | var member = memberList[n];
70 | MonoDevelop.Ide.Gui.Content.IExtensibleTextEditor extEditor = document.GetContent ();
71 | if (extEditor != null)
72 | extEditor.SetCaretTo (Math.Max (1, member.NameLocation.Line), member.NameLocation.Column);
73 | }
74 | #endregion
75 | }
76 | }
77 |
78 |
--------------------------------------------------------------------------------
/MonoDevelop.DBinding/GuiBuilder/ProjectResourceProvider.cs:
--------------------------------------------------------------------------------
1 | //
2 | // DProjectResourceProvider.cs
3 | //
4 | // Author:
5 | // Alexander Bothe
6 | //
7 | // Copyright (c) 2014 Alexander Bothe
8 | //
9 | // Permission is hereby granted, free of charge, to any person obtaining a copy
10 | // of this software and associated documentation files (the "Software"), to deal
11 | // in the Software without restriction, including without limitation the rights
12 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13 | // copies of the Software, and to permit persons to whom the Software is
14 | // furnished to do so, subject to the following conditions:
15 | //
16 | // The above copyright notice and this permission notice shall be included in
17 | // all copies or substantial portions of the Software.
18 | //
19 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
25 | // THE SOFTWARE.
26 | using System;
27 | using MonoDevelop.Projects;
28 |
29 | namespace MonoDevelop.D.GuiBuilder
30 | {
31 | public class ProjectResourceProvider : MarshalByRefObject, Stetic.IResourceProvider
32 | {
33 | protected Project project;
34 | public virtual Project Project{ get{ return project; } }
35 |
36 | public ProjectResourceProvider (Project prj)
37 | {
38 | this.project = prj;
39 | }
40 |
41 | public Stetic.ResourceInfo[] GetResources ()
42 | {
43 | return new Stetic.ResourceInfo[0];
44 | }
45 |
46 | public System.IO.Stream GetResourceStream (string resourceName)
47 | {
48 | return null;
49 | }
50 |
51 | public Stetic.ResourceInfo AddResource (string fileName)
52 | {
53 | return null;
54 | }
55 |
56 | public void RemoveResource (string resourceName)
57 | {
58 |
59 | }
60 | }
61 | }
62 |
63 |
--------------------------------------------------------------------------------
/MonoDevelop.DBinding/Refactoring/RefactoringCommandsExtension.cs:
--------------------------------------------------------------------------------
1 | using MonoDevelop.Ide.Gui.Content;
2 | using MonoDevelop.Components.Commands;
3 | using MonoDevelop.Refactoring;
4 | using MonoDevelop.Ide.Commands;
5 |
6 | namespace MonoDevelop.D.Refactoring
7 | {
8 | public class RefactoringCommandsExtension : TextEditorExtension
9 | {
10 | readonly RefactoringCommandCapsule caps = new RefactoringCommandCapsule();
11 |
12 | bool Update()
13 | {
14 | return caps.Update (document) && caps.resultResolutionAttempt != D_Parser.Resolver.LooseResolution.NodeResolutionAttempt.RawSymbolLookup;
15 | }
16 |
17 | [CommandHandler(RefactoryCommands.FindReferences)]
18 | void FindReferences()
19 | {
20 | if(Update())
21 | caps.FindReferences (false);
22 | }
23 |
24 | [CommandHandler(RefactoryCommands.FindAllReferences)]
25 | void FindAllReferences()
26 | {
27 | if (Update())
28 | caps.FindReferences(true);
29 | }
30 |
31 | [CommandHandler(RefactoryCommands.FindDerivedClasses)]
32 | void FindDerivedClasses()
33 | {
34 | if (Update())
35 | caps.FindDerivedClasses();
36 | }
37 |
38 | [CommandHandler(RefactoryCommands.GotoDeclaration)]
39 | void GotoDeclaration()
40 | {
41 | if(Update())
42 | caps.GotoDeclaration ();
43 | }
44 |
45 | [CommandUpdateHandler(EditCommands.Rename)]
46 | [CommandUpdateHandler(RefactoryCommands.FindReferences)]
47 | [CommandUpdateHandler(RefactoryCommands.FindAllReferences)]
48 | [CommandUpdateHandler(RefactoryCommands.FindDerivedClasses)]
49 | [CommandUpdateHandler(RefactoryCommands.GotoDeclaration)]
50 | [CommandUpdateHandler(RefactoryCommands.ImportSymbol)]
51 | void Rename_Update(CommandInfo ci)
52 | {
53 | ci.Bypass = false;
54 | }
55 |
56 | [CommandHandler(EditCommands.Rename)]
57 | void Rename()
58 | {
59 | if(Update())
60 | caps.RenameSymbol ();
61 | }
62 |
63 | [CommandHandler(RefactoryCommands.ImportSymbol)]
64 | void TryImportMissingSymbol()
65 | {
66 | if(!Update() && caps.lastResults != null && caps.resultResolutionAttempt == D_Parser.Resolver.LooseResolution.NodeResolutionAttempt.RawSymbolLookup)
67 | caps.TryImportMissingSymbol ();
68 | }
69 | }
70 | }
71 |
--------------------------------------------------------------------------------
/MonoDevelop.DBinding.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 11.00
3 | # Visual Studio 2010
4 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MonoDevelop.D", "MonoDevelop.DBinding\MonoDevelop.D.csproj", "{5867254F-6B1C-4A4C-BF98-C283740A0470}"
5 | EndProject
6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DParser2", "Parser\DParser2\DParser2.csproj", "{0290A229-9AA1-41C3-B525-CAFB86D8BC42}"
7 | EndProject
8 | Global
9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
10 | Debug|Any CPU = Debug|Any CPU
11 | Debug|x86 = Debug|x86
12 | Release|Any CPU = Release|Any CPU
13 | Release|x86 = Release|x86
14 | EndGlobalSection
15 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
16 | {0290A229-9AA1-41C3-B525-CAFB86D8BC42}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
17 | {0290A229-9AA1-41C3-B525-CAFB86D8BC42}.Debug|Any CPU.Build.0 = Debug|Any CPU
18 | {0290A229-9AA1-41C3-B525-CAFB86D8BC42}.Debug|x86.ActiveCfg = Debug|x86
19 | {0290A229-9AA1-41C3-B525-CAFB86D8BC42}.Debug|x86.Build.0 = Debug|x86
20 | {0290A229-9AA1-41C3-B525-CAFB86D8BC42}.Release|Any CPU.ActiveCfg = Release|Any CPU
21 | {0290A229-9AA1-41C3-B525-CAFB86D8BC42}.Release|Any CPU.Build.0 = Release|Any CPU
22 | {0290A229-9AA1-41C3-B525-CAFB86D8BC42}.Release|x86.ActiveCfg = Release|x86
23 | {0290A229-9AA1-41C3-B525-CAFB86D8BC42}.Release|x86.Build.0 = Release|x86
24 | {5867254F-6B1C-4A4C-BF98-C283740A0470}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
25 | {5867254F-6B1C-4A4C-BF98-C283740A0470}.Debug|Any CPU.Build.0 = Debug|Any CPU
26 | {5867254F-6B1C-4A4C-BF98-C283740A0470}.Debug|x86.ActiveCfg = Debug|Any CPU
27 | {5867254F-6B1C-4A4C-BF98-C283740A0470}.Release|Any CPU.ActiveCfg = Release|Any CPU
28 | {5867254F-6B1C-4A4C-BF98-C283740A0470}.Release|Any CPU.Build.0 = Release|Any CPU
29 | {5867254F-6B1C-4A4C-BF98-C283740A0470}.Release|x86.ActiveCfg = Release|Any CPU
30 | EndGlobalSection
31 | GlobalSection(MonoDevelopProperties) = preSolution
32 | StartupItem = MonoDevelop.DBinding\MonoDevelop.D.csproj
33 | EndGlobalSection
34 | GlobalSection(SolutionProperties) = preSolution
35 | HideSolutionNode = FALSE
36 | EndGlobalSection
37 | EndGlobal
38 |
--------------------------------------------------------------------------------
/MonoDevelop.DBinding/Projects/VisualD/VisualDProjectReferenceCollection.cs:
--------------------------------------------------------------------------------
1 | //
2 | // VisualDProjectReferenceCollection.cs
3 | //
4 | // Author:
5 | // Alexander Bothe
6 | //
7 | // Copyright (c) 2013 Alexander Bothe
8 | //
9 | // Permission is hereby granted, free of charge, to any person obtaining a copy
10 | // of this software and associated documentation files (the "Software"), to deal
11 | // in the Software without restriction, including without limitation the rights
12 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13 | // copies of the Software, and to permit persons to whom the Software is
14 | // furnished to do so, subject to the following conditions:
15 | //
16 | // The above copyright notice and this permission notice shall be included in
17 | // all copies or substantial portions of the Software.
18 | //
19 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
25 | // THE SOFTWARE.
26 | using System;
27 |
28 | namespace MonoDevelop.D.Projects.VisualD
29 | {
30 | public class VisualDProjectReferenceCollection : DProjectReferenceCollection
31 | {
32 | public new VisualDProject Owner {get{ return base.Owner as VisualDProject; }}
33 |
34 | public VisualDProjectReferenceCollection (VisualDProject prj) : base(prj)
35 | {
36 | }
37 |
38 | #region implemented abstract members of DProjectReferenceCollection
39 |
40 | public override void DeleteProjectRef (string projectId)
41 | {
42 |
43 | }
44 |
45 | public override void FireUpdate ()
46 | {
47 | if (Update != null)
48 | Update (this, EventArgs.Empty);
49 | }
50 |
51 | public override bool AddReference ()
52 | {
53 | return false;
54 | }
55 |
56 | public override event EventHandler Update;
57 |
58 | #endregion
59 | }
60 | }
61 |
62 |
--------------------------------------------------------------------------------
/MonoDevelop.DBinding/OptionPanels/ProjectIncludesWidget.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using MonoDevelop.Core;
3 | using MonoDevelop.D.Projects;
4 | namespace MonoDevelop.D
5 | {
6 | [System.ComponentModel.ToolboxItem(true)]
7 | public partial class ProjectIncludesWidget : Gtk.Bin
8 | {
9 | public readonly DProject Project;
10 | public readonly DProjectConfiguration CurrentConfig;
11 | public ProjectIncludesWidget (DProject prj, DProjectConfiguration cfg)
12 | {
13 | this.Build ();
14 |
15 | Project = prj;
16 | CurrentConfig = cfg;
17 | }
18 |
19 | public void Load()
20 | {
21 | text_Includes.Buffer.Text = string.Join ("\n", Project.References.RawIncludes);
22 | }
23 |
24 | public void Store()
25 | {
26 | int oldHash=0, newHash = 0;
27 | var refs = Project.References.RawIncludes;
28 | foreach (var p in refs)
29 | oldHash += p.GetHashCode ();
30 | refs.Clear ();
31 |
32 | foreach (var p in text_Includes.Buffer.Text.Split('\n')) {
33 | var p_ = p.Trim().TrimEnd ('\\', '/');
34 | if (string.IsNullOrWhiteSpace(p_))
35 | continue;
36 | refs.Add (p_);
37 | newHash += p_.GetHashCode ();
38 | }
39 |
40 | if (oldHash != newHash) { // Only reparse if paths changed
41 | Project.NeedsFullRebuild = true;
42 |
43 | try {
44 | // Update parse cache immediately
45 | Project.UpdateLocalIncludeCache ();
46 | } catch (Exception ex) {
47 | LoggingService.LogError ("Include path analysis error", ex);
48 | }
49 | }
50 | }
51 |
52 | protected void OnButtonAddIncludeClicked(object sender, EventArgs e)
53 | {
54 | var dialog = new Gtk.FileChooserDialog(
55 | "Select D Source Folder",
56 | Ide.IdeApp.Workbench.RootWindow,
57 | Gtk.FileChooserAction.SelectFolder,
58 | "Cancel",
59 | Gtk.ResponseType.Cancel,
60 | "Ok",
61 | Gtk.ResponseType.Ok)
62 | {
63 | TransientFor = Toplevel as Gtk.Window,
64 | WindowPosition = Gtk.WindowPosition.Center
65 | };
66 |
67 | try
68 | {
69 | if (dialog.Run() == (int)Gtk.ResponseType.Ok)
70 | {
71 | text_Includes.Buffer.Text += (text_Includes.Buffer.CharCount == 0 ? "" : "\n") + string.Join("\n", dialog.Filenames);
72 | }
73 | }
74 | finally
75 | {
76 | dialog.Destroy();
77 | }
78 | }
79 | }
80 | }
81 |
82 |
--------------------------------------------------------------------------------
/MonoDevelop.DBinding/Debugging/IDBacktraceHelpers.cs:
--------------------------------------------------------------------------------
1 | using D_Parser.Dom;
2 | using D_Parser.Resolver;
3 | using System;
4 | using System.Collections.Generic;
5 | using System.Linq;
6 | using System.Text;
7 |
8 | namespace MonoDevelop.D.Debugging
9 | {
10 | public interface IDBacktraceSymbol
11 | {
12 | ulong Offset { get; }
13 | string Name { get; }
14 | string TypeName { get; }
15 | AbstractType DType { get; }
16 | string Value { get; }
17 | string FileName { get; }
18 |
19 | bool HasParent { get; }
20 | IDBacktraceSymbol Parent { get; }
21 |
22 | int ChildCount { get; }
23 | IEnumerable Children { get; }
24 | }
25 |
26 | public interface IDBacktraceArraySymbol : IDBacktraceSymbol
27 | {
28 | ulong FirstElementOffset {get;}
29 | int ArrayLength { get;}
30 | }
31 |
32 | public interface IDBacktraceHelpers
33 | {
34 | void GetCurrentStackFrameInfo(out string file, out ulong offset, out CodeLocation sourceLocation);
35 |
36 | IEnumerable Parameters { get; }
37 | IEnumerable Locals { get; }
38 | IDBacktraceSymbol FindSymbol(string name);
39 |
40 | ///
41 | /// Amount of bytes per pointer.
42 | /// Used for determining whether the program is a 64 or 32 bit program.
43 | ///
44 | int PointerSize { get; }
45 |
46 | byte[] ReadBytes(ulong offset, ulong size);
47 | byte ReadByte(ulong offset);
48 | short ReadInt16(ulong offset);
49 | int ReadInt32(ulong offset);
50 | long ReadInt64(ulong offset);
51 |
52 | ///
53 | /// Strictly optional: Allows dynamic execution/injection of code while debuggee status is claimed to be "paused".
54 | /// Mainly used for toString()-Examination for D objects.
55 | ///
56 | IActiveExamination ActiveExamination { get; }
57 | }
58 |
59 | public interface IActiveExamination
60 | {
61 | ///
62 | /// Throws InvalidOperationException if data couldn't be allocated
63 | ///
64 | ulong Allocate(int size);
65 | void Free(ulong offset, int size);
66 |
67 | void Write(ulong offset, byte[] data);
68 | ///
69 | /// Pushes the stack base pointer, puts the E/RIP to , executes it until a return command occurs.
70 | ///
71 | void Execute(ulong offset);
72 | }
73 | }
74 |
--------------------------------------------------------------------------------
/MonoDevelop.DBinding/Projects/Dub/DefinitionFormats/JSON/JSONThingDeserializer.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using Newtonsoft.Json;
3 | using System.IO;
4 |
5 | namespace MonoDevelop.D.Projects.Dub.DefinitionFormats
6 | {
7 | public class JSONThingDeserializer
8 | {
9 | public JSONObject Deserialize(TextReader tr)
10 | {
11 | using (var r = new JsonTextReader (tr)) {
12 | r.Read ();
13 | return ReadObject (r);
14 | }
15 | }
16 |
17 | JSONObject ReadObject(JsonReader r)
18 | {
19 | if (r.TokenType != JsonToken.StartObject)
20 | throw new InvalidDataException ("Object begin expected");
21 | r.Read ();
22 |
23 | var o = new JSONObject();
24 | while (r.TokenType == JsonToken.PropertyName) {
25 | var name = (r.Value as string).ToLowerInvariant();
26 | r.Read ();
27 | var thing = ReadThing (r);
28 |
29 | o.Properties.Add (name, thing);
30 | }
31 |
32 | if (r.TokenType != JsonToken.EndObject)
33 | throw new InvalidDataException ("Object end expected");
34 | r.Read ();
35 |
36 | return o;
37 | }
38 |
39 | JSONThing ReadThing(JsonReader r)
40 | {
41 | switch (r.TokenType) {
42 | case JsonToken.Null:
43 | r.Read ();
44 | return new JSONValueLeaf{ Value = string.Empty };
45 | case JsonToken.Comment:
46 | r.Read ();
47 | return ReadThing (r);
48 | case JsonToken.Integer:
49 | case JsonToken.Float:
50 | case JsonToken.Boolean:
51 | case JsonToken.String:
52 | var ret = new JSONValueLeaf{ Value = r.Value.ToString() };
53 | r.Read ();
54 | return ret;
55 | case JsonToken.StartObject:
56 | return ReadObject(r);
57 | case JsonToken.StartArray:
58 | return ReadArray(r);
59 | default:
60 | throw new InvalidDataException("Object, array or string value expected");
61 | }
62 | }
63 |
64 | JSONArray ReadArray(JsonReader r)
65 | {
66 | if (r.TokenType != JsonToken.StartArray)
67 | throw new InvalidDataException ("Array begin expected");
68 | r.Read ();
69 |
70 | var array = new JSONArray ();
71 | while (r.TokenType != JsonToken.EndArray) {
72 | array.Items.Add (ReadThing (r));
73 | }
74 |
75 | if (r.TokenType != JsonToken.EndArray)
76 | throw new InvalidDataException ("Array end expected");
77 | r.Read ();
78 |
79 | return array;
80 | }
81 | }
82 | }
83 |
84 |
--------------------------------------------------------------------------------
/MonoDevelop.DBinding/Projects/VisualD/VisualDProject.cs:
--------------------------------------------------------------------------------
1 | //
2 | // VisualDProject.cs
3 | //
4 | // Author:
5 | // Alexander Bothe
6 | //
7 | // Copyright (c) 2013 Alexander Bothe
8 | //
9 | // Permission is hereby granted, free of charge, to any person obtaining a copy
10 | // of this software and associated documentation files (the "Software"), to deal
11 | // in the Software without restriction, including without limitation the rights
12 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13 | // copies of the Software, and to permit persons to whom the Software is
14 | // furnished to do so, subject to the following conditions:
15 | //
16 | // The above copyright notice and this permission notice shall be included in
17 | // all copies or substantial portions of the Software.
18 | //
19 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
25 | // THE SOFTWARE.
26 | using MonoDevelop.D.Projects;
27 | using MonoDevelop.Projects;
28 |
29 | namespace MonoDevelop.D.Projects.VisualD
30 | {
31 | public class VisualDProject : AbstractDProject
32 | {
33 | #region Properties
34 | DProjectReferenceCollection references;
35 | internal string ItemIdToAssign
36 | {
37 | set{
38 | var h = ItemHandler as MonoDevelop.Projects.Formats.MSBuild.MSBuildProjectHandler;
39 | if (h != null)
40 | h.ItemId = value;
41 | }
42 | }
43 | #endregion
44 |
45 | public VisualDProject ()
46 | {
47 | references = new VisualDProjectReferenceCollection (this);
48 | }
49 |
50 | protected override void OnSave(Core.IProgressMonitor monitor)
51 | {
52 | //base.OnSave(monitor);
53 | }
54 |
55 | public override SolutionItemConfiguration CreateConfiguration (string name)
56 | {
57 | return new VisualDPrjConfig (name);
58 | }
59 |
60 | public override DProjectReferenceCollection References
61 | {
62 | get { return references; }
63 | }
64 | }
65 | }
66 |
67 |
--------------------------------------------------------------------------------
/MonoDevelop.DBinding/Projects/VisualD/VisualDPrjConfig.cs:
--------------------------------------------------------------------------------
1 | //
2 | // VisualDPrjConfig.cs
3 | //
4 | // Author:
5 | // Alexander Bothe
6 | //
7 | // Copyright (c) 2013 Alexander Bothe
8 | //
9 | // Permission is hereby granted, free of charge, to any person obtaining a copy
10 | // of this software and associated documentation files (the "Software"), to deal
11 | // in the Software without restriction, including without limitation the rights
12 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13 | // copies of the Software, and to permit persons to whom the Software is
14 | // furnished to do so, subject to the following conditions:
15 | //
16 | // The above copyright notice and this permission notice shall be included in
17 | // all copies or substantial portions of the Software.
18 | //
19 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
25 | // THE SOFTWARE.
26 | using System;
27 | using System.Xml;
28 | using MonoDevelop.Projects;
29 | using System.Collections.Generic;
30 |
31 | namespace MonoDevelop.D.Projects.VisualD
32 | {
33 | public class VisualDPrjConfig : ProjectConfiguration
34 | {
35 | #region Properties
36 | public readonly Dictionary Properties = new Dictionary();
37 | #endregion
38 |
39 | public VisualDPrjConfig (string name) : base(name)
40 | {
41 | }
42 |
43 | public static VisualDPrjConfig ReadAndAdd(VisualDProject prj, string name, string platform, XmlReader x)
44 | {
45 | var c = prj.AddNewConfiguration (name ?? "Unknown") as VisualDPrjConfig;
46 | c.Platform = platform;
47 |
48 | while (x.Read ()) {
49 | var n = x.LocalName;
50 | if (string.IsNullOrWhiteSpace (n) || n == "Config")
51 | continue;
52 | var content = x.ReadElementContentAsString();
53 |
54 | if (!string.IsNullOrWhiteSpace (content))
55 | c.Properties [n] = content;
56 | }
57 |
58 | return c;
59 | }
60 | }
61 | }
62 |
63 |
--------------------------------------------------------------------------------
/MonoDevelop.DBinding/Unittest/UnittestSettings.cs:
--------------------------------------------------------------------------------
1 | //
2 | // UnittestOptions.cs
3 | //
4 | // Author:
5 | // Alexander Bothe
6 | //
7 | // Copyright (c) 2013 Alexander Bothe
8 | //
9 | // Permission is hereby granted, free of charge, to any person obtaining a copy
10 | // of this software and associated documentation files (the "Software"), to deal
11 | // in the Software without restriction, including without limitation the rights
12 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13 | // copies of the Software, and to permit persons to whom the Software is
14 | // furnished to do so, subject to the following conditions:
15 | //
16 | // The above copyright notice and this permission notice shall be included in
17 | // all copies or substantial portions of the Software.
18 | //
19 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
25 | // THE SOFTWARE.
26 | using System.Xml;
27 |
28 | namespace MonoDevelop.D.Unittest
29 | {
30 | public static class UnittestSettings
31 | {
32 | // $main
33 | public const string UnittestCommand_Default = "rdmd -unittest -main $libs $includes $sources $compilerflags $linkerflags";
34 | public static string UnittestCommand = UnittestCommand_Default;
35 | public const string MainMethodFlag_Default = "-main";
36 | public static string MainMethodFlag=MainMethodFlag_Default;
37 |
38 | internal static void Load(XmlReader x)
39 | {
40 | while (x.Read ()) {
41 | switch (x.LocalName) {
42 | case "UnittestCommand":
43 | UnittestCommand = x.ReadString ();
44 | break;
45 | case "MainMethodFlag":
46 | MainMethodFlag = x.ReadString ();
47 | break;
48 | }
49 | }
50 | }
51 |
52 | internal static void Save(XmlWriter x)
53 | {
54 | x.WriteStartElement("UnittestCommand");
55 | x.WriteCData(UnittestCommand);
56 | x.WriteEndElement();
57 |
58 | x.WriteStartElement("MainMethodFlag");
59 | x.WriteCData(MainMethodFlag);
60 | x.WriteEndElement();
61 | }
62 | }
63 | }
64 |
65 |
--------------------------------------------------------------------------------
/MonoDevelop.DBinding/Building/CompilerPresets/gdc.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | GNU
5 | gdc
6 | true
7 |
8 |
9 | "{0}"
10 | "-I{0}"
11 | -fversion
12 | -fdebug
13 | -funittest
14 |
15 |
16 | "-fdoc-inc={0}"
17 | "-fdoc-dir={0}"
18 | -L
19 | "@{0}"
20 | -m32
21 | -m64
22 |
23 |
24 |
25 | gdc
26 |
27 | -c "$src" -o "$obj" $includes -g
28 | -o "$target" -g $objs $libs
29 | -g $sources $libs $includes -o "$exe"
30 |
31 |
32 | -c "$src" -frelease -o "$obj" $includes -O3
33 | -o "$target" -frelease -O3 $objs $libs
34 | -O3 -frelease $sources $libs $includes -o "$exe"
35 |
36 |
37 |
38 |
39 | gdc
40 |
41 | -fPIC -c "$src" -o "$obj" $includes -g
42 | -o "$target" -g $objs $libs -shared
43 |
44 |
45 | -fPIC -frelease -c "$src" -o "$obj" $includes -O3
46 | -o "$target" -frelease -O3 $objs $libs -shared
47 |
48 |
49 |
50 |
51 | ar
52 |
53 | -c "$src" -o "$obj" $includes -g
54 | rcs "$target" $objs
55 |
56 |
57 | -c "$src" -o "$obj" $includes -frelease -O3
58 | rcs "$target" $objs
59 |
60 |
61 |
--------------------------------------------------------------------------------
/MonoDevelop.DBinding/Profiler/Commands/ProfilerModeHandler.cs:
--------------------------------------------------------------------------------
1 | //
2 | // ProfilerModeHandler.cs
3 | //
4 | // Author:
5 | // foerdi <>
6 | //
7 | // Copyright (c) 2013 foerdi
8 | //
9 | // Permission is hereby granted, free of charge, to any person obtaining a copy
10 | // of this software and associated documentation files (the "Software"), to deal
11 | // in the Software without restriction, including without limitation the rights
12 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13 | // copies of the Software, and to permit persons to whom the Software is
14 | // furnished to do so, subject to the following conditions:
15 | //
16 | // The above copyright notice and this permission notice shall be included in
17 | // all copies or substantial portions of the Software.
18 | //
19 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
25 | // THE SOFTWARE.
26 | using MonoDevelop.Components.Commands;
27 | using MonoDevelop.D.Profiler.Gui;
28 | using MonoDevelop.Ide.Gui;
29 |
30 | namespace MonoDevelop.D.Profiler.Commands
31 | {
32 | public class ProfilerModeHandler : CommandHandler
33 | {
34 | private static bool isProfilerMode;
35 | public static bool IsProfilerMode
36 | {
37 | get { return isProfilerMode; }
38 | set
39 | {
40 | var changed = isProfilerMode != value;
41 | isProfilerMode = value;
42 |
43 | var pad = Ide.IdeApp.Workbench.GetPad ();
44 | if(pad == null)
45 | return;
46 | var dpad = pad.Content as DProfilerPad;
47 | if (dpad == null)
48 | return;
49 |
50 | if (isProfilerMode) {
51 | pad.Visible = true;
52 | if (changed)
53 | pad.BringToFront ();
54 | }
55 |
56 | dpad.Widget.RefreshSwitchProfilingIcon();
57 | }
58 | }
59 |
60 | protected override void Update (CommandInfo info)
61 | {
62 | base.Update (info);
63 | info.Checked = IsProfilerMode;
64 | }
65 |
66 | protected override void Run ()
67 | {
68 | IsProfilerMode = !IsProfilerMode;
69 | }
70 | }
71 | }
72 |
73 |
--------------------------------------------------------------------------------
/MonoDevelop.DBinding/OptionPanels/DubOptionPanel.cs:
--------------------------------------------------------------------------------
1 | //
2 | // DubOptionPanel.cs
3 | //
4 | // Author:
5 | // Alexander Bothe
6 | //
7 | // Copyright (c) 2013 Alexander Bothe
8 | //
9 | // Permission is hereby granted, free of charge, to any person obtaining a copy
10 | // of this software and associated documentation files (the "Software"), to deal
11 | // in the Software without restriction, including without limitation the rights
12 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13 | // copies of the Software, and to permit persons to whom the Software is
14 | // furnished to do so, subject to the following conditions:
15 | //
16 | // The above copyright notice and this permission notice shall be included in
17 | // all copies or substantial portions of the Software.
18 | //
19 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
25 | // THE SOFTWARE.
26 | using MonoDevelop.Ide.Gui.Dialogs;
27 |
28 | namespace MonoDevelop.D.OptionPanels
29 | {
30 | [System.ComponentModel.ToolboxItem (true)]
31 | public partial class DubOptionPanel : Gtk.Bin
32 | {
33 | public DubOptionPanel ()
34 | {
35 | this.Build ();
36 |
37 | text_dub.Text = DubSettings.Instance.DubCommand;
38 | text_commonArgs.Text = DubSettings.Instance.CommonArgs;
39 | }
40 |
41 | public void ApplyChanges()
42 | {
43 | DubSettings.Instance.DubCommand = text_dub.Text;
44 | DubSettings.Instance.CommonArgs = text_commonArgs.Text;
45 | }
46 |
47 | public bool Valid
48 | {
49 | get{
50 | return !string.IsNullOrWhiteSpace(text_dub.Text);
51 | }
52 | }
53 | }
54 |
55 | public class DubOptionPanelBinding : OptionsPanel
56 | {
57 | DubOptionPanel pan;
58 | public override Gtk.Widget CreatePanelWidget ()
59 | {
60 | return pan = new DubOptionPanel ();
61 | }
62 |
63 | public override void ApplyChanges ()
64 | {
65 | pan.ApplyChanges ();
66 | }
67 |
68 | public override bool ValidateChanges ()
69 | {
70 | return pan.Valid;
71 | }
72 | }
73 | }
74 |
75 |
--------------------------------------------------------------------------------
/MonoDevelop.DBinding/Gui/MixinInsightExtension.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using MonoDevelop.Ide.Gui.Content;
3 | using System.Threading;
4 | using MonoDevelop.Core;
5 |
6 | namespace MonoDevelop.D.Gui
7 | {
8 | public class MixinInsightExtension : TextEditorExtension
9 | {
10 | static AutoResetEvent stateChanged = new AutoResetEvent(false);
11 | static Thread updateTh;
12 | static bool initialized;
13 |
14 | public override void Initialize()
15 | {
16 | base.Initialize();
17 |
18 | if (!initialized)
19 | {
20 | initialized = true;
21 |
22 | if(MixinInsightPad.EnableCaretTracking)
23 | StartUpdateThread();
24 |
25 | PropertyService.AddPropertyHandler(MixinInsightPad.activateAutomatedCaretTrackingPropId, (object s, PropertyChangedEventArgs pea) =>
26 | {
27 | if ((bool)pea.NewValue)
28 | {
29 | StartUpdateThread();
30 | }
31 | else if (updateTh != null)
32 | {
33 | updateTh.Abort();
34 | }
35 | });
36 | }
37 |
38 | Document.DocumentParsed += Document_DocumentParsed;
39 | }
40 |
41 | static void StartUpdateThread()
42 | {
43 | if(updateTh == null || !updateTh.IsAlive){
44 | updateTh = new Thread(updateTh_method);
45 | updateTh.IsBackground = true;
46 | updateTh.Priority = ThreadPriority.Lowest;
47 | updateTh.Start();
48 | }
49 | }
50 |
51 | void Document_DocumentParsed(object sender, EventArgs e)
52 | {
53 | stateChanged.Set();
54 | }
55 |
56 | public override void Dispose()
57 | {
58 | Document.DocumentParsed -= Document_DocumentParsed;
59 | }
60 |
61 | public override void TextChanged(int startIndex, int endIndex)
62 | {
63 | stateChanged.Set();
64 | base.TextChanged(startIndex, endIndex);
65 | }
66 |
67 | public override void CursorPositionChanged()
68 | {
69 | base.CursorPositionChanged();
70 | stateChanged.Set();
71 | }
72 |
73 | static void updateTh_method()
74 | {
75 | while (true)
76 | {
77 | stateChanged.WaitOne();
78 | while (stateChanged.WaitOne(400));
79 |
80 | var pad = MixinInsightPad.Instance;
81 | if (pad != null && pad.Window.ContentVisible)
82 | pad.Update();
83 | }
84 | }
85 |
86 | public override bool ExtendsEditor(MonoDevelop.Ide.Gui.Document doc, IEditableTextBuffer editor)
87 | {
88 | return doc.IsFile && DLanguageBinding.IsDFile(doc.FileName);
89 | }
90 | }
91 | }
92 |
--------------------------------------------------------------------------------
/MonoDevelop.DBinding/Formatting/Indentation/DIndentationTracker.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using Mono.TextEditor;
3 | using MonoDevelop.Ide.Gui.Content;
4 |
5 | namespace MonoDevelop.D.Formatting.Indentation
6 | {
7 | public class DIndentationTracker: IIndentationTracker
8 | {
9 | TextEditorData data;
10 | DocumentStateTracker stateTracker;
11 |
12 | public DIndentationTracker (TextEditorData data, DocumentStateTracker stateTracker)
13 | {
14 | this.data = data;
15 | this.stateTracker = stateTracker;
16 | }
17 |
18 | string GetIndentationString (int offset, DocumentLocation loc)
19 | {
20 | stateTracker.UpdateEngine (Math.Min (data.Length, offset + 1));
21 | DocumentLine line = data.Document.GetLine (loc.Line);
22 | if (line == null)
23 | return "";
24 | // Get context to the end of the line w/o changing the main engine's state
25 | var ctx = stateTracker.Engine.Clone () as DIndentEngine;
26 | for (int max = offset; max < line.Offset + line.Length; max++) {
27 | ctx.Push (data.Document.GetCharAt (max));
28 | }
29 | // int pos = line.Offset;
30 | string curIndent = line.GetIndentation (data.Document);
31 | int nlwsp = curIndent.Length;
32 | // int o = offset > pos + nlwsp ? offset - (pos + nlwsp) : 0;
33 | if (!stateTracker.Engine.LineBeganInsideMultiLineComment || (nlwsp < line.LengthIncludingDelimiter && data.Document.GetCharAt (line.Offset + nlwsp) == '*')) {
34 | return ctx.ThisLineIndent;
35 | }
36 | return curIndent;
37 | }
38 | public string GetIndentationString (int lineNumber, int column)
39 | {
40 | return GetIndentationString (data.LocationToOffset (lineNumber, column), new DocumentLocation (lineNumber, column));
41 | }
42 |
43 | public string GetIndentationString (int offset)
44 | {
45 | return GetIndentationString (offset, data.OffsetToLocation (offset));
46 | }
47 |
48 | string GetIndent (int lineNumber, int column)
49 | {
50 | var line = data.GetLine (lineNumber);
51 | if (line == null)
52 | return "";
53 | int offset = line.Offset + Math.Min (line.Length, column - 1);
54 |
55 | stateTracker.UpdateEngine (offset);
56 | return stateTracker.Engine.NewLineIndent;
57 | }
58 |
59 | public int GetVirtualIndentationColumn (int offset)
60 | {
61 | return 1 + GetIndentationString (offset).Length;
62 | }
63 |
64 | public int GetVirtualIndentationColumn (int lineNumber, int column)
65 | {
66 | return 1 + GetIndentationString (lineNumber, column).Length;
67 | }
68 | }
69 | }
70 |
--------------------------------------------------------------------------------
/MonoDevelop.DBinding/Building/CompilerPresets/ldc2.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | LDC
5 | ldc2
6 | true
7 |
8 |
9 | "{0}"
10 | "-I={0}"
11 | -d-version
12 | -d-debug
13 | -unittest
14 |
15 | -D
16 | "{0}"
17 | "-Dd={0}"
18 | -L=
19 | "@{0}"
20 | -m32
21 | -m64
22 |
23 |
24 |
25 | ldc2
26 |
27 | -c "$src" "-of=$obj" $includes -g
28 | "-of=$target" -g $objs $libs
29 | -g $sources $libs $includes "-od=$objectsDirectory" "-of=$exe"
30 |
31 |
32 | -c "$src" -release "-of=$obj" $includes -O3
33 | "-of=$target" -release -O3 $objs $libs
34 | -O3 -release $sources $libs $includes "-od=$objectsDirectory" "-of=$exe"
35 |
36 |
37 |
38 |
39 | ldc2
40 |
41 | -relocation-model=pic -c "$src" "-of=$obj" $includes -g
42 | "-of=$target" -g $objs $libs -shared
43 |
44 |
45 | -relocation-model=pic -release -c "$src" "-of=$obj" $includes -O3
46 | "-of=$target" -release -O3 $objs $libs -shared
47 |
48 |
49 |
50 |
51 | ar
52 |
53 | -c "$src" "-of=$obj" $includes -g
54 | rcs "$target" $objs
55 |
56 |
57 | -c "$src" "-of=$obj" $includes -release -O3
58 | rcs "$target" $objs
59 |
60 |
61 |
--------------------------------------------------------------------------------
/MonoDevelop.DBinding/gtk-gui/MonoDevelop.D.ProjectDependenciesWidget.cs:
--------------------------------------------------------------------------------
1 |
2 | // This file has been generated by the GUI designer. Do not modify.
3 | namespace MonoDevelop.D
4 | {
5 | public partial class ProjectDependenciesWidget
6 | {
7 | private global::Gtk.VBox vbox2;
8 | private global::Gtk.Label label16;
9 | private global::Gtk.ScrolledWindow scrolledwindow2;
10 | private global::Gtk.VBox vbox_ProjectDeps;
11 |
12 | protected virtual void Build ()
13 | {
14 | global::Stetic.Gui.Initialize (this);
15 | // Widget MonoDevelop.D.ProjectDependenciesWidget
16 | global::Stetic.BinContainer.Attach (this);
17 | this.HeightRequest = 300;
18 | this.Name = "MonoDevelop.D.ProjectDependenciesWidget";
19 | // Container child MonoDevelop.D.ProjectDependenciesWidget.Gtk.Container+ContainerChild
20 | this.vbox2 = new global::Gtk.VBox ();
21 | this.vbox2.Name = "vbox2";
22 | this.vbox2.Spacing = 6;
23 | // Container child vbox2.Gtk.Box+BoxChild
24 | this.label16 = new global::Gtk.Label ();
25 | this.label16.Name = "label16";
26 | this.label16.Xalign = 0F;
27 | this.label16.LabelProp = global::MonoDevelop.Core.GettextCatalog.GetString ("Checking a project in this list will add an include (that points to the respective project's base directory) to this project automatically.");
28 | this.label16.Wrap = true;
29 | this.vbox2.Add (this.label16);
30 | global::Gtk.Box.BoxChild w1 = ((global::Gtk.Box.BoxChild)(this.vbox2 [this.label16]));
31 | w1.Position = 0;
32 | w1.Expand = false;
33 | // Container child vbox2.Gtk.Box+BoxChild
34 | this.scrolledwindow2 = new global::Gtk.ScrolledWindow ();
35 | this.scrolledwindow2.CanFocus = true;
36 | this.scrolledwindow2.Name = "scrolledwindow2";
37 | // Container child scrolledwindow2.Gtk.Container+ContainerChild
38 | global::Gtk.Viewport w2 = new global::Gtk.Viewport ();
39 | w2.ShadowType = ((global::Gtk.ShadowType)(0));
40 | // Container child GtkViewport.Gtk.Container+ContainerChild
41 | this.vbox_ProjectDeps = new global::Gtk.VBox ();
42 | this.vbox_ProjectDeps.Name = "vbox_ProjectDeps";
43 | this.vbox_ProjectDeps.Spacing = 6;
44 | w2.Add (this.vbox_ProjectDeps);
45 | this.scrolledwindow2.Add (w2);
46 | this.vbox2.Add (this.scrolledwindow2);
47 | global::Gtk.Box.BoxChild w5 = ((global::Gtk.Box.BoxChild)(this.vbox2 [this.scrolledwindow2]));
48 | w5.Position = 1;
49 | this.Add (this.vbox2);
50 | if ((this.Child != null)) {
51 | this.Child.ShowAll ();
52 | }
53 | this.Show ();
54 | }
55 | }
56 | }
57 |
--------------------------------------------------------------------------------
/MonoDevelop.DBinding/Refactoring/DRefactoringContext.cs:
--------------------------------------------------------------------------------
1 | //
2 | // DRefactoringContext.cs
3 | //
4 | // Author:
5 | // Alexander Bothe
6 | //
7 | // Copyright (c) 2013 Alexander Bothe
8 | //
9 | // Permission is hereby granted, free of charge, to any person obtaining a copy
10 | // of this software and associated documentation files (the "Software"), to deal
11 | // in the Software without restriction, including without limitation the rights
12 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13 | // copies of the Software, and to permit persons to whom the Software is
14 | // furnished to do so, subject to the following conditions:
15 | //
16 | // The above copyright notice and this permission notice shall be included in
17 | // all copies or substantial portions of the Software.
18 | //
19 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
25 | // THE SOFTWARE.
26 | using System;
27 | using MonoDevelop.Ide.Gui;
28 | using MonoDevelop.Ide.TypeSystem;
29 | using MonoDevelop.D.Parser;
30 | using D_Parser.Resolver;
31 | using MonoDevelop.D.Resolver;
32 | using D_Parser.Completion;
33 | using D_Parser.Resolver.TypeResolution;
34 | using D_Parser.Dom;
35 |
36 | namespace MonoDevelop.D.Refactoring
37 | {
38 | public class DRefactoringContext : IRefactoringContext
39 | {
40 | public readonly Document Doc;
41 | public readonly ParsedDModule ParsedDoc;
42 | AbstractType[] lastResults;
43 |
44 | public IEditorData ed;
45 | public LooseResolution.NodeResolutionAttempt resultResolutionAttempt;
46 | public ISyntaxRegion syntaxObject;
47 |
48 | public AbstractType[] CurrentResults
49 | {
50 | get{
51 | if (lastResults == null)
52 | lastResults = DResolverWrapper.ResolveHoveredCodeLoosely (out ed, out resultResolutionAttempt, out syntaxObject, Doc);
53 |
54 | return lastResults;
55 | }
56 | }
57 |
58 | public DRefactoringContext (Document doc, ParsedDModule mod)
59 | {
60 | this.ParsedDoc = mod;
61 | this.Doc = doc;
62 | }
63 |
64 | public IDisposable CreateScript ()
65 | {
66 | return null;
67 | }
68 | }
69 | }
70 |
71 |
--------------------------------------------------------------------------------
/readme.md:
--------------------------------------------------------------------------------
1 |
2 | Mono-D is a language binding for MonoDevelop for the [D Programming language](http://dlang.org).
3 |
4 | [Project site](http://wiki.dlang.org/Mono-D).
5 |
6 | Few (none?) GNU/Linux distros package a new enough MonoDevelop required by Mono-D.
7 | You can download pre-built binaries built with mono3 below. Unpack to `/opt/mono`.
8 | * [MonoDevelop GNU/Linux **x64**](http://simendsjo.me/files/abothe/MonoDevelop.x64.Master.tar.xz)
9 |
10 | # How to initialize Mono-D development under Linux
11 |
12 | [](https://gitter.im/aBothe/Mono-D?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
13 |
14 | * Setup MonoDevelop to use /opt/mono instead of other runtimes
15 | - Open MonoDevelop
16 | - Go to Edit -> Options -> Projects tab -> .NET Runtimes
17 | - Enter /opt/mono as new runtime if it's not there already!
18 | - Select it as standard runtime
19 | - Now you can build Mono-D with its gtk-sharp dependencies and no Mono.Cairo conflicts
20 | * Clone Mono-D
21 | - Open a terminal in your projects folder
22 | - `git clone https://github.com/aBothe/Mono-D.git`
23 | - `cd Mono-D`
24 | - `git submodule init`
25 | - `git submodule update`
26 | * Build Mono-D
27 | - Open & build the main solution
28 | - Add symlinks from projectdir/Mono-D/bin/Debug/* to your MonoDevelop AddIns folder
29 | - `cd /opt/mono/lib/monodevelop/AddIns`
30 | - `ln -s -d %YourProjectDirectory%/Mono-D/bin/Debug D`
31 | - In the solution view, open the MonoDevelop.D options -> Properties -> Run -> Custom Commands
32 | - Choose Execute
33 | - Set `/opt/mono/bin/monodevelop` as executable
34 | - Working directory can be left empty
35 | - Confirm via OK
36 | - Press F5 to debug
37 |
38 | # How to initialize Mono-D development under Windows
39 |
40 | * Clone Mono-D
41 | - Open a git bash in your projects folder
42 | - `git clone https://github.com/aBothe/Mono-D.git`
43 | - `cd Mono-D`
44 | - `git submodule init`
45 | - `git submodule update`
46 | * Build Mono-D
47 | - Open & build the main solution inside Visual Studio or Xamarin Studio (the latter is required to do changes on Gtk#-based Option Panels etc.)
48 | - Add symlinks from projectdir/Mono-D/bin/Debug/* to your MonoDevelop AddIns folder
49 | - Run the `make symlink.bat` that is located inside the folder root
50 | - You might want to set a new default executable path to XamarinStudio.exe, but normally, this is not necessary if you've installed XS via the normal installer
51 | - Run & Debug Mono-D
52 |
--------------------------------------------------------------------------------
/MonoDevelop.DBinding/Projects/Dub/DubSolution.cs:
--------------------------------------------------------------------------------
1 | using MonoDevelop.Projects;
2 | using System;
3 | using MonoDevelop.Core.Execution;
4 | using System.Collections.Generic;
5 | using System.Collections.ObjectModel;
6 |
7 | namespace MonoDevelop.D.Projects.Dub
8 | {
9 | ///
10 | /// A dub package container.
11 | ///
12 | public class DubSolution : Solution
13 | {
14 | public readonly SolutionFolder ExternalDepFolder = new SolutionFolder { Name = "External Dependencies" };
15 |
16 | public DubSolution()
17 | {
18 | RootFolder.AddItem (ExternalDepFolder);
19 | }
20 |
21 | internal void AddProject(AbstractDProject sub)
22 | {
23 | var folder = sub.BaseDirectory == BaseDirectory || sub.BaseDirectory.IsChildPathOf (BaseDirectory) ? RootFolder : ExternalDepFolder;
24 |
25 | if (folder == ExternalDepFolder && sub is DubProject) {
26 | var packageName = (sub as DubProject).packageName.Split(':');
27 | for (int i = 0; i < packageName.Length - 1; i++) {
28 | bool foundSubFolder = false;
29 | foreach (var subFolder in folder.GetAllItems()) {
30 | if (String.Equals (subFolder.Name, packageName [i], StringComparison.CurrentCultureIgnoreCase)) {
31 | folder = subFolder;
32 | foundSubFolder = true;
33 | break;
34 | }
35 | }
36 | if (!foundSubFolder) {
37 | var newSubFolder = new SolutionFolder{ Name = packageName [i] };
38 | folder.AddItem (newSubFolder);
39 | folder = newSubFolder;
40 | }
41 | }
42 | }
43 |
44 | if (!folder.Items.Contains (sub))
45 | folder.AddItem (sub, false);
46 | }
47 |
48 | public override string Name
49 | {
50 | get
51 | {
52 | return StartupItem != null ? StartupItem.Name : base.Name;
53 | }
54 | set
55 | {
56 |
57 | }
58 | }
59 |
60 | public override Core.FilePath FileName
61 | {
62 | get
63 | {
64 | return StartupItem != null ? StartupItem.FileName : base.FileName;
65 | }
66 | set
67 | {
68 | }
69 | }
70 |
71 | public override void Dispose ()
72 | {
73 | StartupItem = null;
74 | base.Dispose ();
75 | GC.ReRegisterForFinalize (this);
76 | }
77 |
78 | protected override BuildResult OnBuild (MonoDevelop.Core.IProgressMonitor monitor, ConfigurationSelector configuration)
79 | {
80 | var s = StartupItem as Project;
81 |
82 | if (s == null)
83 | return new BuildResult{ FailedBuildCount = 1, CompilerOutput = "No default package specified!", BuildCount = 0 };
84 |
85 | return StartupItem.Build(monitor, configuration);
86 | }
87 | }
88 | }
89 |
--------------------------------------------------------------------------------
/MonoDevelop.DBinding/OptionPanels/ProjectDependenciesWidget.cs:
--------------------------------------------------------------------------------
1 | using Gtk;
2 | using MonoDevelop.D.Projects;
3 | using System;
4 | using System.Collections;
5 | using System.Collections.Generic;
6 | using MonoDevelop.Projects;
7 |
8 | namespace MonoDevelop.D
9 | {
10 | [System.ComponentModel.ToolboxItem(true)]
11 | public partial class ProjectDependenciesWidget : Bin
12 | {
13 | public readonly DProject Project;
14 | public readonly DProjectConfiguration CurrentConfig;
15 | public ProjectDependenciesWidget (DProject prj, DProjectConfiguration cfg)
16 | {
17 | this.Build ();
18 | Show();
19 |
20 | Project = prj;
21 | CurrentConfig = cfg;
22 | }
23 |
24 | public void Load()
25 | {
26 | // Remove old children list
27 | var depsChildren = ((ArrayList)vbox_ProjectDeps.AllChildren);
28 | for (int k = depsChildren.Count - 1; k >= 0; k--)
29 | vbox_ProjectDeps.Remove((Widget)depsChildren[k]);
30 |
31 | // Init new project dep list
32 | int i = 0;
33 | var refs_ = Project.References.ReferencedProjectIds;
34 | var refs = refs_ as IList ?? new List(refs_);
35 |
36 | foreach(var prj in Project.ParentSolution.GetAllProjects())
37 | {
38 | if (prj == Project)
39 | continue;
40 |
41 | var cb = new CheckButton(prj.Name){
42 | CanFocus=true,
43 | DrawIndicator=true,
44 | UseUnderline=false,
45 | Active = refs.Contains(prj.ItemId)
46 | };
47 |
48 | cb.Data.Add("prj", prj);
49 |
50 | vbox_ProjectDeps.Add(cb);
51 |
52 | var bc=(Box.BoxChild)vbox_ProjectDeps[cb];
53 | bc.Expand=false;
54 | bc.Fill=false;
55 | bc.Position=i++;
56 | }
57 | vbox_ProjectDeps.ShowAll();
58 | }
59 |
60 | public void Store()
61 | {
62 | var tbl = new List(Project.References.ReferencedProjectIds);
63 | var refs = Project.References as DefaultDReferencesCollection;
64 |
65 | foreach (var i in vbox_ProjectDeps)
66 | {
67 | var cb = i as CheckButton;
68 |
69 | if (cb == null)
70 | continue;
71 |
72 | var prj = cb.Data["prj"] as DProject;
73 | if (prj == null)
74 | continue;
75 |
76 | var id = prj.ItemId;
77 |
78 | if (cb.Active) {
79 | if (!tbl.Contains (id))
80 | refs.ProjectDependencies.Add(id);
81 | else
82 | tbl.Remove (id);
83 | } else {
84 | if (tbl.Contains (id)) {
85 | refs.ProjectDependencies.Remove (id);
86 | tbl.Remove (id);
87 | }
88 | }
89 | }
90 |
91 | foreach (var id in tbl)
92 | refs.ProjectDependencies.Remove (id);
93 | }
94 | }
95 | }
96 |
97 |
--------------------------------------------------------------------------------
/MonoDevelop.DBinding/Formatting/DietTemplateFormattingPanel.cs:
--------------------------------------------------------------------------------
1 | //
2 | // DietTemplateFormattingPanel.cs
3 | //
4 | // Author:
5 | // Alexander Bothe
6 | //
7 | // Copyright (c) 2013 Alexander Bothe
8 | //
9 | // Permission is hereby granted, free of charge, to any person obtaining a copy
10 | // of this software and associated documentation files (the "Software"), to deal
11 | // in the Software without restriction, including without limitation the rights
12 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13 | // copies of the Software, and to permit persons to whom the Software is
14 | // furnished to do so, subject to the following conditions:
15 | //
16 | // The above copyright notice and this permission notice shall be included in
17 | // all copies or substantial portions of the Software.
18 | //
19 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
25 | // THE SOFTWARE.
26 | using System;
27 | using MonoDevelop.Ide.Gui.Dialogs;
28 |
29 | namespace MonoDevelop.D.Formatting
30 | {
31 | class DietTemplateFormattingPolicy : IEquatable {
32 | #region IEquatable implementation
33 |
34 | public bool Equals (DietTemplateFormattingPolicy other)
35 | {
36 | return true;
37 | }
38 |
39 | #endregion
40 |
41 |
42 | }
43 |
44 | class DietTemplateFormattingWidget : Gtk.Bin {
45 |
46 | }
47 |
48 | class DietTemplateFormattingPanel : MimeTypePolicyOptionsPanel
49 | {
50 | DietTemplateFormattingPolicy policy = new DietTemplateFormattingPolicy();
51 |
52 | public DietTemplateFormattingPanel ()
53 | {
54 | }
55 |
56 | #region implemented abstract members of OptionsPanel
57 |
58 | public override Gtk.Widget CreatePanelWidget ()
59 | {
60 | return new DietTemplateFormattingWidget();
61 | }
62 |
63 | #endregion
64 |
65 | #region implemented abstract members of MimeTypePolicyOptionsPanel
66 |
67 | protected override void LoadFrom (DietTemplateFormattingPolicy policy)
68 | {
69 | this.policy = policy;
70 | }
71 |
72 | protected override DietTemplateFormattingPolicy GetPolicy ()
73 | {
74 | return policy;
75 | }
76 |
77 | #endregion
78 | }
79 | }
80 |
81 |
--------------------------------------------------------------------------------
/MonoDevelop.DBinding/OptionPanels/UnittestOptions.cs:
--------------------------------------------------------------------------------
1 | //
2 | // UnittestOptions.cs
3 | //
4 | // Author:
5 | // Alexander Bothe
6 | //
7 | // Copyright (c) 2013 Alexander Bothe
8 | //
9 | // Permission is hereby granted, free of charge, to any person obtaining a copy
10 | // of this software and associated documentation files (the "Software"), to deal
11 | // in the Software without restriction, including without limitation the rights
12 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13 | // copies of the Software, and to permit persons to whom the Software is
14 | // furnished to do so, subject to the following conditions:
15 | //
16 | // The above copyright notice and this permission notice shall be included in
17 | // all copies or substantial portions of the Software.
18 | //
19 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
25 | // THE SOFTWARE.
26 | using System;
27 | using MonoDevelop.Ide.Gui.Dialogs;
28 | using MonoDevelop.D.Unittest;
29 |
30 | namespace MonoDevelop.D.OptionPanels
31 | {
32 | [System.ComponentModel.ToolboxItem (true)]
33 | public partial class UnittestOptions : Gtk.Bin
34 | {
35 | public UnittestOptions ()
36 | {
37 | this.Build ();
38 |
39 | text_UnittestCommand.Text = UnittestSettings.UnittestCommand;
40 | text_MainCreationFlag.Text = UnittestSettings.MainMethodFlag;
41 | }
42 |
43 | public void Save()
44 | {
45 | UnittestSettings.UnittestCommand = text_UnittestCommand.Text;
46 | UnittestSettings.MainMethodFlag = text_MainCreationFlag.Text;
47 | }
48 |
49 | protected void Reset_MainMethodFlag (object sender, EventArgs e)
50 | {
51 | text_MainCreationFlag.Text = UnittestSettings.MainMethodFlag_Default;
52 | }
53 |
54 | protected void Reset_UnittestCmd (object sender, EventArgs e)
55 | {
56 | text_UnittestCommand.Text = UnittestSettings.UnittestCommand_Default;
57 | }
58 | }
59 |
60 | public class UnittestOptionsBinding : OptionsPanel
61 | {
62 | UnittestOptions w;
63 | public override Gtk.Widget CreatePanelWidget ()
64 | {
65 | return w = new UnittestOptions ();
66 | }
67 |
68 | public override void ApplyChanges ()
69 | {
70 | w.Save ();
71 | }
72 | }
73 | }
74 |
75 |
--------------------------------------------------------------------------------
/MonoDevelop.DBinding/Projects/Dub/DubSubPackage.cs:
--------------------------------------------------------------------------------
1 | //
2 | // DubSubPackage.cs
3 | //
4 | // Author:
5 | // Alexander Bothe
6 | //
7 | // Copyright (c) 2013 Alexander Bothe
8 | //
9 | // Permission is hereby granted, free of charge, to any person obtaining a copy
10 | // of this software and associated documentation files (the "Software"), to deal
11 | // in the Software without restriction, including without limitation the rights
12 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13 | // copies of the Software, and to permit persons to whom the Software is
14 | // furnished to do so, subject to the following conditions:
15 | //
16 | // The above copyright notice and this permission notice shall be included in
17 | // all copies or substantial portions of the Software.
18 | //
19 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
25 | // THE SOFTWARE.
26 | using System;
27 | using Newtonsoft.Json;
28 | using MonoDevelop.Projects;
29 | using System.Collections.Generic;
30 | using System.Linq;
31 | using MonoDevelop.Core;
32 |
33 | namespace MonoDevelop.D.Projects.Dub
34 | {
35 | public class DubSubPackage : DubProject
36 | {
37 | public bool useOriginalBasePath;
38 | public FilePath OriginalBasePath;
39 | public FilePath VirtualBasePath;
40 |
41 | protected override FilePath GetDefaultBaseDirectory ()
42 | {
43 | return useOriginalBasePath ? OriginalBasePath : VirtualBasePath;
44 | }
45 |
46 | public override IEnumerable GetSourcePaths (ConfigurationSelector sel)
47 | {
48 | useOriginalBasePath = true;
49 | var en = base.GetSourcePaths (sel).ToList();
50 | useOriginalBasePath = false;
51 | return en;
52 | }
53 |
54 | protected override void DoExecute (IProgressMonitor monitor, ExecutionContext context, ConfigurationSelector configuration)
55 | {
56 | useOriginalBasePath = true;
57 | base.DoExecute (monitor, context, configuration);
58 | useOriginalBasePath = false;
59 | }
60 |
61 | protected override BuildResult DoBuild (IProgressMonitor monitor, ConfigurationSelector configuration)
62 | {
63 | useOriginalBasePath = true;
64 | var res = base.DoBuild (monitor, configuration);
65 | useOriginalBasePath = false;
66 | return res;
67 | }
68 | }
69 | }
70 |
71 |
--------------------------------------------------------------------------------
/MonoDevelop.DBinding/Projects/Dub/DubSettings.cs:
--------------------------------------------------------------------------------
1 | //
2 | // DubSettings.cs
3 | //
4 | // Author:
5 | // Alexander Bothe
6 | //
7 | // Copyright (c) 2013 Alexander Bothe
8 | //
9 | // Permission is hereby granted, free of charge, to any person obtaining a copy
10 | // of this software and associated documentation files (the "Software"), to deal
11 | // in the Software without restriction, including without limitation the rights
12 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13 | // copies of the Software, and to permit persons to whom the Software is
14 | // furnished to do so, subject to the following conditions:
15 | //
16 | // The above copyright notice and this permission notice shall be included in
17 | // all copies or substantial portions of the Software.
18 | //
19 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
25 | // THE SOFTWARE.
26 | using MonoDevelop.Core;
27 | using System.Xml;
28 |
29 | namespace MonoDevelop.D
30 | {
31 | public class DubSettings : ICustomXmlSerializer
32 | {
33 | #region Properties
34 | const string DubSettingsPropId = "MonoDevelop.D.Dub";
35 | static DubSettings inst;
36 | public static DubSettings Instance
37 | {
38 | get{
39 | if (inst == null) {
40 | inst = PropertyService.Get (DubSettingsPropId);
41 | if (inst == null)
42 | inst = new DubSettings ();
43 | }
44 |
45 | return inst;
46 | }
47 | }
48 |
49 | public static void Save()
50 | {
51 | PropertyService.Set (DubSettingsPropId, Instance);
52 | }
53 |
54 | public string DubCommand = "dub";
55 | public string CommonArgs = string.Empty;
56 | #endregion
57 |
58 | #region Loading & Saving
59 | public void WriteTo (XmlWriter w)
60 | {
61 | w.WriteStartElement ("cmd");
62 | w.WriteCData (DubCommand);
63 | w.WriteEndElement ();
64 |
65 | w.WriteStartElement ("commonargs");
66 | w.WriteCData (CommonArgs);
67 | w.WriteEndElement ();
68 | }
69 |
70 | public ICustomXmlSerializer ReadFrom (XmlReader r)
71 | {
72 | while (r.Read ()) {
73 | switch (r.LocalName) {
74 | case "cmd":
75 | DubCommand = r.ReadString ();
76 | break;
77 | case "commonargs":
78 | CommonArgs = r.ReadString ();
79 | break;
80 | }
81 | }
82 | return this;
83 | }
84 | #endregion
85 | }
86 | }
87 |
88 |
--------------------------------------------------------------------------------
/MonoDevelop.DBinding/Refactoring/ImportSymbolSelectionDlg.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using Gtk;
3 | using D_Parser.Dom;
4 | using MonoDevelop.Ide;
5 | using System.Collections.Generic;
6 |
7 | namespace MonoDevelop.D
8 | {
9 | public partial class ImportSymbolSelectionDlg : Dialog
10 | {
11 | public static T Show(IEnumerable items, string title, Func