@codemirror/autocomplete 6.4.1 → 6.4.2
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.
- package/CHANGELOG.md +6 -0
- package/dist/index.cjs +3 -2
- package/dist/index.d.ts +1 -1
- package/dist/index.js +3 -2
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
package/dist/index.cjs
CHANGED
|
@@ -1367,11 +1367,12 @@ interpreted as indicating a placeholder.
|
|
|
1367
1367
|
*/
|
|
1368
1368
|
function snippet(template) {
|
|
1369
1369
|
let snippet = Snippet.parse(template);
|
|
1370
|
-
return (editor,
|
|
1370
|
+
return (editor, completion, from, to) => {
|
|
1371
1371
|
let { text, ranges } = snippet.instantiate(editor.state, from);
|
|
1372
1372
|
let spec = {
|
|
1373
1373
|
changes: { from, to, insert: state.Text.of(text) },
|
|
1374
|
-
scrollIntoView: true
|
|
1374
|
+
scrollIntoView: true,
|
|
1375
|
+
annotations: pickedCompletion.of(completion)
|
|
1375
1376
|
};
|
|
1376
1377
|
if (ranges.length)
|
|
1377
1378
|
spec.selection = fieldSelection(ranges, 0);
|
package/dist/index.d.ts
CHANGED
|
@@ -338,7 +338,7 @@ interpreted as indicating a placeholder.
|
|
|
338
338
|
declare function snippet(template: string): (editor: {
|
|
339
339
|
state: EditorState;
|
|
340
340
|
dispatch: (tr: Transaction) => void;
|
|
341
|
-
},
|
|
341
|
+
}, completion: Completion, from: number, to: number) => void;
|
|
342
342
|
/**
|
|
343
343
|
A command that clears the active snippet, if any.
|
|
344
344
|
*/
|
package/dist/index.js
CHANGED
|
@@ -1363,11 +1363,12 @@ interpreted as indicating a placeholder.
|
|
|
1363
1363
|
*/
|
|
1364
1364
|
function snippet(template) {
|
|
1365
1365
|
let snippet = Snippet.parse(template);
|
|
1366
|
-
return (editor,
|
|
1366
|
+
return (editor, completion, from, to) => {
|
|
1367
1367
|
let { text, ranges } = snippet.instantiate(editor.state, from);
|
|
1368
1368
|
let spec = {
|
|
1369
1369
|
changes: { from, to, insert: Text.of(text) },
|
|
1370
|
-
scrollIntoView: true
|
|
1370
|
+
scrollIntoView: true,
|
|
1371
|
+
annotations: pickedCompletion.of(completion)
|
|
1371
1372
|
};
|
|
1372
1373
|
if (ranges.length)
|
|
1373
1374
|
spec.selection = fieldSelection(ranges, 0);
|