NamesMT / blade-php

[Blade Syntax for PHP] Visual Studio Code extension
MIT License
2 stars 0 forks source link

Blade comments instead of Html comments #3

Closed NsCRio closed 1 year ago

NsCRio commented 1 year ago

Hi,

I love this extension, I have to say it works very well, I just have a little problem, and I kindly ask (if feasible) to get it fixed. At the moment when you go to comment a piece of text with the shortcuts the comment method is set to HTML, is it possible to set it to Blade comments?

Schermata del 2023-02-22 10-02-03

NamesMT commented 1 year ago

Hi, I just published a new version that will correct the language config file and the comment used, but this will only works when the file is in blade language mode though, If you want a solution while working in PHP language mode, you could follow this stackoverflow answer to setup a snippet and the keybind to comment in blade's style

Example: php.json

{
    "Blade comment": {
        "prefix": "_$_SHORTCUTTED", // whatever trigger you want
        "body": [
            "{{-- ${TM_SELECTED_TEXT} --}}$0",
        ],
        "description": "Wraps selected texts inside a blade comment block"
    }
}

keybindings.json

[
    {
        "key": "ctrl+k b",
        "command": "editor.action.insertSnippet",
        "args": {
            "name": "Blade comment"
        },
        "when": "editorTextFocus"
    }
}
NsCRio commented 1 year ago

A thousand thanks. I appreciate your work.