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

Add Widget. #18

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 10 additions & 0 deletions src/lean_client/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,13 @@ class InfoSource:
file: Optional[str] = None


@dataclass
class Widget:
line: int
column: int
id: int


GoalState = NewType('GoalState', str)

@dataclass
Expand All @@ -178,6 +185,7 @@ class InfoRecord:
state: Optional[GoalState] = None
tactic_param_idx: Optional[int] = None
tactic_params: Optional[List[str]] = None
widget: Optional[Widget] = None

@classmethod
def from_dict(cls, dic):
Expand All @@ -187,6 +195,8 @@ def from_dict(cls, dic):
dic['type_'] = dic.pop('type')
if 'source' in dic:
dic['source'] = InfoSource(**dic.pop('source'))
if 'widget' in dic:
dic['widget'] = Widget(**dic.pop('widget'))
return cls(**dic)


Expand Down