mingjunyang / atom-format-lua

MIT License
3 stars 5 forks source link

Uncaught TypeError: Cannot read property 'length' of null #1

Closed Stanzilla closed 7 years ago

Stanzilla commented 9 years ago

[Enter steps to reproduce below:]

  1. ...
  2. ...

Atom Version: 1.0.7 System: Microsoft Windows 8.1 Pro Thrown From: atom-format-lua package, v0.0.5

Stack Trace

Uncaught TypeError: Cannot read property 'length' of null

At C:\Users\Benjamin\.atom\packages\atom-format-lua\lib\atom-format-lua.coffee:41

TypeError: Cannot read property 'length' of null
  at Object.module.exports.AtomFormatLua.format (C:\Users\Benjamin\.atom\packages\atom-format-lua\lib\atom-format-lua.coffee:41:28)
  at atom-workspace.subscriptions.add.atom.commands.add.atom-format-lua:format (C:\Users\Benjamin\.atom\packages\atom-format-lua\lib\atom-format-lua.coffee:12:94)
  at CommandRegistry.module.exports.CommandRegistry.handleCommandEvent (C:\Users\Benjamin\AppData\Local\atom\app-1.0.7\resources\app.asar\src\command-registry.js:241:29)
  at CommandRegistry.handleCommandEvent (C:\Users\Benjamin\AppData\Local\atom\app-1.0.7\resources\app.asar\src\command-registry.js:3:61)
  at CommandRegistry.module.exports.CommandRegistry.dispatch (C:\Users\Benjamin\AppData\Local\atom\app-1.0.7\resources\app.asar\src\command-registry.js:156:19)
  at [object Object].jQuery.fn.trigger (C:\Users\Benjamin\AppData\Local\atom\app-1.0.7\resources\app.asar\src\space-pen-extensions.js:64:23)
  at EventEmitter.<anonymous> (C:\Users\Benjamin\AppData\Local\atom\app-1.0.7\resources\app.asar\src\window-event-handler.js:75:67)
  at emitTwo (events.js:87:13)
  at EventEmitter.emit (events.js:169:7)
  at EventEmitter.ipc.sendSync (C:\Users\Benjamin\AppData\Local\atom\app-1.0.7\resources\atom.asar\renderer\api\lib\ipc.js:21:31)
  at BrowserWindow.RemoteMemberFunction [as emit] (C:\Users\Benjamin\AppData\Local\atom\app-1.0.7\resources\atom.asar\renderer\api\lib\remote.js:110:29)
  at ContextMenuManager.module.exports.ContextMenuManager.showForEvent (C:\Users\Benjamin\AppData\Local\atom\app-1.0.7\resources\app.asar\src\context-menu-manager.js:170:31)
  at HTMLDocument.<anonymous> (C:\Users\Benjamin\AppData\Local\atom\app-1.0.7\resources\app.asar\src\window-event-handler.js:150:33)
  at HTMLDocument.handler (C:\Users\Benjamin\AppData\Local\atom\app-1.0.7\resources\app.asar\src\space-pen-extensions.js:112:34)
  at HTMLDocument.jQuery.event.dispatch (C:\Users\Benjamin\AppData\Local\atom\app-1.0.7\resources\app.asar\node_modules\space-pen\vendor\jquery.js:4681:9)
  at HTMLDocument.elemData.handle (C:\Users\Benjamin\AppData\Local\atom\app-1.0.7\resources\app.asar\node_modules\space-pen\vendor\jquery.js:4359:46)

Commands

Config

{
  "core": {
    "disabledPackages": [
      "spell-check",
      "highlight-css-color",
      "white-cursor",
      "feedback",
      "welcome",
      "auto-indent",
      "linter-luacheck",
      "atom-beautify",
      "build"
    ],
    "autoHideMenuBar": true,
    "excludeVcsIgnoredPaths": false
  }
}

Installed Packages

# User
atom-format-lua, v0.0.5
auto-detect-indentation, v0.4.2
autocomplete-paths, v1.0.2
autocomplete-php, v0.3.7
autocomplete-sass, v0.1.0
css-color-underline, v1.0.1
file-icons, v1.6.9
fold-functions, v0.3.1
indent-guide-improved, v1.4.2
indentation-indicator, v0.6.0
keyboard-localization, v1.4.8
language-blade, v0.15.0
language-gitignore, v0.2.0
language-lua, v0.9.4
laravel, v0.7.0
less-than-slash, v0.8.0
line-ending-selector, v0.0.5
linter, v1.4.3
linter-lua, v1.0.0
linter-lua-findglobals, v1.0.0
linter-php, v1.0.3
minimap, v4.13.2
one-dark-syntax, v1.1.0
one-dark-ui, v1.0.3
open-recent, v2.3.0
tabs-to-spaces, v0.11.1
trailing-spaces, v0.3.2

# Dev
No dev packages
mingjunyang commented 9 years ago

I use atom in Linux System,I am not try it on windows,Let's try it.

mingjunyang commented 9 years ago

@Stanzilla I did not know how to set and get PATH and lua command on windows system. maybe we need a setting item,config the environment variable , set the lua command. I try this weekend.

Stanzilla commented 9 years ago

@mingjunyang you can probably look at how https://github.com/atom-community/linter does it as a start.

mingjunyang commented 9 years ago

@Stanzilla Let's try.

Stanzilla commented 9 years ago

@mingjunyang had any success yet?

mingjunyang commented 9 years ago

@Stanzilla I have update to v0.0.6,add a setting item in config.cson.

"atom-format-lua":
     lua51: "/usr/bin/lua5.1"

try it . I haven't windows system to test it .

Stanzilla commented 9 years ago

It doesn't error anymore but it also just does nothing now. I click "format atom-format-lua" (which is a not very nice name for a menu item) and nothing happens.