Skip to content

Commit

Permalink
chore: remove workaround in widgets (#3105)
Browse files Browse the repository at this point in the history
This is a follow-up on #2964 that ~~updates stage0,~~ removes a
workaround ~~, and updates release notes.~~
  • Loading branch information
Vtec234 authored Dec 22, 2023
1 parent d1a15de commit 7c38649
Showing 1 changed file with 3 additions and 16 deletions.
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

0 comments on commit 7c38649

Please sign in to comment.