mlaursen / vim-react-snippets

Useful snippets for developing in React (Javascript and Typescript)
Apache License 2.0
243 stars 21 forks source link

I have to select between JS and TS snippets #3

Closed andys8 closed 5 years ago

andys8 commented 5 years ago

Installed Ultisnips, installed this plugin, and set the command to let g:UltiSnipsExpandTrigger="<c-j>".

There is a selection, that pops up, when I want to expand e.g. fc. The filetype is typescript.tsx. Do I need to configure something? Is my filetype detected as JS and TS at the same time? Thanks :)

image

mlaursen commented 5 years ago

Hmm, what's the result of :set filetype?. For me, I just get filetype=typescript.

I'm currently using leafgarland/typescript-vim, pangloss/vim-javascript, and mxw/vim-jsx for syntax highlighting and formatting which seems to allow this to work "out of the box" for me.

Side note: I should probably update my README if other people are using these snippets since it's changed a lot over time. I can add a section about how to resolve this issue as well there once we figure it out

mlaursen commented 5 years ago

Oh, I skipped over the

filetype is typescript.tsx

Wonder if it'll work if you set it to typescript or typescriptreact instead since those are the two filetype snippets defined in the UltiSnips folder

blackxored commented 4 years ago

I have this same issue, even though my ft=typescript (which i set manually as other plugins conflict if you've typescriptreact). Is still asking me to choose between a javascript snippet and a typescript one.