summaryrefslogtreecommitdiffstats
path: root/struct.h
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2017-03-21 06:22:42 -0700
committerKaz Kylheku <kaz@kylheku.com>2017-03-21 06:22:42 -0700
commit7e2f1500f34098be4a0cc0b2130cffb3a729793b (patch)
tree18e9a0b5e4136d8379f583fdd2069748f6648ac8 /struct.h
parentc2dec325d87de8be8917e7b52f118f4664a9e13a (diff)
downloadtxr-7e2f1500f34098be4a0cc0b2130cffb3a729793b.tar.gz
txr-7e2f1500f34098be4a0cc0b2130cffb3a729793b.tar.bz2
txr-7e2f1500f34098be4a0cc0b2130cffb3a729793b.zip
listener: completion sensitive for slots and methods.
When completing .prefix[TAB], .(prefix[TAB] or .[prefix[TAB], restrict identifiers to the appropriate namespace. The former will report only symbols from the relevant package which are struct slots; the latter further restricts it to those which are static slots defined as functions. * lib.c (symbol_visible): Static function becomes extern. * lib.h (symbol_visible): Declared. * parser.c (find_matching_syms): par parameter is renamed kind and can hold additional values 'S' (slots) and 'M' (methods). New get_slot_syms function is used to fetch the slots, as necessary, instead of the visible syms, if the kind is 'S' or 'M'. The same loop as before (with the minor change of recognizing 'S' and 'M' also) performs the prefix matching. (provide_completions): Recognize . .( and .[ prefix, calculating the kind argument of find_matching_syms in a new way. * struct.c (get_slot_syms): New function. * struct.h (get_slot_syms): Declared. * txr.1: Add some notes about this under the description of completion. The full rules are not given though; let the user discover.
Diffstat (limited to 'struct.h')
-rw-r--r--struct.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/struct.h b/struct.h
index d7f30f0d..10f87f72 100644
--- a/struct.h
+++ b/struct.h
@@ -63,4 +63,5 @@ val super_method(val strct, val slotsym);
val uslot(val slot);
val umethod(val slot, struct args *);
val method_name(val fun);
+val get_slot_syms(val package, val is_current, val method_only);
void struct_init(void);