-
Notifications
You must be signed in to change notification settings - Fork 258
RenameProvider for variable/function renaming #2152
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 228 commits
b52eaea
e2e032b
6c673d7
1b0c292
5a33847
c5b2c26
d496419
dbdd78f
e4fb46b
0b9a562
6e1dfd9
55ec303
49bd609
1840171
eeebe4e
dc410b0
4fd1b0c
2293294
f9c8753
3024dca
29b65e4
2b1e640
327c814
7ab6d17
2611cd8
426a81c
369ba75
3bf4e17
1a57413
c4339ef
6d64038
dccb672
8cbead4
ce0af4e
953cff7
0903de3
bb94a62
89a7687
2185545
5103a79
1829bb2
8f7ecba
61f7891
7edadea
00a5639
7aea9ca
6b786c0
c561062
2da9afc
f654b9e
72d8a08
3419910
950b3e5
b409867
dfa10e0
e520f0d
c712665
374b890
340b40b
cdd45f1
5c71254
4294b69
fa5ce76
7c511be
3024204
e8785fc
73b7121
b8f5c9a
b22e7ef
3d47904
d3985d0
ff593a7
9160cda
d842e76
7ecbd68
80b668c
e05f794
8646dd4
5ec6d30
d3f7148
a688a19
123d2eb
3f28bdb
e883d5c
94f26c2
88fe7b2
699aa64
b183682
a152c3a
9905c4b
343ed7c
6477f43
20ab7bb
fa854b5
3af5ebd
a7b6cb3
9f7dafa
65a6940
8c854f1
be90d8c
c67c4f4
8811154
9170b05
7e7ccbf
8c2c31e
cb10656
9550af2
7a41db9
8b61cf8
e7f9491
baa2af1
1a100e7
13f2b65
de02ede
117ac8b
7300a82
bb04380
f49add8
3d4def9
a4c3388
79f22b1
2be446c
a47913f
a452988
25d1f01
145dccd
ca323b4
56c93ed
41412ea
30ca8e8
c4d273b
9b6201f
ac4064f
aaabc80
c713a87
7b8cc20
29d38a6
75a3336
5b59774
72ea7b0
9d04533
b63d7c8
5006645
54c6224
3036b57
403077c
19172ea
9ef7207
955f6eb
5baa192
e9508fa
26ebf6e
1324e9d
ab1dbab
c3c79e0
f444eac
cac1533
ba48b19
6e3c72a
cdcb746
9b13345
70a485d
4910ab8
43c719a
785d1d3
8acf310
5cc72ce
2a9c6ad
2503906
f21ba79
2142aa1
d1f2a63
c5d10c5
b7034a1
7113b11
e40fe6c
2d745d8
7d1f3b7
84a3dc4
ffb7aef
5599e05
44be8dd
1c8a2ce
fc066e0
0304587
ff75355
9e05678
13e99eb
93c449e
edcadeb
8af302e
27f1a3b
87fee89
c8d26c6
6832e0c
46ccae3
7607f46
5c34173
9f611ba
bdb40b7
102c69d
d3bb1b9
706c9b1
25f74a5
4da6079
0abbb25
9f1aaa2
e643423
8821310
38fe329
87753ed
981f6e9
35eea13
d430459
153dd51
ab33c51
437f305
97b1469
f961736
ede9213
334803c
ec821a1
664b264
48f308b
56b41a9
474687b
3a2d896
03bb351
e0038a2
b38a260
08f05cc
07cf2ea
25ddfd3
ca0aa89
9b87e04
e8ddd9a
9633056
7cebf5e
715df7f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -54,6 +54,13 @@ This release contains a logging overhaul which purposely removes our | |
| dependency on Serilog and should lead to improved stability with | ||
| PowerShell 5.1 (by avoiding a major GAC assembly conflict). | ||
|
|
||
| ## v3.30.0 (mistakenly released as v3.3.0) | ||
| ### Friday, November 15, 2024 | ||
|
|
||
| See more details at the GitHub Release for [v3.3.0](https://github.com/PowerShell/PowerShellEditorServices/releases/tag/v3.3.0). | ||
|
|
||
| Logging updates and dropped EOL PowerShell | ||
|
|
||
|
Comment on lines
+57
to
+63
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Did we mean to include this?
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @andyleejordan I can split it out a separate commit but it was sort of a drive-by issue I noticed that broke.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nope totally fine to keep as long as it was intentional and not AI hallucinated 😃 |
||
| ## v3.21.0 | ||
| ### Wednesday, October 30, 2024 | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| // Copyright (c) Microsoft Corporation. | ||
| // Licensed under the MIT License. | ||
|
|
||
| using OmniSharp.Extensions.JsonRpc; | ||
| using OmniSharp.Extensions.LanguageServer.Protocol.Models; | ||
|
|
||
| namespace Microsoft.PowerShell.EditorServices.Handlers; | ||
|
|
||
| /// <summary> | ||
| /// A convenience exception for handlers to throw when a request fails for a normal reason, | ||
| /// and to communicate that reason to the user without a full internal stacktrace. | ||
| /// </summary> | ||
| /// <param name="message">The message describing the reason for the request failure.</param> | ||
| /// <param name="logDetails">Additional details to be logged regarding the failure. It should be serializable to JSON.</param> | ||
| /// <param name="severity">The severity level of the message. This is only shown in internal logging.</param> | ||
| internal class HandlerErrorException | ||
| ( | ||
| string message, | ||
| object logDetails = null, | ||
| MessageType severity = MessageType.Error | ||
| ) : RpcErrorException(0, logDetails!, message) | ||
| { | ||
| internal MessageType Severity { get; } = severity; | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,40 @@ | ||
| // Copyright (c) Microsoft Corporation. | ||
| // Licensed under the MIT License. | ||
|
|
||
| using System; | ||
| namespace Microsoft.PowerShell.EditorServices.Refactoring | ||
| { | ||
| internal class TargetSymbolNotFoundException : Exception | ||
| { | ||
| public TargetSymbolNotFoundException() | ||
| { | ||
| } | ||
|
|
||
| public TargetSymbolNotFoundException(string message) | ||
| : base(message) | ||
| { | ||
| } | ||
|
|
||
| public TargetSymbolNotFoundException(string message, Exception inner) | ||
| : base(message, inner) | ||
| { | ||
| } | ||
| } | ||
|
|
||
| internal class FunctionDefinitionNotFoundException : Exception | ||
| { | ||
| public FunctionDefinitionNotFoundException() | ||
| { | ||
| } | ||
|
|
||
| public FunctionDefinitionNotFoundException(string message) | ||
| : base(message) | ||
| { | ||
| } | ||
|
|
||
| public FunctionDefinitionNotFoundException(string message, Exception inner) | ||
| : base(message, inner) | ||
| { | ||
| } | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,41 @@ | ||
| // Copyright (c) Microsoft Corporation. | ||
| // Licensed under the MIT License. | ||
| #nullable enable | ||
|
|
||
| using System.Threading; | ||
| using System.Threading.Tasks; | ||
| using Microsoft.PowerShell.EditorServices.Services; | ||
|
|
||
| using OmniSharp.Extensions.LanguageServer.Protocol.Document; | ||
| using OmniSharp.Extensions.LanguageServer.Protocol.Models; | ||
| using OmniSharp.Extensions.LanguageServer.Protocol.Client.Capabilities; | ||
|
|
||
| namespace Microsoft.PowerShell.EditorServices.Handlers; | ||
|
|
||
| /// <summary> | ||
| /// A handler for <a href="https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#textDocument_prepareRename">textDocument/prepareRename</a> | ||
| /// </summary> | ||
| internal class PrepareRenameHandler | ||
| ( | ||
| RenameService renameService | ||
| ) : IPrepareRenameHandler | ||
| { | ||
| public RenameRegistrationOptions GetRegistrationOptions(RenameCapability capability, ClientCapabilities clientCapabilities) => capability.PrepareSupport ? new() { PrepareProvider = true } : new(); | ||
|
|
||
| public async Task<RangeOrPlaceholderRange?> Handle(PrepareRenameParams request, CancellationToken cancellationToken) | ||
| => await renameService.PrepareRenameSymbol(request, cancellationToken).ConfigureAwait(false); | ||
| } | ||
|
|
||
| /// <summary> | ||
| /// A handler for <a href="https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#textDocument_rename">textDocument/rename</a> | ||
| /// </summary> | ||
| internal class RenameHandler( | ||
| RenameService renameService | ||
| ) : IRenameHandler | ||
| { | ||
| // RenameOptions may only be specified if the client states that it supports prepareSupport in its initial initialize request. | ||
| public RenameRegistrationOptions GetRegistrationOptions(RenameCapability capability, ClientCapabilities clientCapabilities) => capability.PrepareSupport ? new() { PrepareProvider = true } : new(); | ||
|
|
||
| public async Task<WorkspaceEdit?> Handle(RenameParams request, CancellationToken cancellationToken) | ||
| => await renameService.RenameSymbol(request, cancellationToken).ConfigureAwait(false); | ||
| } |
Uh oh!
There was an error while loading. Please reload this page.