Skip to content

lsp: Add graindoc code action. #2301

@spotandjake

Description

@spotandjake

It would be useful if we had a code action in the lsp where if you hovered over something like:

let test = (x,y) => {
  print(x)
  return 1
}

it would offer to insert a template graindoc header like:

/**
 * 
 *
 * @param x: 
 * @param y:
 * @returns:
 *
 * @example
 *
 * @since
 */
let test = (x,y) => {
  print(x)
  return 1
}

We would probably only want to target provided values and module headers with this, and we may want to discuss what attributes should be in the template, the params and returns seem obvious, but the example and since might not make sense to include.

This should be fairly easy to implement the only thing to consider is we don't currently expose binds through sourcetree, so we would need to modify that slightly to support this, we would also need to mark if the binds are exported or not.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions