【发布时间】:2018-02-10 14:20:35
【问题描述】:
我需要设置在 Visual Studio -> Tools -> Options -> Text Editor -> JavaScript/TypeScript -> EsLint 中找到的 Visual Studio 选项的值,但我似乎找不到该选项的 CollectionPath。
GetSubCollectionNames("Text Editor"); 产生多个结果,而GetSubCollectionNames("Text Editor\\JavaScript"); 产生 0 个结果。
TL;DR
如何为下图中的选项找到正确的CollectionPath?
这是我目前正在使用的。
[ImportingConstructor]
internal VSOptions([Import] SVsServiceProvider serviceProvider)
{
var settingsManager = new ShellSettingsManager(serviceProvider);
_writableSettingsStore = settingsManager.GetWritableSettingsStore(SettingsScope.UserSettings)
?? throw new Exception(nameof(settingsManager));
var textEditorSubCollections = _writableSettingsStore.GetSubCollectionNames("Text Editor");
var javaScriptSubCollections = _writableSettingsStore.GetSubCollectionNames("Text Editor\\JavaScript");
// TODO: set option value when we have the right CollectionPath
}
【问题讨论】:
标签: c# mef options visual-studio-extensions vs-extensibility