@@ -31,14 +31,18 @@ local inlay_hints = {}
31
31
32
32
local inlay_hints_ns = vim .api .nvim_create_namespace (' lsp_extensions.inlay_hints' )
33
33
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
36
40
37
41
inlay_hints .get_callback = function (opts )
38
42
opts = opts or {}
39
43
40
44
local highlight = opts .highlight or " Comment"
41
- local prefix = opts .prefix or " || "
45
+ local prefix = opts .prefix or " > "
42
46
local aligned = opts .aligned or false
43
47
44
48
local only_current_line = opts .only_current_line
@@ -80,9 +84,9 @@ inlay_hints.get_callback = function(opts)
80
84
end
81
85
82
86
local text
83
- if aligned then
87
+ if aligned then
84
88
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 )
86
90
else
87
91
text = prefix .. hint .label
88
92
end
0 commit comments