IntelliSense loses track of types of variables
- Dominant language
- C#
- Stars
- 20.7k
- Forks
- 4.3k
- PR merge metrics
- PR metrics pending
Description
**Version Used**: 17.12 P4
**Steps to Reproduce**:
https://github.com/user-attachments/assets/4fde08d1-5ae8-4233-aa00-d8eda1c0df4b
**Diagnostic Id**:
**Expected Behavior**:
The type of `dataSource` should be clear, because:
- `dataSourceFactory.GetDataSourceAsync` returns a `ValueTask` (awaited)
- it has no other overloads, in fact the only method of that interface (`GetDocumentAsync` has no overloads either)
- neither the syntax tree is broken which could invalidate the declarations earlier
- no other symbol named `dataSource` outside of this context
- none of the related types are declared in the enclosing scope
**Actual Behavior**:
Quick Info can't infer the type of `dataSource`, code completion doesn't work either.
Diagnostics don't report it as an individual error, it reports only that `GetDocumentAsync` is missing an argument - which is correct, and also means that some underlying parts could still infer the type correctly.
This must be an edge case, because I encounter this error rarely.
Contributor guide
Assessment
This issue has not been assessed yet.