File: idlw-complete-structtag.el.html

Completion of structure tags can be done automatically in the shell, since the list of tags can be determined dynamically through interaction with IDL.

Completion of structure tags in a source buffer is highly ambiguous since you never know what kind of structure a variable will hold at runtime. To make this feature useful in source buffers, we need a special assumption/convention. We will assume that the structure is defined in the same buffer and directly assigned to the correct variable. This is mainly useful for applications in which there is one main structure which contains a large amount of information (and many tags). For example, many widget applications define a "state" structure that contains all important data about the application. The different routines called by the event handler then use this structure. If you use the same variable name for this structure throughout your application (a good idea for many reasons), IDLWAVE can support completion for its tags.

This file is a completion plugin which implements this kind of completion. It is also an example which shows how completion plugins should be programmed.

New versions of IDLWAVE, documentation, and more information available from:
                https://github.com/jdtsmith/idlwave

INSTALLATION
============
Load it with the following line in your init file:

  (with-eval-after-load 'idlwave
    (require 'idlw-complete-structtag))

DESCRIPTION
===========
Suppose your IDL program contains something like

    myvar = state.a*

where the star marks the cursor position. If you now press the completion key M-TAB, IDLWAVE searches the current file for a structure definition

  state = {tag1:val1, tag2:val2, ...}

and offers the tags for completion.

In the idlwave shell, idlwave sends a "print,tag_names()" for the variable to idl and determines the current tag list dynamically.

Notes
-----
 - The structure definition assignment "state = {...}" must use the
   same variable name as the completion location "state.*".
 - The structure definition must be in the same file.
 - The structure definition is searched backwards and then forward
   from the current position, until a definition with tags is found.
 - The file is parsed again for each new completion variable and location.
 - You can force an update of the tag list with the usual command
   to update routine info in IDLWAVE: C-c C-i

Defined variables (1)

idlwave-structtag-struct-locationThe location of the structure definition, for help display.

Defined functions (7)

idlwave-complete-structure-tag()
idlwave-complete-structure-tag-get-tags-from-help()
idlwave-complete-structure-tag-help(MODE WORD)
idlwave-complete-structure-tag-query-shell(VAR)
idlwave-prepare-structure-tag-completion(VAR)
idlwave-sintern-structtag(NAME &optional SET)
idlwave-structtag-reset()

Defined faces (0)