Skip to content

Commit 3a2f032

Browse files
author
Ravi Chande
authored
Merge pull request #2975 from NTaylorMullen/nimullen/330/331
Update Razor test plan for Razor.VSCode-1.0.0-alpha3.
2 parents 8c2c4a6 + 8059655 commit 3a2f032

File tree

1 file changed

+88
-32
lines changed

1 file changed

+88
-32
lines changed

test-plan.md

Lines changed: 88 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -94,9 +94,12 @@ The easist way to verify that a project was successfully loaded is to open a .cs
9494
* Add a new file and reference a type in it from a different file. Deleting from disk the file containing the referenced type should produce error messages
9595

9696
#### ASP.NET Core Razor
97-
The Razor experience is available when you open a .cshtml file in a valid OmniSharp project. To setup a test project to verify on you can do:
98-
1. `dotnet new razor`
99-
2. Open `Pages/Index.cshtml`
97+
The Razor experience is available when you open a .cshtml file in a valid OmniSharp project.
98+
99+
To setup a test project to verify on you can do:
100+
1. Install the latest preview of the .NET Core 3.0 SDK by going to https://github.com/dotnet/core-sdk and picking the appropriate platform specific installer from the Release/3.0.1XX column. The version should be 3.0.0-preview4-nnnnnn.
101+
2. `dotnet new webapp`
102+
3. Open `Pages/Index.cshtml`
100103

101104
##### C# Completion
102105
* Typing `@DateTime.Now` and `@(DateTime.Now)` provides completions throughout typing.
@@ -109,14 +112,26 @@ The Razor experience is available when you open a .cshtml file in a valid OmniSh
109112
##### C# Diagnostics
110113
* Typing `@ThisDoesNotExist` results in an error being created and squiggled in the .cshtml file. NOTE: This error squiggly will be misaligned due to known issues.
111114

115+
##### TagHelper completion
116+
Note that the pipe in the below examples indicates the cursor.
117+
* Typing `<environment>` prompts you with HTML completion for the `environment` tag and on completion commit auto-completes the closing tag.
118+
* Type `<cache |`, hit ctrl + space, search for `asp-vary-by-user`, commit the completion. Ensure that it auto-completes the attribute to: `<cache asp-vary-by-user`.
119+
* Type `<form |`, hit ctrl + space, search for `asp-route-...`, commit the completion. Ensure that it auto-completes the attribute to: `<form asp-route-|=""`. Type `foo` and then hit tab. Cursor should be inside of the double quotes: `<form asp-route-foo="|"`.
120+
121+
##### Razor Diagnostics
122+
* Typing `@{ <strong> }` results in errors. One error should be about the "strong" tag missing a closing tag.
123+
* Fixing the error and typing `</strong>` i.e. `@{ <strong></strong> }` results in the diagnostic going away.
124+
112125
##### Known issues:
113126
- Error squiggles may be misaligned due to known issues.
114127

115128
#### Blazor
116-
The Blazor experience is available when you open a .cshtml file in a valid OmniSharp/Blazor project. To setup a test project to verify on you can do:
117-
1. `dotnet new -i Microsoft.AspNetCore.Blazor.Templates`
118-
2. `dotnet new blazor`
119-
3. Open `Pages/Index.cshtml`
129+
The Blazor experience is available when you open a .razor file in a valid OmniSharp/Blazor project.
130+
131+
To setup a test project to verify on you can do:
132+
1. Install the latest preview of the .NET Core 3.0 SDK by going to https://github.com/dotnet/core-sdk and picking the appropriate platform specific installer from the Release/3.0.1XX column. The version should be 3.0.0-preview4-nnnnnn.
133+
2. `dotnet new blazorserverside`
134+
3. Open `Pages/Index.razor`
120135

121136
##### C# Completion
122137
* Typing `@DateTime.Now` and `@(DateTime.Now)` provides completions throughout typing.
@@ -128,11 +143,31 @@ The Blazor experience is available when you open a .cshtml file in a valid OmniS
128143

