自动格式化程序是否可以使用 VS 代码中的某些字符来排列代码

Is it possible for the auto formatter to line up code using certain characters in VS Code

自动格式化程序是否可以使用 VS Code 中的某些字符来排列代码?

例如,转这个:

{
    "one" : "one",
    "two" : "two",
    "three" : "three",
    "four" : "four"
}

进入这个:

{
    "one"   : "one",
    "two"   : "two",
    "three" : "three",
    "four"  : "four"
}

或者这个:

var one = "one";
var two = "two";
var three = "three";
var four = "four";

进入这个:

var one   = "one";
var two   = "two";
var three = "three";
var four  = "four";

实现这种与语言无关的一种方法是使用 Cursor Align 扩展,并使用多个游标。要对齐一组字符,您可以 select 所有出现的 selection(在 Windows 上,键盘快捷键是 Ctrl+Shift+L)