Peekmo / atom-autocomplete-php

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

Unexpected end of input #186

Closed slaughter550 closed 8 years ago

slaughter550 commented 9 years ago

When saving this file on Atom 1.0.19

<?php

namespace App\Jobs;

use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Queue\SerializesModels;
use Illuminate\Contracts\Bus\SelfHandling;
use Illuminate\Contracts\Queue\ShouldQueue;

class QueueMarshal extends Job implements SelfHandling, ShouldQueue
{
    use InteractsWithQueue, SerializesModels;

    public function __construct()
    {
        //
    }

    public function handle()
    {
        //
    }
}

I get the error message Unexpected end of input with this trace

SyntaxError: Unexpected end of input
  at Object.parse (native)
  at execute (/Users/slaughter/.atom/packages/atom-autocomplete-php/lib/services/php-proxy.coffee:34:32)
  at Object.module.exports.methods (/Users/slaughter/.atom/packages/atom-autocomplete-php/lib/services/php-proxy.coffee:165:19)
  at Object.module.exports.getMethodContext (/Users/slaughter/.atom/packages/atom-autocomplete-php/lib/services/php-file-parser.coffee:528:25)
  at FunctionProvider.<anonymous> (/Users/slaughter/.atom/packages/atom-autocomplete-php/lib/goto/function-provider.coffee:68:33)
  at FunctionProvider.module.exports.FunctionProvider.registerMarkers (/Users/slaughter/.atom/packages/atom-autocomplete-php/lib/goto/function-provider.coffee:149:12)
  at FunctionProvider.module.exports.AbstractProvider.rescanMarkers (/Users/slaughter/.atom/packages/atom-autocomplete-php/lib/goto/abstract-provider.coffee:175:10)
  at /Users/slaughter/.atom/packages/atom-autocomplete-php/lib/goto/abstract-provider.coffee:32:18
  at Emitter.module.exports.Emitter.emit (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/event-kit/lib/emitter.js:82:11)
  at TextBuffer.module.exports.TextBuffer.saveAs (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/text-buffer/lib/text-buffer.js:1037:20)
  at TextBuffer.module.exports.TextBuffer.save (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/text-buffer/lib/text-buffer.js:1004:19)
  at TextEditor.module.exports.TextEditor.save (/Applications/Atom.app/Contents/Resources/app.asar/src/text-editor.js:584:26)
  at Pane.module.exports.Pane.saveItem (/Applications/Atom.app/Contents/Resources/app.asar/src/pane.js:547:18)
  at Pane.module.exports.Pane.saveActiveItem (/Applications/Atom.app/Contents/Resources/app.asar/src/pane.js:530:19)
  at Workspace.module.exports.Workspace.saveActivePaneItem (/Applications/Atom.app/Contents/Resources/app.asar/src/workspace.js:609:35)
  at atom-workspace.atom.commands.add.core:save (/Applications/Atom.app/Contents/Resources/app.asar/src/workspace-element.js:293:30)
  at CommandRegistry.module.exports.CommandRegistry.handleCommandEvent (/Applications/Atom.app/Contents/Resources/app.asar/src/command-registry.js:245:29)
  at /Applications/Atom.app/Contents/Resources/app.asar/src/command-registry.js:3:61
  at KeymapManager.module.exports.KeymapManager.dispatchCommandEvent (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/atom-keymap/lib/keymap-manager.js:524:16)
  at KeymapManager.module.exports.KeymapManager.handleKeyboardEvent (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/atom-keymap/lib/keymap-manager.js:347:22)
  at HTMLDocument.module.exports.WindowEventHandler.onKeydown (/Applications/Atom.app/Contents/Resources/app.asar/src/window-event-handler.js:184:20)

Please let me know if you need any more information and I'd be happy to provide it

ghost commented 9 years ago

In general, this error shows up when there is something wrong with your PHP code or one of the classes you're trying to get information (autocompletion, tooltips, ...) for contains syntax errors.

If your PHP code is completely valid (i.e. it runs correctly) and this error still shows up, it could be that the package is not correctly set up. Could you verify if the package is working properly? You can use the Atom Autocomplete Php: Configuration command for this (use Atom's command palette to find it).

alexandernst commented 9 years ago

Maybe a good idea (if possible) would be to tell the user on which line the code is invalid (assuming that the error happened because of invalid code, of course).