Skip to content

add or remove braces to arrow function #309

@linde12

Description

@linde12

I cant get this feature to work (or maybe it needs implementation in coc-tsserver?) It should be available in typescript: microsoft/TypeScript#23423

The only option i get is to create a function statement. I want to be able to quickly add braces around an arrow function, e.g. if i have something like:

<button onClick={() => setCount(count + 1)}>
  Click me!
</button>

Then i want to be able to quickly convert that arrow function to a block as such:

<button onClick={() => {
  return setCount(count + 1)
}}>
  Click me!
</button>

image

vim version: NVIM v0.5.0
node version: v14.17.2
coc.nvim version: 0.0.80-3086844413
coc.nvim directory: /home/linde/.vim/plugged/coc.nvim
term: alacritty
platform: linux

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions