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

Razor VSCode 5.0 Preview 3 #3696

Merged
Merged
Show file tree
Hide file tree
Changes from 4 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
6 changes: 4 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@

* Known limitations with the preview Razor (cshtml) language service to be addressed in a future release:
* Only ASP.NET Core projects are supported (no support for ASP.NET projects)
* Limited support for colorization and formatting
* Loss of HTML completions following C# less than (`<`) operator
* Limited support for formatting
* Error squiggles misaligned for expressions near the start of a new line
* Emmet based abbreviation expansion is not yet supported
* There currently is no completion support for package references in csproj files. ([#1156](https://github.com/OmniSharp/omnisharp-vscode/issues/1156))
Expand All @@ -12,6 +11,9 @@
## 1.21.16 (Not yet released)
* Support for .NET Core 3.1 in csx files (PR: [#1731](https://github.com/OmniSharp/omnisharp-roslyn/pull/1731))
* 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))
* 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.21.15 (March 19, 2020)
* Fixed freezing and unresponsiveness when opening folder with many nested sub-folders (PR: [#3681](https://github.com/OmniSharp/omnisharp-vscode/pull/3681))
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 10 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
],
"defaults": {
"omniSharp": "1.34.15",
"razor": "1.0.0-alpha3-5.0.0-preview.2.20156.4"
"razor": "1.0.0-alpha3-5.0.0-preview.3.20176.8"
},
"main": "./dist/extension",
"scripts": {
Expand Down Expand Up @@ -79,7 +79,7 @@
"http-proxy-agent": "2.1.0",
"https-proxy-agent": "^3.0.1",
"jsonc-parser": "2.0.3",
"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",
"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",
"mkdirp": "^1.0.3",
"node-filter-async": "1.1.1",
"remove-bom-buffer": "3.0.0",
Expand Down Expand Up @@ -301,8 +301,8 @@
{
"id": "Razor",
"description": "Razor Language Server (Windows / x64)",
"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",
"fallbackUrl": "https://razorvscodetest.blob.core.windows.net/languageserver/RazorLanguageServer-win-x64-5.0.0-preview.2.20156.4.zip",
"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",
"fallbackUrl": "https://razorvscodetest.blob.core.windows.net/languageserver/RazorLanguageServer-win-x64-5.0.0-preview.3.20176.8.zip",
"installPath": ".razor",
"platforms": [
"win32"
Expand All @@ -314,8 +314,8 @@
{
"id": "Razor",
"description": "Razor Language Server (Windows / x86)",
"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",
"fallbackUrl": "https://razorvscodetest.blob.core.windows.net/languageserver/RazorLanguageServer-win-x86-5.0.0-preview.2.20156.4.zip",
"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",
"fallbackUrl": "https://razorvscodetest.blob.core.windows.net/languageserver/RazorLanguageServer-win-x86-5.0.0-preview.3.20176.8.zip",
"installPath": ".razor",
"platforms": [
"win32"
Expand All @@ -327,8 +327,8 @@
{
"id": "Razor",
"description": "Razor Language Server (Linux / x64)",
"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",
"fallbackUrl": "https://razorvscodetest.blob.core.windows.net/languageserver/RazorLanguageServer-linux-x64-5.0.0-preview.2.20156.4.zip",
"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",
"fallbackUrl": "https://razorvscodetest.blob.core.windows.net/languageserver/RazorLanguageServer-linux-x64-5.0.0-preview.3.20176.8.zip",
"installPath": ".razor",
"platforms": [
"linux"
Expand All @@ -343,8 +343,8 @@
{
"id": "Razor",
"description": "Razor Language Server (macOS / x64)",
"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",
"fallbackUrl": "https://razorvscodetest.blob.core.windows.net/languageserver/RazorLanguageServer-osx-x64-5.0.0-preview.2.20156.4.zip",
"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",
"fallbackUrl": "https://razorvscodetest.blob.core.windows.net/languageserver/RazorLanguageServer-osx-x64-5.0.0-preview.3.20176.8.zip",
"installPath": ".razor",
"platforms": [
"darwin"
Expand Down
2 changes: 1 addition & 1 deletion src/razor/razor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export async function activateRazorExtension(context: vscode.ExtensionContext, e
const languageServerDir = configuredLanguageServerDir || path.join(extensionPath, '.razor');

if (fs.existsSync(languageServerDir)) {
await Razor.activate(context, languageServerDir, eventStream);
await Razor.activate(vscode, context, languageServerDir, eventStream, /* enableProposedApis: */ false);
} else if (configuredLanguageServerDir) {
// It's only an error if the nonexistent dir was explicitly configured
// If it's the default dir, this is expected for unsupported platforms
Expand Down
39 changes: 23 additions & 16 deletions test-plan.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,29 +5,29 @@ When you open a directory in VS Code, the C# extension should look for a .csproj
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

Project types to test:
* Standalone csproj
* Directory containing .sln file that references csprojs--projects should be loaded
* Standalone csproj
* Directory containing .sln file that references csprojs--projects should be loaded
* .NET Core/.NET Standard csproj
* (Windows) Desktop .NET projects
* Unity projects
* 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.
* 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.

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.

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

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

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

#### Signature Help
#### Signature Help
* Signature Help shows up in a method call after typing `(`
* Signature help shows documentation for methods and for parameters
* Parameter documentation is only shown for the currently active parameter
Expand Down Expand Up @@ -96,7 +96,7 @@ The easist way to verify that a project was successfully loaded is to open a .cs
#### ASP.NET Core Razor
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:
To setup a test project to verify on you can do:
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.
2. `dotnet new webapp`
3. Open `Pages/Index.cshtml`
Expand Down Expand Up @@ -161,13 +161,19 @@ Note that the pipe in the below examples indicates the cursor.
* Typing `@{ <strong> }` results in errors. One error should be about the "strong" tag missing a closing tag.
* Fixing the error and typing `</strong>` i.e. `@{ <strong></strong> }` results in the diagnostic going away.

##### HTML Completion Documentation
* Typing `<a` results in the suggestion of the `a` tag with a description of the tag, and `MDN Reference`.

##### C# <text> tag
* 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.

##### Known issues:
- Error squiggles may be misaligned due to known issues.
- Error squiggles may be misaligned due to known issues.

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

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

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

##### C# Diagnostics
* There are 0 .cshtml related errors on open.
* Typing `@ThisDoesNotExist` does not result in an error being created.
* Typing `@ThisDoesNotExist` does not result in an error being created.

##### Html Completion
Verifying Html is needed to ensure the Razor experience is still partially enabled.
Expand Down Expand Up @@ -339,7 +345,7 @@ Verify each of the test projects above's `project.razor.json` file (ASP.NET Core
#### Report a Razor issue
Perform the following in any of the above Razor projects.
* 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`.
* 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:
* 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:
- Razor log output under the **Logs** section
- The Razor document content under the **Workspace information** section
- Projected CSharp document under the **Workspace information** section
Expand All @@ -358,6 +364,7 @@ This option can be set to any of the following values:
* "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.
* "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".
* "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 ...."
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.

#### OmniSharp Options

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

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".
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".
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.
* If the option is not set, the OmniSharp path displayed in the "OmniSharp Log" should end with "run"
* If the option is set, the OmniSharp path as mentioned above should end with "OmniSharp.exe"

#### omnisharp.path
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).
* 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.
* 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.
* 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.
* "<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`.
* "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`.
* All the above configurations should work, with and without setting the useMono option on Linux
* 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.
* 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.

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