【问题标题】:Taming Visual Studio Code IntelliSense驯服 Visual Studio Code IntelliSense
【发布时间】:2019-11-05 03:28:40
【问题描述】:

假设我正在编写一个打字稿表达式,并意识到我需要的局部变量还不存在。没问题,我想,让我们在移动光标输入变量声明之前简单地完成输入:

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 在匹配导入的标识符时不那么宽松?

【问题讨论】:

    标签: javascript typescript visual-studio-code


    【解决方案1】:

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

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

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

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

    【讨论】:

      【解决方案2】:

      谢谢,这里有类似的问题。 Escape 是唯一可以绕过这些 IntelliSense 选项的键。

      【讨论】:

        猜你喜欢
        • 2018-03-22
        • 1970-01-01
        • 2022-01-07
        • 2016-10-31
        • 1970-01-01
        • 2019-06-10
        • 1970-01-01
        • 1970-01-01
        • 2016-02-07
        相关资源
        最近更新 更多