欢迎各位兄弟 发布技术文章

这里的技术是共享的

You are here

atom 微信小程序扩展 有大用

atom 支持微信小程序开发环境



在使用 atom 作为微信小程序开发 IDE 时,由于微信小程序的模板文件拓展名为 .wxml 和样式文件名为 .wxss,使得 atom 无法识别语法做代码高亮,更不能使用 emmet 插件进行补全。

  1. 支持语法高亮  (好像这个可以不要)

// 在 config.cson 里 `core` 配置下添加 `customFileTypes` 配置即可支持 .wxml 和 .wxss 的语法高亮
core:
    customFileTypes:
      'text.html.mustache': [
        'wxml'
      ]
      'source.css': [
        'wxss'
      ]
  1. emmet tab 快捷键支持 .wxml 补全

// emmet 要先识别当前文件的语法格式才能做自动拓展,故必须先完成上面步骤让 atom 能识别 wxml 语法才行
// 在 keymap.cson 中添加如下配置即可
'atom-text-editor[data-grammar="text html mustache"]:not([mini])':
    'tab': 'emmet:expand-abbreviation-with-tab'

参考链接:

http://flight-manual.atom.io/using-atom/sections/basic-customization/#customizing-language-recognition

来自 https://github.com/weekeight/weekeight.github.io/issues/50



image.png


autocomplete-wx 要先安装(会报错,但是Tab能自动补全)后卸载(才不报错,此时Tab同样能自动补全)

普通分类: