Skip to content

Commit

Permalink
Format with stylua
Browse files Browse the repository at this point in the history
  • Loading branch information
hinell authored and github-actions[bot] committed Mar 27, 2023
1 parent 91db50e commit bcadaf4
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions lua/luasnip/loaders/from_vscode.lua
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,16 @@ local function get_file_snippets(lang, file)
local body = type(parts.body) == "string" and parts.body
or table.concat(parts.body, "\n")

-- Skip entire snippet if entry has `scope` field mismatching lang
-- This prevents snippets mapped by package.json to one language
-- to be used for another. This is not part of LSP Snippets! See:
-- https://code.visualstudio.com/docs/editor/userdefinedsnippets#_snippet-scope
if type(parts.scope) == "string" and not (string.match(parts.scope, lang)) then
goto continue
end
-- Skip entire snippet if entry has `scope` field mismatching lang
-- This prevents snippets mapped by package.json to one language
-- to be used for another. This is not part of LSP Snippets! See:
-- https://code.visualstudio.com/docs/editor/userdefinedsnippets#_snippet-scope
if
type(parts.scope) == "string"
and not (string.match(parts.scope, lang))
then
goto continue
end

-- There are still some snippets that fail while loading
pcall(function()
Expand Down

0 comments on commit bcadaf4

Please sign in to comment.