aboutsummaryrefslogtreecommitdiff
path: root/src/lsp/server.zc
diff options
context:
space:
mode:
Diffstat (limited to 'src/lsp/server.zc')
-rw-r--r--src/lsp/server.zc3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/lsp/server.zc b/src/lsp/server.zc
index 65137a6..6f4ce67 100644
--- a/src/lsp/server.zc
+++ b/src/lsp/server.zc
@@ -3486,7 +3486,8 @@ int gen_code_actions() {
if (!imported) { hov_text("include "); hov_text(p[1]); }
if (p[2]) { if (!imported) hov_text(" and "); hov_text("use "); hov_text(p[1]); hov_put('.'); hov_text(p[2]); }
ws("{\"title\":"); wjs(hov, hn); ws(",\"kind\":\"quickfix\",");
- if (single) ws("\"isPreferred\":true,");
+ // the runtime's own name wins over a library wrapper of it (rt.put_c over std.Io.put_c).
+ if (single || (p == ca_list && rt.eq_w(p[1], "rt"))) ws("\"isPreferred\":true,");
ws("\"edit\":{\"documentChanges\":[{\"textDocument\":{\"uri\":");
wjs(duri[ca_i], dulen[ca_i]); ws(",\"version\":"); wn(dver[ca_i]); ws("},\"edits\":[");
pc_reset(ca_i);