diff options
author | Mike Krüger <mkrueger@novell.com> | 2010-04-26 23:35:26 +0400 |
---|---|---|
committer | Mike Krüger <mkrueger@novell.com> | 2010-04-26 23:35:26 +0400 |
commit | d09d8b5c796edc23fe1cd1cbe6767a7544182298 (patch) | |
tree | 464bd8529aef087124effa8ab6ff27409a472ade /main/src | |
parent | 2d740cc14cabaa2f93c5d0ed0e55644ccf38bc7e (diff) |
* MonoDevelop.Ide.NavigateToDialog/NavigateToDialog.cs: Worked on
navigate to dialog.
svn path=/trunk/monodevelop/; revision=156124
Diffstat (limited to 'main/src')
-rw-r--r-- | main/src/core/MonoDevelop.Ide/ChangeLog | 5 | ||||
-rw-r--r-- | main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.NavigateToDialog/NavigateToDialog.cs | 34 |
2 files changed, 32 insertions, 7 deletions
diff --git a/main/src/core/MonoDevelop.Ide/ChangeLog b/main/src/core/MonoDevelop.Ide/ChangeLog index 146b95618d..2506639368 100644 --- a/main/src/core/MonoDevelop.Ide/ChangeLog +++ b/main/src/core/MonoDevelop.Ide/ChangeLog @@ -1,5 +1,10 @@ 2010-04-26 Mike Krüger <mkrueger@novell.com> + * MonoDevelop.Ide.NavigateToDialog/NavigateToDialog.cs: Worked + on navigate to dialog. + +2010-04-26 Mike Krüger <mkrueger@novell.com> + * MonoDevelop.Ide.NavigateToDialog/NavigateToDialog.cs: changed file search behavior to the old one. diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.NavigateToDialog/NavigateToDialog.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.NavigateToDialog/NavigateToDialog.cs index 5fd82e4b8c..515eeed3b5 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.NavigateToDialog/NavigateToDialog.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.NavigateToDialog/NavigateToDialog.cs @@ -553,9 +553,11 @@ namespace MonoDevelop.Ide.NavigateToDialog SearchResult CheckType (IType type, string toMatch) { int rank; - if (!MatchName (type.Name, toMatch, out rank)) - return null; - return new TypeSearchResult (toMatch, rank, type); + if (MatchName (type.Name, toMatch, out rank)) + return new TypeSearchResult (toMatch, rank, type, true); + if (MatchName (type.FullName, toMatch, out rank)) + return new TypeSearchResult (toMatch, rank, type, false); + return null; } SearchResult CheckMember (IMember member, string toMatch) @@ -837,18 +839,29 @@ namespace MonoDevelop.Ide.NavigateToDialog class TypeSearchResult : MemberSearchResult { + bool useFullName; + public override string File { get { return ((IType)member).CompilationUnit.FileName; } } + protected override OutputFlags Flags { + get { + return OutputFlags.IncludeParameters | OutputFlags.IncludeGenerics | (useFullName ? OutputFlags.None : OutputFlags.UseFullName); + } + } + public override string Description { get { - return String.Format (GettextCatalog.GetString ("from Project \"{0}\""), ((IType)member).SourceProject.Name); + if (useFullName) + return String.Format (GettextCatalog.GetString ("from Project \"{0}\""), ((IType)member).SourceProject.Name); + return String.Format (GettextCatalog.GetString ("from Project \"{0} in {1}\""), ((IType)member).SourceProject.Name, ((IType)member).Namespace); } } - public TypeSearchResult (string match, int rank, IType type) : base (match, rank, type) + public TypeSearchResult (string match, int rank, IType type, bool useFullName) : base (match, rank, type) { + this.useFullName = useFullName; } } @@ -901,9 +914,16 @@ namespace MonoDevelop.Ide.NavigateToDialog { protected IMember member; + protected virtual OutputFlags Flags { + get { + return OutputFlags.IncludeParameters | OutputFlags.IncludeGenerics; + } + } + public override string MarkupText { get { - OutputSettings settings = new OutputSettings (OutputFlags.IncludeParameters | OutputFlags.IncludeGenerics | OutputFlags.IncludeMarkup); + + OutputSettings settings = new OutputSettings (Flags | OutputFlags.IncludeMarkup); settings.EmitNameCallback = delegate (INode domVisitable, ref string outString) { if (domVisitable == member) outString = HighlightMatch (outString, match); @@ -914,7 +934,7 @@ namespace MonoDevelop.Ide.NavigateToDialog public override string PlainText { get { - return Ambience.GetString (member, OutputFlags.IncludeParameters | OutputFlags.IncludeGenerics); + return Ambience.GetString (member, Flags); } } |