MCPcopy
hub / github.com/PowerShell/vscode-powershell / getEffectiveConfigurationTarget

Function getEffectiveConfigurationTarget

src/settings.ts:182–199  ·  view source on GitHub ↗
(
    settingName: string,
)

Source from the content-addressed store, hash-verified

180
181// Get the ConfigurationTarget (read: scope) of where the *effective* setting value comes from
182export function getEffectiveConfigurationTarget(
183 settingName: string,
184): vscode.ConfigurationTarget | undefined {
185 const configuration = vscode.workspace.getConfiguration(
186 utils.PowerShellLanguageId,
187 );
188 const detail = configuration.inspect(settingName);
189 if (detail === undefined) {
190 return undefined;
191 } else if (typeof detail.workspaceFolderValue !== "undefined") {
192 return vscode.ConfigurationTarget.WorkspaceFolder;
193 } else if (typeof detail.workspaceValue !== "undefined") {
194 return vscode.ConfigurationTarget.Workspace;
195 } else if (typeof detail.globalValue !== "undefined") {
196 return vscode.ConfigurationTarget.Global;
197 }
198 return undefined;
199}
200
201export async function changeSetting(
202 settingName: string,

Callers 2

settings.test.tsFile · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected