           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)
+          createSuggestion(serverSuggestion, fields, prefix, pipeBefore)
 
         suggestions = sortSuggestions(suggestions)
         resolve(suggestions)
 
-  getPrefix = (editor, bufferPosition) ->
-    line = editor.getTextInRange([[bufferPosition.row, 0], bufferPosition])
+  getPrefix = (textBeforeCursor) ->
     regex = /[\w0-9\._!\?\:@]+$/
-    line.match(regex)?[0] or ''
-
-  createSuggestion = (serverSuggestion, fields, prefix) ->
+    textBeforeCursor.match(regex)?[0] or ''
+
+  createSuggestion = (serverSuggestion, fields, prefix, pipeBefore) ->
     if fields[1] == 'module'
       [name, kind, subtype, desc] = fields
     else

      when 'var'
        createSuggestionForVariable(name)
      when 'private_function'
        createSuggestionForFunction(serverSuggestion, name, kind, signature, "", desc, spec, prefix)
      when 'public_function'
        createSuggestionForFunction(serverSuggestion, name, kind, signature, "", desc, spec, prefix)
      when 'function'
        createSuggestionForFunction(serverSuggestion, name, kind, signature, mod, desc, spec, prefix)
      when 'public_macro'
        createSuggestionForFunction(serverSuggestion, name, kind, signature, "", desc, spec, prefix)
      when 'macro'
        createSuggestionForFunction(serverSuggestion, name, kind, signature, mod, desc, spec, prefix)
      when 'module'
        createSuggestionForModule(serverSuggestion, name, desc, prefix, subtype)
      else

      rightLabel: 'variable'
    }

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