Giter Club home page Giter Club logo

Comments (12)

 avatar commented on August 18, 2024

Hello

Could you follow the steps listed here [1]? It will allow you to see what exactly is going wrong or is being output. The package is failing because the PHP side is outputting some expected (and not just the output JSON); judging from the 'W' in the console, I'd guess it's a warning of some kind.

[1] #41 (comment)

from php-ide-serenata.

ELD avatar ELD commented on August 18, 2024

So I get warning messages like this:

...
- WARNING: Could not find a record for the interface Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface of FQSEN Symfony\Component\HttpKernel\DependencyInjection\AddClassesToCachePass
  - Indexing /Users/eric/Dev/Web/acl-demo/vendor/symfony/http-kernel/DependencyInjection/Extension.php
  - WARNING: Could not find a record for parent FQSEN Symfony\Component\DependencyInjection\Extension\Extension of FQSEN Symfony\Component\HttpKernel\DependencyInjection\Extension
  - Indexing /Users/eric/Dev/Web/acl-demo/vendor/symfony/http-kernel/DependencyInjection/ConfigurableExtension.php
  - Indexing /Users/eric/Dev/Web/acl-demo/vendor/symfony/http-kernel/TerminableInterface.php
  - Indexing /Users/eric/Dev/Web/acl-demo/vendor/symfony/http-kernel/HttpKernel.php
  - Indexing /Users/eric/Dev/Web/acl-demo/vendor/symfony/http-kernel/DependencyInjection/ContainerAwareHttpKernel.php
  - Indexing /Users/eric/Dev/Web/acl-demo/vendor/symfony/http-kernel/DependencyInjection/FragmentRendererPass.php
  - WARNING: Could not find a record for the interface Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface of FQSEN Symfony\Component\HttpKernel\DependencyInjection\FragmentRendererPass
  - Indexing /Users/eric/Dev/Web/acl-demo/vendor/symfony/http-kernel/Fragment/FragmentHandler.php
  - Indexing /Users/eric/Dev/Web/acl-demo/vendor/symfony/http-kernel/DependencyInjection/LazyLoadingFragmentHandler.php
  - Indexing /Users/eric/Dev/Web/acl-demo/vendor/symfony/http-kernel/DependencyInjection/MergeExtensionConfigurationPass.php
  - WARNING: Could not find a record for parent FQSEN Symfony\Component\DependencyInjection\Compiler\MergeExtensionConfigurationPass of FQSEN Symfony\Component\HttpKernel\DependencyInjection\MergeExtensionConfigurationPass
...

from the indexing output. They're all the same structure of message, they just vary based on which class or interface it complains about.

I should have also said that the errors are happening when attempting to type code. The autocompletion doesn't appear as expected as a result.

from php-ide-serenata.

 avatar commented on August 18, 2024

Are there any warnings shown when you omit the --show-output parameter (don't forget to remove the database first or use another one or it will skip indexing because the files were not modified)?

from php-ide-serenata.

ELD avatar ELD commented on August 18, 2024

Nope, not warnings are printed without the --show-output flag.

┌─( ~/.a/p/php-integrator-base )──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────( @Nitrogen )─┐
└─❱❱❱ php php/src/Main.php TestDatabase.sqlite --reindex /Users/eric/Dev/Web/acl-demo                                                                                                                                          +438 11:58 ❰─┘
{"success":true,"result":null}%

from php-ide-serenata.

 avatar commented on August 18, 2024

Ok, are you inside a class when this error occurs? And does the error occur when typing class members after $this, self, parent or static or even when trying to type global function names or constants?

In case of the latter; the autocompletion providers are using promises, what you can also try is going into the Main.coffee file of php-integrator-autocomplete-plus and try commenting out the providers being added one by one to see which one is the culprit (or perhaps it can also be deduced from the Promise rejection instead, which may be easier).

And also: nice (Fish?) shell theme.

from php-ide-serenata.

ELD avatar ELD commented on August 18, 2024

It's happened both inside and outside of a class. Outside of a class, I was inside a function calling trying to type out a closure. Inside the class, I was simply trying to call a global function.

I'll try some more troubleshooting on it later today.

from php-ide-serenata.

ELD avatar ELD commented on August 18, 2024

Okay, I've done some troubleshooting. It turns out it's with the FunctionProvider that causes the error.

For reference, I'm working with a Laravel codebase. For example, writing the following:

Route::get('example', function() {
    return 'test';
});

causes the error on the second parameter which is a closure. This also happens whenever autocompletion attempts to complete a function.

Also, thanks for the compliment about the shell theme. I use Zsh and Prezto with the Garrett theme.

from php-ide-serenata.

 avatar commented on August 18, 2024

Alright, thanks for helping me track this down. Since it's the function provider that is generating the error and it only uses one method that uses a promise (@service.getGlobalFunctions), the PHP side for fetching the global functions must be returning some malformed data.

Could you run the following command (after the TestDatabase.sqlite is already present and the --index command you previously ran finished)?

php php/src/Main.php TestDatabase.sqlite --functions

Let me know if any warnings or errors show up. It should output a big JSON string and nothing else.

from php-ide-serenata.

ELD avatar ELD commented on August 18, 2024

I get a bunch of warnings:

Warning: Invalid argument supplied for foreach() in /Users/eric/.atom/packages/php-integrator-base/php/src/IndexDataAdapter.php on line 473
PHP Warning:  Invalid argument supplied for foreach() in /Users/eric/.atom/packages/php-integrator-base/php/src/IndexDataAdapter.php on line 473

I don't know how many times this warning is repeated, but there are quite a few instances of it. It still returns JSON, but it prints out tons of warnings.

from php-ide-serenata.

 avatar commented on August 18, 2024

Ok, I think I figured out what the problem is. I've released 0.4.7, could you give it a try to see if this fixes things? It should automatically reindex your entire project as I've bumped the database version, but in case it doesn't, you can always remove the databases in the indexes subfolder of the package.

from php-ide-serenata.

ELD avatar ELD commented on August 18, 2024

That seemed to fix the problem. Thanks so much for your help!

from php-ide-serenata.

 avatar commented on August 18, 2024

No problem, thanks for taking the time to track this down with me.

from php-ide-serenata.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.