Skip to content

Commit 91d97b2

Browse files
authored
Razor VSCode 5.0 Preview 3 (#3696)
- Razor support for `<text>` tag completions. - Ability to restart the Razor Language Server to activate changes to the razor.trace level. - Bug fixes and performance improvements.
1 parent 3df235d commit 91d97b2

File tree

5 files changed

+44
-32
lines changed

5 files changed

+44
-32
lines changed

CHANGELOG.md

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,19 @@
22

33
* Known limitations with the preview Razor (cshtml) language service to be addressed in a future release:
44
* Only ASP.NET Core projects are supported (no support for ASP.NET projects)
5-
* Limited support for colorization and formatting
6-
* Loss of HTML completions following C# less than (`<`) operator
5+
* Limited support for formatting
76
* Error squiggles misaligned for expressions near the start of a new line
87
* Emmet based abbreviation expansion is not yet supported
98
* There currently is no completion support for package references in csproj files. ([#1156](https://github.com/OmniSharp/omnisharp-vscode/issues/1156))
109
* As an alternative, consider installing the [MSBuild Project Tools](https://marketplace.visualstudio.com/items?itemName=tintoy.msbuild-project-tools) extension by @tintoy.
1110

12-
## 1.21.16 (Not yet released)
11+
## 1.21.17 (Not yet released)
12+
* Updated Razor support (PR:[#3696](https://github.com/OmniSharp/omnisharp-vscode/pull/3696))
13+
* Razor support for `<text>` tag completions.
14+
* Ability to restart the Razor Language Server to activate changes to the `razor.trace` level.
15+
* Bug fixes and performance improvements.
16+
17+
## 1.21.16 (March 30, 2020)
1318
* Support for .NET Core 3.1 in csx files (PR: [#1731](https://github.com/OmniSharp/omnisharp-roslyn/pull/1731))
1419
* Update the minimal MSBuild to better support .NET 5 Previews ([omnisharp-vscode#3653](https://github.com/OmniSharp/omnisharp-vscode/issues/3653), PR: [#1746](https://github.com/OmniSharp/omnisharp-roslyn/pull/1746))
1520

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
],
3131
"defaults": {
3232
"omniSharp": "1.34.15",
33-
"razor": "1.0.0-alpha3-5.0.0-preview.2.20156.4"
33+
"razor": "1.0.0-alpha3-5.0.0-preview.3.20176.8"
3434
},
3535
"main": "./dist/extension",
3636
"scripts": {
@@ -79,7 +79,7 @@
7979
"http-proxy-agent": "2.1.0",
8080
"https-proxy-agent": "^3.0.1",
8181
"jsonc-parser": "2.0.3",
82-
"microsoft.aspnetcore.razor.vscode": "https://download.visualstudio.microsoft.com/download/pr/d133ee88-8117-494f-98a7-ae71672f71dc/9ceda6d2cdba3e0e4faeccb56f115078/microsoft.aspnetcore.razor.vscode-5.0.0-preview.2.20156.4.tgz",
82+
"microsoft.aspnetcore.razor.vscode": "https://download.visualstudio.microsoft.com/download/pr/d48b3dd6-2eac-41f4-b7e9-f7008908917c/7f5df2f7ce62629d29b9d07b4851ce9b/microsoft.aspnetcore.razor.vscode-5.0.0-preview.3.20176.8.tgz",
8383
"mkdirp": "^1.0.3",
8484
"node-filter-async": "1.1.1",
8585
"remove-bom-buffer": "3.0.0",
@@ -301,8 +301,8 @@
301301
{
302302
"id": "Razor",
303303
"description": "Razor Language Server (Windows / x64)",
304-
"url": "https://download.visualstudio.microsoft.com/download/pr/d133ee88-8117-494f-98a7-ae71672f71dc/4eb950fee2bebe2edbabf8dcf2d77f1d/razorlanguageserver-win-x64-5.0.0-preview.2.20156.4.zip",
305-
"fallbackUrl": "https://razorvscodetest.blob.core.windows.net/languageserver/RazorLanguageServer-win-x64-5.0.0-preview.2.20156.4.zip",
304+
"url": "https://download.visualstudio.microsoft.com/download/pr/d48b3dd6-2eac-41f4-b7e9-f7008908917c/63a80df6345ade745ba4ab05b5c02348/razorlanguageserver-win-x64-5.0.0-preview.3.20176.8.zip",
305+
"fallbackUrl": "https://razorvscodetest.blob.core.windows.net/languageserver/RazorLanguageServer-win-x64-5.0.0-preview.3.20176.8.zip",
306306
"installPath": ".razor",
307307
"platforms": [
308308
"win32"
@@ -314,8 +314,8 @@
314314
{
315315
"id": "Razor",
316316
"description": "Razor Language Server (Windows / x86)",
317-
"url": "https://download.visualstudio.microsoft.com/download/pr/d133ee88-8117-494f-98a7-ae71672f71dc/b57997b4175112edc7393335555130a0/razorlanguageserver-win-x86-5.0.0-preview.2.20156.4.zip",
318-
"fallbackUrl": "https://razorvscodetest.blob.core.windows.net/languageserver/RazorLanguageServer-win-x86-5.0.0-preview.2.20156.4.zip",
317+
"url": "https://download.visualstudio.microsoft.com/download/pr/d48b3dd6-2eac-41f4-b7e9-f7008908917c/3572052bd5787c0187803ce7fa801d4f/razorlanguageserver-win-x86-5.0.0-preview.3.20176.8.zip",
318+
"fallbackUrl": "https://razorvscodetest.blob.core.windows.net/languageserver/RazorLanguageServer-win-x86-5.0.0-preview.3.20176.8.zip",
319319
"installPath": ".razor",
320320
"platforms": [
321321
"win32"
@@ -327,8 +327,8 @@
327327
{
328328
"id": "Razor",
329329
"description": "Razor Language Server (Linux / x64)",
330-
"url": "https://download.visualstudio.microsoft.com/download/pr/d133ee88-8117-494f-98a7-ae71672f71dc/79de139da12da03601cd4ab0ac35b151/razorlanguageserver-linux-x64-5.0.0-preview.2.20156.4.zip",
331-
"fallbackUrl": "https://razorvscodetest.blob.core.windows.net/languageserver/RazorLanguageServer-linux-x64-5.0.0-preview.2.20156.4.zip",
330+
"url": "https://download.visualstudio.microsoft.com/download/pr/d48b3dd6-2eac-41f4-b7e9-f7008908917c/57125c181c3b9dce2157e40d1623e8c8/razorlanguageserver-linux-x64-5.0.0-preview.3.20176.8.zip",
331+
"fallbackUrl": "https://razorvscodetest.blob.core.windows.net/languageserver/RazorLanguageServer-linux-x64-5.0.0-preview.3.20176.8.zip",
332332
"installPath": ".razor",
333333
"platforms": [
334334
"linux"
@@ -343,8 +343,8 @@
343343
{
344344
"id": "Razor",
345345
"description": "Razor Language Server (macOS / x64)",
346-
"url": "https://download.visualstudio.microsoft.com/download/pr/d133ee88-8117-494f-98a7-ae71672f71dc/5a2bef67e8d13bcef95f07972d3357bf/razorlanguageserver-osx-x64-5.0.0-preview.2.20156.4.zip",
347-
"fallbackUrl": "https://razorvscodetest.blob.core.windows.net/languageserver/RazorLanguageServer-osx-x64-5.0.0-preview.2.20156.4.zip",
346+
"url": "https://download.visualstudio.microsoft.com/download/pr/d48b3dd6-2eac-41f4-b7e9-f7008908917c/f5508e6670d0d5de3be09b1b8bc9a484/razorlanguageserver-osx-x64-5.0.0-preview.3.20176.8.zip",
347+
"fallbackUrl": "https://razorvscodetest.blob.core.windows.net/languageserver/RazorLanguageServer-osx-x64-5.0.0-preview.3.20176.8.zip",
348348
"installPath": ".razor",
349349
"platforms": [
350350
"darwin"

src/razor/razor.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export async function activateRazorExtension(context: vscode.ExtensionContext, e
1515
const languageServerDir = configuredLanguageServerDir || path.join(extensionPath, '.razor');
1616

1717
if (fs.existsSync(languageServerDir)) {
18-
await Razor.activate(context, languageServerDir, eventStream);
18+
await Razor.activate(vscode, context, languageServerDir, eventStream, /* enableProposedApis: */ false);
1919
} else if (configuredLanguageServerDir) {
2020
// It's only an error if the nonexistent dir was explicitly configured
2121
// If it's the default dir, this is expected for unsupported platforms

test-plan.md

Lines changed: 23 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -5,29 +5,29 @@ When you open a directory in VS Code, the C# extension should look for a .csproj
55
If you look in "Output > Omnisharp Log" a bunch of information should be printed about what copy of MSBuild was used and what projects were load
66

77
Project types to test:
8-
* Standalone csproj
9-
* Directory containing .sln file that references csprojs--projects should be loaded
8+
* Standalone csproj
9+
* Directory containing .sln file that references csprojs--projects should be loaded
1010
* .NET Core/.NET Standard csproj
1111
* (Windows) Desktop .NET projects
1212
* Unity projects
13-
* A directory containing a .cs file without a csproj/sln. As stated above, intellisense should appear only when a change is made to the file.
13+
* A directory containing a .cs file without a csproj/sln. As stated above, intellisense should appear only when a change is made to the file.
1414

1515
The easist way to verify that a project was successfully loaded is to open a .cs file within it and verify that the references codelens indicator appears.
1616

1717
#### Specific projects to test opening (on all OSes):
1818
* `dotnet new console` in a directory
19-
* A more complex dotnet solution, eg. [1]
19+
* A more complex dotnet solution, eg. [1]
2020
* A console app solution created in Visual Studio
2121

2222
#### Unity
2323
* Follow the directions at https://code.visualstudio.com/docs/other/unity to configure VS Code with unity
2424
* Try editing a project like https://github.com/staceyhaffner/SuperSpaceShooter
2525

26-
#### Intellisense
26+
#### Intellisense
2727
* The completion list in a file contains symbols defined in references and in the file
2828
* If you write a documentation comment on a symbol, the completion list displays it
2929

30-
#### Signature Help
30+
#### Signature Help
3131
* Signature Help shows up in a method call after typing `(`
3232
* Signature help shows documentation for methods and for parameters
3333
* Parameter documentation is only shown for the currently active parameter
@@ -96,7 +96,7 @@ The easist way to verify that a project was successfully loaded is to open a .cs
9696
#### ASP.NET Core Razor
9797
The Razor experience is available when you open a .cshtml file in a valid OmniSharp project.
9898

99-
To setup a test project to verify on you can do:
99+
To setup a test project to verify on you can do:
100100
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.
101101
2. `dotnet new webapp`
102102
3. Open `Pages/Index.cshtml`
@@ -161,13 +161,19 @@ Note that the pipe in the below examples indicates the cursor.
161161
* Typing `@{ <strong> }` results in errors. One error should be about the "strong" tag missing a closing tag.
162162
* Fixing the error and typing `</strong>` i.e. `@{ <strong></strong> }` results in the diagnostic going away.
163163

164+
##### HTML Completion Documentation
165+
* Typing `<a` results in the suggestion of the `a` tag with a description of the tag, and `MDN Reference`.
166+
167+
##### C# <text> tag
168+
* Typing `@{ <te` results in the suggestion of the `text` tag with a description. Selecting the `text` suggestion and closing the tag with the `>` character results in the closing `</text>` being automatically added.
169+
164170
##### Known issues:
165-
- Error squiggles may be misaligned due to known issues.
171+
- Error squiggles may be misaligned due to known issues.
166172

167173
#### Blazor
168174
The Blazor experience is available when you open a .razor file in a valid OmniSharp/Blazor project.
169175

170-
To setup a test project to verify on you can do:
176+
To setup a test project to verify on you can do:
171177
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.
172178
2. `dotnet new blazorserverside`
173179
3. Open `Pages/Index.razor`
@@ -220,7 +226,7 @@ To setup a test project to verify on you can do:
220226
- Save `Counter.razor` then wait 5 seconds.
221227
- 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="|"`
222228
- 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"`
223-
* Verify `_Imports.razor` works as expected:
229+
* Verify `_Imports.razor` works as expected:
224230
- Add a new Folder `Utilities` under the `/Pages` folder. Within that folder add a `Helper.razor` file.
225231
- Open the `_Imports.razor` under the `/Pages` folder. Add `@using YourProjectName.Pages.Utilities`
226232
- Go back to `Index.razor`. Typing `<Helper>` prompts you with HTML completion for the `Helper` tag.
@@ -234,7 +240,7 @@ To setup a test project to verify on you can do:
234240
- Error squiggles may be misaligned due to known issues.
235241

236242
#### Legacy Razor
237-
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:
243+
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:
238244
1. Open Visual Studio
239245
2. New Project
240246
3. ASP.NET Web Application (.NET Framework)
@@ -249,7 +255,7 @@ The Razor experience is degraded (but no errors) when you open a .cshtml file in
249255

250256
##### C# Diagnostics
251257
* There are 0 .cshtml related errors on open.
252-
* Typing `@ThisDoesNotExist` does not result in an error being created.
258+
* Typing `@ThisDoesNotExist` does not result in an error being created.
253259

254260
##### Html Completion
255261
Verifying Html is needed to ensure the Razor experience is still partially enabled.
@@ -339,7 +345,7 @@ Verify each of the test projects above's `project.razor.json` file (ASP.NET Core
339345
#### Report a Razor issue
340346
Perform the following in any of the above Razor projects.
341347
* 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`.
342-
* 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:
348+
* 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:
343349
- Razor log output under the **Logs** section
344350
- The Razor document content under the **Workspace information** section
345351
- Projected CSharp document under the **Workspace information** section
@@ -358,6 +364,7 @@ This option can be set to any of the following values:
358364
* "Off" - Will launch Razor Language server with its log output set to 'Off'. The header in the Razor Log output window will be shown but no other content will be shown.
359365
* "Messages" - Will launch Razor Language server with its log output set to 'Messages'. Limited messages will be shown such as "Opening document xyz in project abc".
360366
* "Verbose" - Will launch Razor Language server with its log output set to 'Verbose'. All logging messages will be shown such as "123 - Synchronizing documentxyz currently ...."
367+
Changing this option should result in a notification message at the bottom right of the window, prompting for a restart of the Razor Language Server.
361368

362369
#### OmniSharp Options
363370

@@ -367,19 +374,19 @@ This option can be set to any of the following values:
367374
* "always" - Will launch OmniSharp using mono if version>=5.2.0 is installed and will throw an error otherwise.
368375
* "never" - Launches OmniSharp without using the global mono
369376

370-
The value of OmniSharp path displayed in the OmniSharp log can be used to know if OmniSharp has launched using mono or not. If it is running using global mono, the path will end with "OmniSharp.exe" else the path will end with "run".
377+
The value of OmniSharp path displayed in the OmniSharp log can be used to know if OmniSharp has launched using mono or not. If it is running using global mono, the path will end with "OmniSharp.exe" else the path will end with "run".
371378
For using this option, mono version greater than or equal to 5.2.0 must be installed. If that is not so, setting this option to true, should give an error.
372379
* If the option is not set, the OmniSharp path displayed in the "OmniSharp Log" should end with "run"
373380
* If the option is set, the OmniSharp path as mentioned above should end with "OmniSharp.exe"
374381

375382
#### omnisharp.path
376383
Setting this path to any of the values as listed below, should start the OmniSharp server and display the correct OmniSharp path in the `OmniSharp Log`(View --> Output--> OmniSharp Log).
377384
* undefined - OmniSharp server must start using the copy of omnisharp shipped with the extension, that is, the OmniSharp path must be the extension path, followed by .omnisharp followed by the default omnisharp version as present in the package.json and the platform-specific executable.
378-
* Some absolute path - OmniSharp server must start using the local copy of OmniSharp pointed to by the path and the same must be displayed as the Omnisharp path. Example:C:\omnisharp-roslyn\artifacts\publish\OmniSharp.Stdio\win7-x64\OmniSharp.exe.
385+
* Some absolute path - OmniSharp server must start using the local copy of OmniSharp pointed to by the path and the same must be displayed as the Omnisharp path. Example:C:\omnisharp-roslyn\artifacts\publish\OmniSharp.Stdio\win7-x64\OmniSharp.exe.
379386
* "<version>" - The specified version must be downloaded and installed (The status of download/install can be seen in the `C#` log). If the installation is successful, the server must start and the OmniSharp path must include the .omnisharp folder followed by the version name and the executable. Eg: If the version is `1.29.2-beta.60`, the path displayed on Windows should be `.omnisharp/1.29.2-beta.60/OmniSharp.exe`.
380387
* "latest" - The file containing the information about the latest CI build (https://roslynomnisharp.blob.core.windows.net/releases/versioninfo.txt), must be downloaded and accordingly the latest CI build from the "master" branch of omnisharp-roslyn should be downloaded and installed. If the installation is successful, the server must start and the OmniSharp path must include the .omnisharp folder followed by the version name and the executable. Eg: If the latest version is `1.29.2-beta.62`, the path displayed on Windows should be `.omnisharp/1.29.2-beta.62/OmniSharp.exe`.
381388
* All the above configurations should work, with and without setting the useMono option on Linux
382-
* The above behavior should be exhibited when a new vscode window is opened, as well as if the setting is modified and a "Restart OmniSharp"(Ctrl+Shift+P --> OmniSharp: Restart OmniSharp) is performed.
389+
* The above behavior should be exhibited when a new vscode window is opened, as well as if the setting is modified and a "Restart OmniSharp"(Ctrl+Shift+P --> OmniSharp: Restart OmniSharp) is performed.
383390

384391
#### Status Bar Item
385392
The status bar item(s) must appear on the left side of the VS Code's status bar

0 commit comments

Comments
 (0)