Skip to content
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

🔧🚗 Migrate setting value of codeFormatting.whitespaceAroundPipe (if present) to new setting codeFormatting.addWhitespaceAroundPipe automatically. #2689

Merged
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
add comment to getConfigurationTarget and rename it to getEffectiveCo…
…nfigurationTarget
  • Loading branch information
Christoph Bergmeister committed May 10, 2020
commit 0ab07f9f368a0d70d150ec4ff0a1acfea033d602
2 changes: 1 addition & 1 deletion src/session.ts
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,7 @@ export class SessionManager implements Middleware {
const configuration = vscode.workspace.getConfiguration(utils.PowerShellLanguageId);
const deprecatedSetting = 'codeFormatting.whitespaceAroundPipe'
if (configuration.has(deprecatedSetting) && !configuration.has('codeFormatting.addWhitespaceAroundPipe')) {
const configurationTarget = await Settings.getConfigurationTarget(deprecatedSetting);
const configurationTarget = await Settings.getEffectiveConfigurationTarget(deprecatedSetting);
const value = configuration.get(deprecatedSetting, configurationTarget)
await Settings.change('codeFormatting.addWhitespaceAroundPipe', value, configurationTarget);
}
Expand Down
3 changes: 2 additions & 1 deletion src/settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,8 @@ export function load(): ISettings {
};
}

export async function getConfigurationTarget(settingName: string): Promise<vscode.ConfigurationTarget> {
// Get the ConfigurationTarget (read: scope) of where the *effective* setting value comes from
export async function getEffectiveConfigurationTarget(settingName: string): Promise<vscode.ConfigurationTarget> {
const configuration = vscode.workspace.getConfiguration(utils.PowerShellLanguageId);

const detail = configuration.inspect(settingName);
Expand Down