Skip to content

Commit

Permalink
Explicit access modifiers, clean up typing
Browse files Browse the repository at this point in the history
  • Loading branch information
noahbkim committed Jun 23, 2020
1 parent 9fd4ee9 commit afeb79e
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

namespace Microsoft.AspNetCore.Razor.LanguageServer.Refactoring
{
class ExtractToCodeBehindCodeActionProvider : RazorCodeActionProvider
internal class ExtractToCodeBehindCodeActionProvider : RazorCodeActionProvider
{
override public Task<CommandOrCodeActionContainer> ProvideAsync(RazorCodeActionContext context, CancellationToken cancellationToken)
{
Expand All @@ -29,7 +29,7 @@ override public Task<CommandOrCodeActionContainer> ProvideAsync(RazorCodeActionC
return Task.FromResult<CommandOrCodeActionContainer>(null);
}

var change = new SourceChange(context.Location.AbsoluteIndex, length: 0, newText: "");
var change = new SourceChange(context.Location.AbsoluteIndex, length: 0, newText: string.Empty);
var node = context.Document.GetSyntaxTree().Root.LocateOwner(change);
if (node is null)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

namespace Microsoft.AspNetCore.Razor.LanguageServer.Refactoring
{
class ExtractToCodeBehindCodeActionResolver : RazorCodeActionResolver
internal class ExtractToCodeBehindCodeActionResolver : RazorCodeActionResolver
{
private readonly ForegroundDispatcher _foregroundDispatcher;
private readonly DocumentResolver _documentResolver;
Expand All @@ -44,7 +44,7 @@ public ExtractToCodeBehindCodeActionResolver(
_documentResolver = documentResolver;
}

override public async Task<WorkspaceEdit> ResolveAsync(JObject data, CancellationToken cancellationToken)
public override async Task<WorkspaceEdit> ResolveAsync(JObject data, CancellationToken cancellationToken)
{
var actionParams = data.ToObject<ExtractToCodeBehindParams>();
var path = Path.GetFullPath(actionParams.Uri.LocalPath);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,8 @@ export class RazorCodeActionRunner {
vscode.commands.registerCommand('razor/runCodeAction', (request: object) => this.runCodeAction(request), this);
}

private async runCodeAction(request: any): Promise<boolean | string | {}> {
private async runCodeAction(request: any): Promise<boolean> {
const response: CodeActionResolutionResponse = await this.serverClient.sendRequest('razor/resolveCodeAction', {Action: request.Action, Data: request.Data});
this.logger.logVerbose(`received from razor/resolveCodeAction: ${JSON.stringify(response)}`);
let workspaceEdit: vscode.WorkspaceEdit;
try {
workspaceEdit = convertWorkspaceEditFromSerializable(response.edit);
Expand Down

0 comments on commit afeb79e

Please sign in to comment.