【发布时间】:2018-03-12 06:40:02
【问题描述】:
我在这里做了一个非常简单的例子:
如您所见,intellisense 为我提供了有关 foo 函数中名为 test 的对象的接口的建议。完美,喜欢!
但是,如果您像这样在其他地方声明该接口:
intellisense 只告诉我 test 参数有 Itest 接口,但没有告诉我它的参数。
那么,在这种情况下,如何在不打开文件或查找编译器错误的情况下“查看”接口“Itest”的参数?
【问题讨论】:
-
开始输入
foo({})并在{}中触发IntelliSense 以获取建议hello: string和world:string? -
执行此操作时,它仅向我显示编译器错误:“(...) property 'hello' is missing in type {}”但没有建议。
-
嗯,它works for me。 ????
-
好吧,我傻了,我明白了,当然如你所说——需要在括号内按ctrl+空格(MAC),不知道为什么我的时候不起作用起初尝试过。谢谢! :)
标签: typescript visual-studio-code intellisense typescript2.0