test_eq("`", "", None)[0:3],
test_instance.get_env(1, "")) (Env.LOCAL,
completion_env
Autocomplete helper: determine context of the token to be autocompleted
Adapted from the stata_kernel version (omitting mata-specific stuff).
Note the corner cases discussed here, but the commented out test cases below are not yet handled:
- github.com/kylebarron/language-stata/issues/90
- statalist.org/forums/forum/general-stata-discussion/general/1448244
CompletionEnv
CompletionEnv ()
Env
Env (value, names=None, module=None, qualname=None, type=None, start=1)
An enumeration.
CompletionEnv.get_env
CompletionEnv.get_env (code:str, r2chars:str, sc_delimiter)
Returns completions environment
Type | Details | |
---|---|---|
code | str | Right-truncated to cursor position |
r2chars | str | The two characters immediately after code , used to accurately determine rcomp |
sc_delimiter | ||
Returns | Tuple |
test_eq("*%b", "", None)[0:2],
test_instance.get_env(1)) (Env.MAGIC,
test_eq("gen time_tc = clock(datea", "", None)[0:2],
test_instance.get_env(20)) (Env.GENERAL,
test_eq("list var1-v", "", None)[0:2],
test_instance.get_env(10)) (Env.GENERAL,