129144
##### C# Diagnostics
130145
* When no changes have been performed on `Pages/Index.cshtml`, there are 0 errors.
131-
* Typing `@ThisDoesNotExist` results in an error being created and squiggled in the .cshtml file.
146+
* Typing `@ThisDoesNotExist` results in an error being created and squiggled in the .cshtml file.
147+
148+
##### Components
149+
* Typing `<Counter>` prompts you with HTML completion for the `Counter` tag and on completion commit auto-completes the closing tag.
150+
- In the completion list that pops up ensure there's also a `YourProjectName.Pages.Counter` entry in the HTML completion list.
151+
* Open `Counter.razor`, in the `@functions { ... }` block add:
152+
```C#
153+
[Parameter]
154+
private int IncrementAmount { get; set; }
155+
```
156+
- Save `Counter.razor` then wait 5 seconds.
157+
- Go back to `Index.razor` and type `<Counter |`, hit ctrl space, search for `IncrementAmount` attribute, commit the completion. Ensure that it auto-completes to `<Counter IncrementAmount="|"`
158+
- While inside the `IncrementAmount` attribute type `in`, hit ctrl + space, search for `int`, type `.`, search for `MaxValue` commit it, you should have `<Counter IncrementAmount="int.MaxValue"`
159+
* Verify `_Imports.razor` works as expected:
160+
- Add a new Folder `Utilities` under the `/Pages` folder. Within that folder add a `Helper.razor` file.
161+
- Open the `_Imports.razor` under the `/Pages` folder. Add `@using YourProjectName.Pages.Utilities`
162+
- Go back to `Index.razor`. Typing `<Helper>` prompts you with HTML completion for the `Helper` tag.
163+
164+
165+
##### Razor Diagnostics
166+
* Typing `@{ <strong> }` results in errors. One error should be about the "strong" tag missing a closing tag.
167+
* Fixing the error and typing `</strong>` i.e. `@{ <strong></strong> }` results in the diagnostic going away.
132168

133169
##### Known issues:
134-
- Error squiggles may be misaligned due to known issues.
135-
- There are some errors in the default Blazor project that are known. All errors that read like `Cannot convert method group 'SomeMethodName' to non-delegate type 'object'. Did you intend to invoke the method? [ProjectName]` are expected.
170+
- Error squiggles may be misaligned due to known issues.
136171

137172
#### Legacy Razor
138173
The Razor experience is degraded (but no errors) when you open a .cshtml file in a valid OmniSharp/Legacy Razor project. To setup a test project to verify on you can do:
@@ -165,56 +200,60 @@ Verifying Html is needed to ensure the Razor experience is still partially enabl
165200

166201
#### Razor Project level Information
167202
To verify the project level information for Razor do the following:
168-
1. Verify the `obj/Debug/TheTFMOfTheProject` folder contains a `project.razor.json` file (once the project is restored)
169-
2. Verify the `project.razor.json`'s `Configuration` section is not set to `null`.
203+
1. Install the latest preview of the .NET Core 3.0 SDK by going to https://github.com/dotnet/core-sdk and picking the appropriate platform specific installer from the Release/3.0.1XX column. The version should be 3.0.0-preview4-nnnnnn.
204+
2. Verify the `obj/Debug/TheTFMOfTheProject` folder contains a `project.razor.json` file (once the project is restored)
205+
3. Verify the `project.razor.json`'s `Configuration` section is not set to `null`.
170206

171207
Verify each of the test projects above's `project.razor.json` file (ASP.NET Core Razor, Blazor and Legacy Razor) looks something like the following:
172208

