Skip to content
Merged
Show file tree
Hide file tree
Changes from 9 commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
b171b00
Move document and edit mapping code up to Remote.Razor
davidwengier Jun 10, 2026
844035f
Move resource
davidwengier Jun 10, 2026
c9b000f
Delete unused file
davidwengier Jun 10, 2026
db79a4d
Move MEF exports to the real classes, and remove indirection
davidwengier Jun 10, 2026
43d93eb
Rename file
davidwengier Jun 10, 2026
1e8434a
Strongly type and simplify logic, now that there is no abstraction to…
davidwengier Jun 10, 2026
9fa0075
Make edit service and mapping service handle multiple C# documents
davidwengier Jun 10, 2026
db803ac
Move document position info code
davidwengier Jun 10, 2026
b41ce6b
Remove unused Razor using directive
davidwengier Jun 10, 2026
6b65bbb
Move formatting files up to Remote.Razor
davidwengier Jun 10, 2026
3796b77
Move almost all of FormattingUtilities
davidwengier Jun 10, 2026
d60bd03
Move C# formatting options helper back a to shared location
davidwengier Jun 10, 2026
e4059b1
Move trigger characters to where they're actually used
davidwengier Jun 10, 2026
b63641b
Fix namespaces and usings
davidwengier Jun 10, 2026
8f4a32d
Add IVT
davidwengier Jun 10, 2026
e46ed32
Move resources
davidwengier Jun 10, 2026
51db216
Update tests
davidwengier Jun 10, 2026
24d5d26
Move MEF attributes and remote unnecessary indirection
davidwengier Jun 10, 2026
74d6760
Unskip tests
davidwengier Jun 11, 2026
62c0956
Make formatting sonic compatible
davidwengier Jun 11, 2026
df11094
Update dependent services so they at least compile
davidwengier Jun 11, 2026
a4948b7
Fix "Show Formatting Document" feature
davidwengier Jun 11, 2026
4ec51a3
Unskip tests (and add one)
davidwengier Jun 11, 2026
f1cbb12
Remove stale comment
davidwengier Jun 11, 2026
e384ef0
Fix benchmark
davidwengier Jun 11, 2026
cffd735
Make Razor inlay hints SONIC-aware
davidwengier Jun 11, 2026
e5affc8
Add SONIC inlay hint tests
davidwengier Jun 11, 2026
d758621
Make Razor folding ranges SONIC-aware
davidwengier Jun 11, 2026
2057517
Add SONIC folding range tests
davidwengier Jun 11, 2026
3eb3b12
Move files from Workspaces to Remote and unify namespaces
davidwengier Jun 11, 2026
c9d98ae
Move MEF export
davidwengier Jun 11, 2026
bff73ca
Rename file
davidwengier Jun 11, 2026
577e795
Make Razor go to definition SONIC-aware
davidwengier Jun 11, 2026
4c73cf3
Correctness
davidwengier Jun 11, 2026
87ff5ca
[Sonic] Inlay hints, folding ranges, and go to definition (#84102)
davidwengier Jun 12, 2026
11d5cb6
[Sonic] Support multiple C# documents in formatting (#84097)
davidwengier Jun 12, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,8 @@ public void Setup()
hostServicesProvider.SetWorkspaceProvider(new WorkspaceProvider(_workspace));

var clientSettingsManager = new RemoteClientSettingsManager();
var documentMappingService = new RemoteDocumentMappingService(filePathService, snapshotManager, EmptyLoggerFactory.Instance);
var razorEditService = new RemoteRazorEditService(documentMappingService, clientSettingsManager, filePathService, snapshotManager, NoOpTelemetryReporter.Instance);
var documentMappingService = new DocumentMappingService(filePathService, snapshotManager, EmptyLoggerFactory.Instance);
var razorEditService = new RazorEditService(documentMappingService, clientSettingsManager, filePathService, snapshotManager, NoOpTelemetryReporter.Instance);

_formattingService = new RemoteRazorFormattingService(
documentMappingService,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ internal interface IRazorEditService
Task<ImmutableArray<RazorTextChange>> MapCSharpEditsAsync(
ImmutableArray<RazorTextChange> textChanges,
IDocumentSnapshot snapshot,
bool declarationDocument,
bool includeCSharpLanguageFeatureEdits,
Func<RazorTextChange, bool>? directlyMappedEditFilter,
CancellationToken cancellationToken);
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

using System;
using System.Collections.Immutable;
using System.Diagnostics.CodeAnalysis;
using System.Linq;
using System.Threading;
using Microsoft.AspNetCore.Razor.Language.Intermediate;
using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.Razor.Protocol;
using Microsoft.CodeAnalysis.Text;

Expand Down Expand Up @@ -58,6 +60,18 @@ public static RazorCSharpDocument GetCSharpDocumentForHintName(this RazorCodeDoc
return document.GetRequiredCSharpDocument(declarationDocument: false);
}

public static bool TryGetCSharpDocumentForGeneratedUri(this RazorCodeDocument codeDocument, Solution solution, Uri generatedDocumentUri, [NotNullWhen(true)] out RazorCSharpDocument? csharpDocument)
{
if (solution.TryGetSourceGeneratedDocumentIdentity(generatedDocumentUri, out var identity))
{
csharpDocument = GetCSharpDocumentForHintName(codeDocument, identity.HintName);
return true;
}

csharpDocument = null;
return false;
}

public static SourceText GetHtmlSourceText(this RazorCodeDocument document, CancellationToken cancellationToken)
=> GetCachedData(document).GetOrComputeHtmlDocument(cancellationToken).Text;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Licensed to the .NET Foundation under one or more agreements.
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

using System;
Expand Down Expand Up @@ -117,6 +117,7 @@ public async Task<ImmutableArray<TextChange>> ExecuteAsync(FormattingContext con
var mappedChanges = await _razorEditService.MapCSharpEditsAsync(
normalizedChanges.SelectAsArray(static c => c.ToRazorTextChange()),
context.CurrentSnapshot,
declarationDocument: false, // PROTOTYPE: Still to fix
context.IncludeCSharpLanguageFeatureEdits,
directlyMappedEditFilter: change => ShouldKeepDirectlyMappedEdit(context, indent, change),
cancellationToken).ConfigureAwait(false);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,9 +136,6 @@
<data name="PositionLine_Outside_Range" xml:space="preserve">
<value>Line '{0}' outside of the {1} range of '{2}' was queried. The document may not be up to date.</value>
</data>
<data name="Unknown_mapping_behavior" xml:space="preserve">
<value>Unknown mapping behavior</value>
</data>
<data name="Format_operation_changed_nonwhitespace" xml:space="preserve">
<value>A format operation is being abandoned because it would add or delete non-whitespace content.</value>
</data>
Expand Down Expand Up @@ -219,4 +216,4 @@
<value> (Baseline since {0})</value>
<comment>{0} is the year the feature reached baseline status (e.g., "2015")</comment>
</data>
</root>
</root>

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@
using Microsoft.CodeAnalysis.LanguageServer.Handler;
using Microsoft.CodeAnalysis.Options;
using Microsoft.CodeAnalysis.Razor.AutoInsert;
using Microsoft.CodeAnalysis.Razor.DocumentMapping;
using Microsoft.CodeAnalysis.Razor.Formatting;
using Microsoft.CodeAnalysis.Razor.Logging;
using Microsoft.CodeAnalysis.Razor.Protocol;
using Microsoft.CodeAnalysis.Razor.Protocol.AutoInsert;
using Microsoft.CodeAnalysis.Razor.Remote;
using Microsoft.CodeAnalysis.Razor.Workspaces;
using Microsoft.CodeAnalysis.Razor.Workspaces.Settings;
using Microsoft.CodeAnalysis.Remote.Razor.DocumentMapping;
using Microsoft.CodeAnalysis.Remote.Razor.ProjectSystem;
using Microsoft.CodeAnalysis.Text;
using Roslyn.Utilities;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
using Microsoft.AspNetCore.Razor.PooledObjects;
using Microsoft.CodeAnalysis.LanguageServer.Handler.CallHierarchy;
using Microsoft.CodeAnalysis.Razor;
using Microsoft.CodeAnalysis.Razor.DocumentMapping;
using Microsoft.CodeAnalysis.Razor.Protocol;
using Microsoft.CodeAnalysis.Razor.Remote;
using Microsoft.CodeAnalysis.Razor.Workspaces;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@
// The .NET Foundation licenses this file to you under the MIT license.

using Microsoft.AspNetCore.Razor.Language;
using Microsoft.CodeAnalysis.Razor.DocumentMapping;

namespace Microsoft.CodeAnalysis.Razor.DocumentMapping;
namespace Microsoft.CodeAnalysis.Remote.Razor.DocumentMapping;

internal sealed class DefaultDocumentPositionInfoStrategy : IDocumentPositionInfoStrategy
{
Expand Down
Loading
Loading