Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Include Compiler features in Project Engine #8172

Merged
merged 1 commit into from
Jan 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ public RazorProjectEngine Create(

return RazorProjectEngine.Create(configuration, fileSystem, b =>
{
CompilerFeatures.Register(b);
initializer.Initialize(b);
configure?.Invoke(b);
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,25 @@ public override async Task InitializeAsync()
await TestServices.Workspace.WaitForAsyncOperationsAsync(FeatureAttribute.Classification, ControlledHangMitigatingCancellationToken);
}

[IdeFact]
public async Task GenericTypeParameters_Work()
{
// Arrange
await TestServices.SolutionExplorer.OpenFileAsync(RazorProjectConstants.BlazorProjectName, RazorProjectConstants.MainLayoutFile, ControlledHangMitigatingCancellationToken);
await TestServices.Editor.SetTextAsync($@"@page ""/counter""
@using Microsoft.AspNetCore.Components.Forms

<ValidationMessage For=""() => input.Hashers"" />
<h1></h1>", ControlledHangMitigatingCancellationToken);

// Act
await TestServices.Editor.WaitForComponentClassificationAsync(ControlledHangMitigatingCancellationToken, count: 1);

// Assert
var expectedClassifications = await GetExpectedClassificationSpansAsync(nameof(GenericTypeParameters_Work), ControlledHangMitigatingCancellationToken);
await TestServices.Editor.VerifyGetClassificationsAsync(expectedClassifications, ControlledHangMitigatingCancellationToken);
}

[IdeFact]
public async Task Components_AreColored()
{
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
0,1,RazorTransition,
1,4,RazorDirective,
6,10,string,
18,1,RazorTransition,
19,5,keyword,
25,9,namespace name,
34,1,operator,
35,10,namespace name,
45,1,operator,
46,10,namespace name,
56,1,operator,
57,5,namespace name,
66,1,HTML Tag Delimiter,
67,17,RazorComponentElement,
85,3,RazorComponentAttribute,
88,1,HTML Operator,
89,1,HTML Attribute Value,
90,1,punctuation,
91,1,punctuation,
93,2,operator,
96,5,identifier,
101,1,operator,
102,7,identifier,
109,1,HTML Attribute Value,
111,1,HTML Tag Delimiter,
112,1,HTML Tag Delimiter,
115,1,HTML Tag Delimiter,
116,2,HTML Element Name,
118,1,HTML Tag Delimiter,
119,1,HTML Tag Delimiter,
120,1,HTML Tag Delimiter,
121,2,HTML Element Name,
123,1,HTML Tag Delimiter,