src/Pure/General/completion.ML
changeset 55915 607948c90bf0
parent 55840 2982d233d798
child 55917 5438ed05e1c9
equal deleted inserted replaced
55914:c5b752d549e3 55915:607948c90bf0
     9   type T
     9   type T
    10   val names: Position.T -> (string * string) list -> T
    10   val names: Position.T -> (string * string) list -> T
    11   val none: T
    11   val none: T
    12   val reported_text: T -> string
    12   val reported_text: T -> string
    13   val report: T -> unit
    13   val report: T -> unit
       
    14   val suppress_abbrevs: string -> Markup.T list
    14 end;
    15 end;
    15 
    16 
    16 structure Completion: COMPLETION =
    17 structure Completion: COMPLETION =
    17 struct
    18 struct
    18 
    19 
    19 abstype T = Completion of {pos: Position.T, total: int, names: (string * string) list}
    20 abstype T = Completion of {pos: Position.T, total: int, names: (string * string) list}
    20 with
    21 with
       
    22 
       
    23 (* completion of names *)
    21 
    24 
    22 fun dest (Completion args) = args;
    25 fun dest (Completion args) = args;
    23 
    26 
    24 fun names pos names =
    27 fun names pos names =
    25   Completion
    28   Completion
    42     else ""
    45     else ""
    43   end;
    46   end;
    44 
    47 
    45 val report = Output.report o reported_text;
    48 val report = Output.report o reported_text;
    46 
    49 
       
    50 
       
    51 (* suppress short abbreviations *)
       
    52 
       
    53 fun suppress_abbrevs s =
       
    54   if not (Symbol.is_ascii_identifier s) andalso (length (Symbol.explode s) = 1 orelse s = "::")
       
    55   then [Markup.no_completion]
       
    56   else [];
       
    57 
    47 end;
    58 end;