Snippet (autocompletion) fields count

Context:
I have a custom panel for suggestion options list (for using editor on mobile). On mobile I’d like to introduce some button that would call nextSnippetField helper, but button should be shown only in case there is more than 1 snippet field user can jump to.

Question: is there a way to get snippet fields count after apply-ing an option?

What I tried:
I thought snippet related state(s) is working with selection ranges and “somehow” just jumping between, so I could just check editor.state.selection.ranges.length, but I get 1 main selection position from range, even if there are more than 1. So, I guess, this approach will not work.

This information isn’t currently exposed. This patch add functions for that purpose.

Thanks, but seems like latest version (v6.6.1, got this version after reinstalling corresponding node modules) of @codemirror/autocomplete doesn’t provide named export for hasNextSnippetField / hasPrevSnippetField

I’ve tagged 6.7.0 now.

I’m still getting v.6.6.1 after reinstalling node_modules several times. I tried to force npm cache clean and reinstall again, and still getting the same result.

codemirror listed dependency:

@codemirror/autocomplete”: “^6.0.0”

So, according to semantic versioning I’m assuming that minor release (e.g. v6.7.0), should be installed with the codemirror package.

@codemirror/autocomplete from node_modules package.json:

“name”: “@codemirror/autocomplete”,
“version”: “6.6.1”

Any hint what I’m doing wrong here?

npm has it. But I’ve had similar issues with that tool completely ignoring freshly published versions, I guess they have some sloppy caching somewhere. Try again a bit later, I guess.