Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: remove workaround in widgets #3105

Merged
merged 1 commit into from
Dec 22, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 3 additions & 16 deletions src/Lean/Widget/UserWidget.lean
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,6 @@ Authors: E.W.Ayers, Wojciech Nawrocki
import Lean.Elab.Eval
import Lean.Server.Rpc.RequestHandling

namespace Lean.Server
open Elab Command in
/-- Derive `Lean.Server.RpcEncodable` for a type.

TODO: remove after update-stage0 -/
elab "#mkrpcenc" n:ident : command => do
elabCommand <| ← `(
namespace $n
deriving instance Lean.Server.RpcEncodable for $n
end $n
)
end Lean.Server

namespace Lean.Widget
open Meta Elab

Expand Down Expand Up @@ -351,7 +338,7 @@ opaque evalUserWidgetDefinition [Monad m] [MonadEnv m] [MonadOptions m] [MonadEr

/-! ## Retrieving panel widget instances -/

#mkrpcenc WidgetInstance
deriving instance Server.RpcEncodable for WidgetInstance

/-- Retrieve all the `UserWidgetInfo`s that intersect a given line. -/
def widgetInfosAt? (text : FileMap) (t : InfoTree) (hoverLine : Nat) : List UserWidgetInfo :=
Expand All @@ -374,12 +361,12 @@ structure PanelWidgetInstance extends WidgetInstance where
but retained for backwards compatibility
with `UserWidgetDefinition`. -/
name? : Option String := none
#mkrpcenc PanelWidgetInstance
deriving Server.RpcEncodable

/-- Output of `getWidgets` RPC.-/
structure GetWidgetsResponse where
widgets : Array PanelWidgetInstance
#mkrpcenc GetWidgetsResponse
deriving Server.RpcEncodable

open Lean Server RequestM in
/-- Get the panel widgets present around a particular position. -/
Expand Down