Commit graph

65 commits

Author SHA1 Message Date
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
Gabriel Ebner
7daefedf05 chore(shell/server): remove hard limit on number of reported tasks 2017-01-17 17:10:37 -08:00
Gabriel Ebner
a230c47178 feat(util/task_queue,emacs,*): highlight running tasks with different background color 2017-01-17 17:10:37 -08:00
Sebastian Ullrich
7b049e7d55 fix(shell/server): prevent empty prefix completion for declarations 2017-01-17 16:38:00 -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
cc3126e944 feat(frontends/lean,library/scoped_ext,shell): complete namespaces 2017-01-10 12:25:33 +01:00
Sebastian Ullrich
fb294f4415 chore(shell/server): info: skip "record" output field if null 2017-01-10 12:25:33 +01:00
Sebastian Ullrich
b04df04120 feat(frontends/lean): rework and simplify completion parsing, enabling completion of empty prefixes 2017-01-10 12:25:33 +01: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
Gabriel Ebner
f6b8eb6821 feat(util/task_queue): lazy tasks 2017-01-04 16:30:22 -08:00
Leonardo de Moura
2e15304f05 feat(frontends/lean): add support for smt_state in the info_manager 2017-01-04 14:23:48 -08:00
Sebastian Ullrich
98398b16f3 feat(frontends/lean,shell): implement completing options 2016-12-27 21:41:02 -08:00
Sebastian Ullrich
3e2d1de21a perf(shell/server,emacs): do not actually compute completions during preliminary 'complete' requests 2016-12-27 21:41:02 -08:00
Sebastian Ullrich
d228c24c81 feat(shell/server,emacs): autocompletion based on server-side parsing 2016-12-27 21:41:02 -08:00
Sebastian Ullrich
daf839e0d5 feat(frontends/lean,shell/server): report current goal anywhere within begin-end/by 2016-12-27 10:07:34 -08:00
Sebastian Ullrich
33ec940604 perf(shell/server): cancel previous 'info' task before starting a new one 2016-12-27 10:07:34 -08:00
Sebastian Ullrich
88adce1ec3 fix(shell/server): ignore exceptions during reparsing 2016-12-27 10:07:34 -08:00
Sebastian Ullrich
47264ef6fd fix(shell/server,emacs/lean-flycheck): do not report tiny tasks as current 2016-12-27 10:07:34 -08:00
Sebastian Ullrich
fa44dc60cb fix(shell/server): don't send out messages from reparsing 2016-12-27 10:07:34 -08:00
Sebastian Ullrich
5cb06ea912 perf(frontends/lean/parser): break at break_at_pos even if not on an interesting token 2016-12-27 10:07:34 -08:00
Sebastian Ullrich
c9a8c02fdc feat(emacs,frontends/lean/parser,shell/server): more accurate info command using server-side parsing 2016-12-27 10:07:34 -08:00
Gabriel Ebner
99fc13af98 refactor(library/module_mgr): cache olean imports as well 2016-12-20 10:15:19 -08:00
Gabriel Ebner
d89512b6fc fix(util/task_queue): fix undefined behavior with null references 2016-12-15 09:48:57 -08:00
Gabriel Ebner
1963c8650f feat(shell/server): support regions of interest consisting of multiple files 2016-12-12 12:40:40 -08:00
Gabriel Ebner
d5bca10af8 feat(shell/server,emacs): show currently executing task if even from another file 2016-12-12 12:40:40 -08:00
Gabriel Ebner
902df5d134 feat(shell/server,emacs): show list of currently running tasks 2016-12-12 12:40:40 -08:00
Leonardo de Moura
58768940e3 chore(shell/server): std::make_unique is a C++14 feature
I got a compilation error
2016-12-06 17:22:24 -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
Gabriel Ebner
ddf103a48d feat(shell/server): support multiple files 2016-12-06 17:14:29 -08:00
Gabriel Ebner
26f0325e9b fix(shell/server): do not fail if module parsing throws an exception 2016-12-02 08:47:46 -08:00
Gabriel Ebner
000d97a9a6 fix(frontends/lean/parser): wrap snapshot in shared_ptr 2016-11-30 11:27:02 -05:00
Gabriel Ebner
c3f72ec0d8 fix(library/module_mgr): do not copy module_info 2016-11-30 11:26:59 -05:00
Leonardo de Moura
d40e97b4bc chore(*): compilation errors, fix style, fix warnings 2016-11-29 11:35:01 -08:00
Gabriel Ebner
3ecfddcbd5 fix(*): fix build 2016-11-29 11:12:43 -08:00
Gabriel Ebner
e448e4e129 refactor(util/task_queue): merge module_task into task and cancel by position 2016-11-29 11:12:43 -08:00
Leonardo de Moura
0b2867d939 fix(shell/server): gcc compilation error 2016-11-29 11:12:43 -08:00
Gabriel Ebner
a8df381d20 feat(*): parallel compilation 2016-11-29 11:12:40 -08:00
Sebastian Ullrich
2a37611d1f feat(emacs): implement show-goal-at-pos using faster info manager 2016-11-10 15:17:15 -08:00
Sebastian Ullrich
1f9554a014 refactor(frontends/lean/info_manager): always pass column in requests 2016-11-08 08:37:41 -08:00
Sebastian Ullrich
ba1b6165e3 feat(frontends, shell): implement basic server 'info' command 2016-11-08 08:37:41 -08:00
Sebastian Ullrich
388b337f50 chore(frontends/lean/info_manager): make copyable and integrate into snapshots 2016-11-08 08:37:41 -08:00
Sebastian Ullrich
67017cecef chore(shell): add back info_manager from master and make it compile 2016-11-08 08:37:41 -08:00
Gabriel Ebner
e18370585d fix(frontends/lean/server): fix relative dependency lookups 2016-10-30 08:42:05 +08:00
Gabriel Ebner
e6f75f2e0f feat(shell/server,emacs/lean-mode): show-goal-at-pos 2016-10-21 15:42:29 -07:00
Sebastian Ullrich
ce28e1aedb fix(shell/server): let completion fall back to first (imports) snapshot 2016-10-16 22:13:44 -07:00