Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Visual Studio.NET / Extensibility / September 2005

Tip: Looking for answers? Try searching our database.

How can I execute Edit.GoToDefinition and check return status?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Parag Chandra - 19 Aug 2005 19:32 GMT
Hi,

I'm writing some functionality that first requires jumping to the definition
of the symbol under the cursor. Is it possible to somehow call
Edit.GoToDefinition and check its return status so that I know if the symbol
definition was found or not? I thought of checking the cursor position
before and after executing the command; if they're the same then it's likely
the command failed, but I still get the message box. Is there some alternate
way to find the definition of a symbol programmatically? Thanks.
"Gary Chang[MSFT]" - 20 Aug 2005 10:19 GMT
Hi Parag,

>Is it possible to somehow call Edit.GoToDefinition and check
>its return status so that I know if the symbol definition was found
>or not.
>......

In the VS IDE's code editor, If the selected text/symbol doesn't not have a
definition, then the GoToDefinition command in the UI will be disabled.
This status is checked by the IVsObjectList.CanGoToSource method, I suggest
you could take a look on it.

Thanks!

Best regards,

Gary Chang
Microsoft Community Support
--------------------
Get Secure! ¡§C www.microsoft.com/security
Register to Access MSDN Managed Newsgroups!
http://support.microsoft.com/default.aspx?scid=/servicedesks/msdn/nospam.asp
&SD=msdn

This posting is provided "AS IS" with no warranties, and confers no rights.
Parag Chandra - 06 Sep 2005 15:24 GMT
Hi Gary,

I didn't have a chance to try this out earlier, so I want to revisit it now.
How do I obtain an IVsObjectList? It seems like I might be able to make use
of SVsObjectManager to call IVsObjectManager2.GetListAndIndex(), but it's
not clear what I should pass in for pNavInfo or dwFlags. Do you have some
client code obtaining and making use of IVsObjectList? Thanks.

> Hi Parag,
>
[quoted text clipped - 24 lines]
> This posting is provided "AS IS" with no warranties, and confers no
> rights.
"Gary Chang[MSFT]" - 07 Sep 2005 10:50 GMT
Hi Parag,

Currently, we are looking into this problem. We will update you as soon as
possible.

Thanks for your understanding!

Best regards,

Gary Chang
Microsoft Community Support
--------------------
Get Secure! ¡§C www.microsoft.com/security
Register to Access MSDN Managed Newsgroups!
http://support.microsoft.com/default.aspx?scid=/servicedesks/msdn/nospam.asp
&SD=msdn

This posting is provided "AS IS" with no warranties, and confers no rights.
"Gary Chang[MSFT]" - 08 Sep 2005 03:59 GMT
Hi Param,

I need to confirm do you want to implement the IVsObjectLists yourself or
you are trying to access the lists implemented by some other symbol
provider?

Thanks!

Best regards,

Gary Chang
Microsoft Community Support
--------------------
Get Secure! ¡§C www.microsoft.com/security
Register to Access MSDN Managed Newsgroups!
http://support.microsoft.com/default.aspx?scid=/servicedesks/msdn/nospam.asp
&SD=msdn

This posting is provided "AS IS" with no warranties, and confers no rights.
Parag Chandra - 08 Sep 2005 14:56 GMT
Hi Gary,

I want to access the IVsObjectLists of some other provider; no interest in
implementing my own just yet. Thanks.

> Hi Param,
>
[quoted text clipped - 16 lines]
> This posting is provided "AS IS" with no warranties, and confers no
> rights.
"Gary Chang[MSFT]" - 09 Sep 2005 04:14 GMT
Hi Parag,

>I want to access the IVsObjectLists of some other
>provider; no interest in implementing my own just yet.

OK, if so, I suggest you try the IVsLibrary2::CreateNavInfo at first. You
can pass a description of the element you are interested and you get a
NavInfo object back. The array of SYMBOL_DESCRIPTION_NODE will be a list
like:

mscorlib            LLT_PHYSICALCONTAINERS
System             LLT_NAMESPACES
Boolean            LLT_CLASSES

Then you will get this info from current selection or similar. You may use
IVsNavigationTool::GetSelectecSymbols. From IVsSelectedSymbol you can call
GetNavInfo to get a NavInfo directly.

To obtain the IVsLibrary2 object, please refer to the
IVsObjectManager2::FindLibrary, where you pass a GUID to the library you
are interested. You can obtain the guid from a NavInfo by calling
IVsNavInfo::GetLibGuid.

Wish this helps!

Best regards,

Gary Chang
Microsoft Community Support
--------------------
Get Secure! ¡§C www.microsoft.com/security
Register to Access MSDN Managed Newsgroups!
http://support.microsoft.com/default.aspx?scid=/servicedesks/msdn/nospam.asp
&SD=msdn

This posting is provided "AS IS" with no warranties, and confers no rights.

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.