sway_lsp/capabilities/code_actions/function_decl/
mod.rs

1
2
3
4
5
6
7
8
9
10
11
12
use crate::capabilities::code_actions::{CodeAction, CodeActionContext};
use lsp_types::CodeActionOrCommand;
use sway_core::language::ty;

use super::common::fn_doc_comment::FnDocCommentCodeAction;

pub(crate) fn code_actions(
    decl: &ty::TyFunctionDecl,
    ctx: &CodeActionContext,
) -> Vec<CodeActionOrCommand> {
    vec![FnDocCommentCodeAction::new(ctx, decl).code_action()]
}