我需要設置在Visual Studio -> Tools -> Options -> Text Editor -> JavaScript/TypeScript -> EsLint
中找到的Visual Studio選項的值,但我似乎找不到此選項的CollectionPath
。使用Settings Store更改VS選項:找到正確的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
}