views:

66

answers:

1

EDITS corrected terminology from Intellisense to Smart Tag

OK, I readily admit that Intellisense/Smart Tags have spoiled me. I've grown accustomed C# in Visual Studio notifying you to add using import declarations when typing in a class name for a namespace that has not yet been imported. You get the nice little colored underscore which you can hover over or do or do ctrl-dot to get the context menu for adding the import or fully qualifying the namespace.

I've just started playing with F# in VS2010, and I'm not getting that helpful reminder when I reference a system library class. I type WebRequest and the Smart Tag doesn't kick in to tell me I need to add an open System.Net declaration.

Am I missing something? Is there a VS extension available that beefs up F# Smart Tagging?

+2  A: 

You're confusing two features here. Intellisense is the feature that helps complete statements and expressions as you type. The squiggle that appears over WebRequest to tell you that you need to add a using / open for System.Net is a smart tag.

F# unfortunately does not implement this particular smart tag in Visual Studio 2010. I don't know of any extension which provides this behavior either.

JaredPar
Do you have a sense for how hard it would be to write such an extension? Is it something that people outside of the F#/VS teams could build?
kvb
@kvb, Without access to the f# compiler it would probably be fairly difficult because it requires semantic knowledge of the situation.
JaredPar
I bet you could build a cheesy version with less effort, using the compiler as a black box and looking for `The namespace or module '%s' is not defined` (along with line/column info) in the Error List, and using DTE to enumerate the referenced assemblies in the project.
Brian
@Brian, that would probably work very well indeed. Why haven't you done that yet ;)
JaredPar
Noted, thanks for the correction. I've updated the title and question with the correct terminology
Tim Trout