bhughes339 / vscode-replacerules

Search/replace rule support for Visual Studio Code
GNU General Public License v3.0
41 stars 13 forks source link

Do not change left parenthesis #24

Closed ahmeti closed 5 years ago

ahmeti commented 5 years ago

Hi, I'm trying to clean the left brackets. But that doesn't work :(

Do you have any ideas? Thank you.

String:

`UpdatedUser`.`name` AS `UpdatedUserName`
FROM ((((((((((`ai_accounts` 
`Account` left join `ai_option_items`
`Sector` on(((`Sector`.`company_id` = 
`Account`.`company_id`) and (`Se

Settings:

"replacerules.rules": {
    "Remove left parenthesis": {
        "find": "/\(+/",
        "replace": ""
    }
}

"replacerules.rulesets": {
    "Sql Beauty": {
        "rules": [
            "Remove left parenthesis",
        ]
    }
}
bhughes339 commented 5 years ago

Hi, the "find" parameter does not need the enclosing forward slashes. You also need to escape your backslash:

"replacerules.rules": {
    "Remove left parenthesis": {
        "find": "\\(+",
        "replace": ""
    }
}
ahmeti commented 5 years ago

It worked great. I'm sorry I wasted your time :( Thank you...