Open mgzenitech opened 4 months ago
Maybe you should use this extension for custom command. https://marketplace.visualstudio.com/items?itemName=edonet.vscode-command-runner
Maybe you should use this extension for custom command. https://marketplace.visualstudio.com/items?itemName=edonet.vscode-command-runner
What's the id for linter diagnostic run action? because I have another extension which allows calling internal VSCode actions.
For example that's how I call other extension action:
"runOnSave.commands": [
{
"async": false,
"commandBeforeSaving": "stylelint.executeAutofix",
"match": ".*\\.css$",
"runIn": "vscode"
}
],
stylelint.executeAutofix
is command id.
In VSCode actions list I see run action but not sure if that's the one to call or even how to use it to trigger my command
It's not intended to run internal command from another extension.
How about adding one more linter before actual linter if you want to implement auto fix on save?
{
"any-lint.linters": [
{
"name": "dot-env auto fix",
"condition": "$.fileExtname == '.env'",
"args": [
"fix",
"-q",
"--no-backup",
"${file}"
],
"binPath": "dotenv-linter",
"cwd": "${workspaceFolder}",
"on": [
"save"
]
},
{
// same as dot-env example
}
]
}
It's not intended to run internal command from another extension.
How about adding one more linter before actual linter if you want to implement auto fix on save?
{ "any-lint.linters": [ { "name": "dot-env auto fix", "condition": "$.fileExtname == '.env'", "args": [ "fix", "-q", "--no-backup", "${file}" ], "binPath": "dotenv-linter", "cwd": "${workspaceFolder}", "on": [ "save" ] }, { // same as dot-env example } ] }
Yeah, I could just call the command directly but wouldn't it be nicer and somehow more native to be able to integrate actions with source.fixAll.any-lint
? Interface could be just by adding additional property, like "asFixAll": true
?
{
"args": [
"`fix`",
"`-q`",
"`--no-backup`",
"$.file"
],
"binPath": "`dotenv-linter`",
"cwd": "$.workspaceFolder",
"lintAfterRun": "true",
"title": "`Fix all fixable problems`",
"type": "run",
"asFixAll": true,
}
Or at least have ability to call them directly, set shortcuts, etc
any-lint.dotenv-linter.action.(some id that people can add to actions)
Would it be possible to register specific diagnostic run actions with "Fix All" action?
Most of the linter extensions integrate well with that.
For example:
I'd like this to get called when calling Fix All action. In addition then there's a way to setup VSCode to automatically fix all linting issues on save.
Or exposing some diagnostic run actions would also work, for example how ESLint does that in addition to normal integration: