php-auto-yasnippets icon indicating copy to clipboard operation
php-auto-yasnippets copied to clipboard

Need help debugging

Open dhaley opened this issue 12 years ago • 11 comments

I installed your package following the README.

When I type 'preg_match' in a php file and they type 'C-c C-y', I get this error:

split-string: Wrong type argument: stringp, nil

This is my config:

https://gist.github.com/dhaley/5707041

Here is the message from emacs debug:

https://gist.github.com/dhaley/5707074

I'm using php mode 1.10 and my php-executable (5.3.13) is: /Applications/MAMP/bin/php/php5.3.13/bin/php

What might I be doing wrong?

dhaley avatar Jun 04 '13 15:06 dhaley

You're not doing anything wrong; your setup looks fine. The problem is a bug in my code. However, so far I have not been able to duplicate the bug because when I tried I discovered another bug on top of the one causing you problems. On that note, would you please run php "/Users/daha1836/.emacs.d/site-lisp/php-auto-yasnippets/Create-PHP-YASnippet.php" preg_match and paste the output? That will be helpful.

My apologies for the bugs, but thanks for the report. I'll try to have it fixed soon.

ejmr avatar Jun 05 '13 18:06 ejmr

Here is the output:

% php "/Users/daha1836/.emacs.d/site-lisp/php-auto-yasnippets/Create-PHP-YASnippet.php" preg_match #key: preg_match #name: preg_match #group: pcre

--

dhaley avatar Jun 06 '13 17:06 dhaley

No argument list comes at the end? The output should look like so:

#key: preg_match
#name: preg_match
#group: pcre
# --
preg_match(${1:$pattern,} ${2:$subject,} ${3:[&$subpatterns],} ${4:[$flags],} ${5:[$offset],})

ejmr avatar Jun 06 '13 23:06 ejmr

Sorry, I left off a line. Here it is:

% php "/Users/daha1836/.emacs.d/site-lisp/php-auto-yasnippets/Create-PHP-YASnippet.php" preg_match #key: preg_match #name: preg_match #group: pcre

--

preg_match(${1:$pattern,} ${2:$subject,} ${3:[&$subpatterns],} ${4:[$flags],} ${5:[$offset],})%

It looks like I have a '%' at the end of my shell output. Not sure if that matters.

dhaley avatar Jun 07 '13 15:06 dhaley

Thank you for the output. The percent character should not be a problem as I am guessing that is your shell prompt. The PHP script does not add a newline to the end of the output so the terminal prompt will immediately follow it. If that character is not your prompt though then that is a bug.

ejmr avatar Jun 07 '13 17:06 ejmr

Would you also please tell me the exit code of Create-PHP-YASnippet.php after you run it with the preg_match argument? The exit code should be zero, but if it is not then that will provide a better idea of the problem. My aplogies for having to ask you to help in this debugging since I cannot reproduce the error on my computer.

ejmr avatar Jun 07 '13 17:06 ejmr

The exit code is 0. Hope that helps.

dhaley avatar Jun 10 '13 16:06 dhaley

Sorry for the delay on this, but today I came across a bug which may be the cause of the problem. I can't say for certain, unfortunately, but hopefully it will help the problem you're having or at least shed some light on it. I just wanted to mention it so you wouldn't think I've dropped trying to resolve this issue.

ejmr avatar Jun 20 '13 23:06 ejmr

@dhaley If you still using the package would you please try the newly released v2.0.0? It contains a patch which (hopefully) addresses your issue.

ejmr avatar Aug 15 '13 18:08 ejmr

I upgraded to 2.0.0 but to no avail.

I still get this message:

https://gist.github.com/dhaley/6273834

Let me know if can still assist.

dhaley avatar Aug 19 '13 20:08 dhaley

Sorry to hear you're still running into the bug, but thank you for the helpful error output.

ejmr avatar Aug 19 '13 20:08 ejmr