-
Notifications
You must be signed in to change notification settings - Fork 149
Add Local and Remote Settings conversion #4387
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 9 commits
b8f19e5
6979c6e
f8f10e3
562fad5
b75809a
5e423da
df7712c
453f0af
4387565
2d13d56
4373847
64cee3d
3c126a7
2e432f7
1d9d860
7164e58
af3704b
842b462
099a0f4
b5250a9
a7520fd
098b932
b6433f8
28e99cf
87ed16d
cdfc374
e82e6f6
5a969bc
87d2988
8c63d4f
b70e19f
f43f490
0dd20d5
e1dafec
e4819a6
4e63165
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -8,36 +8,35 @@ import { type AppSettingsClientProvider, type IAppSettingsClient } from "@micros | |
| import { AzExtFsExtra, callWithTelemetryAndErrorHandling, type IActionContext } from "@microsoft/vscode-azext-utils"; | ||
| import * as vscode from 'vscode'; | ||
| import { type ILocalSettingsJson } from "../../../funcConfig/local.settings"; | ||
| import { type LocalProjectTreeItem } from "../../../tree/localProject/LocalProjectTreeItem"; | ||
| import { decryptLocalSettings } from "./decryptLocalSettings"; | ||
| import { encryptLocalSettings } from "./encryptLocalSettings"; | ||
| import { getLocalSettingsFileNoPrompt } from "./getLocalSettingsFile"; | ||
|
|
||
| export class LocalSettingsClientProvider implements AppSettingsClientProvider { | ||
| private _node: LocalProjectTreeItem; | ||
| constructor(node: LocalProjectTreeItem) { | ||
| this._node = node; | ||
| private _workspaceFolder: vscode.WorkspaceFolder; | ||
| constructor(workspaceFolder: vscode.WorkspaceFolder) { | ||
| this._workspaceFolder = workspaceFolder; | ||
| } | ||
|
|
||
| public async createClient(): Promise<IAppSettingsClient> { | ||
| return new LocalSettingsClient(this._node); | ||
| return new LocalSettingsClient(this._workspaceFolder); | ||
| } | ||
| } | ||
|
|
||
| export class LocalSettingsClient implements IAppSettingsClient { | ||
| public fullName: string; | ||
| public isLinux: boolean; | ||
| private _node: LocalProjectTreeItem; | ||
| private _workspaceFolder: vscode.WorkspaceFolder | ||
|
|
||
| constructor(node: LocalProjectTreeItem) { | ||
| constructor(workspaceFolder: vscode.WorkspaceFolder) { | ||
| this.isLinux = false; | ||
| this.fullName = 'local'; | ||
| this._node = node; | ||
| this._workspaceFolder = workspaceFolder; | ||
| } | ||
|
|
||
| public async listApplicationSettings(): Promise<StringDictionary> { | ||
| const result = await callWithTelemetryAndErrorHandling<StringDictionary | undefined>('listApplicationSettings', async (context: IActionContext) => { | ||
| const localSettingsPath: string | undefined = await getLocalSettingsFileNoPrompt(context, this._node.workspaceFolder); | ||
| const localSettingsPath: string | undefined = await getLocalSettingsFileNoPrompt(context, this._workspaceFolder); | ||
| if (localSettingsPath === undefined) { | ||
| return { properties: {} }; | ||
| } else { | ||
|
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. You can use your helper function again in here (a couple lines below this). It also may make more sense to export |
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We may want to change the verbiage from "convert" to "add" considering we aren't deleting the old settings anymore.