|
14 | 14 | using Microsoft.CodeAnalysis.Razor.ProjectSystem; |
15 | 15 | using Microsoft.CodeAnalysis.Razor.Protocol; |
16 | 16 | using Microsoft.CodeAnalysis.Razor.Protocol.CodeActions; |
| 17 | +using Microsoft.CodeAnalysis.Razor.Workspaces; |
17 | 18 | using Microsoft.CodeAnalysis.Testing; |
18 | 19 | using Microsoft.NET.Sdk.Razor.SourceGenerators; |
19 | 20 | using Microsoft.VisualStudio.LanguageServer.Protocol; |
@@ -45,7 +46,7 @@ public async Task Handle_NoTagName_DoesNotProvideLightBulb() |
45 | 46 |
|
46 | 47 | var context = CreateRazorCodeActionContext(request, cursorPosition, documentPath, contents, new SourceSpan(0, 1)); |
47 | 48 |
|
48 | | - var provider = new ComponentAccessibilityCodeActionProvider(); |
| 49 | + var provider = new ComponentAccessibilityCodeActionProvider(new FileSystem()); |
49 | 50 |
|
50 | 51 | // Act |
51 | 52 | var commandOrCodeActionContainer = await provider.ProvideAsync(context, DisposalToken); |
@@ -74,7 +75,7 @@ public async Task Handle_InvalidSyntaxTree_NoStartNode() |
74 | 75 | var context = CreateRazorCodeActionContext(request, cursorPosition, documentPath, contents, new SourceSpan(0, 0)); |
75 | 76 | context.CodeDocument.SetFileKind(FileKinds.Legacy); |
76 | 77 |
|
77 | | - var provider = new ComponentAccessibilityCodeActionProvider(); |
| 78 | + var provider = new ComponentAccessibilityCodeActionProvider(new FileSystem()); |
78 | 79 |
|
79 | 80 | // Act |
80 | 81 | var commandOrCodeActionContainer = await provider.ProvideAsync(context, DisposalToken); |
@@ -102,7 +103,7 @@ public async Task Handle_CursorOutsideComponent() |
102 | 103 |
|
103 | 104 | var context = CreateRazorCodeActionContext(request, cursorPosition, documentPath, contents, new SourceSpan(contents.IndexOf("Component", StringComparison.Ordinal), 9)); |
104 | 105 |
|
105 | | - var provider = new ComponentAccessibilityCodeActionProvider(); |
| 106 | + var provider = new ComponentAccessibilityCodeActionProvider(new FileSystem()); |
106 | 107 |
|
107 | 108 | // Act |
108 | 109 | var commandOrCodeActionContainer = await provider.ProvideAsync(context, DisposalToken); |
@@ -130,7 +131,7 @@ public async Task Handle_ExistingComponent_SupportsFileCreationTrue_ReturnsResul |
130 | 131 |
|
131 | 132 | var context = CreateRazorCodeActionContext(request, cursorPosition, documentPath, contents, new SourceSpan(contents.IndexOf("Component", StringComparison.Ordinal), 9), supportsFileCreation: true); |
132 | 133 |
|
133 | | - var provider = new ComponentAccessibilityCodeActionProvider(); |
| 134 | + var provider = new ComponentAccessibilityCodeActionProvider(new FileSystem()); |
134 | 135 |
|
135 | 136 | // Act |
136 | 137 | var commandOrCodeActionContainer = await provider.ProvideAsync(context, DisposalToken); |
@@ -177,7 +178,7 @@ public async Task Handle_ExistingComponent_CaseIncorrect_ReturnsResults() |
177 | 178 |
|
178 | 179 | var context = CreateRazorCodeActionContext(request, cursorPosition, documentPath, contents, new SourceSpan(contents.IndexOf("CompOnent", StringComparison.Ordinal), 9), supportsFileCreation: true); |
179 | 180 |
|
180 | | - var provider = new ComponentAccessibilityCodeActionProvider(); |
| 181 | + var provider = new ComponentAccessibilityCodeActionProvider(new FileSystem()); |
181 | 182 |
|
182 | 183 | // Act |
183 | 184 | var commandOrCodeActionContainer = await provider.ProvideAsync(context, DisposalToken); |
@@ -226,7 +227,7 @@ @using Fully.Qualified |
226 | 227 |
|
227 | 228 | var context = CreateRazorCodeActionContext(request, cursorPosition, documentPath, contents, new SourceSpan(contents.IndexOf("CompOnent", StringComparison.Ordinal), 9), supportsFileCreation: true); |
228 | 229 |
|
229 | | - var provider = new ComponentAccessibilityCodeActionProvider(); |
| 230 | + var provider = new ComponentAccessibilityCodeActionProvider(new FileSystem()); |
230 | 231 |
|
231 | 232 | // Act |
232 | 233 | var commandOrCodeActionContainer = await provider.ProvideAsync(context, DisposalToken); |
@@ -267,7 +268,7 @@ public async Task Handle_ExistingGenericComponent_SupportsFileCreationTrue_Retur |
267 | 268 |
|
268 | 269 | var context = CreateRazorCodeActionContext(request, cursorPosition, documentPath, contents, new SourceSpan(contents.IndexOf("GenericComponent", StringComparison.Ordinal), "GenericComponent".Length), supportsFileCreation: true); |
269 | 270 |
|
270 | | - var provider = new ComponentAccessibilityCodeActionProvider(); |
| 271 | + var provider = new ComponentAccessibilityCodeActionProvider(new FileSystem()); |
271 | 272 |
|
272 | 273 | // Act |
273 | 274 | var commandOrCodeActionContainer = await provider.ProvideAsync(context, DisposalToken); |
@@ -314,7 +315,7 @@ public async Task Handle_NewComponent_SupportsFileCreationTrue_ReturnsResult() |
314 | 315 |
|
315 | 316 | var context = CreateRazorCodeActionContext(request, cursorPosition, documentPath, contents, new SourceSpan(contents.IndexOf("Component", StringComparison.Ordinal), 9), supportsFileCreation: true); |
316 | 317 |
|
317 | | - var provider = new ComponentAccessibilityCodeActionProvider(); |
| 318 | + var provider = new ComponentAccessibilityCodeActionProvider(new FileSystem()); |
318 | 319 |
|
319 | 320 | // Act |
320 | 321 | var commandOrCodeActionContainer = await provider.ProvideAsync(context, DisposalToken); |
@@ -344,7 +345,7 @@ public async Task Handle_NewComponent_CaretInAttribute_ReturnsResult() |
344 | 345 |
|
345 | 346 | var context = CreateRazorCodeActionContext(request, cursorPosition, documentPath, contents, new SourceSpan(contents.IndexOf("Component", StringComparison.Ordinal), 9), supportsFileCreation: true); |
346 | 347 |
|
347 | | - var provider = new ComponentAccessibilityCodeActionProvider(); |
| 348 | + var provider = new ComponentAccessibilityCodeActionProvider(new FileSystem()); |
348 | 349 |
|
349 | 350 | // Act |
350 | 351 | var commandOrCodeActionContainer = await provider.ProvideAsync(context, DisposalToken); |
@@ -374,7 +375,7 @@ public async Task Handle_NewComponent_SupportsFileCreationFalse_ReturnsEmpty() |
374 | 375 |
|
375 | 376 | var context = CreateRazorCodeActionContext(request, cursorPosition, documentPath, contents, new SourceSpan(contents.IndexOf("Component", StringComparison.Ordinal), 9), supportsFileCreation: false); |
376 | 377 |
|
377 | | - var provider = new ComponentAccessibilityCodeActionProvider(); |
| 378 | + var provider = new ComponentAccessibilityCodeActionProvider(new FileSystem()); |
378 | 379 |
|
379 | 380 | // Act |
380 | 381 | var commandOrCodeActionContainer = await provider.ProvideAsync(context, DisposalToken); |
@@ -402,7 +403,7 @@ public async Task Handle_ExistingComponent_SupportsFileCreationFalse_ReturnsResu |
402 | 403 |
|
403 | 404 | var context = CreateRazorCodeActionContext(request, cursorPosition, documentPath, contents, new SourceSpan(contents.IndexOf("Component", StringComparison.Ordinal), 9), supportsFileCreation: false); |
404 | 405 |
|
405 | | - var provider = new ComponentAccessibilityCodeActionProvider(); |
| 406 | + var provider = new ComponentAccessibilityCodeActionProvider(new FileSystem()); |
406 | 407 |
|
407 | 408 | // Act |
408 | 409 | var commandOrCodeActionContainer = await provider.ProvideAsync(context, DisposalToken); |
|
0 commit comments