Repository navigation
Commit 8d73cb4
Offer every open that resolves the name, not the first one found
The fix computed a suggestion for every namespace and type a name could be
resolved from, and then `Seq.tryHead` threw all but one away — whichever
one the assembly crawler happened to reach first. An unresolved `File` was
answered with `System.Net.WebRequestMethods` and never with `System.IO`;
an unresolved `WriteLine` with `System.Diagnostics.Trace` and never with
`System.Console`.
`IFSharpMultiCodeFixProvider` already exists for providers with more than
one suggestion, so the provider implements that instead and registers them
all. Following Roslyn's add-import fix, which faces the same problem: the
list is capped, at five opens and three qualifications, because a lightbulb
is a menu somebody reads, and it is ordered with what `System` holds first
rather than by whatever order the crawler walked the assemblies in --
without that, `Microsoft.VisualBasic.FileSystem` sorts above
`System.Console` for `WriteLine`.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>1 parent 80554c3 commit 8d73cb4
4 files changed
Lines changed: 294 additions & 127 deletions
File tree
- docs/release-notes/.VisualStudio
- vsintegration
- src/FSharp.Editor/CodeFixes
- tests/FSharp.Editor.Tests/CodeFixes
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| 8 | + | |
| 9 | + | |
8 | 10 | | |
9 | 11 | | |
10 | 12 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
5 | 6 | | |
6 | 7 | | |
7 | 8 | | |
| |||
18 | 19 | | |
19 | 20 | | |
20 | 21 | | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
21 | 38 | | |
22 | 39 | | |
23 | 40 | | |
| |||
65 | 82 | | |
66 | 83 | | |
67 | 84 | | |
| 85 | + | |
68 | 86 | | |
69 | 87 | | |
70 | 88 | | |
71 | 89 | | |
| 90 | + | |
72 | 91 | | |
73 | 92 | | |
74 | 93 | | |
75 | 94 | | |
76 | 95 | | |
77 | 96 | | |
78 | 97 | | |
| 98 | + | |
79 | 99 | | |
80 | 100 | | |
81 | 101 | | |
82 | 102 | | |
83 | 103 | | |
84 | 104 | | |
85 | 105 | | |
86 | | - | |
| 106 | + | |
87 | 107 | | |
88 | | - | |
89 | | - | |
| 108 | + | |
| 109 | + | |
90 | 110 | | |
91 | 111 | | |
92 | 112 | | |
| |||
163 | 183 | | |
164 | 184 | | |
165 | 185 | | |
166 | | - | |
| 186 | + | |
167 | 187 | | |
168 | 188 | | |
169 | 189 | | |
| |||
191 | 211 | | |
192 | 212 | | |
193 | 213 | | |
194 | | - | |
195 | | - | |
| 214 | + | |
196 | 215 | | |
197 | | - | |
| 216 | + | |
198 | 217 | | |
0 commit comments