Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Could not decode JSON #80

Open
zhougts opened this issue Dec 10, 2018 · 8 comments
Open

Could not decode JSON #80

zhougts opened this issue Dec 10, 2018 · 8 comments
Labels
bug Something isn't working

Comments

@zhougts
Copy link

zhougts commented Dec 10, 2018

I get an error when calling the phpactor-goto-definition function:
json-read-string: Bad string format: "doesn't start with "'!"
Phpactor Output:

In RpcCommand.php line 58:
                          
  Could not decode JSON:  
                          

rpc [--replay] [--pretty]
@kermorgant kermorgant added the bug Something isn't working label Dec 11, 2018
@kermorgant
Copy link
Contributor

Hi,

It might be helpful to look at the content of these buffers : Phpactor Output, Phpactor Input

Besides, how did you install phpactor.el and phpactor ?

We recently added the ability to install phpactor from phpactor.el and this should be the best way for phpactor.el to have a "known to work" version of phpactor.

@zhougts
Copy link
Author

zhougts commented Dec 11, 2018

I installed it with use-package\

(use-package phpactor)

Then, I execute
phpactor-update

@kermorgant
Copy link
Contributor

Then, I execute phpactor-update

Good. Could you please share the contents of "Phpactor Output" or "Phpactor Input" ?

@zhougts
Copy link
Author

zhougts commented Dec 11, 2018

This is the output after I execute phpactor-update:

Loading composer repositories with package information
Installing dependencies from lock file
Package operations: 40 installs, 0 updates, 0 removals
  - Installing ocramius/package-versions (1.3.0): Loading from cache
  - Installing doctrine/lexer (v1.0.1): Loading from cache
  - Installing symfony/polyfill-ctype (v1.9.0): Loading from cache
  - Installing symfony/filesystem (v3.4.15): Loading from cache
  - Installing psr/log (1.0.2): Loading from cache
  - Installing microsoft/tolerant-php-parser (dev-master 7ea7734): Cloning 7ea773435b from cache
  - Installing phpactor/class-mover (dev-master 529a0c9): Cloning 529a0c9f4a from cache
  - Installing symfony/polyfill-mbstring (v1.9.0): Loading from cache
  - Installing twig/twig (v2.5.0): Loading from cache
  - Installing phpactor/code-builder (dev-master 68832ef): Cloning 68832ef137 from cache
  - Installing webmozart/assert (1.3.0): Loading from cache
  - Installing webmozart/path-util (2.3.0): Loading from cache
  - Installing phpactor/class-to-file (dev-master 5379835): Cloning 53798359f0 from cache
  - Installing phpactor/code-transform (dev-master 520f7a9): Cloning 520f7a99d4 from cache
  - Installing symfony/process (v4.1.4): Loading from cache
  - Installing symfony/options-resolver (v4.1.4): Loading from cache
  - Installing symfony/finder (v4.1.4): Loading from cache
  - Installing symfony/debug (v4.1.4): Loading from cache
  - Installing symfony/console (v3.4.15): Loading from cache
  - Installing seld/jsonlint (1.7.1): Loading from cache
  - Installing phpbench/dom (0.2.0): Loading from cache
  - Installing psr/container (1.0.0): Loading from cache
  - Installing phpbench/container (1.2): Loading from cache
  - Installing lstrojny/functional-php (1.8.0): Loading from cache
  - Installing doctrine/annotations (v1.6.0): Loading from cache
  - Installing beberlei/assert (v3.0.0): Loading from cache
  - Installing phpbench/phpbench (dev-master 7a33cea): Cloning 7a33cea9dc from cache
  - Installing phpactor/docblock (dev-master ae0dd14): Cloning ae0dd14ff4 from cache
  - Installing jetbrains/phpstorm-stubs (dev-master eae9c1b): Cloning eae9c1b5b5 from cache
  - Installing phpactor/worse-reflection (dev-master b3c7fbc): Cloning b3c7fbc796 from cache
  - Installing phpactor/source-code-filesystem (dev-master a0b641b): Cloning a0b641b9ed from cache
  - Installing phpactor/completion (dev-master 3138e9d): Cloning 3138e9dc45 from cache
  - Installing phpactor/path-finder (dev-master 9375374): Cloning 9375374c41 from cache
  - Installing webmozart/glob (4.1.0): Loading from cache
  - Installing symfony/yaml (v3.4.15): Loading from cache
  - Installing sebastian/diff (2.0.x-dev abcc704): Cloning abcc70409d from cache
  - Installing monolog/monolog (1.23.0): Loading from cache
  - Installing dnoegel/php-xdg-base-dir (0.1): Loading from cache
  - Installing composer/xdebug-handler (1.3.0): Loading from cache
  - Installing phpactor/phpactor (0.9.0): Loading from cache
Generating optimized autoload files
Warning: Ambiguous class resolution, "Phpactor\CodeTransform\Adapter\WorseReflection\Transformer\AddMissingProperties" was found in both "C:/Users/admin/.emacs.d/elpa/phpactor-20181128.135/vendor/phpactor/code-transform/lib\Adapter\WorseReflection\Transformer\AddMissingMethods.php" and "C:/Users/admin/.emacs.d/elpa/phpactor-20181128.135/vendor/phpactor/code-transform/lib\Adapter\WorseReflection\Transformer\AddMissingProperties.php", the first will be used.
ocramius/package-versions:  Generating version class...
ocramius/package-versions: ...done generating version class

I run phpactor-status:
Phpactor Input:

{"action":"status","parameters":[]}

Phpactor Output:


In RpcCommand.php line 58:
                          
  Could not decode JSON:  
                          

rpc [--replay] [--pretty]

@MarTango
Copy link
Contributor

I believe I had this issue, and resolved it by using my own clone of phpactor (which was up to date with master) - so it might be the case that this can be fixed with a change in phpactor.el's composer.lock

@kermorgant
Copy link
Contributor

@MarTango this is quite ironic given the installation of phpactor withing phpactor.el was meant to give a more reliable outcome :-(

@tszg thanks for the feedback. Alas, I can't see what's wrong from that.

within emacs, is the phpactor-executable variable set to nil ?
from the command line, does the phpactor executable (the one found under phpactor.el's vendor/bin/ directory) behave normally (what does phpactor status give ?)

@zhougts
Copy link
Author

zhougts commented Dec 16, 2018

I run it on the command line and get the right result. I'm looking for the same problem here phpactor/phpactor#564, Perhaps this is related to the Windows system, my environment is win10.

@kermorgant
Copy link
Contributor

@zhougts there have been several changes on develop branch since December. I'd be interested to know whether the issue is still present.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants