Skip to content

Commit 4fbd101

Browse files
committed
Move RenameSymbolSettings to RenameSymbol.ts
I know this differs from the existing style of the codebase but it makes sense to keep the separation of concerns local. Ideally PartialSettings is also updated to a stricter type like Record<String, Object> or something.
1 parent 5dd6dca commit 4fbd101

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

src/features/RenameSymbol.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import { LanguageClientConsumer } from "../languageClientConsumer";
77
import { RenameProvider, WorkspaceEdit, TextDocument, CancellationToken, Position,Uri,Range, DocumentSelector } from "vscode";
88
import { LanguageClient } from "vscode-languageclient/node";
99
import { ILogger } from "../logging";
10+
import { PartialSettings } from "../settings";
1011
// eslint-disable-next-line @typescript-eslint/no-empty-interface
1112
interface RenameSymbolOptions {
1213
CreateAlias?:boolean
@@ -47,6 +48,11 @@ interface IPrepareRenameSymbolRequestResponse {
4748
message : string
4849
}
4950

51+
export class RenameSymbolSettings extends PartialSettings {
52+
createAlias = true;
53+
acceptRenameDisclaimer = false;
54+
}
55+
5056
const RenameSymbolRequestType = new RequestType<IRenameSymbolRequestArguments, IRenameSymbolRequestResponse, void>("powerShell/renameSymbol");
5157
const PrepareRenameSymbolRequestType = new RequestType<IPrepareRenameSymbolRequestArguments, IPrepareRenameSymbolRequestResponse, void>("powerShell/PrepareRenameSymbol");
5258

src/settings.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import os = require("os");
77
import { ILogger } from "./logging";
88
import untildify from "untildify";
99
import path = require("path");
10+
import { RenameSymbolSettings } from "./features/RenameSymbol";
1011

1112
// TODO: Quite a few of these settings are unused in the client and instead
1213
// exist just for the server. Those settings do not need to be represented in
@@ -17,7 +18,7 @@ import path = require("path");
1718
// Perhaps we just get rid of this entirely?
1819

1920
// eslint-disable-next-line @typescript-eslint/no-extraneous-class
20-
class PartialSettings { }
21+
export class PartialSettings { }
2122

2223
export class Settings extends PartialSettings {
2324
powerShellAdditionalExePaths: PowerShellAdditionalExePathSettings = {};
@@ -156,9 +157,7 @@ class ButtonSettings extends PartialSettings {
156157
showPanelMovementButtons = false;
157158
}
158159

159-
class RenameSymbolSettings extends PartialSettings {
160-
createAlias = true;
161-
}
160+
162161

163162
// This is a recursive function which unpacks a WorkspaceConfiguration into our settings.
164163
function getSetting<TSetting>(key: string | undefined, value: TSetting, configuration: vscode.WorkspaceConfiguration): TSetting {

0 commit comments

Comments
 (0)