       rightLabel: 'variable'
     }
 
-  createSuggestionForFunction = (serverSuggestion, name, kind, signature, mod, desc, spec, prefix) ->
+  createSuggestionForFunction = (serverSuggestion, name, kind, signature, mod, desc, spec, prefix, pipeBefore) ->
     args = signature.split(',')
     [func, arity] = name.split('/')
     [moduleParts..., postfix] = prefix.split('.')

          name = fields[0]
          if lastModuleHint && (lastModuleHint not in [name, ":#{name}"]) && modules_to_add.length > 0
            fields[0] = modules_to_add.join('.') + '.' + name
          createSuggestion(serverSuggestion, fields, prefix)

        suggestions = sortSuggestions(suggestions)
        resolve(suggestions)

  getPrefix = (editor, bufferPosition) ->
    line = editor.getTextInRange([[bufferPosition.row, 0], bufferPosition])
    regex = /[\w0-9\._!\?\:@]+$/
    line.match(regex)?[0] or ''

  createSuggestion = (serverSuggestion, fields, prefix) ->
    if fields[1] == 'module'
      [name, kind, subtype, desc] = fields
    else

      params  = [1..arity].map (i) -> "${#{i}:arg#{i}}"
      displayText = "#{func}/#{arity}"

    snippet_params = params
    snippet_params = snippet_params[1...] if snippet_params.length > 0 && pipeBefore

    if snippet_params.length > 0
      snippet = "#{func}(#{snippet_params.join(', ')})"

    snippet = snippet.replace(/^:/, '') + "$0"

    [type, iconHTML, rightLabel] =
      switch kind
