friendly-snippets
friendly-snippets copied to clipboard
Cloning to add Rails seems to break the integration
I have forked and cloned the repo down to add in Rails snippet. But typescript is not working properly, for example the function prefix is returning the javascript syntax instead of typescript.
function name(params) {
}
For your reference, I am using vim-plug and I have it point to the directory where I have cloned it
:Plug '~/plugins/friendly-snippets'
What am I missing? How does vimsnip integrate with friendly-snippets? Do I have to locate at a specific directory?
I am able to add rails.json and then update package.json. This seems to work, but I am not sure why typescript snippet is breaking.
{
"language": "ruby",
"path": "./snippets/rails.json"
},
Update
After some researching, I am not sure if this is the part that is causing problem? If I remove typescript and typescriptreact from here, then things are working fine.
{
"language": [
"javascript",
"typescript",
"javascriptreact",
"typescriptreact"
],
"path": "./snippets/javascript/javascript.json"
},
Hey thanks for reporting , did the typescript snippets worked properly before you added the rails ones ? I don't see why adding more snippets would break other snippets. Maybe there is something wrong in my package.json. However, if the snippets worked properly before adding the rails ones, then I don't have any idea of where could be the problem.
After some researching, I am not sure if this is the part that is causing problem? If I remove typescript and typescriptreact from here, then things are working fine.
I guess the javascript snippets are overwriting the typescript ones when you're in a typescript file, but that doesn't happen to me.
It doesn't work also. Yeah that's one thing I'm confused. Not sure why when I point it to local directory then it breaks. So I am not sure if I should create a PR because I'm worried it will break the plugin. But if you don't mind me asking, why do we need the typescript and typescript react to point to the JavaScript snippet?
But if you don't mind me asking, why do we need the typescript and typescript react to point to the JavaScript snippet?
Because there is some basic snippets that are still useful when writing in those. Those snippets were mostly taken from this repo and as you can see here, they are also using the basic javascript snippets for javascriptreact and typescript(react).
Hey, I'm testing and can't reproduce. I have the snippets in a local repo and after adding the rails snippets to test, the typescript ones keep working as expected. Do you still have the same problem ?
@rafamadriz , Thank you for spending time to check this out. Unfortunately yeah, I am still having the same problem. Attach is a short video on what my problem is. I guess for now I will keep a local copy, until I figure out the problem.
https://user-images.githubusercontent.com/40255418/118746935-ab5e9700-b88b-11eb-9509-7853a2e75acf.mp4
Hello @weizheheng :wave:, just following up on this issue. Have you had any luck on adding the snippets / prevent the error you ran into? If not, I can plan to dedicate some time to this in the coming days.
Keep us posted :sunglasses:
@rafamadriz do you think it's safe to close this issue now?
@OkelleyDevelopment Yeah I think we can close this now
Closing, if it's still an issue feel free to reopen it later on. :sunglasses: