dotnet / dotnet/roslyn

Unimported completions don't work when completion session starts with `throw new`

Open
#81,791 2 comments 0 reactions 0 assignees View on GitHub
Area-IDE
Dominant language
C#
Stars
20.7k
Forks
4.3k
PR merge metrics
PR metrics pending

Description

**Version Used**:
VS 2026 18.1.1

**Steps to Reproduce**:
```cs
void M()
{
$$
}
```
Start typing `throw new UnreahableException` at `$$`

**Expected Behavior**:
When I get after `throw new` I get `UnreahableException` as unimported completion item

**Actual Behavior**:
When I get after `throw new` I don't get _any_ unimported completions. However, if I stop and invoke completion session after `throw new` manually, I get unimported completions (including `UnreachableException`):

![Image](https://github.com/user-attachments/assets/c8332bff-fc30-40d8-bdcf-d304bcbc218d)

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the supplied C# example in Visual Studio 18.1.1, comparing automatic completion after `throw new` with a manually invoked session. Trace the completion path for unimported items; done means `UnreachableException` and other applicable unimported completions appear automatically after `throw new`.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
devtools
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.