'use babel'

/* @flow */

import {Disposable} from 'atom'
import {Main} from './main'
import type {Provider} from './types'

module.exports = {
  config: {

  },
  activate() {
    this.instance = new Main()
  },
  deactivate() {
    this.instance.dispose()
  },
  provideIntentions(): Main {
    return this.instance
  },
  consumeProvider(provider: Provider): Disposable {
    const providers = [].concat(provider)
    providers.forEach(provider => {
      this.instance.addProvider(provider)
    })
    return new Disposable(() => {
      providers.forEach(provider => {
        this.instance.deleteProvider(provider)
      })
    })
  }
}

'use babel'

/* @flow */

import {Disposable} from 'atom'
import {Main} from './main'
import type {Provider} from './types'

module.exports = {
  config: {

  },
  activate() {
    this.instance = new Main()
  },
  deactivate() {
    this.instance.dispose()
  },
  provideIntentions(): Main {
    return this.instance
  },
  consumeProvider(provider: Provider) {
    const providers = [].concat(provider)
    providers.forEach(provider => {
      this.instance.addProvider(provider)
    })
    return new Disposable(() => {
      providers.forEach(provider => {
        this.instance.deleteProvider(provider)
      })
    })
  }
}

--- 
+++ 
@@ -19,7 +19,7 @@
   provideIntentions(): Main {
     return this.instance
   },
-  consumeProvider(provider: Provider): Disposable {
+  consumeProvider(provider: Provider) {
     const providers = [].concat(provider)
     providers.forEach(provider => {
       this.instance.addProvider(provider)
:art: Add return type to consumer method
