neoclide / coc-vetur

Vue language server extension for coc.nvim
219 stars 7 forks source link

fix(client): globalSnippetDir from VSCode vetur #16

Closed fannheyward closed 5 years ago

fannheyward commented 5 years ago

close #15

vls https://github.com/vuejs/vetur/commit/97296141b2a3bc1a6fb534e4731205a6ead95fac#diff-877bd9af6bc48cd17355e381d60af061 and https://github.com/vuejs/vetur/commit/0e5c2324a59c5e21d6101dc55a067e38dfa876c4 make globalSnippetDir is must have in initializationOptions.

fannheyward commented 5 years ago

@chemzqm the globalSnippetDir in VSCode vetur is used to save user's custom snippets, then loaded by language server.

The path is in user data home, for Win, is [APPDATA]/Code/User/snippets/vetur, for Mac, is ~/Library/Application Support/Code/User/snippets. If the path is not found, vls will ignore it. So use VSCode's path is safe.

https://github.com/vuejs/vetur/blob/f2c73f783bc8636f11d894cbe4ec684aff07dd52/server/src/modes/vue/snippets.ts#L104