diff options
Diffstat (limited to 'src/lsp')
| -rw-r--r-- | src/lsp/server.zc | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/lsp/server.zc b/src/lsp/server.zc index 2587c3b..1608c4c 100644 --- a/src/lsp/server.zc +++ b/src/lsp/server.zc @@ -3407,11 +3407,13 @@ int do_code_actions(int i) { start = ca_start; while (start > 0 && (hid(dc(base, start - 1)) || dc(base, start - 1) == '.')) start--; dot = start; while (dot < ca_end && dc(base, dot) != '.') dot++; + // the error can sit on the qualifier alone: actor in actor.vector + if (dot == ca_end && dot < dsize[i] && dc(base, dot) == '.' && run.lib_file(hname) && !run.module_imported(hname)) { ca_add(hname, 0, 0); send(gen_code_actions); return 0; } if (dot < ca_end) { // rt.put_c without include rt needs only the include; Text.itoa without std is std.Text.itoa char* owner = rt.new(dot - start + 1); k = start; n = 0; while (k < dot) { owner[n] = dc(base, k); n++; k++; } owner[n] = 0; - if (run.module_known(owner) || run.module_loaded(owner)) { if (!run.module_imported(owner)) ca_add(owner, 0, 0); } + if (run.module_known(owner) || run.module_loaded(owner) || run.lib_file(owner)) { if (!run.module_imported(owner)) ca_add(owner, 0, 0); } else { char* dotted = rt.new(ca_end - start + 1); k = start; n = 0; while (k < ca_end) { dotted[n] = dc(base, k); n++; k++; } dotted[n] = 0; |
