New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
IDLE Autocomplete and Call Tips Do Not Pop Up on OS X with ActiveTcl 8.5.18 #68758
Comments
I recently upgraded to Python 2.7.10 on my MacOSX Yosemite computer. I also added a Python 3.4.3 installation. At the time I upgraded Tcl/Tk with ActiveTcl 8.5.18 as was suggested on the Python for MacOSX installation page. At this point, Autocomplete and Call Tips stopped popping up. I checked the preferences and it seemed to be turned on. The delay was set to 2000, so I changed that to 2, but nothing happened. Pressing <ctrl>-Spacebar and then using the down arrow key lets me cycle through the the available functions, but putting a dot after an object has no effect, and if I open parentheses, I get no tips. This is both in the IDLE Shell and Editor windows. I tried to redo everything by deleting all instances of Python from my drive. I reinstalled them, reloaded all packages, and Autocomplete and call tips still are not popping up. Is there any known issues or is there a workaround? Do I possibly need to add or change the new Tk path somewhere so that IDLE can find what it needs to popup autocomplete? Is there a way that I can initiate IDLE Autocomplete and Call Tips during the coding session to manually get them to work? I am somewhat new to Python, and I often rely on the autocomplete tips to remind me of what I need to do or what methods are available for an object. I really like IDLE but it is hard for me to use without this functionality. Any help would be greatly appreciated. Thank you, |
Thanks for the report. Taking a quick look at it, it appears that the problem was introduced with the most recently releases of ActiveTcl on OS X, 8.5.18 and 8.6.4. The autocomplete popups seem to work fine with the previous OS X release of ActiveTcl 8.5 (8.5.17) and with a MacPorts +quartz build of Tcl/Tk 8.6.3. I know that Kevin Walzer added a lot of fixes to the native OS X version of Tk that were first released with 8.6.4 and 8.5.18 and I think there have been additional fixes since then but are not yet in an official Tcl/Tk release. I'm cc-ing Kevin here; perhaps this will look familiar. As workarounds, if you have access to ActiveTcl 8.5.17, you could install that. Or, if you feel up to building your own framework version of 8.5.17, you could try that. You *could* also remove 8.5.18 and fall back to the Apple-supplied system Tcl/Tk 8.5.9 but I would strongly recommend not doing that as that version has critical problems, most notably the bug that causes Tk to crash (and, thus, crash IDLE with no opportunity for saving work) by typing multi-character compose codes in text boxes (like option-u on US keyboard layouts). So it should first be established whether this problem still exists with current trunk of 8.5.x (for that's what the OS X installers link with) and, if so, try to get a new version of ActiveTcl 8.5.x released. It might help to file an issue with ActiveState (https://bugs.activestate.com/index.cgi) and/or on the Tk issue tracker (https://core.tcl.tk/tk/reportlist). And it would be even better to have a pure Tcl/Tk test case using wish so that Python is not a factor. Unfortunately, I'm not going to have much time for the immediate future to shepherd that activity. |
Where in the IDLE source code tree is this code housed? Is it possible to provide a Python script that reproduces the issue? |
Thank you for the reply. I raised a bug with ActiveState. I am a Community User, so I can't access prior builds of ActiveTcl, and I am no where near competent enough to build up a framework. |
Kevin, I think that Autocomplete is implemented as an IDLE extension in: and configured in: Perhaps someone could try to reduce it to smaller test case; I will likely not have time to work on it myself for the immediate future. Tal, can you reproduce this issue when using ActiveTcl 8.5.18? |
More tests might help pin down the bug. Here is the complete config for completions. Notes: config-extensions.def is initially opened and generically processed in various methods of configHandler.IdleConf, and on request, the config-extentions section of EditorWindow.py. cfgBindings can be (sensibly) reconfigured, the others not. Names that follow, before '=', become pseudoevents handles by methods in the Alessandro, you said <Control-Key-space> works, <KeyRelease-period> does not. How about <Key-Tab> and <KeyRelease-(back)slash>. The latter pair work within path strings when the preceding chars begin a path that exist on your system. For instance, on Win 7, './ lists options in the current directory. I have no idea why KeyRelease instead of Key is used above and below. There is no key equivalent of releasing a mouse button in a different location than where pressed. Kevin, could there be a bug with KeyRelease on Mac? Alessandro, you could test by making a backup of configextensions.def and removing 'Release' for 'period'. The calltip files are [CallTips] Alessandro, you said <KeyRelease-parenleft> does not work. How abut <Control-Key-backslash> (after '(') to open? Does <KeyRelease-parenright> close properly? I do not know what <KeyRelease-0> (zero) is about. It does not work for me. For both boxes, clicking on the box should also close. Does it? |
Hi Terry, I will try my best to answer your questions. To update you, I decided to completely uninstall the ActiveState frameworks from my Mac. This brought me back to the dreaded Apple version of Tcl/Tk 8.5.9 with the IDLE warning about it. At this point Autocomplete and Call Tips worked again. If I initialized a list and then typed a_list. then the pop up menu would appear for the methods associated with list. If I typed a_list.append( then the Call Tip with the docstring information for list.append would appear. (I didn't try some of the other methods that we talk about in the questions as I was not aware of them at the time). I then downloaded a new installer from ActiveState for Tcl/Tk 8.5.18 and ran the install. I tested IDLE again, and at this point the Autocomplete pop up menu does not display, and the Call Tips no longer appear when I open a methods parenthesis. Questions:
To expand on this, if I press <Control-Key-space> at the prompt of the IDLE shell or at a blank line in an editor screen the Up and Down arrow keys will cycle through any builtin functions, keyword arguments (mostly errors), or declared variables available, plus True and False.
------------------------ "Alessandro, you could test by making a backup of configextensions.def and removing 'Release' for 'period'."
------------------------ "Alessandro, you said <KeyRelease-parenleft> does not work. How abut <Control-Key-backslash> (after '(') to open? Does <KeyRelease-parenright> close properly?"
One thing to note, something is happening with <KeyRelease-0> after a closed parenthesis, it is just that nothing is visible. So if I enter a_list.append() and then press and release the 0 key and then press the Up or Down arrow key, the cursor is frozen in place for the first press. Then is starts to move with subsequent presses. It seems like IDLE is trying to get the Call Tip, but no window appears to display the information. ------------------------ "For both boxes, clicking on the box should also close. Does it?
Thank you for the reply and trying to find a solution. ~ A |
I did some followup on this today, and could reproduce it with a few lines of Tcl/Tk code. As Ned noted, it seems particular to the ActiveTcl build, as when I built my own 8.5.18 it also worked fine. (If you're curious, the thing that is failing is the MacWindowStyle call to set the window to type "help". If you use that, the window just doesn't show up. Oddly, other types, e.g. "utility" work properly). I tried various introspection techniques to see if I could detect that this problem had occurred from code, but no luck. As far as Tk was concerned, the window was there. Will send a message to tcl-core list regarding this. For reference, Tcl script to reproduce is: wm geometry . +32+32 |
I experimented with Mark's sample code (thanks for that, BTW), and found that the window with the "help" tag applied would display with this simple addition: raise .t I believe the equivalent call in Tinter is lift(), because raise() is for error handling? Perhaps someone can experiment with appropriate calls to lift() in the relevant sections of IDLE. The "help" style is excluded from becoming a frontmost window by default in OS X. Here is the relevant code in tkMacOSXWm.c:
Therefore, an explicit call to raise may be helpful in displaying the window. I realize that such calls are not present in the current IDLE code, and did not seem to be required previously--there likely was some change in recent Tk-Cocoa commits in event loop handling, memory management, window display, and drawing that caused this new bug to crop up. Tracking the actual source of the bug at the C level is likely to prove very difficult because there have been so many changes. However, since the fix at the script level is trivial, I do not think a major effort is necessary to step through the code at the C level. |
Yes, *raise* is a keyword and .lift() is the substitute. |
Awesome, thanks Kevin. Have attached calltip.patch. The extra lift() call doesn't seem to hurt on Windows or X11, so didn't make it conditional. |
Alessandro, would you have a chance to test this one line patch, which makes calltips work again on OS X? |
New changeset b5bc7e9dab77 by Terry Jan Reedy in branch '2.7': New changeset 6687630e201a by Terry Jan Reedy in branch '3.4': |
Added equivalent completion window patch. Would have preferred confirmation that Idle versions work, but 3.4.4rc1 is only a week away and I think having bug confirmed and fixed in tcl is enough to go with. |
This issue continues unfixed. After uninstalling ActiveTcl 8.5.18 and then installing ActiveTcl 8.5.17, IDLE completion and call tips work again. Tested with Python 3.5 and 3.4.1. |
My previous comment was incorrect, sorry. I thought that this issue was fixed in time for the release of Python 3.5, but it wasn't (fix was committed on Sep 26, two weeks after 3.5's release). My apologies. |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: