Cross-project intellisense guidance

Coordinator
May 29, 2008 at 7:46 AM
Anyone know how intellisense works between projects in Visual Studio?

If you have a Boo project and a C# project with the C# project referencing the Boo project, no intellisense is initially provided for the namespaces and classes defined in the Boo project when you're in a class in the C# project; however, once you do a build you get the intellisense, until you make a change (then it's out of date).

It's obviously just using the built assemblies in this case.

When you have two C# projects referencing eachother, you don't need to do a build to get the intellisense, it's automatically kept upto date. So I guess I need to expose some kind of service to VS to allow it to get the intellisense info when it wants it, I also have a feeling this has got something todo with the CodeDOM objects, but I don't know what yet.

Anybody have any thoughts on this? I'm kind-of floundering.
Coordinator
May 29, 2008 at 2:10 PM
From the email exchange between you, justin chase and myself:

Justin:
"
Oh I see what you're saying, I had to figure this out already so I can actually help. Here is an example of how I have had to do this:

http://www.codeplex.com/NBusiness/SourceControl/FileView.aspx?itemId=407932&changeSetId=32909

In that example I am able to find all types by iterating through a Projects CodeModel property. This looks a lot like a COM version of the standard CodeDom except that it is for classes that exist in projects loaded into VS. It's nice because it is changed dynamically by VS as code is created. To get intellisense support in the reverse direction (for example a C# project referencing a Boo project) I believe you simply need to have a mechanism for building up this CodeModel property as a user edits files in the project. Not trivial!
"

I mentioned this to you during a chat once, i think... but I actually went and tracked this down as a result of your post. This sounds like the source of the "automatically kept up to date" intellisense classes and stuff that you're after... maybe there's an event handler the boo project can subscribe to so that it can get updated intellisense info when it updates?

And is this something we should implement on the boo project side so that c# projects can get up-to-date boo stuff? I guess that's what you were after, in the first place..
Coordinator
May 29, 2008 at 2:35 PM
I don't seem to recall ever receiving that e-mail... no matter.

This sounds like a great place to start. I knew there must be something that VS needs to keep upto date, as all projects can't be implementing their own way of doing it. The "not trivial" part of it should be pretty straight forward, as we're already building up the intellisense for the boo files.

I'll take a bash at this over the next few days, but it looks promising. Thanks