[英]Atom's JavaScript autocompletion in TypeScript
Today, I've been trying to get autocompletion on Atom through autocomplete+
and ternjs
packages.今天,我一直在尝试通过
autocomplete+
和ternjs
包在Atom 上实现autocomplete+
。 However, I don't know how to get autocompletion for external libraries like lodash.js
.但是,我不知道如何为
lodash.js
等外部库获取自动完成lodash.js
。 I've found a lodash-autocomplete
package that works on .js
files.我找到了一个适用于
.js
文件的lodash-autocomplete
包。
Is there a workaround to get it working in .ts
files?有没有办法让它在
.ts
文件中工作?
This is answered in the official Atom FAQ :这在官方Atom 常见问题解答中得到了回答:
Atom includes a feature called "custom file types" which you can use by adding some entries into your
config.cson
that look like this:Atom 包含一个称为“自定义文件类型”的功能,您可以通过在
config.cson
中添加一些条目来使用它,如下所示:core: customFileTypes: 'source.js': [ 'ts' ]
Take note that this might lead to some undesired side-effects, eg duplicate snippets/autocompletions.请注意,这可能会导致一些不需要的副作用,例如重复的片段/自动完成。 As a long-term fix, consider requesting this feature from the author of the package.
作为长期修复,请考虑向软件包作者请求此功能。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.