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

feat: necessary information for tooltips on options in code #43

Merged
merged 1 commit into from
Sep 4, 2024
Merged
Show file tree
Hide file tree
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
4 changes: 2 additions & 2 deletions src/highlighting/SubVerso/Highlighting/Code.lean
Original file line number Diff line number Diff line change
Expand Up @@ -188,8 +188,8 @@ def infoKind [Monad m] [MonadLiftT IO m] [MonadMCtx m] [MonadEnv m]
| .ofTermInfo termInfo => termInfoKind ids ci termInfo
| .ofFieldInfo fieldInfo => some <$> fieldInfoKind ci fieldInfo
| .ofOptionInfo oi =>
let docs ← findDocString? (← getEnv) oi.declName
pure <| some <| .option oi.declName docs
let doc := (← getOptionDecls).find? oi.optionName |>.map (·.descr)
pure <| some <| .option oi.optionName oi.declName doc
| .ofCompletionInfo _ => pure none
| .ofTacticInfo _ => pure none
| _ =>
Expand Down
4 changes: 2 additions & 2 deletions src/highlighting/SubVerso/Highlighting/Highlighted.lean
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ inductive Token.Kind where
| const (name : Name) (signature : String) (docs : Option String)
| var (name : FVarId) (type : String)
| str (string : String)
| option (name : Name) (docs : Option String)
| option (name : Name) (declName : Name) (docs : Option String)
| docComment
| sort
| unknown
Expand All @@ -56,7 +56,7 @@ instance : Quote Token.Kind where
quote
| .keyword n occ docs => mkCApp ``keyword #[quote n, quote occ, quote docs]
| .const n sig docs => mkCApp ``const #[quote n, quote sig, quote docs]
| .option n docs => mkCApp ``option #[quote n, quote docs]
| .option n d docs => mkCApp ``option #[quote n, quote d, quote docs]
| .var (.mk n) type => mkCApp ``var #[mkCApp ``FVarId.mk #[quote n], quote type]
| .str s => mkCApp ``str #[quote s]
| .docComment => mkCApp ``docComment #[]
Expand Down
Loading