Adding an FSI Signature File removes generic type resolution in tooltips
- Dominant language
- F#
- Stars
- 4.3k
- Forks
- 876
- Avg merge
- 4d 11h
- Merged PRs (30d)
- 131
Description
If you create a `*.fsi` file and it contains functions with generic types, then those types will no longer be resolved in tooltips, greatly hampering one of the key tools for F# development: type discovery.
Possibly related is this fix: https://github.com/dotnet/fsharp/issues/11022
### Repro steps
1. Create a new project with a `test.fs` file in it, like this and then observe tooltip behavior of `makeString`:
```f#
namespace HelloWorld.Tests
module FsiTest =
let makeString x = string x
let f() = makeString 42
```
2. Add an extra source file and call it `test.fsi`, have it contain this and again observe tooltip behavior of `makeString` in the file above:
```
namespace HelloWorld.Tests
module FsiTest =
val makeString: x: 'T -> string
```
## Expected behavior
In the first case, the tooltip looks like this, i.e., showing the resolution of the generic types, in this case `'a is int`:

In the second case, the tooltip should look like this (the same, except for `'a is int` now being `'T is int`):

## Actual behavior
Instead, the type information for the generics resolution completely disappears:

## Known workarounds
I know of only two:
* Do not use `*.fsi` files, not really an option, though, in public libraries or when you want to restrict the surface area.
* While working, set compile action to `None`, which gives back the tooltips, then reset it to `F# compiler` before you compile.
Neither is particularly appealing, so if there's something I'm missing, I'd love to hear it!
## Related information
* Seen in VS 2022 GA release and VS 2022 Preview
* Seen with simple and more complex type signatures
* Renaming `'T` to `'a` as in the signature file does not help
* Explicitly using the same generic type in the implementation file, i.e. `makeString (x: 'T) = string x` doesn't help either
* Also happens if this project is referenced by another project. That other project suffers the same issue.
Contributor guide
Assessment
This issue has not been assessed yet.