2016-12-01 7 views
1

拡張機能がインストールされているときの初期設定をsettings.jsonに書き込む方法を探しています。settings.jsonに初期設定を書き込む

WorkspaceConfiguration APIが見つかりましたが、実行時に値を取得/更新するようです。

設定+コメントをデフォルト設定ファイルに追加します。

enter image description here

答えて

1

私はあなたの質問を正しく聞きたいと思います:私はあなたがFile> Preferences> User Settingsで得ることができるUser Settings settings.jsonを意味すると思います。

もしあなたがTSLintを使っていると分かっているなら、あなたの拡張フォルダ(windows:$ USERFOLDER/.vscode/extensions)に行き、その拡張子を選んでください(私の場合は "eg2.tslint- ")、ファイルを読み込みます。

... 
"contributes": { 
    "configuration": { 
     "type": "object", 
     "title": "TSLint", 
     "properties": { 
      "tslint.enable": { 
       "type": "boolean", 
       "default": true, 
       "description": "Control whether tslint is enabled for TypeScript files or not." 
      }, 
      "tslint.rulesDirectory": { 
       "type": [ 
        "string", 
        "array" 
       ], 
       "items": { 
        "type": "string" 
       }, 
       "description": "An additional rules directory", 
       "default": "" 
      }, 
      "tslint.validateWithDefaultConfig": { 
       "type": "boolean", 
       "description": "Validate a file when there is only a default tslint configuration is found", 
       "default": false 
      }, 
      "tslint.configFile": { 
       "type": "string", 
       "description": "The path to the rules configuration file", 
       "default": "" 
      }, 
      "tslint.ignoreDefinitionFiles": { 
       "type": "boolean", 
       "default": true, 
       "description": "Control if TypeScript definition files should be ignored" 
      }, 
      "tslint.exclude": { 
       "type": [ 
        "string", 
        "array" 
       ], 
       "items": { 
        "type": "string" 
       }, 
       "description": "Configure glob patterns of file paths to exclude from linting" 
      }, 
      "tslint.run": { 
       "type": "string", 
       "enum": [ 
        "onSave", 
        "onType" 
       ], 
       "default": "onType", 
       "description": "Run the linter on save (onSave) or on type (onType)" 
      }, 
      "tslint.nodePath": { 
       "type": "string", 
       "default": "", 
       "description": "A path added to NODE_PATH when resolving the tslint module." 
      }, 
      "tslint.autoFixOnSave": { 
       "type": "boolean", 
       "default": false, 
       "description": "Turns auto fix on save on or off." 
      } 
     } 
    } 
... 

が、これは

を役に立てば幸い
関連する問題