如何在打字稿的 Visual Studio 代码中使用完整导入获取编译器错误消息?

Spa*_*ker 3 compiler-errors typescript visual-studio-code

我正在 Visual Studio 代码中编辑一段打字稿代码。为此,我收到一条编译器错误消息,内容如下:

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.
Run Code Online (Sandbox Code Playgroud)

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

Tit*_*mir 6

您可以添加不截断的选项tsconfig.json

"noErrorTruncation": true
Run Code Online (Sandbox Code Playgroud)

编译器选项页面没有提供很多关于被截断的信息,但是如果你禁用截断,你应该以更长的错误为代价获得编译器关于错误的所有信息。