Extension not decompiling nuget packages right SqlCommand & SqlReader
- Dominant language
- TypeScript
- Stars
- 3.1k
- Forks
- 737
- Avg merge
- 18h 40m
- Merged PRs (30d)
- 31
Description
## Environment data
`dotnet --info` output:
```
.NET SDK:
Version: 7.0.110
Commit: ba920f88ac
Runtime Environment:
OS Name: fedora
OS Version: 38
OS Platform: Linux
RID: fedora.38-x64
Base Path: /usr/lib64/dotnet/sdk/7.0.110/
Host:
Version: 7.0.10
Architecture: x64
Commit: a6dbb800a4
.NET SDKs installed:
7.0.110 [/usr/lib64/dotnet/sdk]
.NET runtimes installed:
Microsoft.AspNetCore.App 7.0.10 [/usr/lib64/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.NETCore.App 7.0.10 [/usr/lib64/dotnet/shared/Microsoft.NETCore.App]
Other architectures found:
None
Environment variables:
DOTNET_ROOT [/usr/lib64/dotnet]
global.json file:
Not found
```
VS Code version: 1.82.2
C# Extension version: v2.1.2
## Steps to reproduce
1. Install this package https://www.nuget.org/packages/Microsoft.Data.SqlClient/5.1.1
2. Write this code
```c#
using Microsoft.Data.SqlClient;
var builder = new SqlConnectionStringBuilder
{
DataSource = "localhost",
UserID = "sa",
Password = "",
InitialCatalog = ""
};
try
{
using var connection = new SqlConnection(builder.ConnectionString);
Console.WriteLine("\nQuery data example:");
Console.WriteLine("=========================================\n");
connection.Open();
var sql = "SELECT name, age FROM People";
using var command = new SqlCommand(sql, connection);
using var reader = command.ExecuteReader();
while (reader.Read())
{
Console.WriteLine("{0} {1}", reader.GetString(0), reader.GetInt32(1));
}
}
catch (SqlException e)
{
Console.WriteLine(e);
}
Console.WriteLine("\nDone. Press enter.");
```
3. Ctrl + Click the ExecuteReader method
## Expected behavior
Decompiled library successfully with intellisense working
## Actual behavior

Notice there is no type inference for SqlDataReader and its return type is null
## Additional context
When getting intellisense for reader, the list is not complete. In this case is missing the `Dispose()` method.

Looking at SqlClient source code for v5.1.1 the method is [defined](https://github.com/dotnet/SqlClient/blob/v5.1.1/src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/SqlDataReader.cs#L830) without a [EditorBrowsable(EditorBrowsableState.Never)] data annotation so it should be showed.
Also tested with VS Code C# Extension v1.26.0, it works but the decompiling is different compared to the source.
Contributor guide
Assessment
This issue has not been assessed yet.