1 type derived from TextEdit
Microsoft.CodeAnalysis.LanguageServer.Protocol (1)
43 instantiations of TextEdit
Microsoft.CodeAnalysis.LanguageServer.Protocol (9)
Microsoft.CodeAnalysis.LanguageServer.Protocol.UnitTests (26)
Completion\CompletionFeaturesTests.cs (8)
156? new() { NewText = "System.Threading.Tasks.Task", Range = new() { Start = new(0, 20), End = new(0, 24) } }
157: new() { NewText = $"using System.Threading.Tasks;{Environment.NewLine}{Environment.NewLine}", Range = new() { Start = new(1, 0), End = new(1, 0) } };
242var expectedAdditionalEdit = new TextEdit() { NewText = $"using NS2;{Environment.NewLine}{Environment.NewLine}", Range = new() { Start = new(1, 0), End = new(1, 0) } };
301var expectedEdit = new TextEdit { Range = new LSP.Range { Start = new(1, 5), End = new(1, 9) }, NewText = "summary" };
731var expectedAdditionalEdit1 = new TextEdit() { NewText = $"using Namespace1;{Environment.NewLine}{Environment.NewLine}", Range = new() { Start = new(1, 0), End = new(1, 0) } };
739var expectedAdditionalEdit2 = new TextEdit() { NewText = $"using Namespace2;{Environment.NewLine}{Environment.NewLine}", Range = new() { Start = new(1, 0), End = new(1, 0) } };
1005var expectedEdit = new TextEdit { Range = new LSP.Range { Start = new(0, 5), End = new(0, 5) }, NewText = "ComplexItem" };
1062var expectedEdit = new TextEdit { Range = new LSP.Range { Start = new(7, 4), End = new(7, 13) }, NewText = $"public override global::System.Boolean AbstractMethod(global::System.Int32 x){Environment.NewLine} {{{Environment.NewLine} throw new System.NotImplementedException();{Environment.NewLine} }}" };
Rename\RenameTests.cs (12)
49var expectedEdits = testLspServer.GetLocations("renamed").Select(location => new LSP.TextEdit() { NewText = renameValue, Range = location.Range });
104var expectedEdits = testLspServer.GetLocations("renamed").Select(location => new LSP.TextEdit() { NewText = renameValue, Range = location.Range });
149var expectedEdits = testLspServer.GetLocations("renamed").Select(location => new LSP.TextEdit() { NewText = renameValue, Range = location.Range });
229var expectedEdits = testLspServer.GetLocations("renamed").Select(location => new LSP.TextEdit() { NewText = renameValue, Range = location.Range });
282var expectedEdits = testLspServer.GetLocations("renamed").Select(location => new LSP.TextEdit() { NewText = renameValue, Range = location.Range });
283var expectedGeneratedEdits = spans["renamed"].Select(span => new LSP.TextEdit() { NewText = renameValue, Range = ProtocolConversions.TextSpanToRange(span, generatedSourceText) });
337var expectedEdits = testLspServer.GetLocations("renamed").Select(location => new LSP.TextEdit() { NewText = renameValue, Range = location.Range });
389var expectedEdits = testLspServer.GetLocations("renamed").Select(location => new LSP.TextEdit() { NewText = renameValue, Range = location.Range });
390var expectedGeneratedEdits = spans["renamed"].Select(span => new LSP.TextEdit() { NewText = renameValue, Range = ProtocolConversions.TextSpanToRange(span, generatedSourceText) });
455var expectedEdits = testLspServer.GetLocations("renamed").Select(location => new LSP.TextEdit() { NewText = renameValue, Range = location.Range });
456var expectedGeneratedEdits = spans["renamed"].Select(span => new LSP.TextEdit() { NewText = renameValue, Range = ProtocolConversions.TextSpanToRange(span, generatedSourceText) });
508var expectedGeneratedEdits = spans["renamed"].Select(span => new LSP.TextEdit() { NewText = renameValue, Range = ProtocolConversions.TextSpanToRange(span, generatedSourceText) });
Microsoft.CodeAnalysis.Razor.Workspaces (6)
CodeActions\Razor\SimplifyTagToSelfClosingCodeActionResolver.cs (1)
43new TextEdit
Microsoft.VisualStudio.LanguageServices.Razor.UnitTests (1)
Microsoft.VisualStudioCode.RazorExtension.UnitTests (1)
208 references to TextEdit
Microsoft.AspNetCore.Razor.Test.Common.Tooling (1)
Microsoft.CodeAnalysis.ExternalAccess.Razor.Features (2)
Microsoft.CodeAnalysis.LanguageServer.Protocol (44)
Microsoft.CodeAnalysis.LanguageServer.Protocol.UnitTests (23)
Completion\CompletionFeaturesTests.cs (7)
155TextEdit expectedAdditionalEdit = isInUsingStatement
242var expectedAdditionalEdit = new TextEdit() { NewText = $"using NS2;{Environment.NewLine}{Environment.NewLine}", Range = new() { Start = new(1, 0), End = new(1, 0) } };
301var expectedEdit = new TextEdit { Range = new LSP.Range { Start = new(1, 5), End = new(1, 9) }, NewText = "summary" };
731var expectedAdditionalEdit1 = new TextEdit() { NewText = $"using Namespace1;{Environment.NewLine}{Environment.NewLine}", Range = new() { Start = new(1, 0), End = new(1, 0) } };
739var expectedAdditionalEdit2 = new TextEdit() { NewText = $"using Namespace2;{Environment.NewLine}{Environment.NewLine}", Range = new() { Start = new(1, 0), End = new(1, 0) } };
1005var expectedEdit = new TextEdit { Range = new LSP.Range { Start = new(0, 5), End = new(0, 5) }, NewText = "ComplexItem" };
1062var expectedEdit = new TextEdit { Range = new LSP.Range { Start = new(7, 4), End = new(7, 13) }, NewText = $"public override global::System.Boolean AbstractMethod(global::System.Int32 x){Environment.NewLine} {{{Environment.NewLine} throw new System.NotImplementedException();{Environment.NewLine} }}" };
Microsoft.CodeAnalysis.LanguageServer.UnitTests (1)
Microsoft.CodeAnalysis.Razor.Workspaces (73)
Completion\Delegation\DelegatedCompletionHelper.cs (9)
192var addProvisionalDot = LspFactory.CreateTextEdit(previousPosition, ".");
317args[1] = complexEditData.Deserialize<TextEdit>() ?? args[1];
321if (args is [TextDocumentIdentifier, TextEdit complexEdit, _, int nextCursorPosition])
323var formattedTextEdit = await FormatTextEditsAsync([complexEdit], documentContext, options, formattingService, cancellationToken).ConfigureAwait(false);
361if (resolvedCompletionItem.TextEdit.Value.TryGetFirst(out var textEdit))
363var formattedTextChange = await FormatTextEditsAsync([textEdit], documentContext, options, formattingService, cancellationToken).ConfigureAwait(false);
379var formattedTextChange = await FormatTextEditsAsync(resolvedCompletionItem.AdditionalTextEdits, documentContext, options, formattingService, cancellationToken).ConfigureAwait(false);
396private static async Task<TextEdit?> FormatTextEditsAsync(TextEdit[] textEdits, DocumentContext documentContext, RazorFormattingOptions options, IRazorFormattingService formattingService, CancellationToken cancellationToken)
Extensions\LspFactory.cs (9)
182public static TextEdit CreateTextEdit(Range range, string newText)
185public static TextEdit CreateTextEdit(LinePositionSpan span, string newText)
188public static TextEdit CreateTextEdit(int startLine, int startCharacter, int endLine, int endCharacter, string newText)
191public static TextEdit CreateTextEdit(Position start, Position end, string newText)
194public static TextEdit CreateTextEdit(LinePosition start, LinePosition end, string newText)
197public static TextEdit CreateTextEdit(int line, int character, string newText)
200public static TextEdit CreateTextEdit(Position position, string newText)
203public static TextEdit CreateTextEdit(LinePosition position, string newText)
206public static TextEdit CreateTextEdit((int line, int character) position, string newText)
Microsoft.CodeAnalysis.Remote.Razor (4)
Microsoft.VisualStudio.LanguageServices.Razor (18)
src\Razor\src\Razor\src\Microsoft.CodeAnalysis.Razor.CohostingShared\Formatting\CohostDocumentFormattingEndpoint.cs (6)
35: AbstractCohostDocumentEndpoint<DocumentFormattingParams, TextEdit[]?>(incompatibleProjectService), IDynamicRegistrationProvider
63protected override Task<TextEdit[]?> HandleRequestAsync(DocumentFormattingParams request, TextDocument razorDocument, CancellationToken cancellationToken)
69private async Task<TextEdit[]?> HandleRequestAsync(DocumentFormattingParams request, TextDocument razorDocument, RazorCSharpSyntaxFormattingOptions csharpSyntaxFormattingOptions, CancellationToken cancellationToken)
106private async Task<TextEdit[]?> TryGetHtmlFormattingEditsAsync(DocumentFormattingParams request, TextDocument razorDocument, CancellationToken cancellationToken)
108var result = await _requestInvoker.MakeHtmlLspRequestAsync<DocumentFormattingParams, TextEdit[]>(
127public Task<TextEdit[]?> HandleRequestAsync(DocumentFormattingParams request, TextDocument razorDocument, RazorCSharpSyntaxFormattingOptions csharpSyntaxFormattingOptions, CancellationToken cancellationToken)
Microsoft.VisualStudio.LanguageServices.Razor.UnitTests (16)
Microsoft.VisualStudioCode.RazorExtension (16)
src\Razor\src\Razor\src\Microsoft.CodeAnalysis.Razor.CohostingShared\Formatting\CohostDocumentFormattingEndpoint.cs (6)
35: AbstractCohostDocumentEndpoint<DocumentFormattingParams, TextEdit[]?>(incompatibleProjectService), IDynamicRegistrationProvider
63protected override Task<TextEdit[]?> HandleRequestAsync(DocumentFormattingParams request, TextDocument razorDocument, CancellationToken cancellationToken)
69private async Task<TextEdit[]?> HandleRequestAsync(DocumentFormattingParams request, TextDocument razorDocument, RazorCSharpSyntaxFormattingOptions csharpSyntaxFormattingOptions, CancellationToken cancellationToken)
106private async Task<TextEdit[]?> TryGetHtmlFormattingEditsAsync(DocumentFormattingParams request, TextDocument razorDocument, CancellationToken cancellationToken)
108var result = await _requestInvoker.MakeHtmlLspRequestAsync<DocumentFormattingParams, TextEdit[]>(
127public Task<TextEdit[]?> HandleRequestAsync(DocumentFormattingParams request, TextDocument razorDocument, RazorCSharpSyntaxFormattingOptions csharpSyntaxFormattingOptions, CancellationToken cancellationToken)
Microsoft.VisualStudioCode.RazorExtension.UnitTests (10)