felixfbecker / php-language-server

PHP Implementation of the VS Code Language Server Protocol 🆚↔🖥
ISC License
1.15k stars 185 forks source link

Parameter hinting still coming when the cursor is outside parenthesis. #721

Open Nainabhandari8 opened 5 years ago

Nainabhandari8 commented 5 years ago

NOTE: -Download brackets from brackets.io page. -Install PHP7 as LSP features like diagnostic problem, find references, find symbols, jump to definition, code hints, parameter hints are only supported in PHP7.

Steps to reproduce: Step 1: Launch Brackets, open any php file. Step 2: Call any function and invoke parameter hints. (here, cursor is in between parenthesis, parameter hints will invoke when we type "(" after function name) Step 3: Move cursor outside parenthesis but pressing right arrow key and observe the behavior.

Actual Result: Parameter hints are still visible.

Expected Result: Parameter hints should not be shown when cursor is outside the parenthesis.

felixfbecker commented 5 years ago

The language server does not support parameter hints?

Nainabhandari8 commented 5 years ago

parameter_hints

felixfbecker commented 5 years ago

These are not provided by the language server

felixfbecker commented 5 years ago

Actually, they are. Forgot that feature was added. Could you please provide some logs of the LSP requests the client makes.

Nainabhandari8 commented 5 years ago

Basically we get valid parameter hints on a signatureHelp request even when the cursor position is just outside of the closing parentheses. The server should respond with empty result when we are outside of the function call scope.

This issue is easily reproducible in Brackets. Ctrl-Shift-Space triggers parameters hints for a given cursor position.



<?php

function hello($var, $var2) {

}
hello() //Place cursor just after hello(), and do Ctrl-Shift-Space, the server responds with parameter hints

?>