Closed Morgy93 closed 7 years ago
Of course I found a way right after posting this:
"body": [
"if (\\$_SERVER['REMOTE_ADDR'] == \"1234\") {",
" $0",
"}"
],
Works, but doesn't look right.
I leave it open so that someone can confirm if this is intended or not.
https://github.com/Microsoft/vscode/issues/25814#issuecomment-298842679 is correct. There is double escaping necessary: (1) escape $
in the snippet-syntax with an backslash \
and (2) escape \
with another backslash in the json-syntax. That make two backslashes
Call me crazy, but i am not able to escape $ character:
Things I tried so far:
"if (\$_SERVER['REMOTE_ADDR'] == \"1234\") {",
"Invalid escape character in string""if ($_SERVER['REMOTE_ADDR'] == \"1234\") {",
Not even shown +:"if ($$_SERVER['REMOTE_ADDR'] == \"1234\") {",
The cursor goes right between SERVER and ['REMOTE_ADDR'] (I don't want it there)"if (${1:$}_SERVER['REMOTE_ADDR'] == \"1234\") {",
It's a variable then and I also don't want the cursor there.I don't know other legit ways to get around this .. any help?