From 859646f628ff0d99e6afe835ba0a48faed2972af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Istv=C3=A1n=20Donk=C3=B3?= Date: Fri, 8 Nov 2024 14:09:17 +0100 Subject: [PATCH] feat(scala): add key for worksheet hover (#3853) ## What is this PR for? Worksheet hovering is a useful feature provided by `metals` to see not just the end result, but also the entire output of a function call, as can be seen here for example: https://youtu.be/Jv9B1crzpWM?t=16m20s Having a default key assigned not only makes it more convenient, but also increases discoverability. (I was also contemplating `mK` as the mapping to be in line with `K` for regular hover, but I wasn't convinced that the consistency is worth the extra keypress.) ## Checklist - [x] I've read the [CONTRIBUTING](https://github.com/LazyVim/LazyVim/blob/main/CONTRIBUTING.md) guidelines. --- lua/lazyvim/plugins/extras/lang/scala.lua | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lua/lazyvim/plugins/extras/lang/scala.lua b/lua/lazyvim/plugins/extras/lang/scala.lua index 3b159697..791b515a 100644 --- a/lua/lazyvim/plugins/extras/lang/scala.lua +++ b/lua/lazyvim/plugins/extras/lang/scala.lua @@ -34,6 +34,13 @@ return { end, desc = "Metals compile cascade", }, + { + "mh", + function() + require("metals").hover_worksheet() + end, + desc = "Metals hover worksheet", + }, }, init_options = { statusBarProvider = "off",