首页 > 解决方案 > vscode: insert constant amount of spaces instead of completing indentation

问题描述

Which setting controls that indentation inserts 4 spaces instead of complete up to 4 spaces. Let me explain via example, (my vscode is set to tab == 4 spaces)

Given the following query (· is used to simulate space)

SELECT col1
·····, col2    -- 5 spaces before coma
··FROM mytable -- 2 spaces before FROM
·WHERE cond1   -- etc...
···AND cond2
···AND cond3

If I press Tab selecting the query I got the following un-formatted code

····SELECT col1   -- 4 spaces added
········, col2    -- 3 spaces added so 8 are before coma
····FROM mytable  -- 2 spaces added so 4 are before FROM
····WHERE cond1   -- etc...
····AND cond2
····AND cond3

Instead of adding 4 spaces to each line, it completes spaces up to the smaller multiple of 4. Current solution is column wise cursor and add manually 4 spaces, but I'd like the Tab buttom to mean insert 4 spaces at the begining of line without any autocompletion / intelligent indent / whatsoever

标签: visual-studio-code

解决方案


推荐阅读