@@ -31,14 +31,18 @@ local inlay_hints = {}
3131
3232local inlay_hints_ns = vim .api .nvim_create_namespace (' lsp_extensions.inlay_hints' )
3333
34- -- vim.lsp.callbacks['rust-analyzer/inlayHints'] = callback
35- -- vim.lsp.callbacks['experimental/inlayHints'] = callback
34+ inlay_hints .request = function (opts , bufnr )
35+ vim .lsp .buf_request (bufnr or 0 , ' rust-analyzer/inlayHints' , inlay_hints .get_params (), inlay_hints .get_callback (opts ))
36+
37+ -- TODO: At some point, rust probably adds this?
38+ -- vim.lsp.buf_request(bufnr or 0, 'experimental/inlayHints', inlay_hints.get_params(), inlay_hints.get_callback(opts))
39+ end
3640
3741inlay_hints .get_callback = function (opts )
3842 opts = opts or {}
3943
4044 local highlight = opts .highlight or " Comment"
41- local prefix = opts .prefix or " || "
45+ local prefix = opts .prefix or " > "
4246 local aligned = opts .aligned or false
4347
4448 local only_current_line = opts .only_current_line
@@ -80,9 +84,9 @@ inlay_hints.get_callback = function(opts)
8084 end
8185
8286 local text
83- if aligned then
87+ if aligned then
8488 local line_length = # vim .api .nvim_buf_get_lines (bufnr , end_line , end_line + 1 , false )[1 ]
85- text = string.format (" %s | %s" , (" " ):rep (longest_line - line_length ), hint .label )
89+ text = string.format (" %s %s" , (" " ):rep (longest_line - line_length ), prefix .. hint .label )
8690 else
8791 text = prefix .. hint .label
8892 end
0 commit comments