Skip to content

Commit

Permalink
Add suport for type on code selection.
Browse files Browse the repository at this point in the history
This adds in initial support, but this issue in Metals
should be merged in first: scalameta/metals#3178.

Closes scalameta#228
  • Loading branch information
ckipp01 committed Oct 3, 2021
1 parent ffc3df0 commit 08c7075
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions lua/metals.lua
Original file line number Diff line number Diff line change
Expand Up @@ -356,6 +356,13 @@ M.show_javap_verbose = function()
))
end

M.type_of_range = function()
local start = vim.api.nvim_buf_get_mark(0, "<")
local vend = vim.api.nvim_buf_get_mark(0, ">")
local range = vim.lsp.util.make_given_range_params(start, vend)
vim.lsp.buf_request(0, "textDocument/hover", range)
end

-- Since we want metals to be the entrypoint for everything, just for ensure that it's
-- easy to set anything for users, we simply include them in here and then expose them.
M.bare_config = setup.bare_config
Expand Down

0 comments on commit 08c7075

Please sign in to comment.