Peekmo / atom-symfony2

Autocomplete for Symfony2 package
MIT License
18 stars 5 forks source link

Uncaught TypeError: Cannot read property 'getStackClasses' of null #4

Closed okdewit closed 8 years ago

okdewit commented 8 years ago

Hope this helps, stack trace generated by atom:

[Enter steps to reproduce below:]

  1. ...
  2. ...

Atom Version: 1.2.4 System: Mac OS X 10.11.1 Thrown From: atom-symfony2 package, v0.2.0

Stack Trace

Uncaught TypeError: Cannot read property 'getStackClasses' of null

At ~/.atom/packages/atom-symfony2/lib/providers/service-provider.coffee:31

TypeError: Cannot read property 'getStackClasses' of null
    at ServiceProvider.module.exports.ServiceProvider.getSuggestions (~/.atom/packages/atom-symfony2/lib/providers/service-provider.coffee:31:33)
    at /Applications/Atom.app/Contents/Resources/app.asar/node_modules/autocomplete-plus/lib/autocomplete-manager.js:286: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:265: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:252:19)
    at /Applications/Atom.app/Contents/Resources/app.asar/node_modules/autocomplete-plus/lib/autocomplete-manager.js:3:61

Commands

     -7:16.1.0 tree-view:toggle (atom-text-editor.editor.is-focused)
     -0:25.9.0 editor:toggle-line-comments (atom-text-editor.editor.is-focused)
     -0:24.2.0 core:move-down (atom-text-editor.editor.is-focused)
     -0:20.8.0 editor:toggle-line-comments (atom-text-editor.editor.is-focused)

Config

{
  "core": {
    "themes": [
      "seti-ui",
      "monokai-seti"
    ],
    "disabledPackages": [
      "wrap-guide"
    ]
  }
}

Installed Packages

# User
atom-symfony2, v0.2.0
font-awesome-snippetset, v0.0.6
git-plus, v5.6.6
linter, v1.11.3
linter-php, v1.1.6
minimap, v4.16.2
minimap-find-and-replace, v4.3.2
minimap-git-diff, v4.1.8
minimap-selection, v4.3.1
monokai-seti, v0.7.0
php-twig, v4.0.0
seti-ui, v0.8.1
symbols-tree-view, v0.10.1
symfony-snippets, v0.3.0
tree-view-git-modified, v0.6.0

# Dev
No dev packages
AlexisFinn commented 8 years ago

At ~/.atom/packages/atom-symfony2/lib/providers/service-provider.coffee:31 Add the following line. (right before elements = parser.parser.getStackClasses(editor, newPosition)) return unless parser.parser? Restart atom. Voila. Doesn't fix the underlying issue but it avoids those pasky messages from popping up at each keypress, and you even get autocompletion back.

Peekmo commented 8 years ago

Hello,

Sorry, I didn't see that issue before. The problem is that you need the plugin atom-autocomplete-php in order to make it works.

It seems that you didn't installed it. (Thank you for the fix anyway AlexisFinn)

AlexisFinn commented 8 years ago

Cool, works fine now, thank you.