aboutsummaryrefslogtreecommitdiffhomepage
path: root/ide
diff options
context:
space:
mode:
authorGravatar Maxime Dénès <mail@maximedenes.fr>2017-04-24 14:15:17 +0200
committerGravatar Maxime Dénès <mail@maximedenes.fr>2017-04-24 14:15:17 +0200
commitecff95e24e69a8761f7aa154312fdcc01f99766b (patch)
tree79dfdcab3df0a1a645fdaf1a6e3f6d8c7f8b1013 /ide
parent3e50f0a7e356b2fcb1cf22ec95549a7322e4e447 (diff)
parente1637bef0f38b46840f146f146ddd4f17bec129a (diff)
Merge PR#580: [ide] Fix #5482 "location for query commands" in IDE.
Diffstat (limited to 'ide')
-rw-r--r--ide/ide_slave.ml11
1 files changed, 6 insertions, 5 deletions
diff --git a/ide/ide_slave.ml b/ide/ide_slave.ml
index 4b95e983d..bf86db08f 100644
--- a/ide/ide_slave.ml
+++ b/ide/ide_slave.ml
@@ -63,25 +63,26 @@ let is_known_option cmd = match cmd with
(** Check whether a command is forbidden in the IDE *)
-let ide_cmd_checks (loc,ast) =
+let ide_cmd_checks ~id (loc,ast) =
let user_error s = CErrors.user_err ~loc ~hdr:"CoqIde" (str s) in
+ let warn msg = Feedback.(feedback ~id (Message (Warning, Some loc, strbrk msg))) in
if is_debug ast then
user_error "Debug mode not available in the IDE";
if is_known_option ast then
- Feedback.msg_warning ~loc (strbrk "Set this option from the IDE menu instead");
+ warn "Set this option from the IDE menu instead";
if is_navigation_vernac ast || is_undo ast then
- Feedback.msg_warning ~loc (strbrk "Use IDE navigation instead");
+ warn "Use IDE navigation instead";
if is_query ast then
- Feedback.msg_warning ~loc (strbrk "Query commands should not be inserted in scripts")
+ warn "Query commands should not be inserted in scripts"
(** Interpretation (cf. [Ide_intf.interp]) *)
let add ((s,eid),(sid,verbose)) =
let pa = Pcoq.Gram.parsable (Stream.of_string s) in
let loc_ast = Stm.parse_sentence sid pa in
- ide_cmd_checks loc_ast;
let newid, rc = Stm.add ~ontop:sid verbose loc_ast in
let rc = match rc with `NewTip -> CSig.Inl () | `Unfocus id -> CSig.Inr id in
+ ide_cmd_checks newid loc_ast;
(* TODO: the "" parameter is a leftover of the times the protocol
* used to include stderr/stdout output.
*