diff options
author | Mike Krüger <mkrueger@novell.com> | 2011-06-19 20:45:56 +0400 |
---|---|---|
committer | Mike Krüger <mkrueger@novell.com> | 2011-06-19 20:45:56 +0400 |
commit | 9a5746028b24fd50fd587f7cb95a8a74ff82c747 (patch) | |
tree | 1a5f11bcd8c77cb38ca7cfe124cf859a3c3594ce /main/src/addins/CBinding | |
parent | 3d03fd1ba6f695d9146068337cb72eaabd1783b1 (diff) |
Refactored ambiences / tried to track illigal instruction.
Diffstat (limited to 'main/src/addins/CBinding')
-rw-r--r-- | main/src/addins/CBinding/Gui/CTextEditorExtension.cs | 6 | ||||
-rw-r--r-- | main/src/addins/CBinding/Parser/DataProvider.cs | 6 |
2 files changed, 7 insertions, 5 deletions
diff --git a/main/src/addins/CBinding/Gui/CTextEditorExtension.cs b/main/src/addins/CBinding/Gui/CTextEditorExtension.cs index cffbf66400..483e61c090 100644 --- a/main/src/addins/CBinding/Gui/CTextEditorExtension.cs +++ b/main/src/addins/CBinding/Gui/CTextEditorExtension.cs @@ -682,12 +682,12 @@ namespace CBinding var result = new List<PathEntry> (); var amb = GetAmbience (); - + var ctx = document.TypeResolveContext; var type = unit.GetTypeDefinition (loc.Line, loc.Column) ?? unit.TopLevelTypeDefinitions.FirstOrDefault (); var curType = type; object lastTag = unit; while (curType != null) { - var markup = amb.GetString (curType, OutputFlags.IncludeGenerics | OutputFlags.IncludeParameters | OutputFlags.ReformatDelegates | OutputFlags.IncludeMarkup); + var markup = amb.GetString (ctx, (IEntity)curType, OutputFlags.IncludeGenerics | OutputFlags.IncludeParameters | OutputFlags.ReformatDelegates | OutputFlags.IncludeMarkup); result.Insert (0, new PathEntry (ImageService.GetPixbuf (type.GetStockIcon (), Gtk.IconSize.Menu), curType.IsObsolete () ? "<s>" + markup + "</s>" : markup) { Tag = lastTag }); lastTag = curType; curType = curType.DeclaringTypeDefinition; @@ -695,7 +695,7 @@ namespace CBinding var member = type.Members.FirstOrDefault (m => m.Region.IsInside (loc.Line, loc.Column)); if (member != null) { - var markup = amb.GetString (member, OutputFlags.IncludeGenerics | OutputFlags.IncludeParameters | OutputFlags.ReformatDelegates | OutputFlags.IncludeMarkup); + var markup = amb.GetString (ctx, member, OutputFlags.IncludeGenerics | OutputFlags.IncludeParameters | OutputFlags.ReformatDelegates | OutputFlags.IncludeMarkup); result.Add (new PathEntry (ImageService.GetPixbuf (member.GetStockIcon (), Gtk.IconSize.Menu), member.IsObsolete () ? "<s>" + markup + "</s>" : markup) { Tag = lastTag }); } diff --git a/main/src/addins/CBinding/Parser/DataProvider.cs b/main/src/addins/CBinding/Parser/DataProvider.cs index ed84cd34b4..995858b5f9 100644 --- a/main/src/addins/CBinding/Parser/DataProvider.cs +++ b/main/src/addins/CBinding/Parser/DataProvider.cs @@ -47,6 +47,7 @@ namespace CBinding.Parser { object tag; Ambience amb; + ITypeResolveContext ctx; List<IEntity> memberList = new List<IEntity> (); Document Document { @@ -57,6 +58,7 @@ namespace CBinding.Parser public DataProvider (Document doc, object tag, Ambience amb) { this.Document = doc; + this.ctx = doc.TypeResolveContext; this.tag = tag; this.amb = amb; Reset (); @@ -83,8 +85,8 @@ namespace CBinding.Parser string GetString (Ambience amb, IEntity x) { if (tag is IParsedFile) - return amb.GetString (x, OutputFlags.IncludeGenerics | OutputFlags.IncludeParameters | OutputFlags.UseFullInnerTypeName | OutputFlags.ReformatDelegates); - return amb.GetString (x, OutputFlags.IncludeGenerics | OutputFlags.IncludeParameters | OutputFlags.ReformatDelegates); + return amb.GetString (ctx, x, OutputFlags.IncludeGenerics | OutputFlags.IncludeParameters | OutputFlags.UseFullInnerTypeName | OutputFlags.ReformatDelegates); + return amb.GetString (ctx, x, OutputFlags.IncludeGenerics | OutputFlags.IncludeParameters | OutputFlags.ReformatDelegates); } public string GetMarkup (int n) |