title: How to autocomplete arguments in custom functions for Monaco?
body: <p>I currently want to use a monaco editor with PHP and I want to expand it with autocompletion for the regular PHP functions as well as custom functions. </p>
  
  <p>While the autocomplete for functions works fine on my early prototype, autocompleting the parameters does not work. See the fiddle for an example: 
  <a href="https://jsfiddle.net/95aq6497/2/" rel="nofollow noreferrer">https://jsfiddle.net/95aq6497/2/</a></p>
  
  <p>Currently, only the function substr is provided as autocomplete and is working. However, the helper for parameters defined by registerSignatureHelpProvider does not work:</p>
  
  <pre><code> monaco.languages.registerSignatureHelpProvider('php', {
  provideSignatureHelp: (model, position, token) =&gt; {
    console.log('Signature Help');
    return {
      activeParameter: 0,
      activeSignature: 0,
      signatures: [{
        label: 'string substr(string $string, int $start [, int $length])',
        parameters: [
          {
            label: 'string $string',
            documentation: 'The input string. Must be one character or longer.'
          },
          {
            label: 'int $start',
            documentation: "If $start is non-negative, the returned string will start at the $start'th position in string, counting from zero. For instance, in the string 'abcdef', the character at position 0 is 'a', the character at position 2 is 'c', and so forth.\r\nIf $start is negative, the returned string will start at the $start'th character from the end of string. If $string is less than $start characters long, FALSE will be returned."
          },
          {
            label: 'int $length',
            documentation: 'If $length is given and is positive, the string returned will contain at most $length characters beginning from $start (depending on the length of $string) If $length is given and is negative, then that many characters will be omitted from the end of $string (after the start position has been calculated when a start is negative). If $start denotes the position of this truncation or beyond, FALSE will be returned. If $length is given and is 0, FALSE or NULL, an empty string will be returned. If $length is omitted, the substring starting from $start until the end of the string will be returned.'
          }
        ]
      }]
    };
  }
  </code></pre>
  
  <p>});</p>
  
  <p>The function is not even executing, as the console.log does not trigger at all. What am I missing? Expanding javascript similarly by a function worked fine like this, but it's not working for PHP, so what's different here?</p>