From 52b7ee1acc0f56ed5ba8f0a8f1ccc986b6433c37 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Eduardo?= Date: Mon, 9 Aug 2021 21:05:15 -0300 Subject: [PATCH] Add initial scroll API --- .../Feature_LanguageSupport.re | 4 +++ src/Feature/LanguageSupport/Hover.re | 25 +++++++++++++++++-- 2 files changed, 27 insertions(+), 2 deletions(-) diff --git a/src/Feature/LanguageSupport/Feature_LanguageSupport.re b/src/Feature/LanguageSupport/Feature_LanguageSupport.re index 10618913e9..30fb732242 100644 --- a/src/Feature/LanguageSupport/Feature_LanguageSupport.re +++ b/src/Feature/LanguageSupport/Feature_LanguageSupport.re @@ -149,6 +149,10 @@ module Msg = { module Hover = { let show = Hover(Hover.(Command(Show))); + let scrollDown = Hover(Hover.(Command(ScrollDown))); + + let scrollDown = Hover(Hover.(Command(ScrollUp))); + let mouseHovered = location => Hover(Hover.MouseHovered(location)); let mouseMoved = location => Hover(Hover.MouseMoved(location)); diff --git a/src/Feature/LanguageSupport/Hover.re b/src/Feature/LanguageSupport/Hover.re index d732e89e14..815e95b45c 100644 --- a/src/Feature/LanguageSupport/Hover.re +++ b/src/Feature/LanguageSupport/Hover.re @@ -66,7 +66,9 @@ module IDGenerator = [@deriving show({with_path: false})] type command = - | Show; + | Show + | ScrollDown + | ScrollUp; [@deriving show({with_path: false})] type msg = @@ -140,6 +142,8 @@ let update = msg, ) => switch (msg) { + | Command(ScrollDown) + | Command(ScrollUp) | Command(Show) => switch (maybeBuffer) { | Some(buffer) => @@ -280,10 +284,27 @@ module Commands = { "editor.action.showHover", Command(Show), ); + + let scrollDown = + define( + ~category="Hover", + ~title="Scroll down", + "editor.action.scrollHoverDown", + Command(ScrollDown) + ) + + + let scrollUp = + define( + ~category="Hover", + ~title="Scroll up", + "editor.action.scrollHoverUp", + Command(ScrollUp) + ) }; module Contributions = { - let commands = Commands.[show]; + let commands = Commands.[show, scrollDown, scrollUp]; }; module Styles = {