 previously_run = null
 
 graphite_function_docs = {}
+graphite_parameter_docs = {}
+graphite_parameter_doc_ids = {}
+$.getJSON 'render_api.fjson', (data) ->
+  html = $.parseHTML(data.body)[0]
+  parameters = html.querySelector 'div#graph-parameters'
+  a.remove() for a in parameters.querySelectorAll 'a.headerlink'
+  for section in parameters.querySelectorAll 'div.section'
+    name = $(section.querySelector 'h3').text()
+    graphite_parameter_docs[name] = section
+    graphite_parameter_doc_ids[section.id] = name
+
+has_docs = (name) ->
+  graphite_parameter_docs[name]? or graphite_parameter_doc_ids[name]? or graphite_function_docs[name]?
+
 $.getJSON 'functions.fjson', (data) ->
   prefix_length = "graphite.render.functions.".length
 

    for a in tag.getElementsByTagName 'a'
      a.remove()
    graphite_function_docs[tag.id[prefix_length..]] = tag.parentNode

suggest = (cm, showHints, options) ->
  cur = cm.getCursor()

              for example in examples
                cli.example "#{default_target_command} #{JSON.stringify example}", run: false
            else
              name = graphite_parameter_doc_ids[name] ? name
              div = graphite_parameter_docs[name]
              if div?
                docs = $(div.cloneNode true)
                docs.find('a').on 'click', (e) ->
                  e.preventDefault()
                  href = $(this).attr 'href'
                  if href[0] is '#'
                    run "docs '#{decodeURI href[1..]}'"
                context.$result.append docs
              else
                cli.text 'Documentation not found'
            context.success()
          else
            cli.html '<h3>Functions</h3>'
            names = (name for name of graphite_function_docs)
            names.sort()
            for name in names
              sig = $(graphite_function_docs[name].getElementsByTagName('dt')[0]).text().trim()
              cli.example "docs #{name}  # #{sig}"

            cli.html '<h3>Parameters</h3>'
            names = (name for name of graphite_parameter_docs)
            names.sort()
            for name in names
              cli.example "docs '#{name}'"
            context.success()

      clear:
