 
       req = http.request options, (res) ->
         res.on 'data', (chunk) ->
-          jsonObject = JSON.parse chunk
+          received = received + chunk
+        res.on 'end', () ->
+          jsonObject = JSON.parse received
           matches = jsonObject["matches"]
           for match in matches
             offset = match['offset']

              severity: 'error'
            }
          Resolve toReturn
      req.write(post_data)
      req.end()


  lint: (TextEditor) ->
    new Promise (Resolve) ->
      received = ""
      toReturn = []

      editorPath = TextEditor.getPath()
