         type: 'keyword'
 
   isIn: (scope) ->
-    @scopes.some (s) -> s==scope
+    scope.every (s1) =>
+      @scopes.some (s) ->
+        s==s1
 
   genSpaceSearch: =>
-    r = new Range {column:0, row:@options.bufferPosition.row},
-      @options.bufferPosition
     new Promise (resolve) =>
-      @editor.backwardsScanInBufferRange /[^\s]+/, r, ({matchText,stop})->
-        resolve(matchText)
-        stop()
+      @editor.backwardsScanInBufferRange /[\w.']+/,
+        @lineRange, ({matchText,stop})->
+          resolve(matchText)
+          stop()
 
   buildSymbolSuggestion: (s, prefix) ->
-    text: s.name
+    text: s.qname ? s.name
     rightLabel: s.module.name
     type: s.symbolType
     replacementPrefix: prefix

    @prefix = @options.prefix
    @scopes = @options.scopeDescriptor.scopes
    @symbols = @controller.symbols

  genTypeSearch: =>
    unless @controller.backend

{Range} = require 'atom'
module.exports=
class SuggestionBuilder
  typeScope: ['meta.function.type-declaration.haskell']
  sourceScope: ['source.haskell']
  moduleScope: ['meta.import.haskell', 'support.other.module.haskell']
  preprocessorScope: ['meta.preprocessor.haskell']
  exportsScope: ['meta.import.haskell', 'meta.declaration.exports.haskell']
  #TODO: exports scope

  constructor: (@options,@info,@controller) ->
