question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How to disable Auto-Formatting in .sol files

See original GitHub issue

Hi @juanfranblanco,

I have a problem that has been bugging me for some time now with vscode-solidity: somehow auto-formatting is configured for my solidity files, even though I never enabled an auto-formatter and even though I never installed or configured prettier-solidity.

As far as I understand, auto-format should only be an option if you intentionally configured it using prettier-solidity.

So my question: Does some auto-formatting ship with vscode-solidity standalone and how can I disable it?

Sometimes I accidentally CMD + Alt + F which I am used to doing in my JS files to use Prettier. But I dont want any formatter to format my Solidity files. But somehow some Formatter is doing something. Even after I disabled Solidity language in the normal Prettier extension to be explicit, my Solidity files still had an auto-formatter configured somewhere. So I think it must be somewhere in the vscode-solidity extension.

The reason I do not want to use that formatter is because it does not adhere to the Solidity Style Guide.

I would appreciate your help and input on how to disable all formatting for the solidity extension.

Thank you!

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:7 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
gitpushacommented, Apr 1, 2020

Thanks for the great work. I really like the vscode-solidity extension and I ve been using it pretty much every day of the last year.

1reaction
juanfranblancocommented, Apr 1, 2020

@gitpusha no I don’t work on that project, so yes please raise that issue there. I mentioned it in a comment, but it deserves an issue, and surely your feedback. It is early stages for the prettier Solidity, but I believe is going to be “pretty” good.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Turn off auto formatting for json files in Visual Studio Code
In Visual Studio Code, in order to stop autoformatting only for your json files add the following in settings.json file by opening User ......
Read more >
Intro to Solidity Linting and Formatting | by Daniel Onggunhao
This file specifies exactly which rules you want Solhint to lint for. ... Prettier will then autoformat everyone's code in the same way....
Read more >
Disable Auto Format in Toad 12.7.1.11
Hi, I am not able to disable the auto formatting in Toad while discribing any object (F4) or while opening a object in...
Read more >
How to escape auto formatting for a single file in vs code.
i have set up auto formatting, every time i save my python code , is there a way to disable it for certain...
Read more >
intellij-solidity/intellij-solidity - Gitter
sol files ? If I create a new .sol using the plugin, indenting works correctly but if I load an existing .sol and...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found