【发布时间】:2016-10-08 09:08:23
【问题描述】:
我正在尝试将设置添加到 Visual Studio 代码扩展 (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 部分看不到我的新“证书”设置。
你知道我错过了什么吗?
【问题讨论】:
-
运气好吗?今天使用 v1.36 为我提供了一个类似的最小可重现示例。这很酷,您可以使用默认对象。 ??????
标签: visual-studio-code vscode-extensions