Skip to content

Snippets broken in 1.107 #203

Discussion options

You must be logged in to vote

OK, I've verified that this works as long as you double-escape the $:

'.source.php':
   'Debug_Query':
     'prefix': 'debug_query'
     'body': 'echo \'<pre>DEBUG QUERY:: \'.print_r(\\$this->MODEL->debug_query(false,false,true),true).\'</pre>\';'

This is happening because the snippet body parser now recognizes $this as a variable just like, say, $TM_CURRENT_LINE. The LSP spec for snippets explicitly says that $s need to be escaped with backslashes. And the double escape is necessary because CSON string parsing uses backslash escapes, so it needs to treat that as a literal backslash so that it survives until the snippets package can consume it.

I regret not realizing that this would be a …

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@savetheclocktower
Comment options

Answer selected by croaker000
@croaker000
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants