Skip to content

Commit

Permalink
Merge pull request #49056 from allisonchou/DisableCodeCleanup
Browse files Browse the repository at this point in the history
Disable code cleanup in LSP
  • Loading branch information
allisonchou authored Oct 30, 2020
2 parents f0e5a3f + 1544fa8 commit 58c086b
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.CodeCleanup;
using Microsoft.CodeAnalysis.Editor;
using Microsoft.CodeAnalysis.Editor.Shared.Extensions;
using Microsoft.CodeAnalysis.Editor.Shared.Utilities;
using Microsoft.CodeAnalysis.Host;
using Microsoft.CodeAnalysis.Host.Mef;
Expand Down Expand Up @@ -178,6 +179,13 @@ async Task<Solution> ApplyFixAsync(ProgressTracker progressTracker, Cancellation
private Task<bool> FixTextBufferAsync(TextBufferCodeCleanUpScope textBufferScope, ICodeCleanUpExecutionContext context)
{
var buffer = textBufferScope.SubjectBuffer;

// Let LSP handle code cleanup in the cloud scenario
if (buffer.IsInCloudEnvironmentClientContext())
{
return SpecializedTasks.False;
}

var document = buffer.CurrentSnapshot.GetOpenDocumentInCurrentContextWithChanges();
if (document == null)
{
Expand Down

0 comments on commit 58c086b

Please sign in to comment.