snowkit / atom-haxe

atom.io haxe plugin, includes completion, error checking and more.
MIT License
43 stars 10 forks source link

Uncaught TypeError: Cannot read property 'path' of null #33

Closed mlms13 closed 9 years ago

mlms13 commented 9 years ago

I can regularly reproduce an an unhandled error by doing the following:

  1. Open a new file
  2. Set syntax to haxe3
  3. Try to type a // comment in the otherwise empty file.

The following error is thrown after the first /:

Atom Version: 1.0.2 System: Mac OS X 10.10.4 Thrown From: haxe package, v0.8.1

Stack Trace

Uncaught TypeError: Cannot read property 'path' of null

At /Users/michaelmartin/.atom/packages/haxe/lib/completion/provider.js:52

TypeError: Cannot read property 'path' of null
  at Object.module.exports.getSuggestions (/Users/michaelmartin/.atom/packages/haxe/lib/completion/provider.js:52:43)
  at /Applications/Atom.app/Contents/Resources/app.asar/node_modules/autocomplete-plus/lib/autocomplete-manager.js:255:56
  at Array.forEach (native)
  at AutocompleteManager.module.exports.AutocompleteManager.getSuggestionsFromProviders (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/autocomplete-plus/lib/autocomplete-manager.js:234:17)
  at AutocompleteManager.getSuggestionsFromProviders (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/autocomplete-plus/lib/autocomplete-manager.js:3:61)
  at AutocompleteManager.module.exports.AutocompleteManager.findSuggestions (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/autocomplete-plus/lib/autocomplete-manager.js:221:19)
  at /Applications/Atom.app/Contents/Resources/app.asar/node_modules/autocomplete-plus/lib/autocomplete-manager.js:3:61

Commands

     -6:33.2.0 editor:indent (atom-text-editor.editor.is-focused)
     -6:32.8.0 editor:move-to-end-of-screen-line (atom-text-editor.editor.is-focused)
     -6:13.7.0 core:move-up (atom-text-editor.editor.is-focused.autocomplete-active)
     -6:13.6.0 core:move-left (atom-text-editor.editor.is-focused)
     -6:13.5.0 linter:set-bubble-transparent (atom-text-editor.editor.is-focused)
  6x -6:13.3.0 editor:move-to-beginning-of-word (atom-text-editor.editor.is-focused)
     -6:11.8.0 editor:select-to-beginning-of-word (atom-text-editor.editor.is-focused)
     -6:04.9.0 core:move-down (atom-text-editor.editor.is-focused)
     -6:04.5.0 editor:move-to-end-of-screen-line (atom-text-editor.editor.is-focused)
     -6:04.1.0 core:select-up (atom-text-editor.editor.is-focused)
     -6:03.9.0 editor:select-to-end-of-line (atom-text-editor.editor.is-focused)
     -6:03.6.0 core:delete (atom-text-editor.editor.is-focused)
     -0:08.5.0 application:new-file (atom-text-editor.editor.is-focused)
     -0:06.9.0 command-palette:toggle (atom-text-editor.editor.is-focused)
     -0:04.8.0 core:confirm (atom-text-editor.editor.mini.is-focused)
     -0:04.8.0 set-syntax:Haxe3 (atom-text-editor.editor)

Config

{
  "core": {
    "ignoredNames": [
      "node_modules"
    ],
    "projectHome": "/Users/michaelmartin/Projects",
    "themes": [
      "one-dark-ui",
      "monokai"
    ],
    "disabledPackages": [
      "docblockr",
      "vim-mode"
    ]
  },
  "haxe": {}
}

Installed Packages

# User
Stylus, v1.0.0
atom-pair, v1.1.6
emmet, v2.3.12
haxe, v0.8.1
highlight-selected, v0.10.1
language-haxe, v0.3.0
language-jade, v0.5.1
linter, v1.2.3
monokai, v0.14.0
pretty-json, v0.4.1
set-syntax, v0.3.0
tasks, v2.2.0
trailing-spaces, v0.3.2

# Dev
tasks, v2.1.0
mlms13 commented 9 years ago

Hmm, this is actually happening for most characters I type... maybe there's something worse going on in my setup. Things were working fine an hour ago.

ruby0x1 commented 9 years ago

Thanks for the report, it's because the package is expecting the file to have a path (it would need one to do anything of use with the haxe features specifically).

But the error will be fixed so that it doesn't just throw the whole time.

ruby0x1 commented 9 years ago

Let me know, this should be fixed in 0.8.3

mlms13 commented 9 years ago

Seems to be working well; thanks for the quick fix!