1
我正在尋找一種將settings.json的初始設置寫入安裝擴展的時候的方法。將初始設置寫入settings.json
我發現WorkspaceConfiguration API,但似乎在運行時檢索/更新值。
我在尋找我的設置+評論到默認設置文件中
我正在尋找一種將settings.json的初始設置寫入安裝擴展的時候的方法。將初始設置寫入settings.json
我發現WorkspaceConfiguration API,但似乎在運行時檢索/更新值。
我在尋找我的設置+評論到默認設置文件中
我希望我能正確地得到您的問題:我假設您的意思是您可以通過文件>首選項>用戶設置獲取用戶設置settings.json。如果你知道TSLint做到這一點,你可以到你的擴展文件夾(windows:$ USERFOLDER/.vscode/extensions),選擇擴展名(在我的例子中是文件夾「eg2.tslint-0.6.7 「)並偷看文件。
...
"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."
}
}
}
...
希望這有助於