 
     contextMenus = {
       '.tree-view.full-menu [is="tree-view-file"] [data-name$=".cpp"]':flashExampleMenuItem,
-      '.tree-view.full-menu [is="tree-view-file"] [data-name$=".ino"]':flashExampleMenuItem
-      '.tree-view.full-menu [is="tree-view-directory"]':flashExampleMenuItem
+      '.tree-view.full-menu [is="tree-view-file"] [data-name$=".ino"]':flashExampleMenuItem,
+# when matching the directory, the item is also propagated to all child elements of that directory regardless
+# of their extension, so for now compiling an example is done only from the files themselves
+#      '.tree-view.full-menu [is="tree-view-directory"]':flashExampleMenuItem
     }
 
     @contextMenus.add atom.contextMenu.add contextMenus

    @compileErrorsView.show()

  # Flash core via the cloud
  flashCloud: (firmware=null) -> @deviceRequired => @projectRequired =>
    fs ?= require 'fs-plus'
    path ?= require 'path'
    _s ?= require 'underscore.string'
    utilities ?= require './vendor/utilities'

    currentPlatform = @getCurrentPlatform()
    rootPath = @getProjectDir()
    files = fs.listSync(rootPath)
    files = files.filter (file) ->
      return (utilities.getFilenameExt(file).toLowerCase() == '.bin') &&
             (_s.startsWith(path.basename(file), currentPlatform))

    if files.length == 0 && (!firmware)
      # If no firmware file, compile
      @emitter.emit "#{@packageName()}:compile-cloud", {thenFlash: true}
    else if (files.length == 1) || (!!firmware)
      # If one firmware file, flash

      if !firmware
        firmware = files[0]

      flashDevice = =>
        process.chdir rootPath
        firmware = path.relative rootPath, firmware

        @statusView.setStatus 'Flashing via the cloud...'


    relative = []
    libraryManager.pathsCommonPrefix files, relative, basePath
    map = {}
    for i in [0..files.length-1]
      map[relative[i]] = files[i]
    return map

  # Compile current project in the cloud
  # when updating arguments here, also update the event emitter above
  compileCloud: (thenFlash=null, files=null, rootPath=null) -> @loginRequired =>
    if !@canCompileNow
      return
