From e8530f913f17668dc7cca51f47869071525da84e Mon Sep 17 00:00:00 2001 From: Fredric Silberberg Date: Thu, 22 Oct 2020 17:36:12 -0700 Subject: [PATCH 1/3] Do not send file changed events for .cs files Similar to the rename and codeAction change, this can cause incremental updates to break if the file is updated on disk (not by a vscode edit). --- src/features/changeForwarding.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/features/changeForwarding.ts b/src/features/changeForwarding.ts index f23c43ba5..11b3a99d3 100644 --- a/src/features/changeForwarding.ts +++ b/src/features/changeForwarding.ts @@ -49,6 +49,13 @@ function forwardFileChanges(server: OmniSharpServer): IDisposable { return; } + if (changeType === FileChangeType.Change && uri.fsPath.endsWith(".cs")) { + // The server watches for file system events from .cs files, if we send + // a file changed event as well it will cause a double-apply and potentially + // invalidate the file state + return; + } + let req = { FileName: uri.fsPath, changeType }; serverUtils.filesChanged(server, [req]).catch(err => { From b44bd87018fbc7cf5db993f6500b61699c1e69fc Mon Sep 17 00:00:00 2001 From: Fred Silberberg Date: Thu, 22 Oct 2020 17:48:38 -0700 Subject: [PATCH 2/3] Update src/features/changeForwarding.ts Co-authored-by: Joey Robichaud --- src/features/changeForwarding.ts | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/features/changeForwarding.ts b/src/features/changeForwarding.ts index 11b3a99d3..30ded29e5 100644 --- a/src/features/changeForwarding.ts +++ b/src/features/changeForwarding.ts @@ -50,9 +50,12 @@ function forwardFileChanges(server: OmniSharpServer): IDisposable { } if (changeType === FileChangeType.Change && uri.fsPath.endsWith(".cs")) { - // The server watches for file system events from .cs files, if we send - // a file changed event as well it will cause a double-apply and potentially - // invalidate the file state + // When a file changes on disk a FileSystemEvent is generated as well as + // a DidChangeTextDocumentEvent. The OmniSharp server listens for Change events + // for ".cs" files and reloads their text from disk. This creates a situation where the server + // may have updated the document to reflect disk and also recieves a set of TextChanges + // to apply to the document. In order to avoid that situation, we will not send Change events + // for ".cs" files and instead allow them to be updated via the DidChangeTextDocumentEvent. return; } From f2e32958e2bd41de44f9d855138e0efa22fca210 Mon Sep 17 00:00:00 2001 From: Joey Robichaud Date: Thu, 22 Oct 2020 17:57:50 -0700 Subject: [PATCH 3/3] Update version and changelog for release --- CHANGELOG.md | 7 ++++--- README.md | 14 +++++++++++++- package-lock.json | 4 ++-- package.json | 4 ++-- 4 files changed, 21 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 57da9603a..d08a271ac 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,6 @@ ## Known Issues in 1.23.5 -* For Mono-based development (e.g. Unity) that requires full .NET framework, you need to set `"omnisharp.useGlobalMono": "always"`. This is needed until Mono [upgrades their bundled MSBuild version](https://github.com/mono/mono/issues/20250) +* For Mono-based development (e.g. Unity) that requires full .NET framework, you need to set `"omnisharp.useGlobalMono": "always"`. The current value of "auto" will remain "never" until Mono [upgrades their bundled MSBuild version](https://github.com/mono/mono/issues/20250). * 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 formatting @@ -13,7 +13,8 @@ ## 1.23.5 (Not yet released) * Set meaning of UseGlobalMono "auto" to "never" since Mono 6.12.0 still ships with MSBuild 16.7 (PR: [#4130](https://github.com/OmniSharp/omnisharp-vscode/pull/4130)) -* Ensure that the rename identifier and run code action providers do not apply changes twice PR: [4133](https://github.com/OmniSharp/omnisharp-vscode/pull/4133) +* Ensure that the rename identifier and run code action providers do not apply changes twice (PR: [#4133](https://github.com/OmniSharp/omnisharp-vscode/pull/4133)) +* Do not send file changed events for .cs files (PR: [#4141](https://github.com/OmniSharp/omnisharp-vscode/pull/4141)) * Update Razor to 6.0.0-alpha1.20521.3: * Improvements to HTML colorization for non-C# portions of the document. * Bug fix - the `razor.format.enable` option is honored again @@ -43,7 +44,7 @@ * [Debugger licensing errors are not reported to the UI ([#3759](https://github.com/OmniSharp/omnisharp-vscode/issues/3759)) * [Error processing 'variables' request. Unknown Error: 0x8000211d ([#3926](https://github.com/OmniSharp/omnisharp-vscode/issues/3926)) * [Method with a function pointer local breaks variables view and debug console ([#4052](https://github.com/OmniSharp/omnisharp-vscode/issues/4052)) -* Update to OmniSharp 1.37.2 (PR: [#4107](https://github.com/OmniSharp/omnisharp-vscode/pull/4107)) +* Update OmniSharp to 1.37.2 (PR: [#4107](https://github.com/OmniSharp/omnisharp-vscode/pull/4107)) * Updated MSBuild, MSBuild resolvers and Roslyn to match .NET Core 5.0 RC2 and VS 16.8 Preview 4. (PR: [omnisharp-roslyn/#1971](https://github.com/OmniSharp/omnisharp-roslyn/pull/1971), PR: [omnisharp-roslyn/#1974](https://github.com/OmniSharp/omnisharp-roslyn/pull/1974)) * Decouple FixAll from the workspace ([omnisharp-roslyn/#1960](https://github.com/OmniSharp/omnisharp-roslyn/issues/1960), PR: [omnisharp-roslyn/#1962](https://github.com/OmniSharp/omnisharp-roslyn/pull/1962)) * Added binding redirects for Microsoft.CodeAnalysis.Features and Microsoft.CodeAnalysis.CSharp.Features (PR: [omnisharp-roslyn/#1964](https://github.com/OmniSharp/omnisharp-roslyn/pull/1964)) diff --git a/README.md b/README.md index faf0844cd..030b68d2f 100644 --- a/README.md +++ b/README.md @@ -20,6 +20,12 @@ The C# extension is powered by [OmniSharp](https://github.com/OmniSharp/omnishar - [Documentation](https://code.visualstudio.com/docs/languages/csharp) - [Video Tutorial compiling with .NET Core](https://channel9.msdn.com/Blogs/dotnet/Get-started-VSCode-Csharp-NET-Core-Windows) +## Note about using .NET Core 3.1.40x SDKs + +The .NET 3.1.40x SDKs require version 16.7 of MSBuild. + +For MacOS and Linux users who have Mono installed, this means you will need to set `omnisharp.useGlobalMono` to `never` until a version of Mono ships with MSBuild 16.7. + ## Note about using .NET 5 SDKs The .NET 5 SDK requires version 16.8 of MSBuild. @@ -29,6 +35,12 @@ For MacOS and Linux users who have Mono installed, this means you will need to s ## What's new in 1.23.5 - Set meaning of UseGlobalMono "auto" to "never" since Mono 6.12.0 still ships with MSBuild 16.7 (PR: [#4130](https://github.com/OmniSharp/omnisharp-vscode/pull/4130)) +- Ensure that the rename identifier and run code action providers do not apply changes twice (PR: [#4133](https://github.com/OmniSharp/omnisharp-vscode/pull/4133)) +- Do not send file changed events for .cs files (PR: [#4141](https://github.com/OmniSharp/omnisharp-vscode/pull/4141)) +- Update Razor to 6.0.0-alpha1.20521.3: + - Improvements to HTML colorization for non-C# portions of the document. + - Bug fix - the `razor.format.enable` option is honored again + ## What's new in 1.23.4 - Use incremental changes to update language server (PR: [#4088](https://github.com/OmniSharp/omnisharp-vscode/pull/4088)) @@ -55,7 +67,7 @@ For MacOS and Linux users who have Mono installed, this means you will need to s - [Debugger licensing errors are not reported to the UI ([#3759](https://github.com/OmniSharp/omnisharp-vscode/issues/3759)) - [Error processing 'variables' request. Unknown Error: 0x8000211d ([#3926](https://github.com/OmniSharp/omnisharp-vscode/issues/3926)) - [Method with a function pointer local breaks variables view and debug console ([#4052](https://github.com/OmniSharp/omnisharp-vscode/issues/4052)) -- Update to OmniSharp 1.37.2 (PR: [#4107](https://github.com/OmniSharp/omnisharp-vscode/pull/4107)) +- Update OmniSharp to 1.37.2 (PR: [#4107](https://github.com/OmniSharp/omnisharp-vscode/pull/4107)) - Updated MSBuild, MSBuild resolvers and Roslyn to match .NET Core 5.0 RC2 and VS 16.8 Preview 4. (PR: [omnisharp-roslyn/#1971](https://github.com/OmniSharp/omnisharp-roslyn/pull/1971), PR: [omnisharp-roslyn/#1974](https://github.com/OmniSharp/omnisharp-roslyn/pull/1974)) - Decouple FixAll from the workspace ([omnisharp-roslyn/#1960](https://github.com/OmniSharp/omnisharp-roslyn/issues/1960), PR: [omnisharp-roslyn/#1962](https://github.com/OmniSharp/omnisharp-roslyn/pull/1962)) - Added binding redirects for Microsoft.CodeAnalysis.Features and Microsoft.CodeAnalysis.CSharp.Features (PR: [omnisharp-roslyn/#1964](https://github.com/OmniSharp/omnisharp-roslyn/pull/1964)) diff --git a/package-lock.json b/package-lock.json index 8d4969956..471f4cec5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "csharp", - "version": "1.23.4", + "version": "1.23.5", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -11219,4 +11219,4 @@ } } } -} +} \ No newline at end of file diff --git a/package.json b/package.json index c82f24c2a..78c478649 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "csharp", "publisher": "ms-dotnettools", - "version": "1.23.4", + "version": "1.23.5", "description": "C# for Visual Studio Code (powered by OmniSharp).", "displayName": "C#", "author": "Microsoft Corporation", @@ -3644,4 +3644,4 @@ ] } } -} +} \ No newline at end of file