我正在尝试为 Visual Studio Code 扩展 (vscode-powershell) 添加设置。
我编辑了 settings.ts
文件以添加:
一个新的接口:
export interface ICertificateSettings {
certificateSubject?: string;
}
我编辑了
ISettings
接口以添加我的接口。export interface ISettings {
useX86Host?: boolean,
enableProfileLoading?: boolean,
scriptAnalysis?: IScriptAnalysisSettings,
developer?: IDeveloperSettings,
certificate?: ICertificateSettings
}
接下来是加载函数,用于添加默认设置并返回值:
export function load(myPluginId: string): ISettings {
let configuration = vscode.workspace.getConfiguration(myPluginId);
let defaultScriptAnalysisSettings = {
enable: true,
settingsPath: ""
};
let defaultDeveloperSettings = {
powerShellExePath: undefined,
bundledModulesPath: "../modules/",
editorServicesLogLevel: "Normal",
editorServicesWaitForDebugger: false
};
let defaultCertificateSettings = {
certificateSubject: ""
};
return {
useX86Host: configuration.get<boolean>("useX86Host", false),
enableProfileLoading: configuration.get<boolean>("enableProfileLoading", false),
scriptAnalysis: configuration.get<IScriptAnalysisSettings>("scriptAnalysis", defaultScriptAnalysisSettings),
developer: configuration.get<IDeveloperSettings>("developer", defaultDeveloperSettings),
certificate: configuration.get<ICertificateSettings>("certificate", defaultCertificateSettings)
}
}
但是当我使用调试面板运行我的扩展并启动时,我在PowerShell部分找不到我的新的“证书”设置。
您知道我缺少什么吗?