LeslieYQ / vue-format

Vue.js的.vue文件的格式化Atom插件
MIT License
30 stars 5 forks source link

Uncaught TypeError: Cannot read property 'getText' of undefined #2

Open ursulashan opened 8 years ago

ursulashan commented 8 years ago

[Enter steps to reproduce below:]

  1. ...
  2. ...

Atom Version: 1.3.2 System: Mac OS X 10.11.1 Thrown From: vue-format package, v0.4.0

Stack Trace

Uncaught TypeError: Cannot read property 'getText' of undefined

At /Users/shanrj/.atom/packages/vue-format/lib/vue-format.coffee:31

TypeError: Cannot read property 'getText' of undefined
    at Object.module.exports.VueFormat.format (/Users/shanrj/.atom/packages/vue-format/lib/vue-format.coffee:31:18)
    at atom-workspace.subscriptions.add.atom.commands.add.vue-format:format (/Users/shanrj/.atom/packages/vue-format/lib/vue-format.coffee:17:85)
    at CommandRegistry.module.exports.CommandRegistry.handleCommandEvent (/Applications/Atom.app/Contents/Resources/app.asar/src/command-registry.js:260:29)
    at CommandRegistry.handleCommandEvent (/Applications/Atom.app/Contents/Resources/app.asar/src/command-registry.js:3:61)
    at CommandRegistry.module.exports.CommandRegistry.dispatch (/Applications/Atom.app/Contents/Resources/app.asar/src/command-registry.js:160:19)
    at AtomEnvironment.module.exports.AtomEnvironment.dispatchApplicationMenuCommand (/Applications/Atom.app/Contents/Resources/app.asar/src/atom-environment.js:1010:28)
    at emitOne (events.js:77:13)
    at EventEmitter.emit (events.js:169:7)

Commands

     -0:58.7.0 emmet:insert-formatted-line-break-only (atom-text-editor.editor.is-focused)
     -0:58.7.0 editor:newline (atom-text-editor.editor.is-focused)
     -0:58.3.0 core:move-left (atom-text-editor.editor.is-focused)
     -0:57.3.0 core:backspace (atom-text-editor.editor.is-focused)
     -0:56.8.0 core:delete (atom-text-editor.editor.is-focused)
     -0:46.9.0 activate-power-mode:toggle (atom-text-editor.editor.is-focused)
     -0:40.6.0 editor:select-line (atom-text-editor.editor.is-focused.power-mode)
  2x -0:39.6.0 core:backspace (atom-text-editor.editor.is-focused.power-mode)
     -0:34.3.0 core:save (atom-text-editor.editor.is-focused.power-mode)
  3x -0:25.3.0 core:backspace (atom-text-editor.editor.is-focused.power-mode)
     -0:22.5.0 core:save (atom-text-editor.editor.is-focused.power-mode)
     -0:18.9.0 command-palette:toggle (ol.tree-view.full-menu.list-tree.has-collapsable-children.focusable-panel)
 13x -0:16.6.0 core:backspace (atom-text-editor.editor.mini.is-focused)
     -0:00.9.0 vue-format:format (atom-pane.pane.active)

Config

{
  "core": {}
}

Installed Packages

# User
activate-power-mode, v0.4.1
emmet, v2.3.17
vue-format, v0.4.0

# Dev
No dev packages
LeslieYQ commented 8 years ago

应该是没有读取你要格式化的vue的文件, 我后面加一个判断来报错吧。