Highlight and replace arguments in autocompleted functions in PyDev interpreter - eclipse

When I hit Ctrl-Alt-Enter in PyDev and begin typing a function name into the interpreter, PyDev helpfully offers a list of autocompletions. When I hit Enter, PyDev completes the function name and adds the parameter names, in parentheses. This would be great, except that the parameter names aren't highlighted, so I have to delete the parameters (or type an octothorpe) before I hit enter.
Is there a way either of making PyDev highlight the parameter names (ideally letting you tab to the next one, as it does in the editor) or of omitting them altogether? Having to manually delete the parameters defeats any efficiency gains from autocompletion.

Unfortunately this cannot be currently configured.
Still, you should be able to apply the completion with Ctrl+Enter (instead of only with Enter). That way the completion is applied without the arguments (nor the parenthesis -- which may not be 100% what you want) -- note that the same can be done in the PyDev editor, not only in the interactive console.
Please add this to the PyDev features tracker.

Related

Powershell 7.3.0 Tab completion not working

I've recently upgraded PowerShell to version 7.3.0 version and now, when I type a command, I see its suggestions like when I'm typing pip it adds list like in this image. Or when I type start of the command it suggests its full name.
The problem is that when I press Tab it doesn't complete the command, instead it just starts listing current directories, i.e. here is an image after pressing Tab once.
Also even when I start typing the full name of the command like pip li it still shows the ending, but when pressing Tab it just does nothing.
I expected this to complete the current command with the suggestion after Tab is pressed.
I've tried to google this problem but haven't found the exact same case I have with 7.3.0 version.
Just press -> (right arrow) key
If you want to change key bindings:
source: https://devblogs.microsoft.com/powershell/announcing-psreadline-2-1-with-predictive-intellisense/
Key Bindings for Predictions
Key bindings control cursor movement and additional features within the prediction. To support users running Predictive IntelliSense on multiple platforms, key bindings are user-settable from the command line or your profile script.
PSReadLine contains functions to navigate and accept predictions. As an example, to accept a displayed prediction, PSReadLine contains functions:
AcceptSuggestion – Accept the current inline suggestion
AcceptNextSuggestionWord – Accept the next word of the inline suggestion
AcceptSuggestion is built within ForwardChar, which by default is bound to RightArrow. Pressing RightArrow accepts an inline suggestion when the cursor is at the end of the current line.
AcceptNextSuggestionWord is built within the function ForwardWord, which can be bound with Ctrl+f by Set-PSReadLineKeyHandler -Chord "Ctrl+f" -Function ForwardWord. Pressing Ctrl+f accepts the next word of an inline suggestion when the cursor is at the end of current editing line.
As a user, you can bound other keys to AcceptSuggestion and AcceptNextSuggestionWord for similar functionalities. Search for ForwardCharAndAcceptNextSuggestionWord in SamplePSReadLineProfile.ps1 for an example to make RightArrow accept the next word from inline suggestion, instead of the whole suggestion line.
List of additional suggested key bindings defined in PSReadLine SamplePSReadLineProfile.ps1

viewing method signatures with parameter highlighting in NetBeans

