Commit graph

21 commits

Author SHA1 Message Date
Sebastian Ullrich
60a244e4f9 fix(frontends/lean,shell): fix file dependencies 2017-03-17 18:20:44 -07:00
Sebastian Ullrich
c46936d180 fix(frontends/lean/interactive): hard-code tactic pretty printing 2017-03-17 18:20:44 -07:00
Leonardo de Moura
cce88c6190 refactor(frontends/lean): interactive tactic support
After this commit, new interactice tactic classes can be added without
writing C++ code (see example: tests/lean/run/my_tac_class.lean).

The tactic_evaluator was simplified, and all the complexity has been
moved to tactic_notation, and lean code.

We can now inspect the intermediate states produced by the rewrite
tactic.

The function (@scope_trace _ line col thunk) can be used to position trace
messages produced by thunk. If line/col are not provided (i.e., we
just write (scope_trace thunk)), then line/col are filled with the
position of this term by the elaborator.

We can visualize the intermediate tactic states inside nested blocks
such as (try { ... })

The new infrastructure can be used to implement custom tactic_state
pretty printers.
2017-01-21 22:38:47 -08:00
Leonardo de Moura
c52be7e8c5 feat(frontends/lean,shell): autocompletion for ^.
@kha, I added autocompletion for ^. I try to elaborate the expression
before ^. using the local context provided by the parser.

The autocompletion only works if the type for the expression before ^. can be
inferred. This is a big limitation because this information cannot be
obtained in many cases. Here are examples that do not work:

  meta def proof_for (e : expr) : smt_tactic expr :=
  do cc ← to_cc_state, cc^.proof_for e
                         --^ does not work here

If we annotate cc with its type, it works:

  meta def proof_for (e : expr) : smt_tactic expr :=
  do cc : cc_state ← to_cc_state, cc^.proof_for e
                                    --^ works

We don't have typing information on the equation lhs at
autocompletion time. So, the following will not work

   private meta def mk_smt_goals_for (cfg : smt_config)
        : list expr → list smt_goal → list expr → tactic (list smt_goal × list expr)
   | []        sr tr := return (sr^.reverse, tr^.reverse)
                                  --^ does not work since
   | (tg::tgs) sr tr := ...
2017-01-17 19:27:59 -08:00
Leonardo de Moura
a3c7ca1501 feat(shell/completion): do not include internal attribute names in auto completion 2017-01-11 08:40:36 -08:00
Sebastian Ullrich
83bddce900 feat(frontends/lean/info_manager,shell/server,emacs/lean-type): info: provide more metadata
* docs: attributes, options, identifiers
* location: attributes, imports
2017-01-11 15:29:14 +01:00
Sebastian Ullrich
82bcdebf7c fix(shell/completion): remove duplicate completion candidates
VS Code does not automatically remove them
2017-01-10 14:42:48 -08:00
Leonardo de Moura
80d0b8d5f5 chore(library,shell): fix style 2017-01-10 09:00:17 -08:00
Sebastian Ullrich
3ae4d0fbee feat(shell/completion,emacs/lean-company): provide doc string and location with completion candidate 2017-01-10 16:19:32 +01:00
Sebastian Ullrich
481a217722 feat(shell/completion): prefer exact prefix matches for all completion modes 2017-01-10 12:25:33 +01:00
Sebastian Ullrich
cc3126e944 feat(frontends/lean,library/scoped_ext,shell): complete namespaces 2017-01-10 12:25:33 +01:00
Sebastian Ullrich
3c89a79144 feat(shell/completion): sort completions alphabetically (secondary) 2017-01-10 12:25:33 +01:00
Leonardo de Moura
b86aef1ff0 feat(shell/completion): do not show internal declarations 2017-01-06 14:14:43 -08:00
Leonardo de Moura
44ef2f4eeb feat(shell/completion): only filter class projections 2017-01-06 14:06:17 -08:00
Sebastian Ullrich
26e2aeec7a feat(frontends/lean,shell): complete attributes 2017-01-06 14:02:31 -08:00
Sebastian Ullrich
2816d3a036 feat(frontends/lean,shell): complete interactive tactics 2017-01-06 14:02:31 -08:00
Sebastian Ullrich
7040844f9a feat(frontends/lean/parser,shell): complete imports 2017-01-06 14:02:31 -08:00
Gabriel Ebner
90ab29d7a3 chore(CMakeLists): rename misleading LEAN_SERVER option 2017-01-05 18:08:59 -08:00
Sebastian Ullrich
98398b16f3 feat(frontends/lean,shell): implement completing options 2016-12-27 21:41:02 -08:00
Gabriel Ebner
45d0525e52 feat(shell,emacs): new lean server protocol 2016-12-06 17:14:29 -08:00
Gabriel Ebner
61b70a71ce refactor(shell/server): move auto-completion code to a separate file 2016-12-06 17:14:29 -08:00