Hi Eric,
Thanks for your post. I am checking this issue and will update you with my
findings.
Have a nice day!
Regards,
HuangTM
Microsoft Online Partner Support
MCSE/MCSD
Get Secure! -- www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
Hi Keith,
Thanks for the patience on this issue. I have reproduced the issue of
double clicking on the task list item that was created via the
IVsGeneratorProgress::GeneratorError. I need to see why it is ignoring the
line number during that process.
Here are some answers to your other questions:
>1 - Is this the right approach to use for this sort of tool?
Yes. Mapping one form of syntax into another is perfect for custom tools.
>2 - Is there any way to make the file management work as mentioned
>("ideally...") above? Currently the .cs file is generated when the user
>saves the .y file and *not* when the user builds the project, and the .cs
>file is placed under source management.
It would be possible to get it done as one of the pre-build steps. We
could start everything off through a macro i.e. capturing BuildEvents or an
add-in, etc..
>3 - Is there any way that an alternative filename can be attached to the
>build error that appears in the Task List? This is not a concern for this
>particular tool but some other tool which supports source file inclusion
>could very well report errors relating to source files other than the main
>input.
Not with the IVsGeneratorProgress::GeneratorError approach. You'll need to
go the route of IVsLaunchPad. See question 4 for more information on this
topic.
>4 - Is there any official documentation available on IVsSingleFileGenerator
>and related interfaces and registry keys?
Yes, install the VSIP SDK 2003 from vsipdev.com under downloads. That will
contain the documentation on IVsSingleFileGenerator and registry entries
(search on "Defining registry settings for custom tools") after installing
the SDKs.
>5 - Is there any way to generate text into the Output window of the IDE? The
>parser generator produces some statistics which should not rightly be placed
>in the Task List but which should be recorded somewhere the user can inspect
>them, and it seems that the Output window is used in this manner by the C#
>compiler.
IVsLaunchPad will provide one such approach.
>6 - (our most immediate concern) Why does double-clicking in the Task List
>not position the cursor to the correct line?
I will need to debug into this aspect. I will let you know my status when
I get more understanding.
thanks!
Mike Wong
Microsoft Developer Support
--------------------
>From: "Keith Dorken" <kadorken@nospamthinkage.ca>
>Subject: Custom tool interface in VS.NET 2003 questions
[quoted text clipped - 87 lines]
>6 - (our most immediate concern) Why does double-clicking in the Task List
>not position the cursor to the correct line?
Mike Wong (Microsoft) - 05 Dec 2003 08:54 GMT
Hi Keith,
this is followup for the below message.
>>6 - (our most immediate concern) Why does double-clicking in the Task List
>>not position the cursor to the correct line?
>I will need to debug into this aspect. I will let you know my status when
>I get more understanding.
I debugged into this tonight and found that the IVsGeneratorProgress that
is passed into the Generate method uses a generic task provider (some
internal build manager). now, the generic task provider has
IVsTaskItem::NavigateTo just opens the file as you have noted already. it
does not do anything with navigating to a line and column. That is now
verified - there is no code in the generic implementation of NavigateTo
that does anything with the line and column. In short, the
IVsGeneratorProgress passed into the Generate is really out of your
control. Since it uses a generic task provider i.e. the IVsTaskItem does
nothing more than opens the document one workaround could be to register
our own task provider which would implement our own IVsTaskItem::NavigateTo
method where we could use the line and column info. That would be a
sizable work item for us to try because we would need to define some of
these items in the managed world. The page I mentioned below
http://vsipdev.com where you can download the VSIP SDK. That is primarily
C++ based. There is a beta that is mentioned on the page as well that
talks about managed support but it is not in the release stage yet. I
can't comment on the release of it. More information can be found in the
VSIP SDK docs that talk about IVsTaskList::RegisterTaskProvider,
IVsTaskProvider, etc. I have not tried this so there could be things like
the COM object lifetime of your generator that come into play so it might
have to move to a package or add-in scenario...
What are your thoughts?
thanks!
Mike Wong
Microsoft Developer Support
--------------------
>X-Tomcat-ID: 74601438
>References: <#j5z8eQuDHA.2448@TK2MSFTNGP12.phx.gbl>
[quoted text clipped - 168 lines]
>>6 - (our most immediate concern) Why does double-clicking in the Task List
>>not position the cursor to the correct line?
Keith Dorken - 05 Dec 2003 15:27 GMT
Thanks for the detailed information; we'll investigate the SDK documentation
and see where we go.
Keith Dorken - 09 Dec 2003 19:36 GMT
UPDATE on our progress (with some more questions)
We downloaded the latest VSIP SDK 2003 and found that it contained no
further documentation on IVsSingleFileGenerator. The original web site where
we found the code template we first used implied that this was no longer
part of the SDK, and the absence of any mention of it in the documentation
would tend to confirm this.
We are wondering if this was correct, and if there was a recommended
replacement?
Bridging the .NET environment and the COM objects in VS is not really a
problem, except that only a few interfaces already exist in referenceable
assemblies, so we have to convert the IDL declarations for some of the
interfaces into C# interface declarations with appropriate attributes. The
.NET environment then manages all the marshalling and lifetime issues.
However we did determine that using
IVsOutputWindowPane::OutputTaskItemString might be the best way to record
the parser generator errors, that is, instead of calling the
IVsGeneratorProgress methods with the errors, we would call
OutputTaskItemString directly.
This appeared to have several advantages:
1- Simplicity; this seemed much easier than defining our own
TaskItemProvider and all associated baggage.
2- Errors are also placed in the Output window, and statistical messages
from the tool could be placed there as well without generating Task List
entries by calling IVsOutputWindowPane::OutputString
3- Errors would be better identified than the "Custon Tool Error" prefix
that IVsGeneratorProgress adds to the message text
We wanted to place the messages in the Build output pane, which has a
well-known uuid (1BD8A850-02D1-11d1-bee7-00a0c913d1f8) identifying it, but
in order to access *any* of the panes, we first have to get the OutputWindow
service, but we find that calls to IOleServiceProvider::QueryService with
the appropriate service uuid (which happens to be the same as
533FAD11-FE7F-41EE-A381-8B67792CD692, the IID for IVsOutputWindow) fail to
return an object. Unfortunately IOleServiceProvider does not provide any way
to enumerate the entire service list (unless that is itself a service one
can request), so we cannot even determine what *is* provided.
Could we be querying incorrectly for this service, or could the site
supplied to our extension object's IObjectWithSite::SetSite method be some
sort of proxy site that only supplies a subset of all the services that
should be available to VS extensions ?
We don't suppose that we should be so lucky that the VSIP SDK should contain
debug symbols for VS (particularly csproj.dll)? Are the debug symbols
available elsewhere?
Thanks in advance, Keith
> Hi Keith,
>
[quoted text clipped - 217 lines]
> >>6 - (our most immediate concern) Why does double-clicking in the Task List
> >>not position the cursor to the correct line?
Mike Wong (Microsoft) - 10 Dec 2003 23:56 GMT
Hi Keith,
sorry about that, you are correct, it got taken out of the release version
of the docs. The story on IVsSingleFileGenerator was that it was really
never meant to be public so they made it private for 2003. Since it was
exposed in a MSDN article (very clear explanation), developers started to
use it. When they made it private for 2003, it blocked customer migration
so one of the product group devs redefined it in a class library available
on gotdotnet. My whole point is that there is no migration story for the
interface since it wasn't meant to be public in the first place.
>Could we be querying incorrectly for this service, or could the site
>supplied to our extension object's IObjectWithSite::SetSite method be some
>sort of proxy site that only supplies a subset of all the services that
>should be available to VS extensions ?
Try the following code instead (reference the envdte dll)
using EnvDTE;
..//guid = 533FAD11...
ProjectItem obj = (ProjectItem)
GetService(typeof(ProjectItem));
Window win =
obj.DTE.Windows.Item(Constants.vsWindowKindOutput);
OutputWindow ow = (OutputWindow) win.Object;
OutputWindowPane owp = ow.OutputWindowPanes.Item(1);
owp.OutputString("Check");
IOleServiceProvider serviceProvider =
(IOleServiceProvider) obj.DTE;
IntPtr pUnk;
int hr = serviceProvider.QueryService(ref guid, ref
guid, out pUnk);
While working on the code, it dawned on me that you could just use the
OutputWindowPane methods to put items into the task list and outputpane.
Check out the methods OutputTaskItemString for the owp variable above. I
do the QueryService off the IOleServiceProvider on the DTE object instead
to show how to get to the various services described in the environment SDK.
>We don't suppose that we should be so lucky that the VSIP SDK should contain
>debug symbols for VS (particularly csproj.dll)? Are the debug symbols
>available elsewhere?
Unfortunately no, but you could set your symbol server to the public http
symbol store to see if it pulls it down. We might have public symbols
available.
The following article has more information
http://support.microsoft.com/default.aspx?scid=kb;en-us;319037
i.e.
symsrv*symsrv.dll*c:\localcache*http://msdl.microsoft.com/download/symbols
I hope that helps.
thanks!
Mike Wong
Microsoft Developer Support
--------------------
>From: "Keith Dorken" <kadorken@nospamthinkage.ca>
>References: <#j5z8eQuDHA.2448@TK2MSFTNGP12.phx.gbl>
<t8h5KmtuDHA.2520@cpmsftngxa07.phx.gbl>
<VVsHd1wuDHA.3088@cpmsftngxa07.phx.gbl>
>Subject: Re: Custom tool interface in VS.NET 2003 questions
>Date: Tue, 9 Dec 2003 14:36:01 -0500
[quoted text clipped - 7 lines]
>NNTP-Posting-Host: cougar.thoughts.thinkage.ca 192.102.11.6
>Path:
cpmsftngxa07.phx.gbl!cpmsftngxa10.phx.gbl!TK2MSFTNGXA05.phx.gbl!TK2MSFTNGP08
.phx.gbl!TK2MSFTNGP09.phx.gbl
>Xref: cpmsftngxa07.phx.gbl microsoft.public.vsnet.ide:9655
>X-Tomcat-NG: microsoft.public.vsnet.ide
[quoted text clipped - 300 lines]
>List
>> >>not position the cursor to the correct line?
START YOUR OWN E-MAIL BUSINESS TODAY and TAKE ADVANTAGE OF THE FOLLOWING:
1.ALL CUSTOMERS PAY YOU IN CASH!!!
2. TOP PART-TIME OWNERS HAVE EARNED $5,000+ IN ONE MONTH!
3. TOP FULL-TIME OWNERS HAVE EARNED $10,000+ IN ONE MONTH!
4. YOU WILL SELL A PRODUCT WHICH COSTS NOTHING TO PRODUCE!
5. YOUR MAIN OVERHEAD IS YOUR TIME!
6. YOUR START UP COSTS ARE LESS THAN $25
7. YOU HAVE MORE THAN 40 MILLION POTENTIAL CUSTOMERS
For additional information please E-mail me at saita@dodo.com.au
=====================================================
New Software that finds leads for YOU for F.R.E.E.!!!!!
http://www.contactthem.com/cgi-bin/at.cgi?a=316161
---
MAF Anti-Spam ID: 20051113184547I1n0UmZ7