From 354a014029681c92a3886588e7c02b8eb01748b5 Mon Sep 17 00:00:00 2001 From: Martin Aeschlimann Date: Thu, 21 Jul 2016 19:57:02 +0200 Subject: [PATCH] Migrate PHP to language-configuration --- extensions/php/language-configuration.json | 19 +++++++++++++++++++ extensions/php/package.json | 2 +- extensions/php/php.configuration.json | 12 ------------ extensions/php/src/phpMain.ts | 12 +----------- 4 files changed, 21 insertions(+), 24 deletions(-) create mode 100644 extensions/php/language-configuration.json delete mode 100644 extensions/php/php.configuration.json diff --git a/extensions/php/language-configuration.json b/extensions/php/language-configuration.json new file mode 100644 index 00000000000..52d8bd3401f --- /dev/null +++ b/extensions/php/language-configuration.json @@ -0,0 +1,19 @@ +{ + "comments": { + "lineComment": "//", // "#" + "blockComment": [ "/*", "*/" ] + }, + "brackets": [ + ["{", "}"], + ["[", "]"], + ["(", ")"] + ], + "autoClosingPairs": [ + { "open": "{", "close": "}", "notIn": ["string"] }, + { "open": "[", "close": "]", "notIn": ["string"] }, + { "open": "(", "close": ")", "notIn": ["string"] }, + { "open": "'", "close": "'", "notIn": ["string"] }, + { "open": "\"", "close": "\"", "notIn": ["string", "comment"] } + ] + +} \ No newline at end of file diff --git a/extensions/php/package.json b/extensions/php/package.json index 45bcc6afb14..53618fd8657 100644 --- a/extensions/php/package.json +++ b/extensions/php/package.json @@ -14,7 +14,7 @@ "extensions": [ ".php", ".php4", ".php5", ".phtml", ".ctp" ], "aliases": [ "PHP", "php" ], "mimetypes": ["application/x-php"], - "configuration": "./php.configuration.json" + "configuration": "./language-configuration.json" }], "grammars": [{ "language": "php", diff --git a/extensions/php/php.configuration.json b/extensions/php/php.configuration.json deleted file mode 100644 index 431ee4bc667..00000000000 --- a/extensions/php/php.configuration.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "comments": { - "lineComment": "//", // "#" - "blockComment": [ "/*", "*/" ] - }, - "brackets": [ - ["{", "}"], - ["[", "]"], - ["(", ")"] - ] - -} \ No newline at end of file diff --git a/extensions/php/src/phpMain.ts b/extensions/php/src/phpMain.ts index 56d41d39a44..3cb964d1e02 100644 --- a/extensions/php/src/phpMain.ts +++ b/extensions/php/src/phpMain.ts @@ -26,16 +26,6 @@ export function activate(context: ExtensionContext): any { // need to set in the extension host as well as the completion provider uses it. languages.setLanguageConfiguration('php', { - wordPattern: /(-?\d*\.\d\w*)|([^\-\`\~\!\@\#\%\^\&\*\(\)\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\?\s]+)/g, - - __characterPairSupport: { - autoClosingPairs: [ - { open: '{', close: '}' }, - { open: '[', close: ']' }, - { open: '(', close: ')' }, - { open: '"', close: '"', notIn: ['string'] }, - { open: '\'', close: '\'', notIn: ['string', 'comment'] } - ] - } + wordPattern: /(-?\d*\.\d\w*)|([^\-\`\~\!\@\#\%\^\&\*\(\)\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\?\s]+)/g }); } \ No newline at end of file