Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/visual-studio-code/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/backbone.js/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Visual studio code 防止VS代码更改Enter时的缩进_Visual Studio Code - Fatal编程技术网

Visual studio code 防止VS代码更改Enter时的缩进

Visual studio code 防止VS代码更改Enter时的缩进,visual-studio-code,Visual Studio Code,假设我有一个包含以下内容的JavaScript文件,并且光标位于管道符号(|): 如果现在按enter键,代码将按以下方式更改: class ItemCtrl { getPropertiesByItemId(id) { return this.fetchItem(id) .then(item => { return this.getPropertiesOfItem(item); });

假设我有一个包含以下内容的JavaScript文件,并且光标位于管道符号(
|
):

如果现在按enter键,代码将按以下方式更改:

class ItemCtrl {
    getPropertiesByItemId(id) {
        return this.fetchItem(id)
            .then(item => {
                return this.getPropertiesOfItem(item);
            });
        }
        |
}
它错误地将右大括号与return语句对齐,而它应该与方法定义对齐。我知道函数中的格式不是最好的,但我还是希望禁用该功能,以防止类似的奇怪事情发生

我已经将
editor.autoIndent
设置为
false
,但它仍然在发生。是否有其他方法,我如何完全关闭此功能?(或者以更智能的方式工作)

在VS代码1.17中,导致“editor.autoIndent”:false无法工作

这应该在VS代码1.18中修复,因为VS代码1.17中的“editor.autoIndent”:false不起作用


这应该在VS代码1.18中修复

您是否有eslint扩展?或者其他正在做的?我禁用了所有扩展。但我实际上意识到,如果我将
editor.autoIndent
设置为true,自动缩进似乎被禁用。对我来说似乎是一个bug或者我的安装被搞砸了。你们有eslint扩展吗?或者其他正在做的?我禁用了所有扩展。但我实际上意识到,如果我将
editor.autoIndent
设置为true,自动缩进似乎被禁用。对我来说似乎是一个bug或者我的安装是一团糟。
class ItemCtrl {
    getPropertiesByItemId(id) {
        return this.fetchItem(id)
            .then(item => {
                return this.getPropertiesOfItem(item);
            });
        }
        |
}