diff options
author | Simon Van Casteren <simonvancasteren@localhost.localdomain> | 2019-12-13 10:58:11 +0100 |
---|---|---|
committer | Simon Van Casteren <simonvancasteren@localhost.localdomain> | 2019-12-13 11:46:57 +0100 |
commit | f2ada9d9761c3aa7575571fd93629b79350a1425 (patch) | |
tree | 4dd385ff8a2fd742a48ecb1db7d385574f6a679c /src/lsp.sml | |
parent | 8ef0d043574638a48c71b7c4c9844fc05973f13d (diff) |
Trial version of completing table fields
Diffstat (limited to 'src/lsp.sml')
-rw-r--r-- | src/lsp.sml | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/lsp.sml b/src/lsp.sml index 2d80479b..920f9f35 100644 --- a/src/lsp.sml +++ b/src/lsp.sml @@ -931,8 +931,19 @@ fun findMatchingStringInEnv (env: ElabEnv.env) (str: string): LspSpec.completion in (case List.map (fn (name, c) => (name, ElabOps.reduceCon env c)) filteredEs of [] => [] - | (name, (Elab.TRecord (Elab.CRecord (_, fields), _), _)) :: _ => + | (name, (Elab.TRecord (Elab.CRecord (_, fields), l2_), l1_)) :: _ => getCompletionsFromFields env (name ^ ".") (Substring.string str) fields + | (name, (* TODO this doesn't always work. I've only managed to get it working for tables in a different module *) + ( ( Elab.CApp + ( ( (Elab.CApp + ( ( Elab.CModProj (_, _, "sql_table") + , l4_) + , ( Elab.CRecord (_, fields) + , l3_))) + , l2_) + , _)) + , l1_)) :: _ => + (debug "!!"; getCompletionsFromFields env (name ^ ".") (Substring.string str) fields) | _ => []) end | _ => |