173209
##### ASP.NET Core Razor
174210
```JSON
175211
{
176-
"ProjectFilePath": "c:\\Users\\JohnDoe\\Projects\\RazorCoreTestApp\\RazorCoreTestApp.csproj",
177-
"TargetFramework": "netcoreapp2.1",
178-
"TagHelpers": [],
212+
"FilePath": "c:\\Users\\JohnDoe\\Projects\\RazorCoreTestApp\\RazorCoreTestApp.csproj",
179213
"Configuration": {
180-
"ConfigurationName": "MVC-2.1",
181-
"LanguageVersion": "2.1",
214+
"ConfigurationName": "MVC-3.0",
215+
"LanguageVersion": "3.0",
182216
"Extensions": [
183217
{
184-
"ExtensionName": "MVC-2.1"
218+
"ExtensionName": "MVC-3.0"
185219
}
186220
]
187-
}
221+
},
222+
"ProjectWorkspaceState": {
223+
"TagHelpers": [ /* LOTS OF ENTRIES HERE */ ],
224+
"CSharpLanguageVersion": 703 // This may be different
225+
},
226+
"RootNamespace": "RazorCoreTestApp",
227+
"Documents": [ /* LOTS OF ENTRIES HERE */]
188228
}
189229
```
190230

191231
##### Blazor
192232
```JSON
193233
{
194-
"ProjectFilePath": "c:\\Users\\JohnDoe\\Projects\\BlazorTestApp\\BlazorTestApp.csproj",
195-
"TargetFramework": "netstandard2.0",
196-
"TagHelpers": [],
234+
"FilePath": "c:\\Users\\JohnDoe\\Projects\\BlazorTestApp\\BlazorTestApp.csproj",
197235
"Configuration": {
198-
"ConfigurationName": "Blazor-0.1",
199-
"LanguageVersion": "1337.1337",
236+
"ConfigurationName": "MVC-3.0",
237+
"LanguageVersion": "MVC-3.0",
200238
"Extensions": [
201239
{
202-
"ExtensionName": "Blazor.AngleSharp-0.1"
203-
},
204-
{
205-
"ExtensionName": "Blazor-0.1"
240+
"ExtensionName": "MVC-3.0"
206241
}
207242
]
208-
}
243+
},
244+
"ProjectWorkspaceState": {
245+
"TagHelpers": [ /* LOTS OF ENTRIES HERE */ ],
246+
"CSharpLanguageVersion": 703 // This may be different
247+
},
248+
"RootNamespace": "BlazorTestApp",
249+
"Documents": [ /* LOTS OF ENTRIES HERE */]
209250
}
210251
```
211252

212253
##### Legacy Razor
213254
```JSON
214255
{
215256
"ProjectFilePath": "c:\\Users\\JohnDoe\\Projects\\LegacyRazorTestApp\\LegacyRazorTestApp.csproj",
216-
"TargetFramework": "v4.6.1",
217-
"TagHelpers": [],
218257
"Configuration": {
219258
"ConfigurationName": "UnsupportedRazor",
220259
"LanguageVersion": "1.0",
@@ -223,10 +262,27 @@ Verify each of the test projects above's `project.razor.json` file (ASP.NET Core
223262
"ExtensionName": "UnsupportedRazorExtension"
224263
}
225264
]
226-
}
265+
},
266+
"ProjectWorkspaceState": {
267+
"TagHelpers": [],
268+
"CSharpLanguageVersion": 703 // This may be different
269+
},
270+
"RootNamespace": null,
271+
"Documents": []
227272
}
228273
```
229274

275+
#### Report a Razor issue
276+
Perform the following in any of the above Razor projects.
277+
* Run the `Report a Razor issue` command while `razor.trace` is set to `Off`. Ensure that you get a dialog stating that `razor.trace` must be set to `Verbose`.
278+
* Run the `Report a Razor issue` command while `razor.trace` is set to `Verbose`. Follow the instructions, type a little bit in a .cshtml file when it's recording. Once you stop the recording ensure that the content copied to your clipboard has the following information:
279+
- Razor log output under the **Logs** section
280+
- The Razor document content under the **Workspace information** section
281+
- Projected CSharp document under the **Workspace information** section
282+
- Projected Html document under the **Workspace information** section
283+
- `dotnet --info` output under **Machine information** section
284+
- The table of extensions under the **Machine information** section
285+
230286
#### Razor Options
231287

232288
##### razor.disabled

0 commit comments

Comments
 (0)