neoclide / coc-tsserver

Tsserver extension for coc.nvim that provide rich features like VSCode for javascript & typescript
MIT License
1.05k stars 68 forks source link

Autofill object members feature request #443

Closed preslavmihaylov closed 8 months ago

preslavmihaylov commented 8 months ago

There's apparently a feature in tsserver which allows one to auto-fill missing members in an object, given that you know what type you're looking for.

a good way to understand what the feature looks like is this comment.

Is these support for something similar in coc-tsserver or are there plans to implement it?

fannheyward commented 8 months ago

It's already supported, fire codeAction on data

image
preslavmihaylov commented 8 months ago

ahh thank you, wasn't aware of code actions!

For completeness, the way I triggered this window is by adding this mapping:

xmap <leader>a  <Plug>(coc-codeaction-selected)

and after selecting the line I'm interested in, it does suggest adding the missing properties.