emacs-php / emacs-php/phpactor.el

Create class not working

Open
#153 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Emacs Lisp
Stars
47
Forks
11
PR merge metrics
No merged PRs in 30d

Description

I have some problems with the `phpactor-create-new-class` seems the json serialization is not working correclty (it may be related to [this issue](https://www.reddit.com/r/emacs/comments/if2gy4/heads_up_emacs_27_jsonserialize_cant_serialize/).
I'm using Emacs 27.1 compiled from the official tarball from the Emacs page.
This is part of the command output

`Debugger entered--Lisp error: (wrong-type-argument json-value-p :null)
json-serialize((:action "class_new" :parameters (:new_path :null :variant :null :overwrite_existing :null :current_path "/usr/Data_2/Programming/drupal-9.0.6/core/modules/aggregator/src/Entity/Feed.php")) :null-object nil :false-object :json-false)
`

`(let ((json (phpactor--serialize-json (list :action action :parameters arguments))) (output (get-buffer-create "*Phpactor Output*")) (coding-system-for-write 'utf-8) (cwd (phpactor-get-working-dir))) (save-current-buffer (set-buffer output) (erase-buffer)) (save-current-buffer (set-buffer (get-buffer-create "*Phpactor Input*")) (setq default-directory cwd) (erase-buffer) (insert json) (call-process-region (point-min) (point-max) phpactor-executable nil output nil "rpc" (format "--working-dir=%s" default-directory)) (phpactor--parse-json output)))
phpactor--rpc("class_new" (:new_path :null :variant :null :overwrite_existing :null :current_path "/usr/Data_2/Programming/drupal-9.0.6/core/modules/aggregator/src/Entity/Feed.php"))
(apply #'phpactor-action-dispatch (phpactor--rpc (plist-get callback :action) parameters))
`

Thank you

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.