LSP document symbols

This commit is contained in:
2026-03-07 21:33:12 -08:00
parent 90e36d8faf
commit 92ced8dcd2
6 changed files with 75 additions and 33 deletions

View File

@@ -127,25 +127,3 @@ deriveShow fc name = do
pure (left, Just right)
-- -- A description would be nice.
-- deriveShow : FC → QName → M Raw
-- deriveShow fc qn = do
-- top <- getTop
-- case lookup qn top : Maybe TopEntry of
-- Nothing => error {Raw} fc "Can't find \{show qn} in derive Show"
-- -- I want case split too... I need to tie the editor into the repl.
-- (Just (MkEntry fc name type (TCon _ conNames) eflags) ) => ?
-- (Just (MkEntry fc name type (Axiom) eflags) ) => ?
-- (Just (MkEntry fc name type (DCon _ _ _ _) eflags) ) => ?
-- (Just (MkEntry fc name type (Fn _) eflags) ) => ?
-- (Just (MkEntry fc name type (PrimTCon _) eflags) ) => ?
-- (Just (MkEntry fc name type (PrimFn _ _ _) eflags) ) => ?
-- (Just (MkEntry fc name type (PrimOp _) eflags) ) => ?
-- error fc "TODO"
-- HasFC as example of user-defined derivation (when we get to that)
-- SetFC would be nice, too.

View File

@@ -28,15 +28,19 @@ dumpEnv ctx =
go : List String -> Int -> List (Val × String × Val) -> List String -> M (List String)
go _ _ Nil acc = pure acc
go names k ((v, n, ty) :: xs) acc = if isVar k v
-- TODO - use Doc and add <+/> as appropriate to printing
then do
-- don't show the = bit for now. Lean folds it.
go names k ((v, n, ty) :: xs) acc = do
ty' <- quote ctx.lvl ty
go names (1 + k) xs (" \{n} : \{render 90 $ pprint names ty'}":: acc)
else do
v' <- quote ctx.lvl v
ty' <- quote ctx.lvl ty
go names (1 + k) xs (" \{n} = \{render 90 $ pprint names v'} : \{render 90 $ pprint names ty'}":: acc)
-- go names k ((v, n, ty) :: xs) acc = if isVar k v
-- then do
-- ty' <- quote ctx.lvl ty
-- go names (1 + k) xs (" \{n} : \{render 90 $ pprint names ty'}":: acc)
-- else do
-- v' <- quote ctx.lvl v
-- ty' <- quote ctx.lvl ty
-- go names (1 + k) xs (" \{n} = \{render 90 $ pprint names v'} : \{render 90 $ pprint names ty'}":: acc)
logMetas : List MetaEntry -> M Unit