Add php configs as initialization options for the language server

Included options:

* fileTypes - List of file types the language server should index
pull/77/head
Jürgen Steitz 2018-08-29 20:50:12 +02:00
parent 31cc5b78e9
commit 5206d4388a
2 changed files with 30 additions and 37 deletions

View File

@ -38,20 +38,34 @@
"workspaceContains:**/*.php" "workspaceContains:**/*.php"
], ],
"contributes": { "contributes": {
"configuration": { "configuration": {
"type": "object", "type": "object",
"title": "PHP IntelliSense", "title": "PHP IntelliSense",
"properties": { "properties": {
"phpIntelliSense.fileTypes": { "php.memoryLimit": {
"type": "array", "type": "string",
"default": [ "default": "4095M",
".php" "description": "The memory limit of the php language server. [Number][K|M|G]. Use '-1' to allow unlimited use of the RAM (default is 4G).",
], "pattern": "^\\d+[KMG]?$"
"description": "An array of file types which should be indexed by the language server." },
} "php.executablePath": {
} "type": [
} "string",
}, "null"
],
"default": null,
"description": "The path to a PHP 7+ executable."
},
"php.fileTypes": {
"type": [
"array"
],
"default": [".php"],
"description": "List of file types that should be indexed by the php language server. (Restart required)"
}
}
}
},
"main": "./out/extension", "main": "./out/extension",
"scripts": { "scripts": {
"build": "tsc -p .", "build": "tsc -p .",
@ -101,27 +115,5 @@
"assets": "php-intellisense.vsix" "assets": "php-intellisense.vsix"
} }
] ]
},
"contributes": {
"configuration": {
"type": "object",
"title": "PHP IntelliSense",
"properties": {
"php.memoryLimit": {
"type": "string",
"default": "4095M",
"description": "The memory limit of the php language server. [Number][K|M|G]. Use '-1' to allow unlimited use of the RAM (default is 4G).",
"pattern": "^\\d+[KMG]?$"
},
"php.executablePath": {
"type": [
"string",
"null"
],
"default": null,
"description": "The path to a PHP 7+ executable."
}
}
}
} }
} }

View File

@ -108,7 +108,8 @@ export async function activate(context: vscode.ExtensionContext): Promise<void>
configurationSection: 'php', configurationSection: 'php',
// Notify the server about changes to PHP files in the workspace // Notify the server about changes to PHP files in the workspace
fileEvents: vscode.workspace.createFileSystemWatcher('**/*.php') fileEvents: vscode.workspace.createFileSystemWatcher('**/*.php')
} },
initializationOptions: conf
}; };
// Create the language client and start the client. // Create the language client and start the client.