2017-09-01 4 views
0

Visual Studio -> Tools -> Options -> Text Editor -> JavaScript/TypeScript -> EsLintにあるVisual Studioオプションの値を設定する必要がありますが、このオプションのCollectionPathが見つからないようです。設定ストアを使用してVSオプションを変更します。正しいCollectionPathを見つける?

GetSubCollectionNames("Text Editor");は多くの結果をもたらし、GetSubCollectionNames("Text Editor\\JavaScript");は0の結果をもたらす。

TL; DR がどのように1は、下の画像に描かオプションの権利CollectionPathを見つけるに行きますか?

enter image description here

これは私が現在使用しているものです。

[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 
} 

答えて

0

Visual StudioでVisual Studio共通設定を拡張するために使用されるWritabelSettingsStoreクラス。 GetPropertyNames( "Text Editor \ JavaScript")を使用して、JavaScript用のすべてのwritabel設定をリストすることができます。ここで、JavaScriptサブコレクションのすべてのプロパティがリストされているわけではありません。

EsLintは、Visual Studioの一般的な設定ではありません。コードをより一貫性のあるものにし、バグを避けるという目的で、ECMAScript/JavaScriptコードで見つかったパターンを識別し報告するための3番目のツールです。

私たちはWritableSettingsStoreクラスで直接変更できませんでした。 EsLintがVisual Studioでどのように追加されたのかを知り、Visual Studioの設定ファイルを変更する必要があります。

関連する問題