You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 35eea13
Browse filesBrowse the repository at this point in the historyBrowse files
conststringrenameDisclaimer="PowerShell rename functionality is only supported in a limited set of circumstances. [Please review the notice](https://github.com/PowerShell/PowerShellEditorServices?tab=readme-ov-file#rename-disclaimer) and accept the limitations and risks.";
199
197
conststringacceptAnswer="I Accept";
200
-
// const string acceptWorkspaceAnswer = "I Accept [Workspace]";
201
-
// const string acceptSessionAnswer = "I Accept [Session]";
202
198
conststringdeclineAnswer="Decline";
203
199
204
-
// TODO: Unfortunately the LSP spec has no spec for the server to change a client setting, so
205
-
// We have a suboptimal experience until we implement a custom feature for this.
206
200
ShowMessageRequestParamsreqParams=new()
207
201
{
208
202
Type=MessageType.Warning,
209
203
Message=renameDisclaimer,
210
204
Actions=newMessageActionItem[]{
211
-
newMessageActionItem(){Title=acceptAnswer},
212
-
newMessageActionItem(){Title=declineAnswer}
213
-
// new MessageActionItem() { Title = acceptWorkspaceAnswer },
214
-
// new MessageActionItem() { Title = acceptSessionAnswer },
// null happens if the user closes the dialog rather than making a selection.
220
213
if(resultisnull||result.Title==declineAnswer)
221
214
{
@@ -232,6 +225,7 @@ private async Task<bool> AcceptRenameDisclaimer(bool acceptDisclaimerOption, Can
232
225
}
233
226
if(result.Title==acceptAnswer)
234
227
{
228
+
// Unfortunately the LSP spec has no spec for the server to change a client setting, so we have a suboptimal experience to tell the user to change the setting rather than doing it for them without implementing custom client behavior.
235
229
conststringacceptDisclaimerNotice="PowerShell rename functionality has been enabled for this session. To avoid this prompt in the future, set the powershell.rename.acceptDisclaimer to true in your settings.";
236
230
ShowMessageParamsmsgParams=new()
237
231
{
@@ -243,16 +237,6 @@ private async Task<bool> AcceptRenameDisclaimer(bool acceptDisclaimerOption, Can
243
237
DisclaimerAcceptedForSession=true;
244
238
returnDisclaimerAcceptedForSession;
245
239
}
246
-
// if (result.Title == acceptWorkspaceAnswer)
247
-
// {
248
-
// // FIXME: Set the appropriate setting
249
-
// return true;
250
-
// }
251
-
// if (result.Title == acceptSessionAnswer)
252
-
// {
253
-
// // FIXME: Set the appropriate setting
254
-
// return true;
255
-
// }
256
240
257
241
thrownewInvalidOperationException("Unknown Disclaimer Response received. This is a bug and you should report it.");
0 commit comments