Skip to content

Commit 0304587

Browse files
committed
Make the PrepareRenameSymbol return more legible
1 parent fc066e0 commit 0304587

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/PowerShellEditorServices/Services/TextDocument/RenameService.cs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,11 +67,9 @@ ILanguageServerConfiguration config
6767
WorkspaceEdit? renameResponse = await RenameSymbol(renameRequest, cancellationToken).ConfigureAwait(false);
6868

6969
// Since LSP 3.16 we can simply basically return a DefaultBehavior true or null to signal to the client that the position is valid for rename and it should use its default selection criteria (which is probably the language semantic highlighting or grammar). For the current scope of the rename provider, this should be fine, but we have the option to supply the specific range in the future for special cases.
70+
RangeOrPlaceholderRange renameSupported = new(new RenameDefaultBehavior() { DefaultBehavior = true });
7071
return (renameResponse?.Changes?[request.TextDocument.Uri].ToArray().Length > 0)
71-
? new RangeOrPlaceholderRange
72-
(
73-
new RenameDefaultBehavior() { DefaultBehavior = true }
74-
)
72+
? renameSupported
7573
: null;
7674
}
7775

0 commit comments

Comments
 (0)