Skip to content

Commit

Permalink
Merge pull request #65292 from CyrusNajmabadi/lspCodeActions
Browse files Browse the repository at this point in the history
Move lsp CodeActions handler down to LSP layer from editor layer.
  • Loading branch information
CyrusNajmabadi authored Nov 10, 2022
2 parents 5b88d79 + 1eaa291 commit 440b6fc
Show file tree
Hide file tree
Showing 27 changed files with 324 additions and 388 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,13 @@ private class FixNameCodeAction : CodeAction
private readonly Func<CancellationToken, Task<Solution>> _createChangedSolutionAsync;
private readonly string _equivalenceKey;

/// <summary>
/// This code action does produce non-text-edit operations (like notifying 3rd parties about a rename). But
/// it doesn't require this. As such, we can allow it to run in hosts that only allow document edits. Those
/// hosts will simply ignore the operations they don't understand.
/// </summary>
public override ImmutableArray<string> Tags => ImmutableArray<string>.Empty;

public FixNameCodeAction(
#if !CODE_STYLE
Solution startingSolution,
Expand Down Expand Up @@ -159,7 +166,7 @@ protected override async Task<IEnumerable<CodeActionOperation>> ComputeOperation
{
codeAction,
factory.CreateSymbolRenamedOperation(_symbol, _newName, _startingSolution, newSolution)
}.AsEnumerable();
};
#endif
}

Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ Namespace Microsoft.CodeAnalysis.Editor.UnitTests.Diagnostics
Dim codeAction = codeActions(codeActionIndex)

If Not glyphTags.IsDefault Then
Assert.Equal(glyphTags, codeAction.Tags)
AssertEx.SetEqual(glyphTags, codeAction.Tags)
End If

Dim oldSolution = workspace.CurrentSolution
Expand Down
Loading

0 comments on commit 440b6fc

Please sign in to comment.