代码之家  ›  专栏  ›  技术社区  ›  SpaceTrucker

如何在visual studio的typescript代码中获取带有完整导入的编译器错误消息?

  •  1
  • SpaceTrucker  · 技术社区  · 8 年前

    我正在用visual studio代码编辑一段typescript代码。为此,我收到一条编译器错误消息,内容如下:

    Type 'import(\"c:/path/to/project/node_modules/@com.m...' is not assignable to type 
    'import(\"c:/path/to/project/node_modules/@com.m...'. Two different types with this name 
    exist, but they are unrelated.
    

    要读取编译器错误消息中导入的完整路径,需要配置什么?

    1 回复  |  直到 8 年前
        1
  •  2
  •   Titian Cernicova-Dragomir    8 年前

    您可以在 tsconfig.json :

    "noErrorTruncation": true
    

    编译器选项 page 不会提供很多关于被截断的内容的信息,但是如果禁用截断,则应该以较长的错误为代价获取编译器关于错误的所有信息。