Closed aka-demik closed 9 years ago
You mean 'Go to declaration', right? This should work properly - did you reference the phobos&druntime include paths in the D settings?
I mean "Search - Go to type..." menu command and Xamarin Unified Search
Ah okay. I've tried to activate this feature for D as well a couple of months ago, but the API of XamarinStudio does not allow custom search result providers - I could check it again, but I don't think they touched this place ever again.
Amazingly, one can add custom providers now. Thanks for the request! :)
Thanks for Mono-D =)
The search will be performed on the project files or external dependencies, too? It would be wonderful if it were possible to choose between "current project" / "Whole solution" search.
I'll make it search all the open projects & their includes first.
Of course I could introduce tags like 'this' or 'sln' to make more fine-grained lookups, but I'm not sure how to easily bring this feature-knowledge to all users.
The menu item "Search - Go to type" puts the focus in the "Unified Search" field and fills it with the text "type:". Maybe add menu items "Search - Go to D-type in sln", "Search - Go to D-type in this file" ... which are will fill the "Unified Search" field with appropriate tags.
Why do you think it's important to have these two options, searching in the current project vs. searching in the entire solution?
According to the experience of using "Go to file ...". This is a very handy feature for projects with a large source tree. But if the project uses Vibe.d or other external dependencies with many files, it is often necessary to write the name of the file completely. Or browse the long list of results. Too many files with similar names =).
So sometimes I dream about a menu item "Go to file in project ...".
What about always writing the project's name in the result description?
As On this screenshot? This is not exactly what I wanted, but also good.
I've put the symbol's tree path into the description - this should work then for non-project-related files as modules.
How do you like the feature as it's implemented right now?
I'm sorry for the delay. Today was a computerless weekend =) Tried version 2.12. Unfortunately it is not working. Now the search is broken completely.It does not produce any results. But I have this in ide *.log:
ERROR [2015-05-01 21:52:50Z]: Error getting search results
System.AggregateException: Произошла одна или несколько ошибок. ---> System.NullReferenceException: Ссылка на объект не указывает на экземпляр объекта.
в System.Linq.Enumerable.<SelectManyIterator>d__14`2.MoveNext()
в System.Linq.Lookup`2.Create[TSource](IEnumerable`1 source, Func`2 keySelector, Func`2 elementSelector, IEqualityComparer`1 comparer)
в System.Linq.GroupedEnumerable`3.GetEnumerator()
в System.Linq.Enumerable.ToDictionary[TSource,TKey,TElement](IEnumerable`1 source, Func`2 keySelector, Func`2 elementSelector, IEqualityComparer`1 comparer)
в ICSharpCode.NRefactory.CSharp.TypeSystem.CSharpAssembly.GetTypes()
в ICSharpCode.NRefactory.CSharp.TypeSystem.CSharpAssembly.get_TopLevelTypeDefinitions()
в ICSharpCode.NRefactory.TypeSystem.TypeSystemExtensions.GetAllTypeDefinitions(IAssembly assembly)
в MonoDevelop.Components.MainToolbar.ProjectSearchCategory.<get_types>d__0.MoveNext()
в System.Linq.Enumerable.FirstOrDefault[TSource](IEnumerable`1 source)
в MonoDevelop.Components.MainToolbar.ProjectSearchCategory.<>c__DisplayClass19.<GetResults>b__18()
в System.Threading.Tasks.Task`1.InnerInvoke()
в System.Threading.Tasks.Task.Execute()
--- Конец трассировки внутреннего стека исключений ---
---> (Внутреннее исключение #0) System.NullReferenceException: Ссылка на объект не указывает на экземпляр объекта.
в System.Linq.Enumerable.<SelectManyIterator>d__14`2.MoveNext()
в System.Linq.Lookup`2.Create[TSource](IEnumerable`1 source, Func`2 keySelector, Func`2 elementSelector, IEqualityComparer`1 comparer)
в System.Linq.GroupedEnumerable`3.GetEnumerator()
в System.Linq.Enumerable.ToDictionary[TSource,TKey,TElement](IEnumerable`1 source, Func`2 keySelector, Func`2 elementSelector, IEqualityComparer`1 comparer)
в ICSharpCode.NRefactory.CSharp.TypeSystem.CSharpAssembly.GetTypes()
в ICSharpCode.NRefactory.CSharp.TypeSystem.CSharpAssembly.get_TopLevelTypeDefinitions()
в ICSharpCode.NRefactory.TypeSystem.TypeSystemExtensions.GetAllTypeDefinitions(IAssembly assembly)
в MonoDevelop.Components.MainToolbar.ProjectSearchCategory.<get_types>d__0.MoveNext()
в System.Linq.Enumerable.FirstOrDefault[TSource](IEnumerable`1 source)
в MonoDevelop.Components.MainToolbar.ProjectSearchCategory.<>c__DisplayClass19.<GetResults>b__18()
в System.Threading.Tasks.Task`1.InnerInvoke()
в System.Threading.Tasks.Task.Execute()<---
My Xamarin Version 5.9 (build 431).
This is a bug inside XS - it only appears on files that are immediately opened after the launch of XS. I already filed a bug report :)
As a temporary workaround, just close the file you edit and re-open it from the project pad. It's weird, brought me huge headaches but easy to fix..hopefully it won't take too much time for them to react. I better file my own PR to them.
Oh and it's occurring on files that do not belong to any opened project, so that's how the magic works, unfortunately.
One of the open files was not owned by the project. I closed it. Now the search is working as before.It finds only results in Xamarin commands. Try reopen files from project pad, did not help.=(
The log has errors. But I think they do not apply to this issue. Anyway:
ERROR [2015-05-02 09:04:39Z]: Could not update jumplists
System.InvalidOperationException: The file type is not registered with this application.
в Microsoft.WindowsAPICodePack.Taskbar.JumpList.AppendCustomCategories()
в Microsoft.WindowsAPICodePack.Taskbar.JumpList.Refresh()
в MonoDevelop.Platform.JumpList.UpdateJumpList()
в MonoDevelop.Platform.JumpList.OnUpdateTimerEllapsed(Object sender, EventArgs args)
INFO [2015-05-02 09:04:40Z]: Parsed 0 files in "" in 0ms (0ms;0% parse time) (~0ms/0ms per file)
INFO [2015-05-02 09:04:40Z]: Parsed 0 files in "" in 0ms (0ms;0% parse time) (~0ms/0ms per file)
INFO [2015-05-02 09:04:40Z]: Parsed 0 files in "" in 0ms (0ms;0% parse time) (~0ms/0ms per file)
INFO [2015-05-02 09:04:40Z]: Add-in loaded: MonoDevelop.Debugger.Soft.AspNet
INFO [2015-05-02 09:04:40Z]: Add-in loaded: MonoDevelop.Debugger.Win32
ERROR [2015-05-02 09:04:41Z]: Could not update jumplists
System.InvalidOperationException: The file type is not registered with this application.
в Microsoft.WindowsAPICodePack.Taskbar.JumpList.AppendCustomCategories()
в Microsoft.WindowsAPICodePack.Taskbar.JumpList.Refresh()
в MonoDevelop.Platform.JumpList.UpdateJumpList()
в MonoDevelop.Platform.JumpList.OnUpdateTimerEllapsed(Object sender, EventArgs args)
ERROR [2015-05-02 09:08:29Z]: Gdk-Critical: inner_clipboard_window_procedure: assertion 'success' failed
Stack trace:
at Gtk.Application.gtk_main()
at Gtk.Application.Run()
at MonoDevelop.Ide.IdeApp.Run()
at MonoDevelop.Ide.IdeStartup.Run(MonoDevelopOptions options)
at MonoDevelop.Ide.IdeStartup.Main(String[] args, IdeCustomizer customizer)
at Xamarin.Startup.MainClass.Main(String[] args)
ERROR [2015-05-02 09:11:53Z]: Gdk-Critical: inner_clipboard_window_procedure: assertion 'success' failed
Stack trace:
at Gtk.Application.gtk_main()
at Gtk.Application.Run()
at MonoDevelop.Ide.IdeApp.Run()
at MonoDevelop.Ide.IdeStartup.Run(MonoDevelopOptions options)
at MonoDevelop.Ide.IdeStartup.Main(String[] args, IdeCustomizer customizer)
at Xamarin.Startup.MainClass.Main(String[] args)
I'll leave this issue open until this ugly bug has been fixed. Sry for the inconveniences.
In any case, now we are closer to a working "Unified Search". Thank you.
Took me a second pair of eyes to fix this :)
Hmm... Now other error.
ERROR [2015-05-05 17:57:57Z]: Add-in error (MonoDevelop.D,2.12.1): Error while getting object for node in path '/MonoDevelop/Ide/SearchCategories'.
System.InvalidOperationException: Type 'MonoDevelop.D.Gui.DTypeSearchCategory' not found in add-in 'MonoDevelop.D,2.12.1'
at Mono.Addins.RuntimeAddin.GetType(String typeName, Boolean throwIfNotFound)
at Mono.Addins.TypeExtensionNode.get_Type()
at Mono.Addins.TypeExtensionNode.CreateInstance()
at Mono.Addins.InstanceExtensionNode.GetInstance(Type expectedType)
at Mono.Addins.ExtensionNode.GetChildObjectsInternal(Type arrayElementType, Boolean reuseCachedInstance)
v2.12.2 .. missed an entry in the project file >_> sorry for this
Hooray, it works. Thank you =D
You're welcome :) If you've got further points of discussion/improvements, please make a new issue report :)
This is a very handy feature for code-navigation. Perhaps there is another convenient way to search in the document outline. But I do not know about it.