148 references to LspFactory
Microsoft.CodeAnalysis.Razor.Workspaces (58)
AutoInsert\AutoClosingTagOnAutoInsertProvider.cs (2)
63
var editForEndTag =
LspFactory
.CreateTextEdit(position, $"$0</{tagNameWithClosingBehavior.TagName}>");
80
var edit =
LspFactory
.CreateTextEdit(position.Line, position.Character - 1, insertionText);
AutoInsert\CloseTextTagOnAutoInsertProvider.cs (1)
31
var edit =
LspFactory
.CreateTextEdit(position, $"$0</{SyntaxConstants.TextTagName}>");
CodeActions\CSharp\TypeAccessibilityCodeActionProvider.cs (1)
266
var fqnTextEdit =
LspFactory
.CreateTextEdit(fqnDiagnostic.Range, fullyQualifiedName);
CodeActions\Razor\ComponentAccessibilityCodeActionProvider.cs (2)
292
var startTagTextEdit =
LspFactory
.CreateTextEdit(startTag.Name.GetRange(context.CodeDocument.Source), newTagName);
299
var endTagTextEdit =
LspFactory
.CreateTextEdit(endTag.Name.GetRange(context.CodeDocument.Source), newTagName);
CodeActions\Razor\CreateComponentCodeActionResolver.cs (2)
42
var newComponentUri =
LspFactory
.CreateFilePathUri(actionParams.Path, _languageServerFeatureOptions);
68
Edits = [
LspFactory
.CreateTextEdit(position: (0, 0), namespaceDirective.GetContent())]
CodeActions\Razor\ExtractToCodeBehindCodeActionResolver.cs (3)
44
var codeBehindUri =
LspFactory
.CreateFilePathUri(codeBehindPath, _languageServerFeatureOptions);
65
Edits = [
LspFactory
.CreateTextEdit(removeRange, string.Empty)]
70
Edits = [
LspFactory
.CreateTextEdit(position: (0, 0), codeBehindContent)]
CodeActions\Razor\ExtractToComponentCodeActionResolver.cs (2)
50
var newComponentUri = new DocumentUri(
LspFactory
.CreateFilePathUri(componentPath, _languageServerFeatureOptions));
104
Range =
LspFactory
.DefaultRange,
CodeActions\Razor\ExtractToCssCodeActionResolver.cs (4)
41
var cssFileUri =
LspFactory
.CreateFilePathUri(cssFilePath, _languageServerFeatureOptions);
57
Edits = [
LspFactory
.CreateTextEdit(removeRange, string.Empty)]
68
Edits = [
LspFactory
.CreateTextEdit(
82
Edits = [
LspFactory
.CreateTextEdit(position: (0, 0), cssContent)]
CodeActions\Razor\GenerateEventHandlerCodeActionResolver.cs (3)
59
var codeBehindUri =
LspFactory
.CreateFilePathUri(codeBehindPath);
69
var edit =
LspFactory
.CreateTextEdit(
103
var tempTextEdit =
LspFactory
.CreateTextEdit(
CodeActions\Razor\PromoteUsingCodeActionResolver.cs (3)
42
var importFileUri = new DocumentUri(
LspFactory
.CreateFilePathUri(importsFile));
69
Edits = [
LspFactory
.CreateTextEdit(insertLocation, textToInsert)]
77
Edits = [
LspFactory
.CreateTextEdit(removeRange, string.Empty)]
CodeActions\Razor\WrapAttributesCodeActionResolver.cs (1)
37
edits.Add(
LspFactory
.CreateTextEdit(start, end, Environment.NewLine + indentationString));
Completion\Delegation\DelegatedCompletionHelper.cs (2)
192
var addProvisionalDot =
LspFactory
.CreateTextEdit(previousPosition, ".");
196
LspFactory
.CreatePosition(
Completion\Delegation\TextEditResponseRewriter.cs (2)
82
return
LspFactory
.CreateRange(translatedStartPosition, translatedEndPosition);
90
return
LspFactory
.CreatePosition(hostDocumentPosition.Line, translatedCharacter);
Extensions\LspExtensions_LinePosition.cs (2)
11
=>
LspFactory
.CreatePosition(linePosition.Line, linePosition.Character);
14
=>
LspFactory
.CreateZeroWidthRange(position);
Extensions\LspExtensions_LinePositionSpan.cs (1)
11
=>
LspFactory
.CreateRange(linePositionSpan);
Extensions\LspExtensions_Position.cs (1)
17
=>
LspFactory
.CreateZeroWidthRange(position);
Extensions\LspExtensions_Range.cs (2)
90
return range ==
LspFactory
.UndefinedRange;
127
return
LspFactory
.CreateRange(overlapStart, overlapEnd);
Extensions\LspExtensions_SourceText.cs (2)
56
=>
LspFactory
.CreateTextEdit(text.GetRange(change.Span), change.NewText ?? "");
59
=>
LspFactory
.CreateTextEdit(text.GetRange(change.Span.Start, change.Span.Start + change.Span.Length), change.NewText ?? "");
Extensions\LspExtensions_SyntaxNode.cs (1)
16
return
LspFactory
.CreateRange(linePositionSpan);
Extensions\LspExtensions_SyntaxToken.cs (1)
16
return
LspFactory
.CreateRange(linePositionSpan);
Extensions\LspFactory.cs (4)
42
$"{nameof(
LspFactory
)}.{nameof(DefaultPosition)} has been corrupted. Current value: {defaultPosition.ToDisplayString()}");
64
$"{nameof(
LspFactory
)}.{nameof(DefaultRange)} has been corrupted. Current value: {defaultRange.ToDisplayString()}");
80
$"{nameof(
LspFactory
)}.{nameof(UndefinedPosition)} has been corrupted. Current value: {undefinedPosition.ToDisplayString()}");
98
$"{nameof(
LspFactory
)}.{nameof(UndefinedRange)} has been corrupted. Current value: {undefinedRange.ToDisplayString()}");
FoldingRanges\UsingsFoldingRangeProvider.cs (1)
44
ranges.Add(
LspFactory
.CreateFoldingRange(FoldingRangeKind.Imports, span));
Formatting\UsingDirectiveHelper.cs (5)
137
return
LspFactory
.CreateTextEdit(line: usingDirectiveLineIndex, character: 0, newText);
144
return
LspFactory
.CreateTextEdit(line: lineIndex, character: 0, newText);
168
return
LspFactory
.CreateTextEdit(insertPosition, newText: $"@using {newUsingNamespace}{Environment.NewLine}");
298
editBuilder.Add(
LspFactory
.CreateTextEdit(insertRange, builder.ToString()));
319
return
LspFactory
.CreateTextEdit(sourceText.GetRange(removeSpan), string.Empty);
GoToDefinition\AbstractDefinitionService.cs (4)
80
return [
LspFactory
.CreateLocation(componentFilePath, range)];
103
return
LspFactory
.DefaultRange;
134
return [
LspFactory
.CreateLocation(resolvedPath,
LspFactory
.DefaultRange)];
Protocol\AutoInsert\RemoteAutoInsertTextEdit.cs (1)
24
TextEdit =
LspFactory
.CreateTextEdit(edit.LinePositionSpan, edit.NewText),
Protocol\DocumentSymbols\DocumentSymbolService.cs (3)
33
symbolInformation.Location.Range =
LspFactory
.DefaultRange;
89
documentSymbol.Range =
LspFactory
.DefaultRange;
90
documentSymbol.SelectionRange =
LspFactory
.DefaultRange;
Rename\RenameService.cs (2)
139
OldDocumentUri = new(
LspFactory
.CreateFilePathUri(oldFilePath, _languageServerFeatureOptions)),
140
NewDocumentUri = new(
LspFactory
.CreateFilePathUri(newFilePath, _languageServerFeatureOptions)),
Microsoft.CodeAnalysis.Razor.Workspaces.UnitTests (27)
Hover\HoverFactoryTest.cs (17)
51
var expectedRange =
LspFactory
.CreateSingleLineRange(line: 1, character: 1, length: 5);
74
var expectedRange =
LspFactory
.CreateSingleLineRange(line: 2, character: 5, length: 9);
118
var expectedRange =
LspFactory
.CreateSingleLineRange(line: 1, character: 9, length: 5);
140
var expectedRange =
LspFactory
.CreateSingleLineRange(line: 1, character: 7, length: 8);
162
var expectedRange =
LspFactory
.CreateSingleLineRange(line: 1, character: 7, length: 8);
238
var expectedRange =
LspFactory
.CreateSingleLineRange(line: 1, character: 7, length: 8);
263
var expectedRange =
LspFactory
.CreateSingleLineRange(line: 1, character: 5, length: 5);
284
var expectedRange =
LspFactory
.CreateSingleLineRange(line: 1, character: 1, length: 5);
306
var expectedRange =
LspFactory
.CreateSingleLineRange(line: 1, character: 7, length: 8);
346
var expectedRange =
LspFactory
.CreateSingleLineRange(line: 1, character: 1, length: 5);
368
var expectedRange =
LspFactory
.CreateSingleLineRange(line: 1, character: 9, length: 5);
389
var expectedRange =
LspFactory
.CreateSingleLineRange(line: 0, character: 1, length: 4);
412
var expectedRange =
LspFactory
.CreateSingleLineRange(line: 1, character: 5, length: 4);
458
var expectedRange =
LspFactory
.CreateSingleLineRange(line: 3, character: 9, length: 4);
481
var expectedRange =
LspFactory
.CreateSingleLineRange(line: 1, character: 7, length: 8);
539
var expectedRange =
LspFactory
.CreateSingleLineRange(line: 1, character: 1, length: 5);
576
var expectedRange =
LspFactory
.CreateSingleLineRange(line: 1, character: 7, length: 8);
RangeExtensionsTests.cs (10)
15
var range1 =
LspFactory
.CreateRange(1, 2, 3, 4);
16
var range2 =
LspFactory
.CreateRange(1, 2, 3, 4);
29
var range1 =
LspFactory
.CreateRange(1, 2, 3, 4);
30
var range2 =
LspFactory
.CreateRange(2, 2, 3, 4);
43
var range1 =
LspFactory
.CreateRange(1, 2, 3, 4);
44
var range2 =
LspFactory
.CreateRange(1, 2, 4, 4);
57
var range1 =
LspFactory
.CreateRange(2, 2, 3, 4);
58
var range2 =
LspFactory
.CreateRange(1, 2, 3, 4);
71
var range1 =
LspFactory
.CreateRange(1, 2, 4, 4);
72
var range2 =
LspFactory
.CreateRange(1, 2, 3, 4);
Microsoft.CodeAnalysis.Remote.Razor (5)
GoToDefinition\RemoteGoToDefinitionService.cs (1)
129
var mappedLocation =
LspFactory
.CreateLocation(mappedDocumentUri, mappedRange);
GoToImplementation\RemoteGoToImplementationService.cs (1)
98
var mappedLocation =
LspFactory
.CreateLocation(mappedDocumentUri, mappedRange);
Hover\RemoteHoverService.cs (1)
90
csharpHover.Range =
LspFactory
.CreateRange(hostDocumentSpan);
NestedFiles\RemoteAddNestedFileService.cs (2)
57
var nestedFileUri =
LspFactory
.CreateFilePathUri(nestedFilePath, _languageServerFeatureOptions);
73
Edits = [
LspFactory
.CreateTextEdit(position: (0, 0), content)]
Microsoft.VisualStudio.LanguageServices.Razor (6)
src\Razor\src\Razor\src\Microsoft.CodeAnalysis.Razor.CohostingShared\Hover\CohostHoverEndpoint.cs (1)
57
var position =
LspFactory
.CreatePosition(request.Position.ToLinePosition());
src\Razor\src\Razor\src\Microsoft.CodeAnalysis.Razor.CohostingShared\Navigation\CohostGoToDefinitionEndpoint.cs (4)
61
var position =
LspFactory
.CreatePosition(request.Position.ToLinePosition());
101
return
LspFactory
.CreateLocation(RemapVirtualHtmlUri(singleLocation.DocumentUri.GetRequiredParsedUri()), singleLocation.Range.ToLinePositionSpan());
105
return Array.ConvertAll(multipleLocations, l =>
LspFactory
.CreateLocation(RemapVirtualHtmlUri(l.DocumentUri.GetRequiredParsedUri()), l.Range.ToLinePositionSpan()));
115
builder.Add(
LspFactory
.CreateDocumentLink(RemapVirtualHtmlUri(target.GetRequiredParsedUri()), documentLink.Range.ToLinePositionSpan()));
src\Razor\src\Razor\src\Microsoft.CodeAnalysis.Razor.CohostingShared\Navigation\CohostGoToImplementationEndpoint.cs (1)
58
var position =
LspFactory
.CreatePosition(request.Position.ToLinePosition());
Microsoft.VisualStudio.LanguageServices.Razor.UnitTests (34)
Cohost\CohostTextPresentationEndpointTest.cs (1)
40
Edits = [
LspFactory
.CreateTextEdit(position: (0, 0), "Hello World")]
Cohost\CohostUriPresentationEndpointTest.cs (2)
63
Edits = [
LspFactory
.CreateTextEdit(position: (0, 0), htmlTag)]
135
Edits = [
LspFactory
.CreateTextEdit(position: (0, 0), htmlTag)]
Cohost\CohostWrapWithTagEndpointTest.cs (17)
35
LspFactory
.CreateSingleLineRange(start: (1, 4), length: 0),
36
[
LspFactory
.CreateTextEdit(position: (1, 4), "<p></p>")]
57
LspFactory
.CreateSingleLineRange(start: (1, 4), length: 0),
59
LspFactory
.CreateTextEdit(position: (2, 4), "<div>"),
60
LspFactory
.CreateTextEdit(position: (2, 11), "</div>")
82
LspFactory
.CreateSingleLineRange(start: (1, 4), length: 0),
84
LspFactory
.CreateTextEdit(2, 4, 2, 5, "<div>"),
85
LspFactory
.CreateTextEdit(2, 12, 2, 13, "</div>")
121
LspFactory
.CreateSingleLineRange(start: (1, 4), length: 0),
123
LspFactory
.CreateTextEdit(position: (0, 0), $"<div>{Environment.NewLine} "),
124
LspFactory
.CreateTextEdit(position: (1, 0), " "),
125
LspFactory
.CreateTextEdit(position: (2, 0), " "),
126
LspFactory
.CreateTextEdit(position: (2, 6), $"{Environment.NewLine}</div>")
159
LspFactory
.CreateSingleLineRange(start: (1, 5), length: 13),
160
[
LspFactory
.CreateTextEdit(1, 4, 1, 17, "<span>@currentCount</span>")]
184
LspFactory
.CreateSingleLineRange(start: (1, 5), length: 13),
185
[
LspFactory
.CreateTextEdit(1, 4, 1, 17, "<span>/*~~~~~~~~~*/</span>")]
Cohost\HtmlRequestInvokerTest.cs (1)
95
Range =
LspFactory
.DefaultRange,
RazorLanguageService_IVsLanguageDebugInfoTest.cs (1)
71
var breakpointRange =
LspFactory
.CreateRange(2, 4, 3, 5);
src\Razor\src\Razor\test\Microsoft.CodeAnalysis.Razor.CohostingShared.UnitTests\CodeActions\Html\HtmlCodeActionProviderTest.cs (4)
41
Range =
LspFactory
.DefaultRange,
72
Range =
LspFactory
.DefaultRange,
85
textDocumentEdit.Edits = [
LspFactory
.CreateTextEdit(context.SourceText.GetRange(span), "Goo /*~~~~~~~~~~~*/ Bar")];
105
Edits = [
LspFactory
.CreateTextEdit(position: (0, 0), "Goo")]
src\Razor\src\Razor\test\Microsoft.CodeAnalysis.Razor.CohostingShared.UnitTests\CodeActions\Html\HtmlCodeActionResolverTest.cs (2)
46
textDocumentEdit.Edits = [
LspFactory
.CreateTextEdit(sourceText.GetRange(span), "Goo /*~~~~~~~~~~~*/ Bar")];
65
Edits = [
LspFactory
.CreateTextEdit(position: (0, 0), "Goo")]
src\Razor\src\Razor\test\Microsoft.CodeAnalysis.Razor.CohostingShared.UnitTests\Diagnostics\RazorDiagnosticHelperTest.cs (4)
65
var expectedRange =
LspFactory
.CreateSingleLineRange(line: 0, character: 3, length: 4);
81
var expectedRange =
LspFactory
.DefaultRange;
97
var expectedRange =
LspFactory
.CreateZeroWidthRange(0, 11);
113
var expectedRange =
LspFactory
.CreateSingleLineRange(line: 0, character: 6, length: 5);
src\Razor\src\Razor\test\Microsoft.CodeAnalysis.Razor.CohostingShared.UnitTests\Endpoints\CohostHoverEndpointTest.cs (1)
396
Position =
LspFactory
.CreatePosition(linePosition),
src\Razor\src\Razor\test\Microsoft.CodeAnalysis.Razor.CohostingShared.UnitTests\Endpoints\CohostInlayHintEndpointTest.cs (1)
149
Range =
LspFactory
.CreateRange(startLine, starChar, endLine, endChar)
Microsoft.VisualStudioCode.RazorExtension (6)
src\Razor\src\Razor\src\Microsoft.CodeAnalysis.Razor.CohostingShared\Hover\CohostHoverEndpoint.cs (1)
57
var position =
LspFactory
.CreatePosition(request.Position.ToLinePosition());
src\Razor\src\Razor\src\Microsoft.CodeAnalysis.Razor.CohostingShared\Navigation\CohostGoToDefinitionEndpoint.cs (4)
61
var position =
LspFactory
.CreatePosition(request.Position.ToLinePosition());
101
return
LspFactory
.CreateLocation(RemapVirtualHtmlUri(singleLocation.DocumentUri.GetRequiredParsedUri()), singleLocation.Range.ToLinePositionSpan());
105
return Array.ConvertAll(multipleLocations, l =>
LspFactory
.CreateLocation(RemapVirtualHtmlUri(l.DocumentUri.GetRequiredParsedUri()), l.Range.ToLinePositionSpan()));
115
builder.Add(
LspFactory
.CreateDocumentLink(RemapVirtualHtmlUri(target.GetRequiredParsedUri()), documentLink.Range.ToLinePositionSpan()));
src\Razor\src\Razor\src\Microsoft.CodeAnalysis.Razor.CohostingShared\Navigation\CohostGoToImplementationEndpoint.cs (1)
58
var position =
LspFactory
.CreatePosition(request.Position.ToLinePosition());
Microsoft.VisualStudioCode.RazorExtension.UnitTests (12)
src\Razor\src\Razor\test\Microsoft.CodeAnalysis.Razor.CohostingShared.UnitTests\CodeActions\Html\HtmlCodeActionProviderTest.cs (4)
41
Range =
LspFactory
.DefaultRange,
72
Range =
LspFactory
.DefaultRange,
85
textDocumentEdit.Edits = [
LspFactory
.CreateTextEdit(context.SourceText.GetRange(span), "Goo /*~~~~~~~~~~~*/ Bar")];
105
Edits = [
LspFactory
.CreateTextEdit(position: (0, 0), "Goo")]
src\Razor\src\Razor\test\Microsoft.CodeAnalysis.Razor.CohostingShared.UnitTests\CodeActions\Html\HtmlCodeActionResolverTest.cs (2)
46
textDocumentEdit.Edits = [
LspFactory
.CreateTextEdit(sourceText.GetRange(span), "Goo /*~~~~~~~~~~~*/ Bar")];
65
Edits = [
LspFactory
.CreateTextEdit(position: (0, 0), "Goo")]
src\Razor\src\Razor\test\Microsoft.CodeAnalysis.Razor.CohostingShared.UnitTests\Diagnostics\RazorDiagnosticHelperTest.cs (4)
65
var expectedRange =
LspFactory
.CreateSingleLineRange(line: 0, character: 3, length: 4);
81
var expectedRange =
LspFactory
.DefaultRange;
97
var expectedRange =
LspFactory
.CreateZeroWidthRange(0, 11);
113
var expectedRange =
LspFactory
.CreateSingleLineRange(line: 0, character: 6, length: 5);
src\Razor\src\Razor\test\Microsoft.CodeAnalysis.Razor.CohostingShared.UnitTests\Endpoints\CohostHoverEndpointTest.cs (1)
396
Position =
LspFactory
.CreatePosition(linePosition),
src\Razor\src\Razor\test\Microsoft.CodeAnalysis.Razor.CohostingShared.UnitTests\Endpoints\CohostInlayHintEndpointTest.cs (1)
149
Range =
LspFactory
.CreateRange(startLine, starChar, endLine, endChar)