@citisen/litearea 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (109) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +514 -0
  3. package/README.zh.md +362 -0
  4. package/dist/grammars.cjs +1228 -0
  5. package/dist/grammars.cjs.map +1 -0
  6. package/dist/grammars.js +1213 -0
  7. package/dist/grammars.js.map +1 -0
  8. package/dist/index.cjs +3103 -0
  9. package/dist/index.cjs.map +1 -0
  10. package/dist/index.js +3040 -0
  11. package/dist/index.js.map +1 -0
  12. package/dist/react.cjs +3032 -0
  13. package/dist/react.cjs.map +1 -0
  14. package/dist/react.js +3010 -0
  15. package/dist/react.js.map +1 -0
  16. package/dist/styles.cjs +453 -0
  17. package/dist/styles.cjs.map +1 -0
  18. package/dist/styles.css +432 -0
  19. package/dist/styles.js +447 -0
  20. package/dist/styles.js.map +1 -0
  21. package/dist/types/core/complete.d.ts +70 -0
  22. package/dist/types/core/complete.d.ts.map +1 -0
  23. package/dist/types/core/format.d.ts +34 -0
  24. package/dist/types/core/format.d.ts.map +1 -0
  25. package/dist/types/core/grammar.d.ts +14 -0
  26. package/dist/types/core/grammar.d.ts.map +1 -0
  27. package/dist/types/core/hover.d.ts +23 -0
  28. package/dist/types/core/hover.d.ts.map +1 -0
  29. package/dist/types/core/index.d.ts +12 -0
  30. package/dist/types/core/index.d.ts.map +1 -0
  31. package/dist/types/core/inspect.d.ts +34 -0
  32. package/dist/types/core/inspect.d.ts.map +1 -0
  33. package/dist/types/core/rank.d.ts +82 -0
  34. package/dist/types/core/rank.d.ts.map +1 -0
  35. package/dist/types/core/scan.d.ts +51 -0
  36. package/dist/types/core/scan.d.ts.map +1 -0
  37. package/dist/types/core/segments.d.ts +44 -0
  38. package/dist/types/core/segments.d.ts.map +1 -0
  39. package/dist/types/core/text.d.ts +113 -0
  40. package/dist/types/core/text.d.ts.map +1 -0
  41. package/dist/types/core/types.d.ts +604 -0
  42. package/dist/types/core/types.d.ts.map +1 -0
  43. package/dist/types/core/vocabulary.d.ts +82 -0
  44. package/dist/types/core/vocabulary.d.ts.map +1 -0
  45. package/dist/types/dom/create.d.ts +17 -0
  46. package/dist/types/dom/create.d.ts.map +1 -0
  47. package/dist/types/dom/editing.d.ts +89 -0
  48. package/dist/types/dom/editing.d.ts.map +1 -0
  49. package/dist/types/dom/editor.d.ts +366 -0
  50. package/dist/types/dom/editor.d.ts.map +1 -0
  51. package/dist/types/dom/index.d.ts +9 -0
  52. package/dist/types/dom/index.d.ts.map +1 -0
  53. package/dist/types/dom/mirror.d.ts +107 -0
  54. package/dist/types/dom/mirror.d.ts.map +1 -0
  55. package/dist/types/dom/overlay.d.ts +52 -0
  56. package/dist/types/dom/overlay.d.ts.map +1 -0
  57. package/dist/types/dom/popup.d.ts +95 -0
  58. package/dist/types/dom/popup.d.ts.map +1 -0
  59. package/dist/types/dom/support.d.ts +41 -0
  60. package/dist/types/dom/support.d.ts.map +1 -0
  61. package/dist/types/dom/tooltip.d.ts +39 -0
  62. package/dist/types/dom/tooltip.d.ts.map +1 -0
  63. package/dist/types/grammars/dshFont.d.ts +127 -0
  64. package/dist/types/grammars/dshFont.d.ts.map +1 -0
  65. package/dist/types/grammars/dshSentry.d.ts +84 -0
  66. package/dist/types/grammars/dshSentry.d.ts.map +1 -0
  67. package/dist/types/grammars/index.d.ts +3 -0
  68. package/dist/types/grammars/index.d.ts.map +1 -0
  69. package/dist/types/index.d.ts +15 -0
  70. package/dist/types/index.d.ts.map +1 -0
  71. package/dist/types/react/index.d.ts +91 -0
  72. package/dist/types/react/index.d.ts.map +1 -0
  73. package/dist/types/styles.d.ts +29 -0
  74. package/dist/types/styles.d.ts.map +1 -0
  75. package/docs/architecture.md +316 -0
  76. package/docs/completion.md +320 -0
  77. package/docs/grammar.md +823 -0
  78. package/package.json +105 -0
  79. package/scripts/browser-check.mjs +838 -0
  80. package/scripts/build-css.mjs +35 -0
  81. package/scripts/release.mjs +91 -0
  82. package/scripts/verify-package.mjs +253 -0
  83. package/src/core/complete.ts +286 -0
  84. package/src/core/format.ts +71 -0
  85. package/src/core/grammar.ts +40 -0
  86. package/src/core/hover.ts +129 -0
  87. package/src/core/index.ts +98 -0
  88. package/src/core/inspect.ts +198 -0
  89. package/src/core/rank.ts +317 -0
  90. package/src/core/scan.ts +720 -0
  91. package/src/core/segments.ts +185 -0
  92. package/src/core/text.ts +238 -0
  93. package/src/core/types.ts +681 -0
  94. package/src/core/vocabulary.ts +196 -0
  95. package/src/dom/create.ts +31 -0
  96. package/src/dom/editing.ts +213 -0
  97. package/src/dom/editor.ts +1143 -0
  98. package/src/dom/index.ts +46 -0
  99. package/src/dom/mirror.ts +305 -0
  100. package/src/dom/overlay.ts +106 -0
  101. package/src/dom/popup.ts +323 -0
  102. package/src/dom/support.ts +88 -0
  103. package/src/dom/tooltip.ts +112 -0
  104. package/src/grammars/dshFont.ts +1004 -0
  105. package/src/grammars/dshSentry.ts +742 -0
  106. package/src/grammars/index.ts +57 -0
  107. package/src/index.ts +122 -0
  108. package/src/react/index.tsx +248 -0
  109. package/src/styles.ts +529 -0
