friendly-snippets icon indicating copy to clipboard operation
friendly-snippets copied to clipboard

Cloning to add Rails seems to break the integration

Open weizheheng opened this issue 4 years ago • 5 comments

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"
      },

weizheheng avatar May 14 '21 16:05 weizheheng

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.

rafamadriz avatar May 14 '21 18:05 rafamadriz

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?

weizheheng avatar May 15 '21 00:05 weizheheng

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).

rafamadriz avatar May 15 '21 04:05 rafamadriz

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 avatar May 18 '21 12:05 rafamadriz

@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

weizheheng avatar May 19 '21 02:05 weizheheng

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:

OkelleyDevelopment avatar Sep 18 '22 23:09 OkelleyDevelopment

@rafamadriz do you think it's safe to close this issue now?

OkelleyDevelopment avatar Dec 05 '22 03:12 OkelleyDevelopment

@OkelleyDevelopment Yeah I think we can close this now

rafamadriz avatar Dec 09 '22 18:12 rafamadriz

Closing, if it's still an issue feel free to reopen it later on. :sunglasses:

OkelleyDevelopment avatar Dec 11 '22 23:12 OkelleyDevelopment