fsprojects/VisualFSharpPowerTools — pull request #507 by vasily-kirichenko (2014-06-16 08:26:05+00:00)
Title: Resolve unopened namespace

It's not ready for merging yet.

* [x] Works in all cases, except the one below.
* [ ] If we open a module that's declared in the same file on the same level, we should place `open` statement just before the unresolved symbol or attach it to the nearest `open` statements block that lays after the opening module:

```fsharp
module TopModule

module M1 =
let func11 x = 1

let _ = ()

open M1 // inserted

let _ = func11 // the unresolved symbol
```
```fsharp
module TopModule

module M1 =
let func11 x = 1

open System
// not here since there's a closer open block below

module M2 =
let x = ()

open AnotherModule
open M1 // inserted

let _ = ()
let _ = func11 // the unresolved symbol
```
* [ ] Add tests for generating `open` statements in a virtual document (`VDocumet` does not seem to fit here as it expose read-only interface). @OkayX6 any suggestions on this?
* [ ] Does not show the smart tag on namespaces (`VsLanguageService.GetFSharpSymbolUse` returns `None` for namespaces at the moment). In general, we should show the tag on types, static methods and functions only; I'm not sure we can determine this from the untyped AST. Maybe we'll need additional functionality from FCS (get unresolved symbol at position in file, which should return symbol kind).

Please, review and test it.