Mahesh Rajput
Mahesh Rajput

Reputation: 276

indentation:Only use indent of 4 spaces in vscode

Every time I open *.sol file in VSCode that already exists in the project it shows indentation: Only use indent of 4 spaces error even though I'm using 4 spaces for indentation, but get a Syntax error. Every time I have to clear that 4 space and again create 4 space for remove error.

I already have gone through the similar questions in stack overflow but didn't get approved answer. One of the related question is this .

error description in image

Note : I used .sol extension of vs code for compile the code.

Upvotes: 1

Views: 1592

Answers (1)

Monarth Sarvaiya
Monarth Sarvaiya

Reputation: 1126

Method 1:

To convert existing indentation from tabs to spaces hit Ctrl+Shift+P or F1 and type:

>Convert Indentation to Spaces

Method 2:

You can use solidity-solhint extensions in visual studio.

Click here.

Upvotes: 1

Related Questions