![]() ![]() As the Extension will resolve the path to the formatter based on Python executable being used or configured in python.pythonPath of settings.json. Pip install -upgrade autopep8 Custom Path You can configure the format provider by changing a setting in the User or Workspace settings file as follows: "": "autopep8" However Mac/Linux paths are also supported. ![]() PathsĪll samples provided here are for windows. Auto Formattingįormatting the source code as and when you save the contents of the file is supported.Įnabling this requires configuring the setting "editor.formatOnSave": true as identified here. The default code format provider is autopep8. Personally what I do is enabling format on save and let the formatter deal with it (you can configure the formatter creating a pyproject.toml which is then picked up by robotframework-tidy – its page has more info).Code formatting is supported using either one of yapf or autopep8. In that case it’ll always indent the cursor to a multiple of your indent size (so, yes, when you press tab the first time it’ll indent up to the next multiple and then it’ll add 4) – if you use it consistently you’ll note that the indent will end up matching because it’ll always be a multiple of 4 (but you have to adjust existing text…).īut still, I’d actually recommend against using that (because it’ll always indent to a multiple of 4 sometimes it’ll add just 1 space and you’ll have to use tab again to actually add a separator… note that this is the default VSCode indent behavior and it’s the reason for the robot.editor.4spacesTab setting) and just using the formatter that comes with the Robot Framework Language Server – the bundled formatter is actually robotframework-tidy (you can see Robotidy 3.3.2 for its docs). I believe that what you want is really setting robot.editor.4spacesTab to false. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |