Dynamic function arguments?

I am new to codemirror and find it quite powerful, but also quite complex. I am trying to define custom python functions with a fixed set of possible input values. The autocompletion of custom function was quite easy using

pythonLanguage.data.of({
  autocomplete: myCompletions,
}),

However, now I want to be able to provide autocompletion for the argument values during the usage of one of these functions.

So, given a custom function foo(param) I’d like it to auto-suggest a list of possible values for param after the user has typed foo(. Is such a thing possible?

Yes, but you’ll have to write your own completion source that looks at the syntax tree, figures out which completions are appropriate, and returns them. See this example.