diff --git a/extensions/php/package.json b/extensions/php/package.json index ac54a389342c2..d427587cdfb62 100644 --- a/extensions/php/package.json +++ b/extensions/php/package.json @@ -39,10 +39,10 @@ "type": "object", "order": 20, "properties": { - "php.builtInCompletions.enable": { + "php.suggest.basic": { "type": "boolean", "default": true, - "description": "%configuration.builtInCompletions.enable%" + "description": "%configuration.suggest.basic%" }, "php.validate.enable": { "type": "boolean", diff --git a/extensions/php/package.nls.json b/extensions/php/package.nls.json index ca608ff98533d..d03bf87cddee1 100644 --- a/extensions/php/package.nls.json +++ b/extensions/php/package.nls.json @@ -1,5 +1,5 @@ { - "configuration.builtInCompletions.enable": "Enable/disable built-in PHP completions.", + "configuration.suggest.basic": "Configures if the built-in HTML language suggestions are enabled. The support suggests PHP globals and variables.", "configuration.validate.enable": "Enable/disable built-in PHP validation.", "configuration.validate.executablePath": "Points to the PHP executable.", "configuration.validate.run": "Whether the linter is run on save or on type.", diff --git a/extensions/php/src/features/completionItemProvider.ts b/extensions/php/src/features/completionItemProvider.ts index 544be05374da7..a430aa3f15469 100644 --- a/extensions/php/src/features/completionItemProvider.ts +++ b/extensions/php/src/features/completionItemProvider.ts @@ -15,7 +15,7 @@ export default class PHPCompletionItemProvider implements CompletionItemProvider public provideCompletionItems(document: TextDocument, position: Position, token: CancellationToken): Promise { let result: CompletionItem[] = []; - let shouldProvideCompletionItems = workspace.getConfiguration('php').get('builtInCompletions.enable', true); + let shouldProvideCompletionItems = workspace.getConfiguration('php').get('suggest.basic', true); if (!shouldProvideCompletionItems) { return Promise.resolve(result); } diff --git a/extensions/php/src/features/hoverProvider.ts b/extensions/php/src/features/hoverProvider.ts index 08fc13a5df914..1e300e2fccd16 100644 --- a/extensions/php/src/features/hoverProvider.ts +++ b/extensions/php/src/features/hoverProvider.ts @@ -5,13 +5,18 @@ 'use strict'; -import { HoverProvider, Hover, MarkedString, TextDocument, CancellationToken, Position } from 'vscode'; +import { HoverProvider, Hover, MarkedString, TextDocument, CancellationToken, Position, workspace } from 'vscode'; import phpGlobals = require('./phpGlobals'); import { textToMarkedString } from './utils/markedTextUtil'; export default class PHPHoverProvider implements HoverProvider { public provideHover(document: TextDocument, position: Position, token: CancellationToken): Hover { + let enable = workspace.getConfiguration('php').get('suggest.basic', true); + if (!enable) { + return null; + } + let wordRange = document.getWordRangeAtPosition(position); if (!wordRange) { return; diff --git a/extensions/php/src/features/signatureHelpProvider.ts b/extensions/php/src/features/signatureHelpProvider.ts index 25615dface162..b52392cfca4ef 100644 --- a/extensions/php/src/features/signatureHelpProvider.ts +++ b/extensions/php/src/features/signatureHelpProvider.ts @@ -5,7 +5,7 @@ 'use strict'; -import { SignatureHelpProvider, SignatureHelp, SignatureInformation, CancellationToken, TextDocument, Position } from 'vscode'; +import { SignatureHelpProvider, SignatureHelp, SignatureInformation, CancellationToken, TextDocument, Position, workspace } from 'vscode'; import phpGlobals = require('./phpGlobals'); var _NL = '\n'.charCodeAt(0); @@ -70,6 +70,11 @@ class BackwardIterator { export default class PHPSignatureHelpProvider implements SignatureHelpProvider { public provideSignatureHelp(document: TextDocument, position: Position, token: CancellationToken): Promise { + let enable = workspace.getConfiguration('php').get('suggest.basic', true); + if (!enable) { + return null; + } + var iterator = new BackwardIterator(document, position.character - 1, position.line); var paramCount = this.readArguments(iterator);