Module uvls::ide::completion
source ยท Expand description
Handle Completion and code suggestions for IDEs
All things completion related happen in here, the process is roughly as follows:
- Find the current context using the latest draft and editor position
- Find good completions in this context
The completion context includes:
- Meta information on the cursor position eg. Are we currently in a path or an empty line etc.
- The semantic context eg. do we need a constraint or a number
- A optional path prefix and suffix. The suffix is used as a weight for completions using the jaro winkler distance, the prefix is a filter restricting possible completions.
To weigh completions we use a simple weight function with hand picked weights for parameters like length or type correctness
Structsยง
- Completion
Opt ๐ - Module
Path ๐ - TopN ๐
Enumsยง
- Completion
Kind ๐ - TextOP ๐
Staticsยง
- AVG_
WEIGH ๐T_ THRESHOLD - MAX_N ๐All things completion related happen in here, the process is roughly as follows:
- MIN_
WEIGHT ๐ - W_LEN ๐
- W_TYPE ๐
Functionsยง
- add_
group_ ๐keywords - add_
keywords ๐ - add_
lang_ ๐lvl_ boolean - add_
lang_ ๐lvl_ type - add_
logic_ ๐op - add_
numeric_ ๐op - add_
string_ ๐op - add_
top_ ๐lvl_ keywords - completion_
symbol ๐ - completion_
weight ๐ - encode_
float ๐ - estimate_
context ๐ - estimate_
env ๐ - make_
relativ_ ๐path - node_at ๐
- path_
len ๐ - position_
to_ ๐node - resolve_
name ๐