Migrate PHP to language-configuration
This commit is contained in:
parent
e7ae751e50
commit
354a014029
4 changed files with 21 additions and 24 deletions
19
extensions/php/language-configuration.json
Normal file
19
extensions/php/language-configuration.json
Normal 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"] }
|
||||
]
|
||||
|
||||
}
|
|
@ -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",
|
||||
|
|
|
@ -1,12 +0,0 @@
|
|||
{
|
||||
"comments": {
|
||||
"lineComment": "//", // "#"
|
||||
"blockComment": [ "/*", "*/" ]
|
||||
},
|
||||
"brackets": [
|
||||
["{", "}"],
|
||||
["[", "]"],
|
||||
["(", ")"]
|
||||
]
|
||||
|
||||
}
|
|
@ -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
|
||||
});
|
||||
}
|
Loading…
Reference in a new issue