gpt4 book ai didi

javascript - 驯服 Visual Studio Code IntelliSense

转载 作者:行者123 更新时间:2023-11-30 19:28:01 25 4
gpt4 key购买 nike

假设我正在编写一个 typescript 表达式,并意识到我需要的局部变量尚不存在。没问题,我想,让我们简单地完成一行的输入,然后移动光标以输入变量声明:

production: level.Sunlifter * 2 * perYear,

唉,输入最后一个逗号会触发 IntelliSense,这有助于将我的代码更改为

production: level.Sunlifter * 2 * prepareSyntheticListenerName,

和导入

import { prepareSyntheticListenerName } from '@angular/compiler/src/render3/util';

显然,IntelliSense 已经意识到“perYear”的字符出现在“prepareSyntheticListenerName"以几乎相同的顺序...

我能否以某种方式告诉 Visual Studio Code 在匹配导入的标识符时放宽要求?

最佳答案

在输入逗号之前按 esc 是我所知道的唯一方法。

可能有帮助的解决方法是将 VSCode 配置为仅从某些包导入。这样至少它犯错误的可能性就会降低。

{
"compilerOptions": {
"types" : ["node", "lodash", "express"]
}
}

https://www.typescriptlang.org/docs/handbook/tsconfig-json.html

关于javascript - 驯服 Visual Studio Code IntelliSense,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56717669/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com