From b1175e61cfc63a99893c98ed2c52d7546ec07f92 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrgen=20Steitz?= Date: Sat, 18 Feb 2017 01:29:15 +0100 Subject: [PATCH 1/7] Add configuration options --- package.json | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/package.json b/package.json index 130c30a..5b1e1f8 100644 --- a/package.json +++ b/package.json @@ -36,6 +36,21 @@ "activationEvents": [ "onLanguage:php" ], + "contributes": { + "configuration": { + "type": "object", + "title": "PHP IntelliSense", + "properties": { + "php.intellisense.fileTypes": { + "type": "array", + "default": [ + ".php" + ], + "description": "An array of file types which should be indexed by the language server." + } + } + } + }, "main": "./out/extension", "scripts": { "compile": "tsc -p .", From 59e6f2cc2f7047bf3990d7463ab546c89eb330da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrgen=20Steitz?= Date: Sat, 18 Feb 2017 01:29:47 +0100 Subject: [PATCH 2/7] Intialize language server with configuration options --- src/extension.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/extension.ts b/src/extension.ts index 6701735..027f460 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -97,7 +97,8 @@ export async function activate(context: vscode.ExtensionContext): Promise configurationSection: 'php' // Notify the server about file changes to composer.json files contain in the workspace // fileEvents: vscode.workspace.createFileSystemWatcher('**/composer.json') - } + }, + initializationOptions: conf.get('intellisense') }; // Create the language client and start the client. From 74be99d15703b16b810334b76e53491bc1bc4a4c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrgen=20Steitz?= Date: Sat, 4 Mar 2017 13:10:46 +0100 Subject: [PATCH 3/7] Update configuration section name --- package.json | 2 +- src/extension.ts | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index a177542..9ae40db 100644 --- a/package.json +++ b/package.json @@ -41,7 +41,7 @@ "type": "object", "title": "PHP IntelliSense", "properties": { - "php.intellisense.fileTypes": { + "phpIntelliSense.fileTypes": { "type": "array", "default": [ ".php" diff --git a/src/extension.ts b/src/extension.ts index 027f460..c178bc7 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -93,12 +93,12 @@ export async function activate(context: vscode.ExtensionContext): Promise protocol2Code: str => vscode.Uri.parse(str) }, synchronize: { - // Synchronize the setting section 'php' to the server - configurationSection: 'php' + // Synchronize the setting section 'phpIntelliSense' to the server + configurationSection: 'phpIntelliSense' // Notify the server about file changes to composer.json files contain in the workspace // fileEvents: vscode.workspace.createFileSystemWatcher('**/composer.json') }, - initializationOptions: conf.get('intellisense') + initializationOptions: vscode.workspace.getConfiguration('phpIntelliSense') }; // Create the language client and start the client. From 5206d4388aeaca7cbc11e7eb0fcbfc8c6a4201fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrgen=20Steitz?= Date: Wed, 29 Aug 2018 20:50:12 +0200 Subject: [PATCH 4/7] Add php configs as initialization options for the language server Included options: * fileTypes - List of file types the language server should index --- package.json | 64 +++++++++++++++++++++--------------------------- src/extension.ts | 3 ++- 2 files changed, 30 insertions(+), 37 deletions(-) diff --git a/package.json b/package.json index 3f8470c..9585ce5 100644 --- a/package.json +++ b/package.json @@ -38,20 +38,34 @@ "workspaceContains:**/*.php" ], "contributes": { - "configuration": { - "type": "object", - "title": "PHP IntelliSense", - "properties": { - "phpIntelliSense.fileTypes": { - "type": "array", - "default": [ - ".php" - ], - "description": "An array of file types which should be indexed by the language server." - } - } - } - }, + "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." + }, + "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", "scripts": { "build": "tsc -p .", @@ -101,27 +115,5 @@ "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." - } - } - } } } diff --git a/src/extension.ts b/src/extension.ts index fc9b83f..62e93d2 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -108,7 +108,8 @@ export async function activate(context: vscode.ExtensionContext): Promise configurationSection: 'php', // Notify the server about changes to PHP files in the workspace fileEvents: vscode.workspace.createFileSystemWatcher('**/*.php') - } + }, + initializationOptions: conf }; // Create the language client and start the client. From 53753ee74940df50dfd2d3e52fb24d83c30dfb4d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrgen=20Steitz?= Date: Wed, 29 Aug 2018 21:56:56 +0200 Subject: [PATCH 5/7] Add vscode config options * fileSizeLimit - Set maximum file size to index * excludeFiles - Exclude files and folders from indexing --- package.json | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/package.json b/package.json index 9585ce5..56904bb 100644 --- a/package.json +++ b/package.json @@ -62,6 +62,20 @@ ], "default": [".php"], "description": "List of file types that should be indexed by the php language server. (Restart required)" + }, + "php.fileSizeLimit": { + "type": [ + "string" + ], + "default": "150K", + "description": "The file size limit of the php language server. [Number][K|M|G]. Use '-1' to allow unlimited file size. (Restart required)" + }, + "php.excludeFiles": { + "type": [ + "array" + ], + "default": [], + "description": "Files and folders that should be excluded from indexing. (Restart required)" } } } From f2675ca489031bea66e9fceb788e9d441ad3fea2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrgen=20Steitz?= Date: Wed, 29 Aug 2018 23:06:16 +0200 Subject: [PATCH 6/7] Add validation pattern to file size limit config --- package.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 56904bb..e9c9639 100644 --- a/package.json +++ b/package.json @@ -68,7 +68,8 @@ "string" ], "default": "150K", - "description": "The file size limit of the php language server. [Number][K|M|G]. Use '-1' to allow unlimited file size. (Restart required)" + "description": "The file size limit of the php language server. [Number][K|M|G]. Use '-1' to allow unlimited file size. (Restart required)", + "pattern": "^\\d+[KMG]?$" }, "php.excludeFiles": { "type": [ From 7453e19acceac11a0aa45a1a6541752ddb0e9c42 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrgen=20Steitz?= Date: Fri, 31 Aug 2018 16:28:15 +0200 Subject: [PATCH 7/7] Upgrade vscode-languageclient to 3.5.1 for workspace/configuration support --- package.json | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index e9c9639..2990ceb 100644 --- a/package.json +++ b/package.json @@ -60,7 +60,9 @@ "type": [ "array" ], - "default": [".php"], + "default": [ + ".php" + ], "description": "List of file types that should be indexed by the php language server. (Restart required)" }, "php.fileSizeLimit": { @@ -107,7 +109,7 @@ "dependencies": { "mz": "^2.4.0", "semver": "^5.3.0", - "vscode-languageclient": "^3.0.3" + "vscode-languageclient": "^3.5.1" }, "commitlint": { "extends": [