@@ -0,0 +1,604 @@
1
+ /** A half-open range of character offsets into the document. `to` is exclusive. */
2
+ export interface Range {
3
+ /** The first character, inclusive. */
4
+ from: number;
5
+ /** The character after the last one, exclusive. */
6
+ to: number;
7
+ }
8
+ /**
9
+ * The name a token is painted under.
10
+ *
11
+ * A scope is a plain string and the engine never interprets it: it becomes a CSS
12
+ * class (`litearea-scope-<scope>`), and a stylesheet decides what that looks
13
+ * like. Dots are kept as written so a grammar can group its own vocabulary
14
+ * (`value.color`, `value.shape`) and theme the group at once.
15
+ */
16
+ export type Scope = string;
17
+ /** How loudly a diagnostic speaks. Mirrors the four levels an editor shows. */
18
+ export type Severity = 'error' | 'warning' | 'info' | 'hint';
19
+ /** One painted span. `text` always equals `text.slice(from, to)`. */
20
+ export interface Token extends Range {
21
+ scope: Scope;
22
+ text: string;
23
+ /** Zero-based line number. */
24
+ line: number;
25
+ /** Zero-based column, counted in characters rather than in display width. */
26
+ column: number;
27
+ /**
28
+ * The scope of the innermost region this token sits inside, when it is inside
29
+ * one. A grammar's validator reads it to tell a word in a comment from the same
30
+ * word in the code around it.
31
+ */
32
+ region?: Scope;
33
+ }
34
+ /**
35
+ * A span the grammar marks for a reason of its own — VSCode calls these semantic
36
+ * tokens and they are deliberately not tokens here.
37
+ *
38
+ * The distinction earns its keep. A token is what the *characters* are; a
39
+ * decoration is what they *mean*, and the two change on different schedules. The
40
+ * font-query grammar paints `Geist Mono` as a family from the characters alone,
41
+ * but which family is *in effect* depends on the installed catalogue — the same
42
+ * characters mean something else on another machine. Painting that as a token
43
+ * would mean re-lexing the document whenever the catalogue changed; painting it
44
+ * as a decoration means recomputing one range list, which is what it is.
45
+ */
46
+ export interface Decoration extends Range {
47
+ /** The class suffix: the span is rendered as `litearea-dec-<kind>`. */
48
+ kind: string;
49
+ /**
50
+ * A short label for the mark, shown as the tooltip's heading.
51
+ *
52
+ * It is combined with whatever the grammar's `describe` says about the token rather than
53
+ * replacing it, because the two answer different questions: the mark says what the
54
+ * grammar concluded ("in effect: Geist Mono") and the description says what the token is
55
+ * (its faces, its weight). A hover that showed only one of them would always be missing
56
+ * the half the reader wanted.
57
+ */
58
+ title?: string;
59
+ }
60
+ /** A problem the grammar found, with the range that should be underlined. */
61
+ export interface Diagnostic extends Range {
62
+ severity: Severity;
63
+ message: string;
64
+ /**
65
+ * A stable machine-readable tag, so a host can react to a specific problem
66
+ * without matching on prose, and so tests can assert on meaning rather than on
67
+ * wording.
68
+ */
69
+ code?: string;
70
+ /** A second paragraph, shown under the message in a tooltip. */
71
+ detail?: string;
72
+ /** Who raised it. Defaults to the grammar id. */
73
+ source?: string;
74
+ }
75
+ /** What one word of a vocabulary explains about itself when the pointer rests on it. */
76
+ export interface VocabularyEntry {
77
+ /** A short signature line, shown first and emphasised. */
78
+ title?: string;
79
+ /** A dimmed line under the title. */
80
+ detail?: string;
81
+ /** The body text. Plain text: litearea does not render markdown. */
82
+ body?: string;
83
+ }
84
+ /**
85
+ * The words a rule may accept, resolved at scan time.
86
+ *
87
+ * A function is how a vocabulary that lives outside the document — the fonts
88
+ * actually installed, the states the host actually has — reaches the grammar
89
+ * without the grammar holding state of its own. It is called once per scan with
90
+ * the grammar's analysis, so a dynamic vocabulary costs one call, not one per
91
+ * token.
92
+ */
93
+ export type WordsSource<State = unknown> = readonly string[] | ResolvedVocabulary<State> | ((context: VocabularyContext<State>) => readonly string[]);
94
+ /** What a vocabulary resolution is allowed to look at. */
95
+ export interface VocabularyContext<State = unknown> {
96
+ text: string;
97
+ /** Whatever `Grammar.analyze` returned. */
98
+ state: State;
99
+ }
100
+ /**
101
+ * A vocabulary after {@link defineVocabulary} has filled in its defaults.
102
+ *
103
+ * It carries four facts that must agree — the word set, the scope a member is
104
+ * painted with, the message a non-member earns, and the documentation a member
105
+ * shows — which is exactly why they are declared together. Split across four
106
+ * places they drift; declared once they cannot.
107
+ */
108
+ export interface ResolvedVocabulary<State = unknown> {
109
+ readonly id: string;
110
+ /** Whether membership is case-sensitive. */
111
+ readonly caseSensitive: boolean;
112
+ /** Every member, in declaration order. */
113
+ resolve(context: VocabularyContext<State>): readonly string[];
114
+ /** Whether a word is a member. */
115
+ has(word: string, context: VocabularyContext<State>): boolean;
116
+ /** The scope a member is painted with. */
117
+ scopeFor(word: string): Scope;
118
+ /** The scope a non-member is painted with, when the vocabulary rejects one. */
119
+ readonly unknownScope: Scope | undefined;
120
+ /** The diagnostic a non-member earns, or `undefined` for silence. */
121
+ reject(word: string, context: VocabularyContext<State>): {
122
+ message: string;
123
+ severity: Severity;
124
+ code: string;
125
+ } | undefined;
126
+ /** What a member explains about itself, for hover. */
127
+ entryFor(word: string): VocabularyEntry | undefined;
128
+ /** How a word is written into the document when it is accepted. */
129
+ format(word: string): string;
130
+ }
131
+ /**
132
+ * Where a rule is allowed to match. Every predicate that is present must hold.
133
+ *
134
+ * The predicates are about *position*, not about the parse. That boundary is
135
+ * deliberate: a rule that could ask "am I inside a rule named running?" would
136
+ * make the highlighter a parser, and the whole point of `analyze` is that the
137
+ * parse happens once, in a function the grammar author can read and test.
138
+ */
139
+ export interface RuleContext {
140
+ /** Only when nothing but whitespace precedes it on its line. */
141
+ firstOnLine?: boolean;
142
+ /** Only when the nearest preceding token has one of these scopes. */
143
+ after?: readonly Scope[];
144
+ /** Only when the nearest preceding token does NOT have one of these scopes. */
145
+ notAfter?: readonly Scope[];
146
+ /** Only when the whole line matches. Anchored at the start. */
147
+ line?: RegExp;
148
+ /** Only when the caret-facing column is at least this many characters in. */
149
+ minColumn?: number;
150
+ /** Only when the column is at most this many characters in. */
151
+ maxColumn?: number;
152
+ /**
153
+ * Only when the character immediately before the match is not one of these.
154
+ * `prevNot: '\\w'` is the common case: it is how a keyword rule is stopped
155
+ * from matching the tail of a longer word.
156
+ */
157
+ prevNot?: string;
158
+ }
159
+ /** A scope is either fixed, or decided per match by a function. */
160
+ export type ScopeSpec<State = unknown> = Scope | ((match: RuleMatch<State>) => Scope);
161
+ /** What a scope function is told about the match it is naming. */
162
+ export interface RuleMatch<State = unknown> {
163
+ /** The matched text. */
164
+ text: string;
165
+ /** The document. */
166
+ source: string;
167
+ /** Where the match starts. */
168
+ from: number;
169
+ /** The capture groups, when the pattern had any. Index 0 is the whole match. */
170
+ groups: readonly (string | undefined)[];
171
+ /** Whatever `Grammar.analyze` returned. */
172
+ state: State;
173
+ }
174
+ /** A regular-expression token: the workhorse. */
175
+ export interface MatchRule<State = unknown> {
176
+ kind: 'match';
177
+ scope: ScopeSpec<State>;
178
+ /**
179
+ * Tried at the current position. The engine adds the sticky flag, so the
180
+ * pattern never has to be anchored by hand and can never skip ahead.
181
+ */
182
+ pattern: RegExp;
183
+ when?: RuleContext;
184
+ }
185
+ /**
186
+ * A vocabulary token: a set of words, matched as a unit.
187
+ *
188
+ * It is its own rule kind rather than sugar over `match` because a word has
189
+ * three properties a regex cannot express. It can be resolved at scan time from
190
+ * data outside the document; it can span several words when a name contains a
191
+ * space; and a word that is NOT in the set is a fact worth reporting, which is
192
+ * where most diagnostics come from.
193
+ */
194
+ export interface WordsRule<State = unknown> {
195
+ kind: 'words';
196
+ words: WordsSource<State>;
197
+ /** Overrides the vocabulary's own scope for this rule only. */
198
+ scope?: ScopeSpec<State>;
199
+ /**
200
+ * Allows one entry to span several words (`IBM Plex Mono`).
201
+ *
202
+ * The engine tries the longest span first and keeps the longest member it finds, so a
203
+ * catalogue holding both `IBM Plex` and `IBM Plex Mono` resolves the longer name. Words
204
+ * are separated by any run of whitespace that does not contain a newline; the separators
205
+ * are part of the matched span and are painted with the member's own scope.
206
+ *
207
+ * Setting `phrase` also stops a multi-word member being matched by the literal fallback,
208
+ * so `max` really is a cap rather than a suggestion.
209
+ */
210
+ phrase?: {
211
+ /**
212
+ * The most words one entry may span. Default 4, which covers every real font family in
213
+ * the shipped catalogue (`Source Han Serif SC` is four).
214
+ */
215
+ max?: number;
216
+ };
217
+ when?: RuleContext;
218
+ /**
219
+ * What to do with a word-shaped token that is not a member.
220
+ *
221
+ * Absent, the rule simply does not match and a later rule gets its turn —
222
+ * which is what a grammar wants when two vocabularies overlap. Present, the
223
+ * token is painted with `scope` and earns `message`, which is how a typo
224
+ * becomes a red underline instead of quietly falling through to plain text.
225
+ */
226
+ unknown?: {
227
+ scope?: Scope;
228
+ message?: string | ((word: string, context: RuleMatch<State>) => string);
229
+ severity?: Severity;
230
+ code?: string;
231
+ };
232
+ }
233
+ /**
234
+ * A delimited region: a block comment, a multi-line string, a heredoc.
235
+ *
236
+ * The engine scans for `end` from the end of `begin` and never re-enters the rule list in
237
+ * between (unless `transparent`), so the contents of a string cannot be mistaken for the
238
+ * language around it. `nested` widens that by one delimiter — the region may open inside
239
+ * itself — and no further. An `end` that never arrives runs the region to the end of the
240
+ * document and raises `unclosed`, because an unterminated block comment is a mistake and not
241
+ * an invitation to tint the rest of the file.
242
+ */
243
+ export interface RegionRule<State = unknown> {
244
+ kind: 'region';
245
+ /** The scope of the whole region when the other three are not given. */
246
+ scope?: ScopeSpec<State>;
247
+ /** The opening delimiter. */
248
+ begin: RegExp;
249
+ /** The closing delimiter, searched for rather than anchored. */
250
+ end: RegExp;
251
+ /** The scope of the opening delimiter. Defaults to `scope`. */
252
+ openScope?: ScopeSpec<State>;
253
+ /** The scope of the closing delimiter. Defaults to `scope`. */
254
+ closeScope?: ScopeSpec<State>;
255
+ /** The scope of what lies between. Defaults to `scope`. */
256
+ contentScope?: ScopeSpec<State>;
257
+ /**
258
+ * Whether the same rule may open again inside itself. Default `false`.
259
+ *
260
+ * Nesting and transparency are different things, and conflating them is how a block
261
+ * comment stops being a comment: a language whose comments nest wants the delimiters
262
+ * matched and everything else inside treated as prose. So this flag adds ONLY the
263
+ * delimiter — the contents stay opaque unless `transparent` says otherwise.
264
+ */
265
+ nested?: boolean;
266
+ /**
267
+ * Whether the grammar's other rules also apply inside this region. Default `false`.
268
+ *
269
+ * The flag for a region that is not prose: a template in another language, or a string
270
+ * with escapes to colour. It implies nesting, because the rule list this exposes includes
271
+ * the rule that opened the region.
272
+ */
273
+ transparent?: boolean;
274
+ when?: RuleContext;
275
+ /** What an unterminated region reports. */
276
+ unclosed?: {
277
+ scope?: Scope;
278
+ message?: string | ((match: RuleMatch<State>) => string);
279
+ severity?: Severity;
280
+ code?: string;
281
+ };
282
+ }
283
+ /** One production of a grammar's lexical rules. Tried in order; first match wins. */
284
+ export type Rule<State = unknown> = MatchRule<State> | WordsRule<State> | RegionRule<State>;
285
+ /** A declarative check: a shape a token must have, or a vocabulary it must join. */
286
+ export interface CheckRule<State = unknown> {
287
+ /** A stable code, copied onto every diagnostic the check raises. */
288
+ code: string;
289
+ severity?: Severity;
290
+ /**
291
+ * The tokens this check applies to, by scope. `*` matches every scope.
292
+ * The check runs on the token's own text.
293
+ */
294
+ scopes: readonly Scope[];
295
+ /**
296
+ * The words that are acceptable. A token in `scopes` whose text is not a
297
+ * member is reported.
298
+ */
299
+ allow?: WordsSource<State>;
300
+ /** The message. `{word}` and `{allowed}` are substituted. */
301
+ message: string;
302
+ detail?: string;
303
+ /** Skips tokens whose text matches, so a check can carve out its exceptions. */
304
+ except?: RegExp;
305
+ /** Runs at most once per line, on the first token that matches `scopes`. */
306
+ perLine?: boolean;
307
+ }
308
+ /** What a grammar's own validator is handed. */
309
+ export interface DiagnoseContext<State = unknown> {
310
+ text: string;
311
+ tokens: readonly Token[];
312
+ /** The result of `Grammar.analyze`, or the grammar's initial state. */
313
+ state: State;
314
+ /** Raises a diagnostic. The grammar supplies the range. */
315
+ report(problem: {
316
+ from: number;
317
+ to: number;
318
+ message: string;
319
+ severity?: Severity;
320
+ code?: string;
321
+ detail?: string;
322
+ }): void;
323
+ }
324
+ /** One row of the completion list. */
325
+ export interface SuggestionItem {
326
+ /** The text the row shows and, unless `insert` says otherwise, writes. */
327
+ label: string;
328
+ /** The text written into the document. Defaults to `label`. */
329
+ insert?: string;
330
+ /** A short dimmed annotation at the right edge, as VSCode's `detail` is. */
331
+ detail?: string;
332
+ /** The paragraph shown in the documentation panel beside or below the list. */
333
+ documentation?: string;
334
+ /** A kind name, for the icon and the colour: `litearea-kind-<kind>`. */
335
+ kind?: string;
336
+ /**
337
+ * The ranking bucket.
338
+ *
339
+ * Rows are ordered by this key first and by match score only within an equal key, which
340
+ * is how a grammar puts a whole group on top — the value already in effect, say —
341
+ * without pretending its label starts with a `0`.
342
+ *
343
+ * Set it on every row or on none. When some rows set it and others do not, the ones that
344
+ * do not are keyed by their LABEL, so their labels are compared against the other rows'
345
+ * sort keys rather than against their labels. That is a comparison between two different
346
+ * things, and it is not what anyone means.
347
+ */
348
+ sortText?: string;
349
+ /** Matched against the needle instead of `label`. */
350
+ filterText?: string;
351
+ /**
352
+ * `replace` (the default) writes over the replaced range; `before` writes
353
+ * ahead of it and keeps it. `before` is how a value is inserted in front of an
354
+ * existing one without destroying it — promoting a fallback font, or adding a
355
+ * state above a line that already exists.
356
+ */
357
+ mode?: 'replace' | 'before';
358
+ /** Text appended after the insert, such as `', '` to invite another entry. */
359
+ append?: string;
360
+ /** Characters that accept this row when typed, as VSCode's commit characters are. */
361
+ commitCharacters?: string;
362
+ /**
363
+ * Where the caret lands, counted back from the end of everything written.
364
+ * Negative moves it left, which is how a grammar leaves the caret inside a
365
+ * pair of delimiters it just wrote.
366
+ */
367
+ caretOffset?: number;
368
+ /** Opaque payload handed back to `Grammar.onAccept`. */
369
+ data?: unknown;
370
+ }
371
+ /** The word the caret sits in, and the range a completion would replace. */
372
+ export interface WordInfo extends Range {
373
+ /** The word's text. */
374
+ text: string;
375
+ /** What precedes the caret inside the word. Empty at the word's start. */
376
+ prefix: string;
377
+ /** What follows the caret inside the word. Empty at the word's end. */
378
+ suffix: string;
379
+ }
380
+ /** One line of the document, and where the caret is on it. */
381
+ export interface LineInfo extends Range {
382
+ text: string;
383
+ /** Zero-based line number. */
384
+ number: number;
385
+ /** The caret's zero-based offset within the line. */
386
+ column: number;
387
+ /** The line's text before the caret. */
388
+ before: string;
389
+ /** The line's text after the caret. */
390
+ after: string;
391
+ }
392
+ /**
393
+ * How the popup came to be open — which decides what may keep it open.
394
+ *
395
+ * There is no `'commit'` member, and that is deliberate: the DOM layer never produced
396
+ * one, and a union member nothing can return is a promise the code does not keep. A
397
+ * commit character accepts the row and closes the list; whatever the user types next is
398
+ * an ordinary `'auto'` trigger.
399
+ */
400
+ export type CompletionTrigger =
401
+ /** Opened by typing a character. */
402
+ 'auto'
403
+ /** Opened by the user asking (Ctrl+Space), with no needle. */
404
+ | 'explicit';
405
+ /** Everything a completion source may look at. */
406
+ export interface CompletionContext<State = unknown> {
407
+ text: string;
408
+ caret: number;
409
+ /** The word around the caret. */
410
+ word: WordInfo;
411
+ /** The line around the caret. */
412
+ line: LineInfo;
413
+ /** The tokens for the whole document. */
414
+ tokens: readonly Token[];
415
+ /** The diagnostics for the whole document. */
416
+ diagnostics: readonly Diagnostic[];
417
+ /** Whatever `Grammar.analyze` returned. */
418
+ state: State;
419
+ /** The scope of the token under the caret, when the caret is in one. */
420
+ scope: Scope | undefined;
421
+ /** The scope of the nearest token before the caret. */
422
+ scopeBefore: Scope | undefined;
423
+ /** Whether nothing but whitespace precedes the caret on its line. */
424
+ firstOnLine: boolean;
425
+ /**
426
+ * Whether the caret is inside the FIRST word of its line, or before it.
427
+ *
428
+ * The difference from `firstOnLine` is the whole reason both exist. A
429
+ * line-oriented language puts something special at the head of every line, and a
430
+ * completion for it has to stay eligible while that head is being spelled out:
431
+ * `runn|` is no longer "at the start of the line" in the strict sense, but it is
432
+ * unmistakably completing the first word. A source that asked `firstOnLine` would
433
+ * switch itself off after the very first keystroke — which is exactly the bug this
434
+ * field was added to fix, and exactly the kind of thing a reference grammar is
435
+ * for finding.
436
+ */
437
+ firstWord: boolean;
438
+ /** The first non-whitespace token on the caret's line, when there is one. */
439
+ firstToken: Token | undefined;
440
+ trigger: CompletionTrigger;
441
+ }
442
+ /**
443
+ * One way the grammar offers completions.
444
+ *
445
+ * Several sources may be declared. The first eligible one that returns rows wins
446
+ * unless it asks to merge, which keeps the common case — "here is the list" —
447
+ * free of any merging logic while still allowing a document-wide source (every
448
+ * property already used elsewhere) to sit alongside a vocabulary.
449
+ */
450
+ export interface CompletionSource<State = unknown> {
451
+ /** A stable id, for tests and for the host's telemetry. */
452
+ id: string;
453
+ /** Eligible only when every predicate holds. Default: always eligible. */
454
+ when?: (context: CompletionContext<State>) => boolean;
455
+ /**
456
+ * The range the chosen row replaces.
457
+ *
458
+ * A function of the context, so it is recomputed from the caret EVERY time the list is
459
+ * filtered. It has to grow with the word being typed: type `ru`, accept `running`, and the
460
+ * replacement must cover both letters, or the result is the completion followed by a
461
+ * leftover character. What stays stable while the user types is the SOURCE — see
462
+ * `CompletionRequest.previousSourceId` — not the range.
463
+ */
464
+ range: Range | ((context: CompletionContext<State>) => Range);
465
+ /** The rows, in whatever order the grammar wants them scored. */
466
+ items: (context: CompletionContext<State>) => readonly SuggestionItem[];
467
+ /** Higher wins when several sources are eligible and none merges. Default 0. */
468
+ priority?: number;
469
+ /** Adds this source's rows to the others' instead of competing with them. */
470
+ merge?: boolean;
471
+ }
472
+ /** One row of a resolved completion list, with the evidence for its position. */
473
+ export interface CompletionRow {
474
+ item: SuggestionItem;
475
+ /** The ranking score. Higher is better. */
476
+ score: number;
477
+ /** The offsets in the row's label the needle matched, for emphasis. */
478
+ indices: number[];
479
+ }
480
+ /** A resolved completion: the range recomputed for this filter, and the rows worth showing. */
481
+ export interface Completion {
482
+ /**
483
+ * The range a chosen row replaces.
484
+ *
485
+ * Recomputed from the caret every time the list is filtered, never held over from an
486
+ * earlier keystroke. That is the whole difference between a completer that works and
487
+ * one that leaves debris: type `ru`, accept `running`, and the range has to cover both
488
+ * letters. Holding the range resolved when the list opened replaces only the `r` and
489
+ * produces `running u`.
490
+ */
491
+ range: Range;
492
+ rows: readonly CompletionRow[];
493
+ /** The needle the rows were filtered against. */
494
+ needle: string;
495
+ /** The source that produced them, for tests and for the host. */
496
+ sourceId: string;
497
+ }
498
+ /** What a hover shows. Every field is plain text; nothing is rendered as markdown. */
499
+ export interface HoverInfo {
500
+ /** A short signature line, shown first and emphasised. */
501
+ title?: string;
502
+ /** A dimmed line under the title. */
503
+ detail?: string;
504
+ /** The paragraph below. */
505
+ body?: string;
506
+ /** The range the hover describes. Defaults to the token under the pointer. */
507
+ range?: Range;
508
+ /** Which part of the editor raised it, for styling. */
509
+ kind?: 'token' | 'diagnostic' | 'decoration' | 'grammar';
510
+ }
511
+ /** Everything a grammar's hover may look at. */
512
+ export interface HoverContext<State = unknown> {
513
+ text: string;
514
+ /** The offset the pointer resolved to, or the caret for a keyboard hover. */
515
+ offset: number;
516
+ /** The token under the offset, when there is one. */
517
+ token: Token | undefined;
518
+ /** The word under the offset. */
519
+ word: WordInfo;
520
+ /** The line under the offset. */
521
+ line: LineInfo;
522
+ tokens: readonly Token[];
523
+ /**
524
+ * Every problem the document has.
525
+ *
526
+ * The one UNDER the offset is not offered separately, and that is a fact about the order
527
+ * of business rather than an omission: a diagnostic outranks a description, so `describe`
528
+ * is only ever called when nothing is wrong at that offset. A grammar that wants to know
529
+ * what else is flagged can read this list.
530
+ */
531
+ diagnostics: readonly Diagnostic[];
532
+ state: State;
533
+ }
534
+ /**
535
+ * A language, complete.
536
+ *
537
+ * `State` is whatever `analyze` returns and is threaded to every other hook, so
538
+ * a grammar author writes the parse once and reads it everywhere with full
539
+ * types. Leaving it out makes the state `unknown`, which is what a grammar with
540
+ * no `analyze` wants.
541
+ */
542
+ export interface Grammar<State = unknown> {
543
+ /** A stable id, used as the default diagnostic `source` and for debugging. */
544
+ id: string;
545
+ /** A human name, for a status line or a demo. */
546
+ name?: string;
547
+ /**
548
+ * The lexical rules, tried in order at each position. First match wins, so a
549
+ * rule that must not shadow another belongs above it.
550
+ */
551
+ rules: readonly Rule<State>[];
552
+ /** The scope for a character no rule claimed. Default `'text'`. */
553
+ fallbackScope?: Scope;
554
+ /**
555
+ * Which characters form a word.
556
+ *
557
+ * It matters more than it looks: this predicate decides what a completion
558
+ * replaces, what a diagnostic underlines, and where a double-click puts the
559
+ * selection. A language whose names contain dots or hyphens must say so, or
560
+ * every completion will replace one segment of a name instead of the name.
561
+ */
562
+ wordChars?: RegExp;
563
+ /** The initial state, used before `analyze` exists and when it is skipped. */
564
+ initialState?: State;
565
+ /**
566
+ * The single structural pass over the document.
567
+ *
568
+ * Called once per text, before the scan, and its result is handed to every rule and to
569
+ * `checks`, `validate`, `compose`, `describe`, and `decorate` alike — which is what keeps
570
+ * them from disagreeing about what the document says.
571
+ *
572
+ * It receives the text and NOT the tokens, deliberately. Handing it tokens
573
+ * would make the scan depend on the analysis that depends on the scan, and the
574
+ * only ways out of that cycle are a second pass or a fixpoint, both of which
575
+ * mean the analysis can disagree with the paint. A structural pass over a line
576
+ * oriented language does not need the lexical result anyway: splitting lines
577
+ * and words is cheaper than asking the scanner to do it again.
578
+ */
579
+ analyze?: (text: string) => State;
580
+ /** Declarative checks, run over the tokens. */
581
+ checks?: readonly CheckRule<State>[];
582
+ /**
583
+ * The grammar's own validator, for what a check cannot express: a duplicated
584
+ * value, a weight the chosen family does not have, a slot filled twice.
585
+ */
586
+ validate?: (context: DiagnoseContext<State>) => void;
587
+ /** The ways this grammar offers completions. */
588
+ compose?: readonly CompletionSource<State>[];
589
+ /** What a thing is, when the pointer rests on it. */
590
+ describe?: (context: HoverContext<State>) => HoverInfo | null | undefined;
591
+ /** Semantic ranges that are not tokens. */
592
+ decorate?: (text: string, state: State) => readonly Decoration[];
593
+ /**
594
+ * Called after a row is accepted, with the text that resulted. The place to
595
+ * sync a host's own state — a stored value, a preview — without re-parsing.
596
+ */
597
+ onAccept?: (result: {
598
+ text: string;
599
+ caret: number;
600
+ item: SuggestionItem;
601
+ state: State;
602
+ }) => void;
603
+ }
604
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/core/types.ts"],"names":[],"mappings":"AA2BA,mFAAmF;AACnF,MAAM,WAAW,KAAK;IACpB,sCAAsC;IACtC,IAAI,EAAE,MAAM,CAAA;IACZ,mDAAmD;IACnD,EAAE,EAAE,MAAM,CAAA;CACX;AAED;;;;;;;GAOG;AACH,MAAM,MAAM,KAAK,GAAG,MAAM,CAAA;AAE1B,+EAA+E;AAC/E,MAAM,MAAM,QAAQ,GAAG,OAAO,GAAG,SAAS,GAAG,MAAM,GAAG,MAAM,CAAA;AAE5D,qEAAqE;AACrE,MAAM,WAAW,KAAM,SAAQ,KAAK;IAClC,KAAK,EAAE,KAAK,CAAA;IACZ,IAAI,EAAE,MAAM,CAAA;IACZ,8BAA8B;IAC9B,IAAI,EAAE,MAAM,CAAA;IACZ,6EAA6E;IAC7E,MAAM,EAAE,MAAM,CAAA;IACd;;;;OAIG;IACH,MAAM,CAAC,EAAE,KAAK,CAAA;CACf;AAED;;;;;;;;;;;GAWG;AACH,MAAM,WAAW,UAAW,SAAQ,KAAK;IACvC,uE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