I have problems getting formatting to work in two instances:
-
Mark section, then right klick ‘Format Selection’ - Executing `robotidy` failed: No module named ‘robotidy’
-
Using ‘Editor: Format On Save’ - No feedback and nothing happens when saving
I have no issues using ‘Format Document’. Any ideas?
VadimPl
(Vadim)
2
Just remove robotidy from your project and update robotframework-pabot and robotframework to the latest ones.
After that in settings.json in VS Code write this:
"[robotframework]": {
"editor.defaultFormatter": null,
"editor.formatOnSave": false
},
"emeraldwalk.runonsave": {
"commands": [
{
"match": "\\.robot$",
"cmd": "poetry run robocop format ${file}",
"autoShowOutputPanel": "error"
},
{
"match": "\\.resource$",
"cmd": "poetry run robocop format ${file}",
"autoShowOutputPanel": "error"
}
]
}
MartinX
(Martin Xiao)
3
Oki so the solution is to rely on another extession?
VadimPl
(Vadim)
4
You can try to downgrade the libraries: robotframework-robocop to 5.x and robotframework-tidy to 4.x.
The settings.json would be like this:
"[robotframework]": {
"editor.defaultFormatter": "d-biehl.robotcode",
"editor.formatOnSave": true
}