     replacementPrefix: prefix
     description: s.name+" :: "+s.typeSignature
 
-  getMatches: (prefix,type) =>
+  getMatches: (type) =>
+    prefix=@getPrefix()
     @symbols
       .filter (s) ->
         s.name.startsWith(prefix)\

        replacementPrefix: prefix
        type: 'import'

  getPreprocessor: (prefix) =>
    (if prefix[0]=='-' then @info.ghcFlags
    else @info.langOpts)
      .filter (line) ->
        line.startsWith prefix
      .map (mod) ->
        text: mod
        rightLabel: if prefix[0]=='-' then 'ghc flag' else 'Language'
        replacementPrefix: prefix
        type: 'keyword'

  isIn: (scope) ->
    scope.every (s1) =>
      @scopes.some (s) ->
        s==s1

  genSpaceSearch: =>
    new Promise (resolve) =>
      @editor.backwardsScanInBufferRange /[\w.']+/,
        @lineRange, ({matchText,stop})->
          resolve(matchText)
          stop()

  buildSymbolSuggestion: (s, prefix) ->
    text: s.qname ? s.name

    @lineRange = new Range [0, @options.bufferPosition.row],
      @options.bufferPosition

  lineSearch: (rx,idx=0) =>
    res=""
    @editor.backwardsScanInBufferRange rx,
      @lineRange, ({match,stop})->
        res=match[idx]
        stop()
    res

  isIn: (scope) ->
    scope.every (s1) =>
      @scopes.some (s) ->
        s==s1

  getPrefix: (rx=/[\w.']+/) =>
    @lineSearch rx

  #ghc-mod search
  getModule: =>
    prefix = @getPrefix()
    @info.moduleList
      .filter (line) ->
        line.startsWith prefix
