microsoft / vscode

Visual Studio Code
https://code.visualstudio.com
MIT License
163.63k stars 29.04k forks source link

Cannot use "<?php" as user snippet prefix anymore #26275

Closed Morgy93 closed 7 years ago

Morgy93 commented 7 years ago
Extension Author Version
xml DotJoshJohnson 1.7.0
gc-excelviewer GrapeCity 1.1.15
beautify HookyQR 1.0.2
composer ikappas 0.5.0
format-indent Kasik96 1.3.0
php-docblocker neilbrayfield 1.0.0
vscode-docker PeterJausovec 0.0.14
vscode-icons robertohuertasm 7.6.0
cordova-tools vsmobile 1.2.7 ;

Steps to Reproduce:

  1. Create a user snippet with "<?php" prefix
  2. Try to use it on a blank new php file

It seems that you can now only use user snippets within <?php ... ?>, because all of my other snippets don't work outside of that.

egamma commented 7 years ago

It seems that you can now only use user snippets within <?php ... ?>, because all of my other snippets don't work outside of that.

Can you please include the user snippets you have defined and that do not work.

Morgy93 commented 7 years ago

@egamma Sure:

        "Test Stuff": {
        "prefix": "<?php",
        "body": [
            "insert me"
        ],
        "description": "Some desc"
    }
Morgy93 commented 7 years ago

Plus have a look at this:

image vs. image

jrieken commented 7 years ago

When compute snippets that show within IntelliSense we use the current word which is defined by your language and most likely just php (missing <?). That makes the snippet not be selected - it doesn't match for us. This is a bug, we should match on "overlap".

To workaround this you can use tab-completions or the 'Insert Snippet' command