When the cursor's positioned in the middle of an argument list (making a method call), is there a way to bring up the method's signature with the parameter that that the cursor is on highlighted? Ctrl-space (sort of) brings up the signature, but it includes the huge search list of everything else I can legally type right there, and it's up to me to count through the arguments and the parameters to figure out which one I'm lined up on. (that popup also disappears if I try to move to the next or previous argument).
I've had this struggle with compiled code, and worse with code as I type it in. I typically type the name of the object, then a dot, and then I wait for the signature list to pop up (that filters down as I type). When I see the signature I'm after, I auto-complete with tab or Enter, and then I always end up in a struggle. NB pastes in variable names that are usually about 99% wrong, and I try to navigate the little red, comma-triggered edit boxes, hoping the signature popup will stay in view while I struggle to edit, delete (and stop thinking about) all the (semantic) errors. I usually end up botching it and loose the precious signature window that highlights each parameter as I moved through the argument list.
Any way to get that thing back (with the parameter highlighting)? And/or make the red editing boxes go away? And/or block NB from populating with all the errors?
Super thankful for any help or tips!
Netbeans show popup with method signatures and popup with method documentation only when your cursor is placed at the name of a method. Popup is displayed automatically when writing method name or on demand if you press Ctrl+Space.
When your cursor is placed at the argument list, only parameter names from method signature are displayed in form of a small tooltip. You can force display of this tooltip by Ctrl+P. Unfortunately there is no way how to invoke popup with method documentation in this phase. Instead you will see documentation popups related to arguments which you will type into the method argument list. The only way to display method documentation again is to place the cursor back at the method name and press Ctrl+Space.
When you start writing a method name, popup with method signatures will emerge. When you select one of proposed method signatures by pressing Enter, Netbeans will autocomplete method name as well as its arguments. You find this uncomfortable, because names of autocompleted arguments are usually wrong. You can however easily navigate between autocompleted arguments using Tab and Shift+Tab and overwrite them as you like. Alternatively, you can use Tab instead of Enter when selecting method from method signatures popup. This way Netbeans will autocomplete only the name of the function, not its arguments.
Described Netbeans behavior applies to editing PHP code, and may differ slightly for other languages.

Eclipse Ctrl+Shift+D not working With Pydev

When Using Pydev on Eclipse, I wanted to bind Ctrl+Shift+D Copy Lines and Ctrl+D to Delete line. But when I do so, the Ctrl+Shift+D doesn't work.
I removed all the other bindings of Ctrl+Shift+D but it doesn't work.
Fun fact, if I choose Ctrl+Shift+C, it does work, so I'm wondering where is this key binding used.
The problem arrises only in Pydev, ie. when I open the file in Text editor the bindings work.
This was fixed for PyDev 6.3.3.
The problem was that there was a command bound to Ctrl+Shift+D which was not visible there because it wasn't properly categorized.
I fixed this in: https://github.com/fabioz/Pydev/commit/422a0bde1d1a3ac5c091c00e88368a3bc3c0dc5f
Note that you could still override it if at the keybindings dialog you created a command and put the 'When' as 'PyDev editor scope' (which defines when it's active -- it wouldn't work without this because the hidden action had a higher priority given that its scope was narrower).
See details at: https://www.brainwy.com/tracker/PyDev/906

Using IntelliJ IDE to autocomplete line and place semi-colon

In eclipse you can hit "enter" and the IDE will automatically take you to the end of the line and place a semicolon.
In IntelliJ, if you hit shift-enter you get similar behavior minus adding the semicolon. I have read and tried cntrl-shift-enter and you get the exact same behavior. However, that is such an awkward key combination to be using all the time, at least much more so than the one-button approach using Eclipse.
Any ideas?
IntelliJ autocomplete escape
In InteiJ IDEA use (Ctrl-Shift-Enter) for "Smart Autocomplete".
It will end the line "smartly" with a semicolon as you wish. It also works in a few different situations like IF statements of FOR loops.
Why don't you redo the key binding?
Go to: (spanner icon) Settings -> Keymap -> Complete Current Statement and rebind how you will (for example, ctrl-enter might suit you better).
Or there's also a default keymap set for Eclipse that you can choose. I'm not sure if it affects the complete-current-line action, but you could take a look.
you can also use ctrl+shift+space
if you want always have it just do this

Tab in Emacs-helm (anything) does not autocomplete with current best match

While trying to autocomplete a file (e.g. to open a file with C-x C-f) Emacs-helm shows a list of possible candidates.
If I then press Tab (which I would hope it would help me choose the first/closest match), I get the following in the minibuffer:
It looks like the minibuffer gets confused with escape characters, and it does not choose the file that I actually want to open (the top choice).
Helm requires this conceptual jump from the default Emacs completion, which is not so obvious:
You don't need to press a key to complete. The completion buffer refreshes
with new results after every input.
This is called "incremental" completion.
The normal tab functionality is not needed in "incremental"
completion. So tab was rebound to helm-select-action, which allows you to
choose an alternative action with the selection. But there is only one action
in read-file-name.
The error you're seeing could be clearer though, I've filed this issue on github.
Additionally, note Helm treats each space separated term as a filtering
regular expression. So, pressing space foo will filter
the current list down to those that contain foo in the name.