Peekmo / atom-autocomplete-php

Autocomplete for PHP in atom editor
MIT License
136 stars 34 forks source link

Uncaught TypeError: Cannot read property 'map' of undefined #269

Closed iluuu1994 closed 8 years ago

iluuu1994 commented 8 years ago

I'm using the Functional\map function from here as follows:

use function Functional\map;

$jsonData = map($someArray, function ($item) {
    return ...;
});

Apparently, atom-autocomplete-php fails at this point because map is a standalone function and is not being accesses via the full namespace. Any idea why this is happening?

Atom Version: 1.8.0 System: Mac OS X 10.11.5 Thrown From: atom-autocomplete-php package, v0.18.9

Stack Trace

Uncaught TypeError: Cannot read property 'map' of undefined

At /Users/ilijatovilo/.atom/packages/atom-autocomplete-php/lib/services/php-file-parser.coffee:686

TypeError: Cannot read property 'map' of undefined
    at Object.module.exports.getMemberContext (/Users/ilijatovilo/.atom/packages/atom-autocomplete-php/lib/services/php-file-parser.coffee:686:32)
    at FunctionProvider.module.exports.FunctionProvider.getTooltipForWord (/Users/ilijatovilo/.atom/packages/atom-autocomplete-php/lib/tooltip/function-provider.coffee:18:25)
    at FunctionProvider.module.exports.AbstractProvider.showPopoverFor (/Users/ilijatovilo/.atom/packages/atom-autocomplete-php/lib/tooltip/abstract-provider.coffee:109:24)
    at HTMLSpanElement.<anonymous> (/Users/ilijatovilo/.atom/packages/atom-autocomplete-php/lib/tooltip/abstract-provider.coffee:78:22)
    at HTMLDivElement.jQuery.event.dispatch (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/jquery/dist/jquery.js:4435:9)
    at HTMLDivElement.elemData.handle (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/jquery/dist/jquery.js:4121:28)

Commands

     -0:12.6.0 core:move-down (atom-text-editor.editor.is-focused)
  2x -0:12.3.0 core:select-up (atom-text-editor.editor.is-focused)
  2x -0:11.8.0 core:backspace (atom-text-editor.editor.is-focused)
  2x -0:11.2.0 core:move-down (atom-text-editor.editor.is-focused)
     -0:10.3.0 core:move-left (atom-text-editor.editor.is-focused)
  3x -0:10.1.0 editor:select-to-beginning-of-word (atom-text-editor.editor.is-focused)
     -0:09.1.0 core:paste (atom-text-editor.editor.is-focused)
     -0:08.7.0 core:move-down (atom-text-editor.editor.is-focused)
     -0:08.5.0 core:move-left (atom-text-editor.editor.is-focused)
  3x -0:08.1.0 editor:select-to-beginning-of-word (atom-text-editor.editor.is-focused)
     -0:07.3.0 core:paste (atom-text-editor.editor.is-focused)
  2x -0:07.0 core:move-left (atom-text-editor.editor.is-focused)
  5x -0:06.5.0 core:backspace (atom-text-editor.editor.is-focused)
     -0:03.7.0 autocomplete-plus:cancel (atom-text-editor.editor.is-focused.autocomplete-active)
  2x -0:03.4.0 core:move-down (atom-text-editor.editor.is-focused)
  3x -0:02.9.0 core:save (atom-text-editor.editor.is-focused)

Config

{
  "core": {
    "disabledPackages": [
      "vim-mode",
      "vim-mode-plus"
    ],
    "excludeVcsIgnoredPaths": false,
    "themes": [
      "one-dark-ui",
      "firewatch-syntax"
    ]
  },
  "atom-autocomplete-php": {}
}

Installed Packages

# User
atom-autocomplete-php, v0.18.9
autocomplete-swift, v1.0.2
browser-plus, v0.0.60
docblockr, v0.7.3
firewatch-syntax, v1.0.1
hyperclick, v0.0.36
intentions, v1.0.5
language-scala, v1.1.6
language-swift, v0.4.0
linter, v1.11.14
linter-php, v1.2.0
php-twig, v4.0.0

# Dev
No dev packages
Peekmo commented 8 years ago

The plugin only works with pure OOP projects. "use function" is not planned to be supported, nor functional programming.

Sorry, Peekmo