GithubHelp home page GithubHelp logo

Comments (6)

ejmr avatar ejmr commented on September 26, 2024

Sorry about the late reply. Off the top of my head I think php-auto-yasnippet-required-files needs to be a cons, e.g.:

(php-auto-yasnippet-required-files . (list "~/project/vendor/autoload.php"))

And if that's the case then I need to correct the example in the README.

from php-auto-yasnippets.

kostajh avatar kostajh commented on September 26, 2024

@ejmr perhaps related: I'm not seeing the error message that @krystalcode noted, but I don't get any output either. Weirdly, I can't seem to set the php-auto-yasnippet-required-files variable through M-x set-variable.

In my .dir-locals.el file at ~/src/myproject/.dir-locals.el, I have:

(php-auto-yasnippet-required-files . (list "~/src/myproject/vendor/autoload.php"))

If I run this command in my terminal:

php ~/.emacs.d/elpa/php-auto-yasnippets-20141128.1411/Create-PHP-YASnippet.php base_path --require-once ~/src/myproject/vendor/autoload.php

Then I get this output which is correct:

#key: base_path
#name: base_path
# --
base_path(${1:[$path = ]}

from php-auto-yasnippets.

ejmr avatar ejmr commented on September 26, 2024

@kostajh Thanks for the information. I'll see if I can replicate the problem on my end and (assuming I get the same issue) see if I can figure out a solution.

from php-auto-yasnippets.

shanavas786 avatar shanavas786 commented on September 26, 2024

Getting same error: tried ((php-mode . ((php-auto-yasnippet-required-files (list "~/project/vendor/autoload.php"))))) and ((php-mode . ((php-auto-yasnippet-required-files . (list "~/project/vendor/autoload.php"))))). No luck

from php-auto-yasnippets.

NateEag avatar NateEag commented on September 26, 2024

Hey, as the original author of the support for user-defined functions, I noticed the latest notification for this thread, and thought I'd see what's up.

It's been years since I actively used this library (not writing PHP these days), but I did discover the root issue here is that somehow, I submitted bogus instructions on setting .dir-locals.el.

To call functions in .dir-locals.el, you have to use the magic eval pseudo-variable.

Something like this should work a lot better:

((php-mode . ((eval . (setq-local php-auto-yasnippet-required-files
                     (list "~/project/vendor/autoload.php"))))))

and someone should update the example in the docs accordingly.

I haven't actually tested this - just verified that the code I pasted above does set the var correctly.

Hopefully this is some help.

from php-auto-yasnippets.

MarTango avatar MarTango commented on September 26, 2024

I think there was a problem with an invalid required filepath resulting in messed up hash tables.
The latest commit should fix this. (I'm not quite sure how, but it seems to have fixed it for me, something about errors not being handled properly?).

((php-mode . ((eval . (setq-local php-auto-yasnippet-required-files
                     (list "~/project/vendor/autoload.php"))))))

works for me

from php-auto-yasnippets.

Related Issues (10)

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.