[确定,我已经开始使用原子文本编辑器。我既是原子文本编辑器又是javascript的初学者。我想知道一件事,为什么Atom在以下情况下不提供建议/自动完成功能:
例如,如果我想写console.log()
,即使我按con
,键入ctrl+space
也不会弹出任何建议。这仅与Atom文本编辑器有关,还是我对console.log()
和javascript的理解有误?实际上,我曾尝试过出色的表现,但它也没有为我提供con
的补充。
已经可以完成console.log()
,您只需要键入log
。这也适用于warn
或error
,但不支持其他控制台方法,例如time
/ timeEnd
或trace
。
Demo:
要覆盖此默认行为,您可以创建your own snippet。
示例:
'.source.js, .source.ts': # defines the scope of the snippet, e.g. JavaScript and TypeScript
'console.log()': # the greyed-out part in the completion popup
'prefix': 'console' # trigger for the snippet
'body': 'console.log($1)' # body of the snippet, where $1 is the cursor position after the completion