diff options
author | Lluis Sanchez <lluis@novell.com> | 2009-10-07 14:51:37 +0400 |
---|---|---|
committer | Lluis Sanchez <lluis@novell.com> | 2009-10-07 14:51:37 +0400 |
commit | c53408e94c88c940ea6aca301343149fc92ba6e5 (patch) | |
tree | 36b269b954963f9209ea9288df22743e4e394c15 /extras/MonoDevelop.AddinAuthoring | |
parent | d24233b5d12923130ce260a515828c33371b180a (diff) |
* MonoDevelop.AddinAuthoring/AddinDescriptionView.cs:
* MonoDevelop.AddinAuthoring/AddinAuthoringService.cs: Improve
formatting of saved .addin files.
* MonoDevelop.AddinAuthoring/AddinData.cs: Remove debug code.
* MonoDevelop.AddinAuthoring.CodeCompletion/CodeCompletionExtension.cs:
Track api changes.
svn path=/trunk/monodevelop/; revision=143614
Diffstat (limited to 'extras/MonoDevelop.AddinAuthoring')
5 files changed, 45 insertions, 4 deletions
diff --git a/extras/MonoDevelop.AddinAuthoring/ChangeLog b/extras/MonoDevelop.AddinAuthoring/ChangeLog index 058022d2a6..aec17db56e 100644 --- a/extras/MonoDevelop.AddinAuthoring/ChangeLog +++ b/extras/MonoDevelop.AddinAuthoring/ChangeLog @@ -1,3 +1,14 @@ +2009-10-07 Lluis Sanchez Gual <lluis@novell.com> + + * MonoDevelop.AddinAuthoring/AddinDescriptionView.cs: + * MonoDevelop.AddinAuthoring/AddinAuthoringService.cs: Improve + formatting of saved .addin files. + + * MonoDevelop.AddinAuthoring/AddinData.cs: Remove debug code. + + * MonoDevelop.AddinAuthoring.CodeCompletion/CodeCompletionExtension.cs: + Track api changes. + 2009-10-01 Lluis Sanchez Gual <lluis@novell.com> * gtk-gui/gui.stetic: diff --git a/extras/MonoDevelop.AddinAuthoring/MonoDevelop.AddinAuthoring.CodeCompletion/CodeCompletionExtension.cs b/extras/MonoDevelop.AddinAuthoring/MonoDevelop.AddinAuthoring.CodeCompletion/CodeCompletionExtension.cs index 528ec0d91a..7047dccfcc 100644 --- a/extras/MonoDevelop.AddinAuthoring/MonoDevelop.AddinAuthoring.CodeCompletion/CodeCompletionExtension.cs +++ b/extras/MonoDevelop.AddinAuthoring/MonoDevelop.AddinAuthoring.CodeCompletion/CodeCompletionExtension.cs @@ -124,22 +124,26 @@ namespace MonoDevelop.AddinAuthoring.CodeCompletion } } - protected override void GetAttributeCompletions(CompletionDataList list, IAttributedXObject attributedOb, Dictionary<string, string> existingAtts) + protected override CompletionDataList GetAttributeCompletions(IAttributedXObject attributedOb, Dictionary<string, string> existingAtts) { + CompletionDataList list = new CompletionDataList (); CompletionContext ctx = GetCompletionContext (1); if (ctx != null) { ctx.SetCompletionAction (CompletionAction.AttributeStart, null); ctx.AddCompletionData (list); } + return list; } - protected override void GetAttributeValueCompletions(CompletionDataList list, IAttributedXObject attributedOb, XAttribute att) + protected override CompletionDataList GetAttributeValueCompletions(IAttributedXObject attributedOb, XAttribute att) { + CompletionDataList list = new CompletionDataList (); CompletionContext ctx = GetCompletionContext (1); if (ctx != null) { ctx.SetCompletionAction (CompletionAction.AttributeValue, att.Name.Name); ctx.AddCompletionData (list); } + return list; } diff --git a/extras/MonoDevelop.AddinAuthoring/MonoDevelop.AddinAuthoring/AddinAuthoringService.cs b/extras/MonoDevelop.AddinAuthoring/MonoDevelop.AddinAuthoring/AddinAuthoringService.cs index a3252ea877..4633966677 100644 --- a/extras/MonoDevelop.AddinAuthoring/MonoDevelop.AddinAuthoring/AddinAuthoringService.cs +++ b/extras/MonoDevelop.AddinAuthoring/MonoDevelop.AddinAuthoring/AddinAuthoringService.cs @@ -35,9 +35,11 @@ using Mono.Addins.Setup; using MonoDevelop.Core; using MonoDevelop.Core.ProgressMonitoring; using MonoDevelop.Ide.Gui; +using MonoDevelop.Ide.Gui.Content; using MonoDevelop.Projects; using MonoDevelop.Core.Serialization; using MonoDevelop.Projects.Formats.MSBuild; +using MonoDevelop.Xml.Formatting; namespace MonoDevelop.AddinAuthoring { @@ -298,6 +300,31 @@ namespace MonoDevelop.AddinAuthoring } return false; } + + public static void SaveFormatted (AddinDescription adesc) + { + XmlDocument doc = adesc.SaveToXml (); + XmlFormatter formatter = new XmlFormatter (); + + TextStylePolicy textPolicy = new TextStylePolicy (80, 4, false, false, true, EolMarker.Unix); + XmlFormattingPolicy xmlPolicy = new XmlFormattingPolicy (); + + XmlFormatingSettings f = new XmlFormatingSettings (); + f.ScopeXPath.Add ("*/*"); + f.EmptyLinesBeforeStart = 1; + f.EmptyLinesAfterEnd = 1; + xmlPolicy.Formats.Add (f); + + f = new XmlFormatingSettings (); + f.ScopeXPath.Add ("Addin"); + f.AttributesInNewLine = true; + f.AlignAttributes = true; + f.AttributesInNewLine = false; + xmlPolicy.Formats.Add (f); + + string xml = formatter.FormatXml (textPolicy, xmlPolicy, doc.OuterXml); + File.WriteAllText (adesc.FileName, xml); + } } class AddinAuthoringServiceConfig diff --git a/extras/MonoDevelop.AddinAuthoring/MonoDevelop.AddinAuthoring/AddinData.cs b/extras/MonoDevelop.AddinAuthoring/MonoDevelop.AddinAuthoring/AddinData.cs index db3598ab72..c973ad8a62 100644 --- a/extras/MonoDevelop.AddinAuthoring/MonoDevelop.AddinAuthoring/AddinData.cs +++ b/extras/MonoDevelop.AddinAuthoring/MonoDevelop.AddinAuthoring/AddinData.cs @@ -289,7 +289,6 @@ namespace MonoDevelop.AddinAuthoring Hashtable addinRefs = new Hashtable (); foreach (AddinDependency adep in CachedAddinManifest.MainModule.Dependencies) { bool found = false; - Console.WriteLine (" r:" + adep.FullAddinId); foreach (ProjectReference pr in Project.References) { if ((pr is AddinProjectReference) && pr.Reference == adep.FullAddinId) { found = true; diff --git a/extras/MonoDevelop.AddinAuthoring/MonoDevelop.AddinAuthoring/AddinDescriptionView.cs b/extras/MonoDevelop.AddinAuthoring/MonoDevelop.AddinAuthoring/AddinDescriptionView.cs index 95718305d8..6789f5a328 100644 --- a/extras/MonoDevelop.AddinAuthoring/MonoDevelop.AddinAuthoring/AddinDescriptionView.cs +++ b/extras/MonoDevelop.AddinAuthoring/MonoDevelop.AddinAuthoring/AddinDescriptionView.cs @@ -74,7 +74,7 @@ namespace MonoDevelop.AddinAuthoring public override void Save () { descWidget.Save (); - adesc.Save (); + AddinAuthoringService.SaveFormatted (adesc); IsDirty = false; data.NotifyChanged (true); } |