@@ -147,7 +147,7 @@ Go to Line
147147 Clear any selection and update the line and column status.
148148
149149Show Completions
150- Open a scrollable list allowing selection of keywords and attributes . See
150+ Open a scrollable list allowing selection of existing names . See
151151 :ref: `Completions <completions >` in the Editing and navigation section below.
152152
153153Expand Word
@@ -469,52 +469,58 @@ are restricted to four spaces due to Tcl/Tk limitations.
469469See also the indent/dedent region commands on the
470470:ref: `Format menu <format-menu >`.
471471
472-
473472.. _completions :
474473
475474Completions
476475^^^^^^^^^^^
477476
478- Completions are supplied for functions, classes, and attributes of classes,
479- both built-in and user-defined. Completions are also provided for
480- filenames.
481-
482- The AutoCompleteWindow (ACW) will open after a predefined delay (default is
483- two seconds) after a '.' or (in a string) an os.sep is typed. If after one
484- of those characters (plus zero or more other characters) a tab is typed
485- the ACW will open immediately if a possible continuation is found.
486-
487- If there is only one possible completion for the characters entered, a
488- :kbd: `Tab ` will supply that completion without opening the ACW.
489-
490- 'Show Completions' will force open a completions window, by default the
491- :kbd: `C - space ` will open a completions window. In an empty
492- string, this will contain the files in the current directory. On a
493- blank line, it will contain the built-in and user-defined functions and
494- classes in the current namespaces, plus any modules imported. If some
495- characters have been entered, the ACW will attempt to be more specific.
496-
497- If a string of characters is typed, the ACW selection will jump to the
498- entry most closely matching those characters. Entering a :kbd: `tab ` will
499- cause the longest non-ambiguous match to be entered in the Editor window or
500- Shell. Two :kbd: `tab ` in a row will supply the current ACW selection, as
501- will return or a double click. Cursor keys, Page Up/Down, mouse selection,
502- and the scroll wheel all operate on the ACW.
503-
504- "Hidden" attributes can be accessed by typing the beginning of hidden
505- name after a '.', e.g. '_'. This allows access to modules with
506- ``__all__ `` set, or to class-private attributes.
507-
508- Completions and the 'Expand Word' facility can save a lot of typing!
509-
510- Completions are currently limited to those in the namespaces. Names in
511- an Editor window which are not via ``__main__ `` and :data: `sys.modules ` will
512- not be found. Run the module once with your imports to correct this situation.
513- Note that IDLE itself places quite a few modules in sys.modules, so
514- much can be found by default, e.g. the re module.
515-
516- If you don't like the ACW popping up unbidden, simply make the delay
517- longer or disable the extension.
477+ Completions are supplied, when requested and available, for module
478+ names, attributes of classes or functions, or filenames. Each request
479+ method displays a completion box with existing names. (See tab
480+ completions below for an exception.) For any box, change the name
481+ being completed and the item highlighted in the box by
482+ typing and deleting characters; by hitting :kbd: `Up `, :kbd: `Down `,
483+ :kbd: `PageUp `, :kbd: `PageDown `, :kbd: `Home `, and :kbd: `End ` keys;
484+ and by a single click within the box. Close the box with :kbd: `Escape `,
485+ :kbd: `Enter `, and double :kbd: `Tab ` keys or clicks outside the box.
486+ A double click within the box selects and closes.
487+
488+ One way to open a box is to type a key character and wait for a
489+ predefined interval. This defaults to 2 seconds; customize it
490+ in the settings dialog. (To prevent auto popups, set the delay to a
491+ large number of milliseconds, such as 100000000.) For imported module
492+ names or class or function attributes, type '.'.
493+ For filenames in the root directory, type :data: `os.sep ` or
494+ data:`os.altsep ` immediately after an opening quote. (On Windows,
495+ one can specify a drive first.) Move into subdirectories by typing a
496+ directory name and a separator.
497+
498+ Instead of waiting, or after a box is closed, open a completion box
499+ immediately with Show Completions on the Edit menu. The default hot
500+ key is :kbd: `C - space `. If one types a prefix for the desired name
501+ before opening the box, the first match or near miss is made visible.
502+ The result is the same as if one enters a prefix
503+ after the box is displayed. Show Completions after a quote completes
504+ filenames in the current directory instead of a root directory.
505+
506+ Hitting :kbd: `Tab ` after a prefix usually has the same effect as Show
507+ Completions. (With no prefix, it indents.) However, if there is only
508+ one match to the prefix, that match is immediately added to the editor
509+ text without opening a box.
510+
511+ Invoking 'Show Completions', or hitting :kbd: `Tab ` after a prefix,
512+ outside of a string and without a preceding '.' opens a box with
513+ keywords, builtin names, and available module-level names.
514+
515+ When editing code in an editor (as oppose to Shell), increase the
516+ available module-level names by running your code
517+ and not restarting the Shell thereafter. This is especially useful
518+ after adding imports at the top of a file. This also increases
519+ possible attribute completions.
520+
521+ Completion boxes intially exclude names beginning with '_' or, for
522+ modules, not included in '__all__'. The hidden names can be accessed
523+ by typing '_' after '.', either before or after the box is opened.
518524
519525.. _calltips :
520526
0 commit comments