summaryrefslogtreecommitdiff
path: root/lua/lang/svelte.lua
diff options
context:
space:
mode:
authorAbouzar Parvan <[email protected]>2021-07-18 03:41:26 +0430
committerGitHub <[email protected]>2021-07-17 19:11:26 -0400
commit71e0266b4b67a8924abbadfce4a4ee1c123b39a2 (patch)
tree351e96c894e09c31d462f9945e5ba5aa2b78ff21 /lua/lang/svelte.lua
parent11ac140eb57c70dd30b5ec34d31da1679c4151ce (diff)
added support for svelte (#1008)
Diffstat (limited to 'lua/lang/svelte.lua')
-rw-r--r--lua/lang/svelte.lua35
1 files changed, 35 insertions, 0 deletions
diff --git a/lua/lang/svelte.lua b/lua/lang/svelte.lua
new file mode 100644
index 00000000..220c2c18
--- /dev/null
+++ b/lua/lang/svelte.lua
@@ -0,0 +1,35 @@
+local M = {}
+
+M.config = function()
+ O.lang.svelte = {}
+end
+
+M.format = function()
+ -- TODO: implement formatter (if applicable)
+ return "No formatter configured!"
+end
+
+M.lint = function()
+ -- TODO: implement linters (if applicable)
+ return "No linters configured!"
+end
+
+M.lsp = function()
+ if require("lv-utils").check_lsp_client_active "svelte" then
+ return
+ end
+
+ require("lspconfig").svelte.setup {
+ cmd = { DATA_PATH .. "/lspinstall/svelte/node_modules/.bin/svelteserver", "--stdio" },
+ filetypes = { "svelte" },
+ root_dir = require("lspconfig.util").root_pattern("package.json", ".git"),
+ on_attach = require("lsp").common_on_attach,
+ }
+end
+
+M.dap = function()
+ -- TODO: implement dap
+ return "No DAP configured!"
+end
+
+return M