【问题标题】:TypeScript importing prevents intellisense/autocomplete when using lodash definition stubs in WebStorm/IntelliJ在 WebStorm/IntelliJ 中使用 lodash 定义存根时,TypeScript 导入会阻止智能感知/自动完成
【发布时间】:2014-06-08 03:46:09
【问题描述】:

我注意到,在已经引用定义文件后导入 lodash 时,WebStorm 会丢失它在引用此定义文件时获得的所有代码智能。

代码看起来像

/// <reference path="lodash.d.ts" />
import _ = require('lodash');

v.s.

/// <reference path="lodash.d.ts" />

两个例子都能正常编译,所以不会影响编译器。

为了记录,我使用的是DefinitelyTyped Lodash definition file

一些截图说明了我的意思:


(来源:nath.is


(来源:nath.is

我正在使用 AMD 模块选项。这是我的文件观察器。


(来源:nath.is

此外,该模块肯定安装在我的 node_modules 文件夹中。

【问题讨论】:

  • 在 WebStorm 8.0.1 中对我来说是可重复的;在当前的每日构建 (136.1746) 中工作正常
  • 是否可以轻松更新到此每日构建?
  • 这是否意味着它是WebStorm中的一个错误?
  • 确定这是一个在下一个 WebStorm 版本中修复的错误
  • 我有 WebStorm 9.0.2 并且 IntelliSense 与 import///&lt;reference... 都可以正常工作

标签: intellij-idea typescript webstorm lodash definitelytyped


【解决方案1】:

我有 WebStorm 9.0.2 并且 IntelliSense 在 import///&lt;reference... 上都可以正常工作

【讨论】:

    猜你喜欢
    • 2017-01-26
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-06-10
    • 2012-08-19
    • 2011-10-26
    • 1970-01-01
    相关资源
    最近更新 更多