sid-srini opened a new pull request, #7747: URL: https://github.com/apache/netbeans/pull/7747
This configurable enhancement is based on end-user feedback received in oracle/javavscode#197 - This seems to be a matter of personal preference - It is not a reflection on the correctness of the default functionality. 1. Added a user preference for insertion of method parameters in code completions. - `"completion-insert-text-parameters"` - default value = `true` - Also available via: - ide/editor.lib2: `EditorPreferencesKeys.COMPLETION_INSERT_TEXT_PARAMETERS` - java/java.completion: `Utilities.isCompletionInsertTextParameters()` 2. Added disabling of the above preference from the LSP client via the client config key `PREFIX + "java.completion.disable.insertMethodParameters"` - Updation occurs in `TextDocumentServiceImpl.completion()` 3. Added an extra arg `insertTextParams` in the following interface methods with the default value `true`: - `JavaCompletionTask.ItemFactory`: - `createExecutableItem` - `createThisOrSuperConstructorItem` - `JavaCompletionTask.TypeCastableItemFactory`: - `createTypeCastableExecutableItem` 4. Invoked the above methods in `JavaCompletionTask` with this parameter value set by `Utilities.isCompletionInsertTextParameters()`. 5. Enhanced the implementations of the above methods in `JavaCompletionCollector` and `JavaCompletionItem` to insert text for method arguments when `insertTextParams` (or `!memberRef`). - The cursor would be placed inside the parentheses if it is _not_ a no-args method completion. 6. Added a follow-up LSP command to the completion item **"editor.action.triggerParameterHints"** for showing the signature help when not inserting text parameters. - This is a necessary guide for the user. - It would not be triggered without this addition, since the trigger character '(' is not typed by the user. 7. Unrelated minor fixes in `JavaCompletionCollector.ItemFactoryImpl`: - Added the default prefix (**"nbls"**) to the usages of the follow-up command **"java.complete.abstract.methods"**. - Without this, the command would not get launched by the client. - Added to the builder in `createExecutableItem()`, the instantiated follow-up command "nbls.java.complete.abstract.methods". -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: notifications-unsubscr...@netbeans.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: notifications-unsubscr...@netbeans.apache.org For additional commands, e-mail: notifications-h...@netbeans.apache.org For further information about the NetBeans mailing lists, visit: https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists