I am used to formatting my code by using the (Ctrl + Shift + i) keyboard shortcut. However, when I use the same shortcut for solidity code (with .sol extension) I get a notification telling me 'There is no document formatter for solidity files installed'. Does anyone know of an extension that can do the job?
These are the two visual studio integrations listed in the solidity documentation .
I dont use visual studio so i dont know if its exactly what you are looking for but maybe it helps.
EDIT: I've been using VS and the solidity extension recommended is: Visual Studio Code extension
The extension provides:
Syntax highlighting
Snippets
Compilation of the current contract (Press F1 Solidity : Compile Current Solidity Contract), or F5
Prettier works with solidity files.
There are some issues recently on their GitHub page but I have been using it recently and it does the job.
To use Prettier as a default formatter for solidity files:
.sol
file and press Ctrl + Shift + P
format document with
default formatter
to Prettier
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.