【问题标题】:Why does not atom recommends/auto-completes console.log()?为什么 atom 不推荐/自动完成 console.log()?
【发布时间】:2020-06-14 11:08:39
【问题描述】:

好的,我已经开始使用 atom 文本编辑器了。我既是 atom 文本编辑器的初学者,也是 javascript 的初学者。我想知道一件事,为什么 Atom 不为以下情况提供建议/自动完成:

例如,如果我想写一个console.log(),输入con 不会弹出任何推荐,即使我点击ctrl+space。这仅与Atom文本编辑器有关,还是我对console.log()和javascript的理解有问题?实际上,我已经尝试过 sublime,但它也没有为我提供 con 的完成。

【问题讨论】:

  • 考虑提交问题over the repo
  • @Tibebes.M 好的,所以,它与我不知道的东西无关,但它是一个错误。我会做的,谢谢

标签: javascript atom-editor


【解决方案1】:

已经可以填写console.log(),您只需输入log。这也适用于warnerror,但不支持其他控制台方法,例如time / timeEndtrace

演示:

要覆盖此默认行为,您可以创建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

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2015-09-06
    • 1970-01-01
    • 2015-12-29
    • 2020-02-23
    • 2011-07-03
    • 2020-12-24
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多