-
Notifications
You must be signed in to change notification settings - Fork 193
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixes #10743 Part of #9519 Brings formatting to cohosting. Relatively simple because of previous PRs. Have left sharing full test coverage of the formatting engine for later
- Loading branch information
Showing
30 changed files
with
1,386 additions
and
224 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 5 additions & 2 deletions
7
src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Formatting/RazorFormattingOptions.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
52 changes: 52 additions & 0 deletions
52
src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Remote/IRemoteFormattingService.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
// Copyright (c) .NET Foundation. All rights reserved. | ||
// Licensed under the MIT license. See License.txt in the project root for license information. | ||
|
||
using System.Collections.Immutable; | ||
using System.Threading; | ||
using System.Threading.Tasks; | ||
using Microsoft.CodeAnalysis.ExternalAccess.Razor; | ||
using Microsoft.CodeAnalysis.Razor.Formatting; | ||
using Microsoft.CodeAnalysis.Text; | ||
|
||
namespace Microsoft.CodeAnalysis.Razor.Remote; | ||
|
||
internal interface IRemoteFormattingService | ||
{ | ||
ValueTask<ImmutableArray<TextChange>> GetDocumentFormattingEditsAsync( | ||
RazorPinnedSolutionInfoWrapper solutionInfo, | ||
DocumentId documentId, | ||
ImmutableArray<TextChange> htmlChanges, | ||
RazorFormattingOptions options, | ||
CancellationToken cancellationToken); | ||
|
||
ValueTask<ImmutableArray<TextChange>> GetRangeFormattingEditsAsync( | ||
RazorPinnedSolutionInfoWrapper solutionInfo, | ||
DocumentId documentId, | ||
ImmutableArray<TextChange> htmlChanges, | ||
LinePositionSpan linePositionSpan, | ||
RazorFormattingOptions options, | ||
CancellationToken cancellationToken); | ||
|
||
ValueTask<ImmutableArray<TextChange>> GetOnTypeFormattingEditsAsync( | ||
RazorPinnedSolutionInfoWrapper solutionInfo, | ||
DocumentId documentId, | ||
ImmutableArray<TextChange> htmlChanges, | ||
LinePosition linePosition, | ||
string triggerCharacter, | ||
RazorFormattingOptions options, | ||
CancellationToken cancellationToken); | ||
|
||
ValueTask<TriggerKind> GetOnTypeFormattingTriggerKindAsync( | ||
RazorPinnedSolutionInfoWrapper solutionInfo, | ||
DocumentId documentId, | ||
LinePosition linePosition, | ||
string triggerCharacter, | ||
CancellationToken cancellationToken); | ||
|
||
internal enum TriggerKind | ||
{ | ||
Invalid, | ||
ValidHtml, | ||
ValidCSharp, | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.