implicit keyword completion only for actual words (amending 73939a9b70a3);
authorwenzelm
Tue Aug 02 21:04:52 2016 +0200 (2016-08-02)
changeset 63587881e8e2cfec2
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
     1.1 --- a/src/Pure/General/completion.scala	Tue Aug 02 18:58:49 2016 +0200
     1.2 +++ b/src/Pure/General/completion.scala	Tue Aug 02 21:04:52 2016 +0200
     1.3 @@ -249,7 +249,7 @@
     1.4  
     1.5    /* word parsers */
     1.6  
     1.7 -  private object Word_Parsers extends RegexParsers
     1.8 +  object Word_Parsers extends RegexParsers
     1.9    {
    1.10      override val whiteSpace = "".r
    1.11  
     2.1 --- a/src/Pure/Isar/outer_syntax.scala	Tue Aug 02 18:58:49 2016 +0200
     2.2 +++ b/src/Pure/Isar/outer_syntax.scala	Tue Aug 02 21:04:52 2016 +0200
     2.3 @@ -89,10 +89,11 @@
     2.4    {
     2.5      val keywords1 = keywords + (name, kind, tags)
     2.6      val completion1 =
     2.7 -      completion.add_keyword(name).add_abbrevs(
     2.8 -        if (Keyword.theory_block.contains(kind))
     2.9 -          List((name, name + "\nbegin\n\u0007\nend"), (name, name))
    2.10 -        else List((name, name)))
    2.11 +      completion.add_keyword(name).
    2.12 +        add_abbrevs(
    2.13 +          (if (Keyword.theory_block.contains(kind)) List((name, name + "\nbegin\n\u0007\nend"))
    2.14 +           else Nil) :::
    2.15 +          (if (Completion.Word_Parsers.is_word(name)) List((name, name)) else Nil))
    2.16      new Outer_Syntax(keywords1, completion1, language_context, true)
    2.17    }
    2.18