implicit keyword completion only for actual words (amending 73939a9b70a3);
authorwenzelm
Tue, 02 Aug 2016 21:04:52 +0200
changeset 63587 881e8e2cfec2
parent 63586 71ee1b8067cc
child 63588 d0e2bad67bd4
implicit keyword completion only for actual words (amending 73939a9b70a3);
src/Pure/General/completion.scala
src/Pure/Isar/outer_syntax.scala
--- a/src/Pure/General/completion.scala	Tue Aug 02 18:58:49 2016 +0200
+++ b/src/Pure/General/completion.scala	Tue Aug 02 21:04:52 2016 +0200
@@ -249,7 +249,7 @@
 
   /* word parsers */
 
-  private object Word_Parsers extends RegexParsers
+  object Word_Parsers extends RegexParsers
   {
     override val whiteSpace = "".r
 
--- a/src/Pure/Isar/outer_syntax.scala	Tue Aug 02 18:58:49 2016 +0200
+++ b/src/Pure/Isar/outer_syntax.scala	Tue Aug 02 21:04:52 2016 +0200
@@ -89,10 +89,11 @@
   {
     val keywords1 = keywords + (name, kind, tags)
     val completion1 =
-      completion.add_keyword(name).add_abbrevs(
-        if (Keyword.theory_block.contains(kind))
-          List((name, name + "\nbegin\n\u0007\nend"), (name, name))
-        else List((name, name)))
+      completion.add_keyword(name).
+        add_abbrevs(
+          (if (Keyword.theory_block.contains(kind)) List((name, name + "\nbegin\n\u0007\nend"))
+           else Nil) :::
+          (if (Completion.Word_Parsers.is_word(name)) List((name, name)) else Nil))
     new Outer_Syntax(keywords1, completion1, language_context, true)
   }