【发布时间】:2017-08-12 20:51:05
【问题描述】:
我使用 Visual Studio Code 和 @types/node (7.0.8),但似乎某些函数等的代码注释格式错误,因此 Visual Studio Code 和 Visual Studio 2017 不会在 IntelliSense 中显示任何快速信息。
例子
import * as fs from 'fs';
fs.unlink
当我输入 fs.unlink VS Code 时,显示函数签名,而不是在中定义的注释
./node_modules/@types/node/index.d.ts
在线 2400
/*
* Asynchronous unlink - deletes the file specified in {path}
*
* @param path
* @param callback No arguments other than a possible exception are given to the completion callback.
*/
export function unlink(path: string | Buffer, callback?: (err?: NodeJS.ErrnoException) => void): void;
这里的罪魁祸首是第一行遗漏了一个星号。 正确的符号是
/**
只要我像这样更改 index.d.ts,我就可以开始使用 IntelliSense。 有些函数的注释正确,有些则没有。
我在这里做错了吗? (这些功能是否尽管被导出却不打算使用) @types/node 是否有错误?如果有,有没有办法教 VS Code 解析这些 cmets?
谢谢
【问题讨论】:
标签: node.js typescript visual-studio-code typescript-typings