equal
deleted
inserted
replaced
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; |