Migrate PHP to language-configuration

This commit is contained in:
Martin Aeschlimann 2016-07-21 19:57:02 +02:00
parent e7ae751e50
commit 354a014029
4 changed files with 21 additions and 24 deletions

View file

@ -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"] }
]
}

View file

@ -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",

View file

@ -1,12 +0,0 @@
{
"comments": {
"lineComment": "//", // "#"
"blockComment": [ "/*", "*/" ]
},
"brackets": [
["{", "}"],
["[", "]"],
["(", ")"]
]
}

View file

@ -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
});
}